From 694ed0d61a93f3e91c2fa9f7fbc3d736a8d701ec Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 14 Jan 2018 18:13:31 +0100 Subject: [PATCH] r600/shader: Initialize max_driver_temp_used correctly for the first time Without this initialization the temp registers used in tgsi_declaration may used random indices, and this may result in failing translation from TGSI with an error message "GPR limit exceeded", because the random index is greater then the allowed limit implying that the shader uses more temporary registers then available. Signed-off-by: Gert Wollny Cc: Signed-off-by: Dave Airlie (cherry picked from commit 5d6470d26b267d522dd343740878bde46f21c446) --- src/gallium/drivers/r600/r600_shader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 0784d2ca3ae..b7aafd948ac 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -3127,6 +3127,7 @@ static int r600_shader_from_tgsi(struct r600_context *rctx, ctx.nliterals = 0; ctx.literals = NULL; + ctx.max_driver_temp_used = 0; shader->fs_write_all = ctx.info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS] && ctx.info.colors_written == 1;