radeonsi: move si_nir_load_input_gs() to si_shader.c
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 1 Mar 2018 04:17:34 +0000 (15:17 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 6 Mar 2018 00:44:06 +0000 (11:44 +1100)
All the tess shader and tgsi equivalents are here and it allows
use to use llvm_type_is_64bit() in the following patch without
exposing it externally.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader_internal.h
src/gallium/drivers/radeonsi/si_shader_nir.c

index 2a50b266f64a5fdd031770a2d84f9d2d7e6310ca..f3a37d71a0a88500a21eb4c7c0b5a33acb59e2aa 100644 (file)
@@ -1682,6 +1682,26 @@ LLVMValueRef si_llvm_load_input_gs(struct ac_shader_abi *abi,
        return LLVMBuildBitCast(ctx->ac.builder, value, type, "");
 }
 
+static LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi,
+                                        unsigned location,
+                                        unsigned driver_location,
+                                        unsigned component,
+                                        unsigned num_components,
+                                        unsigned vertex_index,
+                                        unsigned const_index,
+                                        LLVMTypeRef type)
+{
+       struct si_shader_context *ctx = si_shader_context_from_abi(abi);
+
+       LLVMValueRef value[8];
+       for (unsigned i = component; i < num_components + component; i++) {
+               value[i] = si_llvm_load_input_gs(&ctx->abi, driver_location  / 4,
+                                                vertex_index, type, i);
+       }
+
+       return ac_build_varying_gather_values(&ctx->ac, value, num_components, component);
+}
+
 static LLVMValueRef fetch_input_gs(
        struct lp_build_tgsi_context *bld_base,
        const struct tgsi_full_src_register *reg,
index dbe4f2e969c5b88a58454bde25d1f77ca0708f94..dc7351701814d5719d2f7e60d76e5c2a9576eb41 100644 (file)
@@ -337,13 +337,4 @@ void si_llvm_load_input_fs(
 
 bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir);
 
-LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi,
-                                 unsigned location,
-                                 unsigned driver_location,
-                                 unsigned component,
-                                 unsigned num_components,
-                                 unsigned vertex_index,
-                                 unsigned const_index,
-                                 LLVMTypeRef type);
-
 #endif
index 05e00d016ebcbac25e085bff2af9f8a4510bd461..54ab0afca6697ae5b1e4f53749cf579f7db12878 100644 (file)
@@ -731,26 +731,6 @@ static void declare_nir_input_fs(struct si_shader_context *ctx,
        si_llvm_load_input_fs(ctx, input_index, out);
 }
 
-LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi,
-                                 unsigned location,
-                                 unsigned driver_location,
-                                 unsigned component,
-                                 unsigned num_components,
-                                 unsigned vertex_index,
-                                 unsigned const_index,
-                                 LLVMTypeRef type)
-{
-       struct si_shader_context *ctx = si_shader_context_from_abi(abi);
-
-       LLVMValueRef value[8];
-       for (unsigned i = component; i < num_components + component; i++) {
-               value[i] = si_llvm_load_input_gs(&ctx->abi, driver_location  / 4,
-                                                vertex_index, type, i);
-       }
-
-       return ac_build_varying_gather_values(&ctx->ac, value, num_components, component);
-}
-
 LLVMValueRef
 si_nir_lookup_interp_param(struct ac_shader_abi *abi,
                           enum glsl_interp_mode interp, unsigned location)