tu: Set num_components to 0 when building bindless intrinsics
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 17 Jun 2020 13:47:29 +0000 (15:47 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Wed, 17 Jun 2020 13:49:40 +0000 (15:49 +0200)
Fixes: 167fa288 (" nir/validate: validate intr->num_components")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5520>

src/freedreno/vulkan/tu_shader.c

index a43280e6a17010a78190c25761dc92b62b7f5952..b5d492aed0f18d60ce28be95ee017563d074e8ad 100644 (file)
@@ -153,7 +153,7 @@ lower_vulkan_resource_index(nir_builder *b, nir_intrinsic_instr *instr,
    nir_intrinsic_instr *bindless =
       nir_intrinsic_instr_create(b->shader,
                                  nir_intrinsic_bindless_resource_ir3);
-   bindless->num_components = 1;
+   bindless->num_components = 0;
    nir_ssa_dest_init(&bindless->instr, &bindless->dest,
                      1, 32, NULL);
    nir_intrinsic_set_desc_set(bindless, set);
@@ -214,7 +214,7 @@ build_bindless(nir_builder *b, nir_deref_instr *deref, bool is_sampler,
    nir_intrinsic_instr *bindless =
       nir_intrinsic_instr_create(b->shader,
                                  nir_intrinsic_bindless_resource_ir3);
-   bindless->num_components = 1;
+   bindless->num_components = 0;
    nir_ssa_dest_init(&bindless->instr, &bindless->dest,
                      1, 32, NULL);
    nir_intrinsic_set_desc_set(bindless, set);