diff options
author | Marek Olšák <[email protected]> | 2012-12-19 15:00:45 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-12-20 17:13:06 +0100 |
commit | d0e40bd3ed13ff58a898686a5b0d6238d7a1728e (patch) | |
tree | 6abfc45fdfeee93c9c50332e9b79ea4ef9f0a77b /src/gallium/drivers/r600 | |
parent | fddcc67f5cb41f70d1d11827eb9190a5caec13c5 (diff) |
r600g: use r600_get_temp to get temporaries for CLIPDIST shader outputs
I need this to be able to use r600_get_temp in the function later.
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index bcd43f10326..0ffa1fa4183 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1468,6 +1468,9 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen, } } + /* Reset the temporary register counter. */ + ctx.max_driver_temp_used = 0; + /* Get instructions if we are using the LLVM backend. */ if (use_llvm) { r600_bytecode_from_byte_stream(&ctx, inst_bytes, inst_byte_count); @@ -1477,15 +1480,20 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen, noutput = shader->noutput; if (ctx.clip_vertex_write) { + unsigned clipdist_temp[2]; + + clipdist_temp[0] = r600_get_temp(&ctx); + clipdist_temp[1] = r600_get_temp(&ctx); + /* need to convert a clipvertex write into clipdistance writes and not export the clip vertex anymore */ memset(&shader->output[noutput], 0, 2*sizeof(struct r600_shader_io)); shader->output[noutput].name = TGSI_SEMANTIC_CLIPDIST; - shader->output[noutput].gpr = ctx.temp_reg; + shader->output[noutput].gpr = clipdist_temp[0]; noutput++; shader->output[noutput].name = TGSI_SEMANTIC_CLIPDIST; - shader->output[noutput].gpr = ctx.temp_reg+1; + shader->output[noutput].gpr = clipdist_temp[1]; noutput++; /* reset spi_sid for clipvertex output to avoid confusing spi */ @@ -1508,7 +1516,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen, alu.src[1].kc_bank = R600_UCP_CONST_BUFFER; alu.src[1].chan = j; - alu.dst.sel = ctx.temp_reg + oreg; + alu.dst.sel = clipdist_temp[oreg]; alu.dst.chan = j; alu.dst.write = (j == ochan); if (j == 3) |