[Mesa-dev] [PATCH 3/5] r300g/compiler/tests: Fix parsing of immediates

Tom Stellard tom at stellard.net
Sun Jan 5 18:51:19 PST 2014


From: Tom Stellard <thomas.stellard at amd.com>

---
 src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c b/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c
index b4e30d8..725be4c 100644
--- a/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c
+++ b/src/gallium/drivers/r300/compiler/tests/rc_test_helpers.c
@@ -439,7 +439,7 @@ int parse_rc_normal_instruction(
 #define FLOAT_TOKEN_LEN 50
 int parse_constant(unsigned *index, float *data, const char *const_str)
 {
-	int matched = sscanf(const_str, "const[%d] {%f, %f, %f, %f}", index,
+	int matched = sscanf(const_str, "const[%d] = {%f %f %f %f}", index,
 				&data[0], &data[1], &data[2], &data[3]);
 	return matched == 5;
 }
@@ -475,7 +475,7 @@ int add_constant(struct radeon_compiler *c, const char *const_str)
 	}
 
 	constants = &c->Program.Constants;
-	if (constants->_Reserved < index) {
+	if (constants->_Reserved <= index) {
 		struct rc_constant * newlist;
 
 		constants->_Reserved = index + 100;
-- 
1.8.1.5



More information about the mesa-dev mailing list