Mesa (master): radeonsi/nir: fix handling of doubles for gs inputs

Timothy Arceri tarceri at kemper.freedesktop.org
Tue Mar 6 00:46:11 UTC 2018


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

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Thu Mar  1 15:21:52 2018 +1100

radeonsi/nir: fix handling of doubles for gs inputs

Fixes piglit test:
tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs.shader_test

Reviewed-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/radeonsi/si_shader.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index f3a37d71a0..2ae2544e3f 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1693,10 +1693,14 @@ static LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi,
 {
 	struct si_shader_context *ctx = si_shader_context_from_abi(abi);
 
-	LLVMValueRef value[8];
+	LLVMValueRef value[4];
 	for (unsigned i = component; i < num_components + component; i++) {
+		unsigned offset = i;
+		if (llvm_type_is_64bit(ctx, type))
+			offset *= 2;
+
 		value[i] = si_llvm_load_input_gs(&ctx->abi, driver_location  / 4,
-						 vertex_index, type, i);
+						 vertex_index, type, offset);
 	}
 
 	return ac_build_varying_gather_values(&ctx->ac, value, num_components, component);




More information about the mesa-commit mailing list