summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_emit.c
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-03-31 20:04:56 -0700
committerCorbin Simpson <[email protected]>2009-03-31 20:23:55 -0700
commit7540c847f1f046967d31445d5c936bcfdc7ed863 (patch)
tree04fcb33dd8443bf0be642711a7a418831a4c74cc /src/gallium/drivers/r300/r300_emit.c
parentddd0c94f0440cebc5e63afc1ae0300e0f51bc0a3 (diff)
r300-gallium: Moar vert shader emit.
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 4032eac1337..989fba74df0 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -329,10 +329,26 @@ void r300_emit_vertex_shader(struct r300_context* r300,
struct r300_vertex_shader* vs)
{
CS_LOCALS(r300);
+ struct r300_screen* r300screen = r300_screen(r300->context.screen);
int i;
- BEGIN_CS(1 + (vs->instruction_count * 4));
+ if (!r300screen->caps->has_tcl) {
+ debug_printf("r300: Implementation error: emit_vertex_shader called,"
+ " but has_tcl is FALSE!\n");
+ return;
+ }
+
+ BEGIN_CS(13 + (vs->instruction_count * 4));
+ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
+ OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, R300_PVS_FIRST_INST(0) |
+ R300_PVS_LAST_INST(vs->instruction_count - 1));
+ OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, vs->instruction_count - 1);
+
+ /* XXX */
+ OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x0);
+
+ OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0);
OUT_CS_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, vs->instruction_count * 4);
for (i = 0; i < vs->instruction_count; i++) {
OUT_CS(vs->instructions[i].inst0);
@@ -340,6 +356,11 @@ void r300_emit_vertex_shader(struct r300_context* r300,
OUT_CS(vs->instructions[i].inst2);
OUT_CS(vs->instructions[i].inst3);
}
+
+ OUT_CS_REG(R300_VAP_CNTL, R300_PVS_NUM_SLOTS(10) |
+ R300_PVS_NUM_CNTLRS(5) |
+ R300_PVS_NUM_FPUS(r300screen->caps->num_vert_fpus) |
+ R300_PVS_VF_MAX_VTX_NUM(12));
END_CS;
}