summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_emit.c
diff options
context:
space:
mode:
authorMaciej Cencora <m.cencora@gmail.com>2009-02-15 20:57:32 +0100
committerNicolai Haehnle <nhaehnle@gmail.com>2009-03-06 22:19:43 +0100
commit7ad7abc4cd5c94b83feea4553ffb5a69d8ad4757 (patch)
tree756f49345cdae4bcde37ef3cd1c2bf8574336cad /src/mesa/drivers/dri/r300/r300_emit.c
parentd8b8fb68954e6eebd0b38708c25a5bec4cf1a26c (diff)
r300: route fog coord and W pos correctly
Also cleanup sw tcl vertex buffer setup Signed-off-by: Nicolai Haehnle <nhaehnle@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_emit.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_emit.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c
index 80bd3389ae..28c3157427 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.c
+++ b/src/mesa/drivers/dri/r300/r300_emit.c
@@ -314,10 +314,6 @@ GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten)
R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT |
R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT;
-#if 0
- if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ;
-#endif
-
if (OutputsWritten & (1 << VERT_RESULT_PSIZ))
ret |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT;
@@ -326,12 +322,21 @@ GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten)
GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten)
{
- GLuint i, ret = 0;
+ GLuint i, ret = 0, first_free_texcoord = 0;
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
if (OutputsWritten & (1 << (VERT_RESULT_TEX0 + i))) {
ret |= (4 << (3 * i));
+ ++first_free_texcoord;
+ }
+ }
+
+ if (OutputsWritten & (1 << VERT_RESULT_FOGC)) {
+ if (first_free_texcoord > 8) {
+ fprintf(stderr, "\tout of free texcoords to write fog coord\n");
+ _mesa_exit(-1);
}
+ ret |= 4 << (3 * first_free_texcoord);
}
return ret;