aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-03-24 14:14:45 +1300
committerTobin Ehlis <tobine@google.com>2016-03-30 06:48:23 -0600
commit0bbed4a16c5b764409cd22dc2e7f70cfe510ee78 (patch)
treef6fbb104eaa8cd0842a05abf8e7f71c29159192a /layers/core_validation.cpp
parent098ec63bdb640195fe01e22778954a34b4ffe4bb (diff)
downloadusermoji-0bbed4a16c5b764409cd22dc2e7f70cfe510ee78.tar.xz
layers: Relax descriptor type match for texel buffers slightly
The descriptor doesn't really provide a sampler, but the consuming code doesn't really look at one either. Allow VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER to match against OpTypeSampledImage with an image type having Dim=Buffer and Sampled=1.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 6a7216e7..4b114711 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -2453,6 +2453,16 @@ static bool descriptor_type_match(layer_data *my_data, shader_module const *modu
return descriptor_type == VK_DESCRIPTOR_TYPE_SAMPLER;
case spv::OpTypeSampledImage:
+ if (descriptor_type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) {
+ /* Slight relaxation for some GLSL historical madness: samplerBuffer
+ * doesn't really have a sampler, and a texel buffer descriptor
+ * doesn't really provide one. Allow this slight mismatch.
+ */
+ auto image_type = module->get_def(type.word(2));
+ auto dim = image_type.word(3);
+ auto sampled = image_type.word(7);
+ return dim == spv::DimBuffer && sampled == 1;
+ }
return descriptor_type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
case spv::OpTypeImage: {