anv/descriptor_set: Only write texture swizzles if we have an image view
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 25 Jun 2019 19:26:56 +0000 (14:26 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 25 Jun 2019 19:43:25 +0000 (19:43 +0000)
When immutable samplers are set we call write_image_view with a NULL
image view.  This causes issues on IVB where we have to fake texture
swizzling.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110999
Fixes: d2aa65eb18 "anv: Emulate texture swizzle in the shader when..."

src/intel/vulkan/anv_descriptor_set.c

index a6b4946..f4e0066 100644 (file)
@@ -1198,7 +1198,7 @@ anv_descriptor_set_write_image_view(struct anv_device *device,
       anv_descriptor_set_write_image_param(desc_map, image_param);
    }
 
-   if (bind_layout->data & ANV_DESCRIPTOR_TEXTURE_SWIZZLE) {
+   if (image_view && (bind_layout->data & ANV_DESCRIPTOR_TEXTURE_SWIZZLE)) {
       assert(!(bind_layout->data & ANV_DESCRIPTOR_SAMPLED_IMAGE));
       assert(image_view);
       struct anv_texture_swizzle_descriptor desc_data[3];