/ appendices / VK_AMD_texture_gather_bias_lod.txt
VK_AMD_texture_gather_bias_lod.txt
1 include::meta/VK_AMD_texture_gather_bias_lod.txt[] 2 3 *Last Modified Date*:: 4 2017-03-21 5 *IP Status*:: 6 No known IP claims. 7 *Interactions and External Dependencies*:: 8 - Requires the 9 https://www.khronos.org/registry/spir-v/extensions/AMD/SPV_AMD_texture_gather_bias_lod.html[`SPV_AMD_texture_gather_bias_lod`] 10 SPIR-V extension. 11 *Contributors*:: 12 - Dominik Witczak, AMD 13 - Daniel Rakos, AMD 14 - Graham Sellers, AMD 15 - Matthaeus G. Chajdas, AMD 16 - Qun Lin, AMD 17 - Rex Xu, AMD 18 - Timothy Lottes, AMD 19 20 This extension adds two related features. 21 22 Firstly, support for the following SPIR-V extension in Vulkan is added: 23 24 * `SPV_AMD_texture_gather_bias_lod` 25 26 Secondly, the extension allows the application to query which formats can be 27 used together with the new function prototypes introduced by the SPIR-V 28 extension. 29 30 === New Object Types 31 32 None. 33 34 === New Enum Constants 35 36 * Extending elink:VkStructureType: 37 ** ename:VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD 38 39 === New Enums 40 41 None. 42 43 === New SPIR-V Capabilities 44 45 * <<spirvenv-capabilities-table-imagegatherbiaslodamd,code:ImageGatherBiasLodAMD>> 46 47 === New Structures 48 49 * slink:VkTextureLODGatherFormatPropertiesAMD 50 51 === New Functions 52 53 None. 54 55 === Examples 56 57 [source,c++] 58 -------------------------------------- 59 60 struct VkTextureLODGatherFormatPropertiesAMD 61 { 62 VkStructureType sType; 63 const void* pNext; 64 VkBool32 supportsTextureGatherLODBiasAMD; 65 }; 66 67 // ---------------------------------------------------------------------------------------- 68 // How to detect if an image format can be used with the new function prototypes. 69 VkPhysicalDeviceImageFormatInfo2 formatInfo; 70 VkImageFormatProperties2 formatProps; 71 VkTextureLODGatherFormatPropertiesAMD textureLODGatherSupport; 72 73 textureLODGatherSupport.sType = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD; 74 textureLODGatherSupport.pNext = nullptr; 75 76 formatInfo.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2; 77 formatInfo.pNext = nullptr; 78 formatInfo.format = ...; 79 formatInfo.type = ...; 80 formatInfo.tiling = ...; 81 formatInfo.usage = ...; 82 formatInfo.flags = ...; 83 84 formatProps.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2; 85 formatProps.pNext = &textureLODGatherSupport; 86 87 vkGetPhysicalDeviceImageFormatProperties2(physical_device, &formatInfo, &formatProps); 88 89 if (textureLODGatherSupport.supportsTextureGatherLODBiasAMD == VK_TRUE) 90 { 91 // physical device supports SPV_AMD_texture_gather_bias_lod for the specified 92 // format configuration. 93 } 94 else 95 { 96 // physical device does not support SPV_AMD_texture_gather_bias_lod for the 97 // specified format configuration. 98 } 99 -------------------------------------- 100 101 === Version History 102 103 * Revision 1, 2017-03-21 (Dominik Witczak) 104 - Initial draft