From: Jason Ekstrand Date: Tue, 23 Feb 2016 05:39:14 +0000 (-0800) Subject: anv/descriptor_set: Set descriptor type for immuatable samplers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bfbb238dea91b1c2bde4f2f3eb20d39c95da3850;p=mesa.git anv/descriptor_set: Set descriptor type for immuatable samplers --- diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index b439f2a0c36..fe105b23f42 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -399,8 +399,17 @@ anv_descriptor_set_create(struct anv_device *device, struct anv_descriptor *desc = set->descriptors; for (uint32_t b = 0; b < layout->binding_count; b++) { if (layout->binding[b].immutable_samplers) { - for (uint32_t i = 0; i < layout->binding[b].array_size; i++) - desc[i].sampler = layout->binding[b].immutable_samplers[i]; + for (uint32_t i = 0; i < layout->binding[b].array_size; i++) { + /* The type will get changed to COMBINED_IMAGE_SAMPLER in + * UpdateDescriptorSets if needed. However, if the descriptor + * set has an immutable sampler, UpdateDescriptorSets may never + * touch it, so we need to make sure it's 100% valid now. + */ + desc[i] = (struct anv_descriptor) { + .type = VK_DESCRIPTOR_TYPE_SAMPLER, + .sampler = layout->binding[b].immutable_samplers[i], + }; + } } desc += layout->binding[b].array_size; }