vulkan: Changes for header version 211
Add anisotropyEnable to VkSamplerCreateInfo.
Add inheritedQueries to VkPhysicalDeviceFeatures
diff --git a/demos/cube.c b/demos/cube.c
index 3acb8fa..25cf077 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -1194,6 +1194,7 @@
.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.mipLodBias = 0.0f,
+ .anisotropyEnable = VK_FALSE,
.maxAnisotropy = 1,
.compareOp = VK_COMPARE_OP_NEVER,
.minLod = 0.0f,
diff --git a/demos/tri.c b/demos/tri.c
index 19848a4..17b5344 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -955,6 +955,7 @@
.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT,
.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT,
.mipLodBias = 0.0f,
+ .anisotropyEnable = VK_FALSE,
.maxAnisotropy = 1,
.compareOp = VK_COMPARE_OP_NEVER,
.minLod = 0.0f,
diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c
index fb6b6cb..c76ee14 100644
--- a/demos/vulkaninfo.c
+++ b/demos/vulkaninfo.c
@@ -829,6 +829,7 @@
printf("\tsparseResidency16Samples = %u\n", features->sparseResidency16Samples );
printf("\tsparseResidencyAliased = %u\n", features->sparseResidencyAliased );
printf("\tvariableMultisampleRate = %u\n", features->variableMultisampleRate );
+ printf("\tiheritedQueries = %u\n", features->inheritedQueries );
}
static void app_dump_sparse_props(const VkPhysicalDeviceSparseProperties *sparseProps)
diff --git a/icd/intel/sampler.c b/icd/intel/sampler.c
index 86e8998..8cc20a8 100644
--- a/icd/intel/sampler.c
+++ b/icd/intel/sampler.c
@@ -195,12 +195,16 @@
min_filter = translate_tex_filter(info->minFilter);
mag_filter = translate_tex_filter(info->magFilter);
- if (info->maxAnisotropy >= 2 && info->maxAnisotropy <= 16)
- max_aniso = info->maxAnisotropy / 2 - 1;
- else if (info->maxAnisotropy > 16)
- max_aniso = GEN6_ANISORATIO_16;
- else
- max_aniso = GEN6_ANISORATIO_2;
+ if (info->anisotropyEnable == VK_FALSE) {
+ max_aniso = 1;
+ } else {
+ if (info->maxAnisotropy >= 2 && info->maxAnisotropy <= 16)
+ max_aniso = info->maxAnisotropy / 2 - 1;
+ else if (info->maxAnisotropy > 16)
+ max_aniso = GEN6_ANISORATIO_16;
+ else
+ max_aniso = GEN6_ANISORATIO_2;
+ }
/*
* Here is how the hardware calculate per-pixel LOD, from my reading of the
@@ -273,7 +277,7 @@
mip_filter << 20 |
lod_bias << 1;
- if (info->maxAnisotropy > 1) {
+ if (info->maxAnisotropy > 1 && info->anisotropyEnable == VK_TRUE) {
dw0 |= GEN6_MAPFILTER_ANISOTROPIC << 17 |
GEN6_MAPFILTER_ANISOTROPIC << 14 |
1;
@@ -321,7 +325,7 @@
dw0 |= translate_compare_func(info->compareOp);
- if (info->maxAnisotropy > 1) {
+ if (info->maxAnisotropy > 1 && info->anisotropyEnable == VK_TRUE) {
dw0 |= GEN6_MAPFILTER_ANISOTROPIC << 17 |
GEN6_MAPFILTER_ANISOTROPIC << 14;
}
diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h
index 598d98e..d9f8046 100644
--- a/include/vulkan/vulkan.h
+++ b/include/vulkan/vulkan.h
@@ -41,7 +41,7 @@
((major << 22) | (minor << 12) | patch)
// Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 210, 0)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 211, 0)
#define VK_NULL_HANDLE 0
@@ -1183,6 +1183,7 @@
VkBool32 sparseResidency16Samples;
VkBool32 sparseResidencyAliased;
VkBool32 variableMultisampleRate;
+ VkBool32 inheritedQueries;
} VkPhysicalDeviceFeatures;
typedef struct VkFormatProperties {
@@ -1851,6 +1852,7 @@
VkSamplerAddressMode addressModeV;
VkSamplerAddressMode addressModeW;
float mipLodBias;
+ VkBool32 anisotropyEnable;
float maxAnisotropy;
VkBool32 compareEnable;
VkCompareOp compareOp;
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index f79e58d..f4123e8 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -3421,6 +3421,7 @@
sampler_ci.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.mipLodBias = 1.0;
+ sampler_ci.anisotropyEnable = VK_FALSE;
sampler_ci.maxAnisotropy = 1;
sampler_ci.compareEnable = VK_FALSE;
sampler_ci.compareOp = VK_COMPARE_OP_NEVER;
@@ -3518,6 +3519,7 @@
sampler_ci.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.mipLodBias = 1.0;
+ sampler_ci.anisotropyEnable = VK_FALSE;
sampler_ci.maxAnisotropy = 1;
sampler_ci.compareEnable = VK_FALSE;
sampler_ci.compareOp = VK_COMPARE_OP_NEVER;
@@ -3615,6 +3617,7 @@
sampler_ci.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.mipLodBias = 1.0;
+ sampler_ci.anisotropyEnable = VK_FALSE;
sampler_ci.maxAnisotropy = 1;
sampler_ci.compareEnable = VK_FALSE;
sampler_ci.compareOp = VK_COMPARE_OP_NEVER;
@@ -3712,6 +3715,7 @@
sampler_ci.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.mipLodBias = 1.0;
+ sampler_ci.anisotropyEnable = VK_FALSE;
sampler_ci.maxAnisotropy = 1;
sampler_ci.compareEnable = VK_FALSE;
sampler_ci.compareOp = VK_COMPARE_OP_NEVER;
@@ -3883,6 +3887,7 @@
sampler_ci.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.mipLodBias = 1.0;
+ sampler_ci.anisotropyEnable = VK_FALSE;
sampler_ci.maxAnisotropy = 1;
sampler_ci.compareEnable = VK_FALSE;
sampler_ci.compareOp = VK_COMPARE_OP_NEVER;
@@ -3990,6 +3995,7 @@
sampler_ci.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
sampler_ci.mipLodBias = 1.0;
+ sampler_ci.anisotropyEnable = VK_FALSE;
sampler_ci.maxAnisotropy = 1;
sampler_ci.compareEnable = VK_FALSE;
sampler_ci.compareOp = VK_COMPARE_OP_NEVER;
diff --git a/tests/vkrenderframework.cpp b/tests/vkrenderframework.cpp
index cb25cb4..469f9ca 100644
--- a/tests/vkrenderframework.cpp
+++ b/tests/vkrenderframework.cpp
@@ -855,7 +855,8 @@
samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerCreateInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerCreateInfo.mipLodBias = 0.0;
- samplerCreateInfo.maxAnisotropy = 0;
+ samplerCreateInfo.anisotropyEnable = VK_FALSE;
+ samplerCreateInfo.maxAnisotropy = 1;
samplerCreateInfo.compareOp = VK_COMPARE_OP_NEVER;
samplerCreateInfo.minLod = 0.0;
samplerCreateInfo.maxLod = 0.0;