summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_emit.c
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-02-12 16:53:06 -0800
committerCorbin Simpson <[email protected]>2009-02-12 18:09:14 -0800
commitaffe0311fa60489e56b854c09f713fae024a0b00 (patch)
tree2c0d4f6f9e43a8d3e8b02cf7961498d15d7cdedf /src/gallium/drivers/r300/r300_emit.c
parent08e324fff3b295bfd5b176ed1242ad838c6d5f25 (diff)
r300-gallium: Add r500 passthrough shader assembly.
This allows a simple passthrough fragment shader to be provided on r500.
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 585a9e729d7..4d1b10de230 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -79,6 +79,39 @@ void r300_emit_dsa_state(struct r300_context* r300,
END_CS;
}
+void r300_emit_fragment_shader(struct r300_context* r300,
+ struct r300_fragment_shader* shader)
+{
+ CS_LOCALS(r300);
+}
+
+void r500_emit_fragment_shader(struct r300_context* r300,
+ struct r500_fragment_shader* shader)
+{
+ CS_LOCALS(r300);
+ int i = 0;
+
+ BEGIN_CS(8 + (shader->shader.instruction_count * 6) + 6);
+ OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO);
+ OUT_CS_REG(R500_US_PIXSIZE, shader->shader.stack_size);
+ OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) |
+ R500_US_CODE_END_ADDR(shader->shader.instruction_count));
+
+ OUT_CS_REG(R500_GA_US_VECTOR_INDEX, R500_GA_US_VECTOR_INDEX_TYPE_INSTR);
+ OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA,
+ shader->shader.instruction_count * 6);
+ for (i = 0; i < shader->shader.instruction_count; i++) {
+ CS_OUT(shader->instructions[i].inst0);
+ CS_OUT(shader->instructions[i].inst1);
+ CS_OUT(shader->instructions[i].inst2);
+ CS_OUT(shader->instructions[i].inst3);
+ CS_OUT(shader->instructions[i].inst4);
+ CS_OUT(shader->instructions[i].inst5);
+ }
+ R300_PACIFY;
+ END_CS;
+}
+
/* XXX add pitch, stride, z/stencil buf */
void r300_emit_fb_state(struct r300_context* r300,
struct pipe_framebuffer_state* fb)