diff options
author | Tom Stellard <[email protected]> | 2010-08-05 10:19:00 -0700 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2010-08-10 13:17:25 -0700 |
commit | c298bab60ea63882f34825a35cbc60f662783e64 (patch) | |
tree | 2a579f6da8146bd34fd9e5ec9090c76604d46dbb /src/gallium/drivers/r300/r300_emit.c | |
parent | 5c7b7da798b47126d9cc887b0df4b2c24ad9176b (diff) |
r300/compiler: Implement hardware assisted loops for vertex shaders.
Single loops work, but nested loops do not.
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 7bd43b6eb5d..98958d1a2e0 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -936,6 +936,22 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state) OUT_CS_TABLE(data, 4); } } + + /* Emit flow control instructions. */ + if (code->num_fc_ops) { + + OUT_CS_REG(R300_VAP_PVS_FLOW_CNTL_OPC, code->fc_ops); + if (r300screen->caps.is_r500) { + OUT_CS_REG_SEQ(R500_VAP_PVS_FLOW_CNTL_ADDRS_LW_0, code->num_fc_ops * 2); + OUT_CS_TABLE(code->fc_op_addrs.r500, code->num_fc_ops * 2); + } else { + OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_ADDRS_0, code->num_fc_ops); + OUT_CS_TABLE(code->fc_op_addrs.r300, code->num_fc_ops); + } + OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_LOOP_INDEX_0, code->num_fc_ops); + OUT_CS_TABLE(code->fc_loop_index, code->num_fc_ops); + } + END_CS; } |