[Mesa-dev] [PATCH 01/27] gallium/radeon: expose LLVM functions implementing emit_store
Marek Olšák
maraeo at gmail.com
Tue Jun 16 16:06:04 PDT 2015
From: Marek Olšák <marek.olsak at amd.com>
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 | 9 ++++++++-
src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 11 +++++------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/radeon/radeon_llvm.h b/src/gallium/drivers/radeon/radeon_llvm.h
index 6a9557b..cf85b94 100644
--- a/src/gallium/drivers/radeon/radeon_llvm.h
+++ b/src/gallium/drivers/radeon/radeon_llvm.h
@@ -205,6 +205,13 @@ build_tgsi_intrinsic_nomem(
struct lp_build_tgsi_context * bld_base,
struct lp_build_emit_data * emit_data);
-
+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 */
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index c8c980d..8a82f92 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -321,8 +321,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;
@@ -336,8 +336,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,
@@ -379,7 +378,7 @@ emit_store(
LLVMBuildStore(builder, value, temp_ptr);
continue;
}
-
+
value = bitcast(bld_base, TGSI_TYPE_FLOAT, value);
if (reg->Register.Indirect) {
@@ -1425,7 +1424,7 @@ void radeon_llvm_context_init(struct radeon_llvm_context * ctx)
lp_build_context_init(&ctx->soa.bld_base.int_bld, &ctx->gallivm, lp_int_type(type));
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;
--
2.1.0
More information about the mesa-dev
mailing list