<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 21, 2017 at 4:28 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
---<br>
src/intel/vulkan/anv_<wbr>descriptor_set.c | 31 +++++++++++++++++++-----------<wbr>-<br>
1 file changed, 19 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>descriptor_set.c b/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
index 4367c0ebe0..a5e65afc48 100644<br>
--- a/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
+++ b/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
@@ -587,8 +587,13 @@ void anv_UpdateDescriptorSets(<br>
switch (write->descriptorType) {<br>
case VK_DESCRIPTOR_TYPE_SAMPLER:<br>
for (uint32_t j = 0; j < write->descriptorCount; j++) {<br>
- ANV_FROM_HANDLE(anv_sampler, sampler,<br>
- write->pImageInfo[j].sampler);<br>
+ /* If this descriptor has an immutable sampler, we don't want to<br>
+ * stomp on it.<br>
+ */<br>
+ struct anv_sampler *sampler =<br>
+ bind_layout->immutable_<wbr>samplers ?<br>
+ bind_layout->immutable_<wbr>samplers[j] :<br>
+ anv_sampler_from_handle(write-<wbr>>pImageInfo[j].sampler);<br>
<br>
desc[j] = (struct anv_descriptor) {<br>
.type = VK_DESCRIPTOR_TYPE_SAMPLER,<br>
@@ -601,17 +606,19 @@ void anv_UpdateDescriptorSets(<br>
for (uint32_t j = 0; j < write->descriptorCount; j++) {<br>
ANV_FROM_HANDLE(anv_image_<wbr>view, iview,<br>
write->pImageInfo[j].<wbr>imageView);<br>
- ANV_FROM_HANDLE(anv_sampler, sampler,<br>
- write->pImageInfo[j].sampler);<br>
-<br>
- desc[j].type = VK_DESCRIPTOR_TYPE_COMBINED_<wbr>IMAGE_SAMPLER;<br>
- desc[j].image_view = iview;<br>
-<br>
- /* If this descriptor has an immutable sampler, we don't want<br>
- * to stomp on it.<br>
+ /* If this descriptor has an immutable sampler, we don't want to<br>
+ * stomp on it.<br>
*/<br>
- if (sampler)<br>
- desc[j].sampler = sampler;<br>
+ struct anv_sampler *sampler =<br>
+ bind_layout->immutable_<wbr>samplers ?<br>
+ bind_layout->immutable_<wbr>samplers[j] :<br>
+ anv_sampler_from_handle(write-<wbr>>pImageInfo[j].sampler);<br>
+<br>
+ desc[j] = (struct anv_descriptor) {<br>
+ .type = VK_DESCRIPTOR_TYPE_COMBINED_<wbr>IMAGE_SAMPLER,<br>
+ .image_view = iview,<br>
+ .sampler = sampler,<br>
+ };<br>
}<br>
break;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.11.0<br>
<br>
</font></span></blockquote></div><br></div>