radv: Remove image_var stores.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 11 May 2018 12:02:13 +0000 (14:02 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 23 Jun 2018 03:54:00 +0000 (20:54 -0700)
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/amd/vulkan/radv_meta_bufimage.c
src/amd/vulkan/radv_meta_fast_clear.c
src/amd/vulkan/radv_meta_resolve_cs.c

index 147d2ea46ef287ff534902a53fc311921ae66a9d..aa17c25833b9af144d282b5f9c815a5d3cf76efc 100644 (file)
@@ -115,11 +115,11 @@ build_nir_itob_compute_shader(struct radv_device *dev, bool is_3d)
        nir_ssa_def *coord = nir_vec4(&b, tmp, tmp, tmp, tmp);
 
        nir_ssa_def *outval = &tex->dest.ssa;
-       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_var_store);
-       store->src[0] = nir_src_for_ssa(coord);
-       store->src[1] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
-       store->src[2] = nir_src_for_ssa(outval);
-       store->variables[0] = nir_deref_var_create(store, output_img);
+       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_deref_store);
+       store->src[0] = nir_src_for_ssa(&nir_build_deref_var(&b, output_img)->dest.ssa);
+       store->src[1] = nir_src_for_ssa(coord);
+       store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
+       store->src[3] = nir_src_for_ssa(outval);
 
        nir_builder_instr_insert(&b, &store->instr);
        return b.shader;
@@ -341,11 +341,11 @@ build_nir_btoi_compute_shader(struct radv_device *dev, bool is_3d)
        nir_builder_instr_insert(&b, &tex->instr);
 
        nir_ssa_def *outval = &tex->dest.ssa;
-       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_var_store);
-       store->src[0] = nir_src_for_ssa(img_coord);
-       store->src[1] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
-       store->src[2] = nir_src_for_ssa(outval);
-       store->variables[0] = nir_deref_var_create(store, output_img);
+       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_deref_store);
+       store->src[0] = nir_src_for_ssa(&nir_build_deref_var(&b, output_img)->dest.ssa);
+       store->src[1] = nir_src_for_ssa(img_coord);
+       store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
+       store->src[3] = nir_src_for_ssa(outval);
 
        nir_builder_instr_insert(&b, &store->instr);
        return b.shader;
@@ -556,11 +556,11 @@ build_nir_itoi_compute_shader(struct radv_device *dev, bool is_3d)
        nir_builder_instr_insert(&b, &tex->instr);
 
        nir_ssa_def *outval = &tex->dest.ssa;
-       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_var_store);
-       store->src[0] = nir_src_for_ssa(dst_coord);
-       store->src[1] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
-       store->src[2] = nir_src_for_ssa(outval);
-       store->variables[0] = nir_deref_var_create(store, output_img);
+       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_deref_store);
+       store->src[0] = nir_src_for_ssa(&nir_build_deref_var(&b, output_img)->dest.ssa);
+       store->src[1] = nir_src_for_ssa(dst_coord);
+       store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
+       store->src[3] = nir_src_for_ssa(outval);
 
        nir_builder_instr_insert(&b, &store->instr);
        return b.shader;
@@ -752,11 +752,11 @@ build_nir_cleari_compute_shader(struct radv_device *dev, bool is_3d)
        comps[3] = nir_imm_int(&b, 0);
        global_id = nir_vec(&b, comps, 4);
 
-       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_var_store);
-       store->src[0] = nir_src_for_ssa(global_id);
-       store->src[1] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
-       store->src[2] = nir_src_for_ssa(&clear_val->dest.ssa);
-       store->variables[0] = nir_deref_var_create(store, output_img);
+       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_deref_store);
+       store->src[0] = nir_src_for_ssa(&nir_build_deref_var(&b, output_img)->dest.ssa);
+       store->src[1] = nir_src_for_ssa(global_id);
+       store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
+       store->src[3] = nir_src_for_ssa(&clear_val->dest.ssa);
 
        nir_builder_instr_insert(&b, &store->instr);
        return b.shader;
index 411d02f231ff74287fa67685d5c1858566966b8e..041c9e44c45b86d10e4c548657f25b998b72539c 100644 (file)
@@ -91,11 +91,11 @@ build_dcc_decompress_compute_shader(struct radv_device *dev)
        nir_builder_instr_insert(&b, &bar->instr);
 
        nir_ssa_def *outval = &tex->dest.ssa;
-       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_var_store);
-       store->src[0] = nir_src_for_ssa(global_id);
-       store->src[1] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
-       store->src[2] = nir_src_for_ssa(outval);
-       store->variables[0] = nir_deref_var_create(store, output_img);
+       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_deref_store);
+       store->src[0] = nir_src_for_ssa(&nir_build_deref_var(&b, output_img)->dest.ssa);
+       store->src[1] = nir_src_for_ssa(global_id);
+       store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
+       store->src[3] = nir_src_for_ssa(outval);
 
        nir_builder_instr_insert(&b, &store->instr);
        return b.shader;
index 322e72e465e963cb7eee6fe2453428d274f429ec..4a37892b8607e1ad2ab74f939efe3e60dc18bcd9 100644 (file)
@@ -135,11 +135,11 @@ build_resolve_compute_shader(struct radv_device *dev, bool is_integer, bool is_s
                outval = radv_meta_build_resolve_srgb_conversion(&b, outval);
 
        nir_ssa_def *coord = nir_iadd(&b, global_id, &dst_offset->dest.ssa);
-       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_var_store);
-       store->src[0] = nir_src_for_ssa(coord);
-       store->src[1] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
-       store->src[2] = nir_src_for_ssa(outval);
-       store->variables[0] = nir_deref_var_create(store, output_img);
+       nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_image_deref_store);
+       store->src[0] = nir_src_for_ssa(&nir_build_deref_var(&b, output_img)->dest.ssa);
+       store->src[1] = nir_src_for_ssa(coord);
+       store->src[2] = nir_src_for_ssa(nir_ssa_undef(&b, 1, 32));
+       store->src[3] = nir_src_for_ssa(outval);
        nir_builder_instr_insert(&b, &store->instr);
        return b.shader;
 }