summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-09 17:50:18 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-05 12:33:55 +0200
commit7d4e25c727b0bc6fdd35c58e444203d180722410 (patch)
treebabc26ea417d16387b3f14df151fea4115a9dbda
parent9b5e45f32703a04aaea9ef85e1d8ec3b706c27eb (diff)
ac/nir: move setting shader_info->fs.writes_memory to radv-specific code
-rw-r--r--src/amd/common/ac_nir_to_llvm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 5d7f53e034..301cb837c8 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3403,9 +3403,6 @@ static void visit_image_store(struct ac_nir_context *ctx,
LLVMValueRef i1false = LLVMConstInt(ctx->ac.i1, 0, false);
LLVMValueRef i1true = LLVMConstInt(ctx->ac.i1, 1, false);
- if (ctx->stage == MESA_SHADER_FRAGMENT)
- ctx->nctx->shader_info->fs.writes_memory = true;
-
if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_BUF) {
params[0] = to_float(&ctx->ac, get_src(ctx, instr->src[2])); /* data */
params[1] = get_sampler_desc(ctx, instr->variables[0], AC_DESC_BUFFER, true, true);
@@ -3466,9 +3463,6 @@ static LLVMValueRef visit_image_atomic(struct ac_nir_context *ctx,
LLVMValueRef i1true = LLVMConstInt(ctx->ac.i1, 1, false);
MAYBE_UNUSED int length;
- if (ctx->stage == MESA_SHADER_FRAGMENT)
- ctx->nctx->shader_info->fs.writes_memory = true;
-
switch (instr->intrinsic) {
case nir_intrinsic_image_atomic_add:
atomic_name = "add";
@@ -4142,6 +4136,9 @@ static LLVMValueRef radv_get_sampler_desc(struct ac_shader_abi *abi,
assert(base_index < layout->binding_count);
+ if (write && ctx->stage == MESA_SHADER_FRAGMENT)
+ ctx->shader_info->fs.writes_memory = true;
+
switch (desc_type) {
case AC_DESC_IMAGE:
type = ctx->v8i32;