Mesa (master): r600g/llvm: Fix alpha_to_one piglit tests

Vincent Lejeune vlj at kemper.freedesktop.org
Mon Feb 18 14:09:13 UTC 2013


Module: Mesa
Branch: master
Commit: 90e6f47ac8c8fdbfd097ef099895cd2ae005eb55
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=90e6f47ac8c8fdbfd097ef099895cd2ae005eb55

Author: Vincent Lejeune <vljn at ovi.com>
Date:   Wed Feb 13 18:49:30 2013 +0100

r600g/llvm: Fix alpha_to_one piglit tests

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

---

 src/gallium/drivers/r600/r600_llvm.c     |    2 ++
 src/gallium/drivers/r600/r600_shader.c   |    1 +
 src/gallium/drivers/radeon/radeon_llvm.h |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index 7a41688..59047e7 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -234,6 +234,8 @@ static void llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
 			elements[chan] = LLVMBuildLoad(base->gallivm->builder,
 				ctx->soa.outputs[i][chan], "");
 		}
+		if (ctx->alpha_to_one && ctx->type == TGSI_PROCESSOR_FRAGMENT && ctx->r600_outputs[i].name == TGSI_SEMANTIC_COLOR)
+			elements[3] = lp_build_const_float(base->gallivm, 1.0f);
 		LLVMValueRef output = lp_build_gather_values(base->gallivm, elements, 4);
 
 		if (ctx->type == TGSI_PROCESSOR_VERTEX) {
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 59a7f92..8642463 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1428,6 +1428,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
 		radeon_llvm_ctx.fs_color_all = shader->fs_write_all && (rscreen->chip_class >= EVERGREEN);
 		radeon_llvm_ctx.stream_outputs = &so;
 		radeon_llvm_ctx.clip_vertex = ctx.cv_output;
+		radeon_llvm_ctx.alpha_to_one = key.alpha_to_one;
 		mod = r600_tgsi_llvm(&radeon_llvm_ctx, tokens);
 		if (debug_get_bool_option("R600_DUMP_SHADERS", FALSE)) {
 			dump = 1;
diff --git a/src/gallium/drivers/radeon/radeon_llvm.h b/src/gallium/drivers/radeon/radeon_llvm.h
index 21360e2..bfeacb5 100644
--- a/src/gallium/drivers/radeon/radeon_llvm.h
+++ b/src/gallium/drivers/radeon/radeon_llvm.h
@@ -64,6 +64,7 @@ struct radeon_llvm_context {
 	struct pipe_stream_output_info *stream_outputs;
 	unsigned color_buffer_count;
 	unsigned fs_color_all;
+	unsigned alpha_to_one;
 
 	/*=== Front end configuration ===*/
 




More information about the mesa-commit mailing list