diff options
author | Ilia Mirkin <[email protected]> | 2014-07-02 12:16:01 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2014-07-03 19:39:25 -0400 |
commit | 313acb3ffa2e73635807c4028b7aedced5bad379 (patch) | |
tree | 84e57a7b097c1e2e9e56e1a994fcdfe35d3c46b2 | |
parent | 556a415033223108eb5706364604b3400f497c58 (diff) |
r600g: allow vs to write to gl_ViewportIndex
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Tested-by: Tobias Droste <[email protected]>
-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 3767e5fbc18..448ca8044de 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -2042,6 +2042,23 @@ static int r600_shader_from_tgsi(struct r600_context *rctx, output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS; pos_emitted = true; break; + case TGSI_SEMANTIC_VIEWPORT_INDEX: + /* spi_sid is 0 for outputs that are + * not consumed by PS */ + if (shader->output[i].spi_sid) { + output[j].array_base = next_param_base++; + output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PARAM; + j++; + memcpy(&output[j], &output[j-1], sizeof(struct r600_bytecode_output)); + } + output[j].array_base = 61; + output[j].swizzle_x = 7; + output[j].swizzle_y = 7; + output[j].swizzle_z = 7; + output[j].swizzle_w = 0; + output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS; + pos_emitted = true; + break; case TGSI_SEMANTIC_CLIPVERTEX: j--; break; |