ac/nir: move setting shader_info->fs.writes_memory to radv-specific code
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 9 Jun 2017 15:50:18 +0000 (17:50 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 31 Jul 2017 12:55:39 +0000 (14:55 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_nir_to_llvm.c

index ad6881000a8354cea1e5852bf61569c76ae504f0..ec8006889d0f469e5c7aa18aae2ed9d4e863c548 100644 (file)
@@ -3431,9 +3431,6 @@ static void visit_image_store(struct ac_nir_context *ctx,
        if (force_glc)
                glc = i1true;
 
-       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);
@@ -3493,9 +3490,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";
@@ -4168,6 +4162,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;