radv: set num_components on vulkan_resource_index intrinsic
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 6 Mar 2019 11:43:56 +0000 (11:43 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 6 Mar 2019 11:56:21 +0000 (11:56 +0000)
In 61e009d2c4e4df we changed the number of components in the
vulkan_resource_index intrinsic and forgot the update Radv's code for
it.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 61e009d2c4e4df ("spirv: Use the same types for resource indices as pointers")
Reviewed-by: Samuel Pitoiset samuel.pitoiset@gmail.com
src/amd/vulkan/radv_meta_buffer.c
src/amd/vulkan/radv_meta_clear.c
src/amd/vulkan/radv_query.c

index ab70f4bae6ec5686285ff83c8bddc2a3d9a7360c..b3aed109a5e24e68cde2f77e42fefea8ecb74ba8 100644 (file)
@@ -30,9 +30,10 @@ build_buffer_fill_shader(struct radv_device *dev)
        nir_intrinsic_instr *dst_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        dst_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       dst_buf->num_components = 1;
        nir_intrinsic_set_desc_set(dst_buf, 0);
        nir_intrinsic_set_binding(dst_buf, 0);
-       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, dst_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &dst_buf->instr);
 
        nir_intrinsic_instr *load = nir_intrinsic_instr_create(b.shader, nir_intrinsic_load_push_constant);
@@ -82,17 +83,19 @@ build_buffer_copy_shader(struct radv_device *dev)
        nir_intrinsic_instr *dst_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        dst_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       dst_buf->num_components = 1;
        nir_intrinsic_set_desc_set(dst_buf, 0);
        nir_intrinsic_set_binding(dst_buf, 0);
-       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, dst_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &dst_buf->instr);
 
        nir_intrinsic_instr *src_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        src_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       src_buf->num_components = 1;
        nir_intrinsic_set_desc_set(src_buf, 0);
        nir_intrinsic_set_binding(src_buf, 1);
-       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, src_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &src_buf->instr);
 
        nir_intrinsic_instr *load = nir_intrinsic_instr_create(b.shader, nir_intrinsic_load_ssbo);
index dc761ca17b28c3c74e030742525d8dc54a94a02c..1ead3a3f7cc7271d6f397867e9c20d25d5d7454c 100644 (file)
@@ -1078,9 +1078,10 @@ build_clear_htile_mask_shader()
                                           nir_intrinsic_vulkan_resource_index);
 
        buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       buf->num_components = 1;
        nir_intrinsic_set_desc_set(buf, 0);
        nir_intrinsic_set_binding(buf, 0);
-       nir_ssa_dest_init(&buf->instr, &buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&buf->instr, &buf->dest, buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &buf->instr);
 
        nir_intrinsic_instr *constants =
index 894b8cd510dbba443ce419e08c95171b7c7e4a17..cb279172922f5a170011627f4539659cc82896ca 100644 (file)
@@ -146,17 +146,19 @@ build_occlusion_query_shader(struct radv_device *device) {
        nir_intrinsic_instr *dst_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        dst_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       dst_buf->num_components = 1;
        nir_intrinsic_set_desc_set(dst_buf, 0);
        nir_intrinsic_set_binding(dst_buf, 0);
-       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, dst_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &dst_buf->instr);
 
        nir_intrinsic_instr *src_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        src_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       src_buf->num_components = 1;
        nir_intrinsic_set_desc_set(src_buf, 0);
        nir_intrinsic_set_binding(src_buf, 1);
-       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, src_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &src_buf->instr);
 
        nir_ssa_def *invoc_id = nir_load_local_invocation_id(&b);
@@ -335,17 +337,19 @@ build_pipeline_statistics_query_shader(struct radv_device *device) {
        nir_intrinsic_instr *dst_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        dst_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       dst_buf->num_components = 1;;
        nir_intrinsic_set_desc_set(dst_buf, 0);
        nir_intrinsic_set_binding(dst_buf, 0);
-       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, dst_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &dst_buf->instr);
 
        nir_intrinsic_instr *src_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        src_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       src_buf->num_components = 1;
        nir_intrinsic_set_desc_set(src_buf, 0);
        nir_intrinsic_set_binding(src_buf, 1);
-       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, src_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &src_buf->instr);
 
        nir_ssa_def *invoc_id = nir_load_local_invocation_id(&b);
@@ -579,17 +583,19 @@ build_tfb_query_shader(struct radv_device *device)
        nir_intrinsic_instr *dst_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        dst_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       dst_buf->num_components = 1;
        nir_intrinsic_set_desc_set(dst_buf, 0);
        nir_intrinsic_set_binding(dst_buf, 0);
-       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, dst_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &dst_buf->instr);
 
        nir_intrinsic_instr *src_buf = nir_intrinsic_instr_create(b.shader,
                                                                  nir_intrinsic_vulkan_resource_index);
        src_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
+       src_buf->num_components = 1;
        nir_intrinsic_set_desc_set(src_buf, 0);
        nir_intrinsic_set_binding(src_buf, 1);
-       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, 1, 32, NULL);
+       nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, src_buf->num_components, 32, NULL);
        nir_builder_instr_insert(&b, &src_buf->instr);
 
        /* Compute global ID. */