gallium/radeon: expose LLVM functions implementing emit_store
authorMarek Olšák <marek.olsak@amd.com>
Sun, 5 Oct 2014 18:20:18 +0000 (20:20 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 22 Jul 2015 22:59:31 +0000 (00:59 +0200)
emit_store will be reimplemented for tessellation control shader outputs
where only radeon_llvm_saturate will be used, but radeonsi will want to
fall back to radeon_llvm_emit_store for other register types.

This exposes both functions.

src/gallium/drivers/radeon/radeon_llvm.h
src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c

index 591e698d4826646138995698e6216a05c329e804..c50eb6914be90365497219e1b13117ecc019d6e5 100644 (file)
@@ -212,4 +212,13 @@ radeon_llvm_emit_fetch_double(struct lp_build_tgsi_context *bld_base,
                              LLVMValueRef ptr,
                              LLVMValueRef ptr2);
 
+LLVMValueRef radeon_llvm_saturate(struct lp_build_tgsi_context *bld_base,
+                                  LLVMValueRef value);
+
+void radeon_llvm_emit_store(
+       struct lp_build_tgsi_context * bld_base,
+       const struct tgsi_full_instruction * inst,
+       const struct tgsi_opcode_info * info,
+       LLVMValueRef dst[4]);
+
 #endif /* RADEON_LLVM_H */
index 7c0318152d14421d9f1d1a4da55b27ce32eadd1b..5bc93d7aa0e6cd90bb16504d1ad7636f8b952b52 100644 (file)
@@ -371,8 +371,8 @@ static void emit_declaration(
        }
 }
 
-static LLVMValueRef radeon_llvm_saturate(struct lp_build_tgsi_context *bld_base,
-                                         LLVMValueRef value)
+LLVMValueRef radeon_llvm_saturate(struct lp_build_tgsi_context *bld_base,
+                                  LLVMValueRef value)
 {
        struct lp_build_emit_data clamp_emit_data;
 
@@ -386,8 +386,7 @@ static LLVMValueRef radeon_llvm_saturate(struct lp_build_tgsi_context *bld_base,
                                  &clamp_emit_data);
 }
 
-static void
-emit_store(
+void radeon_llvm_emit_store(
        struct lp_build_tgsi_context * bld_base,
        const struct tgsi_full_instruction * inst,
        const struct tgsi_opcode_info * info,
@@ -1542,7 +1541,7 @@ void radeon_llvm_context_init(struct radeon_llvm_context * ctx)
        }
 
        bld_base->soa = 1;
-       bld_base->emit_store = emit_store;
+       bld_base->emit_store = radeon_llvm_emit_store;
        bld_base->emit_swizzle = emit_swizzle;
        bld_base->emit_declaration = emit_declaration;
        bld_base->emit_immediate = emit_immediate;