vallium: fix input attachment lowering variable shadowing
authorDave Airlie <airlied@redhat.com>
Tue, 18 Aug 2020 05:17:57 +0000 (15:17 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 19 Aug 2020 00:16:09 +0000 (10:16 +1000)
This caused a bunch of tests to crash due to pos being shadowed
wrongly.

Fixes:
dEQP-VK.binding_model.descriptor_copy.graphics.input_attachment*

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Fixes: b38879f8c5f57b7f1802 ("vallium: initial import of the vulkan frontend")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6339>

src/gallium/frontends/vallium/val_lower_input_attachments.c

index a8b8af7392821391739cc1f98fb74a6a1a2b22c6..532f71df29c611ad678bef124cc02d8f583685e4 100644 (file)
@@ -32,7 +32,7 @@ load_frag_coord(nir_builder *b)
       nir_find_variable_with_location(b->shader, nir_var_shader_in,
                                       VARYING_SLOT_POS);
    if (pos == NULL) {
       nir_find_variable_with_location(b->shader, nir_var_shader_in,
                                       VARYING_SLOT_POS);
    if (pos == NULL) {
-      nir_variable *pos = nir_variable_create(b->shader, nir_var_shader_in,
+      pos = nir_variable_create(b->shader, nir_var_shader_in,
                                            glsl_vec4_type(), NULL);
       pos->data.location = VARYING_SLOT_POS;
    }
                                            glsl_vec4_type(), NULL);
       pos->data.location = VARYING_SLOT_POS;
    }