radeonsi: remove 2 callbacks from si_shader_context
authorMarek Olšák <marek.olsak@amd.com>
Tue, 5 Sep 2017 11:01:43 +0000 (13:01 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 7 Sep 2017 11:00:06 +0000 (13:00 +0200)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader_internal.h
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index db8297ddc4abf43ae7d61b960e412123f7508dc3..861d82fff7cbbad57de1eb11e0cd50d2edfc7ecc 100644 (file)
@@ -1493,9 +1493,9 @@ static LLVMValueRef load_sample_position(struct si_shader_context *ctx, LLVMValu
        return lp_build_gather_values(gallivm, pos, 4);
 }
 
-static void declare_system_value(struct si_shader_context *ctx,
-                                unsigned index,
-                                const struct tgsi_full_declaration *decl)
+void si_load_system_value(struct si_shader_context *ctx,
+                         unsigned index,
+                         const struct tgsi_full_declaration *decl)
 {
        struct lp_build_context *bld = &ctx->bld_base.base;
        struct gallivm_state *gallivm = &ctx->gallivm;
@@ -1770,8 +1770,8 @@ static void declare_system_value(struct si_shader_context *ctx,
        ctx->system_values[index] = value;
 }
 
-static void declare_compute_memory(struct si_shader_context *ctx,
-                                   const struct tgsi_full_declaration *decl)
+void si_declare_compute_memory(struct si_shader_context *ctx,
+                              const struct tgsi_full_declaration *decl)
 {
        struct si_shader_selector *sel = ctx->shader->selector;
        struct gallivm_state *gallivm = &ctx->gallivm;
@@ -5691,7 +5691,6 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx,
                bld_base->emit_epilogue = si_tgsi_emit_epilogue;
                break;
        case PIPE_SHADER_COMPUTE:
-               ctx->declare_memory_region = declare_compute_memory;
                break;
        default:
                assert(!"Unsupported shader type");
@@ -6345,8 +6344,6 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
 
        shader->info.uses_instanceid = sel->info.uses_instanceid;
 
-       ctx.load_system_value = declare_system_value;
-
        if (!si_compile_tgsi_main(&ctx, is_monolithic)) {
                si_llvm_dispose(&ctx);
                return -1;
index f304295cb6e5fce2488d99d1590351135e5f536e..1231ef494657cea9e3ca5ce298b1e76d01c3e332 100644 (file)
@@ -78,13 +78,6 @@ struct si_shader_context {
                           const struct tgsi_full_declaration *decl,
                           LLVMValueRef out[4]);
 
-       void (*load_system_value)(struct si_shader_context *,
-                                 unsigned index,
-                                 const struct tgsi_full_declaration *decl);
-
-       void (*declare_memory_region)(struct si_shader_context *,
-                                     const struct tgsi_full_declaration *decl);
-
        /** This array contains the input values for the shader.  Typically these
          * values will be in the form of a target intrinsic that will inform the
          * backend how to load the actual inputs to the shader.
@@ -325,6 +318,12 @@ LLVMValueRef si_load_image_desc(struct si_shader_context *ctx,
                                LLVMValueRef list, LLVMValueRef index,
                                enum ac_descriptor_type desc_type, bool dcc_off);
 
+void si_load_system_value(struct si_shader_context *ctx,
+                         unsigned index,
+                         const struct tgsi_full_declaration *decl);
+void si_declare_compute_memory(struct si_shader_context *ctx,
+                              const struct tgsi_full_declaration *decl);
+
 void si_llvm_load_input_vs(
        struct si_shader_context *ctx,
        unsigned input_index,
index 7a59c90c3e0b98457d03e5745f65b34928a35aab..231f16f049dd5d7f8bbb6055d5b2b8aba3f2a9e9 100644 (file)
@@ -842,7 +842,7 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base,
        {
                unsigned idx;
                for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) {
-                       ctx->load_system_value(ctx, idx, decl);
+                       si_load_system_value(ctx, idx, decl);
                }
        }
        break;
@@ -870,7 +870,7 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base,
        }
 
        case TGSI_FILE_MEMORY:
-               ctx->declare_memory_region(ctx, decl);
+               si_declare_compute_memory(ctx, decl);
                break;
 
        default: