From 44a117ab9ac7e18ffddf4d59ae35fe2c266efc1d Mon Sep 17 00:00:00 2001
From: Vadim Girlin <vadimgirlin@gmail.com>
Date: Sat, 25 May 2013 22:56:53 +0400
Subject: r600g/sb: fix handling of preloaded inputs for compute shaders

For compute shaders we need to let the backend know that
GPRs 0 and 1 are preloaded with some compute-specific input
values, otherwise any use of these regs without previous
definition is considered as undefined value and usually
is simply replaced with 0.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
---
 src/gallium/drivers/r600/sb/sb_bc_parser.cpp | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src')

diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
index 3ea09cb73b4..c2443b8ef6c 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
@@ -111,6 +111,10 @@ int bc_parser::parse_decls() {
 	if (!pshader) {
 		if (gpr_reladdr)
 			sh->add_gpr_array(0, bc->ngpr, 0x0F);
+
+		// compute shaders have some values preloaded in R0, R1
+		sh->add_input(0 /* GPR */, true /* preloaded */, 0x0F /* mask */);
+		sh->add_input(1 /* GPR */, true /* preloaded */, 0x0F /* mask */);
 		return 0;
 	}
 
-- 
cgit v1.2.3