zink: Fix reversed cap declarations for ImageBuffer
authorEmma Anholt <emma@anholt.net>
Tue, 13 Dec 2022 21:16:03 +0000 (13:16 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 14 Dec 2022 12:23:58 +0000 (12:23 +0000)
Fixes validation fails on
KHR-GLES31.core.texture_buffer.texture_buffer_texture_buffer_range.

Fixes: f55a4407ef97 ("zink: more accurately set {Sampled,Image}Buffer caps")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20308>

src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c

index 7b0e7f91e343a6970ecf0bf5e4989f3d63d3ca66..9d9078e6487267189a8e0e08204f081b3f0f7b71 100644 (file)
@@ -990,9 +990,9 @@ get_bare_image_type(struct ntv_context *ctx, struct nir_variable *var, bool is_s
    }
    if (dimension == SpvDimBuffer) {
       if (is_sampler)
-         spirv_builder_emit_cap(&ctx->builder, SpvCapabilityImageBuffer);
-      else
          spirv_builder_emit_cap(&ctx->builder, SpvCapabilitySampledBuffer);
+      else
+         spirv_builder_emit_cap(&ctx->builder, SpvCapabilityImageBuffer);
    }
 
    bool arrayed = glsl_sampler_type_is_array(type);