diff options
author | Dave Airlie <[email protected]> | 2013-01-11 13:30:30 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2013-01-11 22:31:54 +0000 |
commit | 199eea4a4be342c255c1e5e22a39b79d316d52a4 (patch) | |
tree | 2ef86bc345e704bbe0ddd84f7f6f58f2dc532ea0 /src/gallium/drivers/r600 | |
parent | cc5fc8bf2f6a8b6390e4d9088060938fe23831e1 (diff) |
r600: always export a position from vertex shader
This fixes piglit glsl-1.40-tf-no-position from gpu hanging on my rv635
at least.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index db45dfd2266..ab0b5e28782 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1751,6 +1751,23 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen, } } + /* add fake position export */ + if (ctx.type == TGSI_PROCESSOR_VERTEX && next_pos_base == 60) { + memset(&output[j], 0, sizeof(struct r600_bytecode_output)); + output[j].gpr = 0; + output[j].elem_size = 3; + output[j].swizzle_x = 7; + output[j].swizzle_y = 7; + output[j].swizzle_z = 7; + output[j].swizzle_w = 7; + output[j].burst_count = 1; + output[j].barrier = 1; + output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS; + output[j].array_base = next_pos_base; + output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT); + j++; + } + /* add fake param output for vertex shader if no param is exported */ if (ctx.type == TGSI_PROCESSOR_VERTEX && next_param_base == 0) { memset(&output[j], 0, sizeof(struct r600_bytecode_output)); |