r300: work-around FRAG_BIT_FOGC warning/error
authorBrian Paul <brianp@vmware.com>
Wed, 14 Jan 2009 23:48:54 +0000 (16:48 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 14 Jan 2009 23:49:24 +0000 (16:49 -0700)
See bug 17929.

Fog doesn't actually work, but the often complained about warning is
silenced.

src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/radeon_program_pair.c

index 6a5c3633a2318d7f18bec67a1d68ad07c3bab534..a63dbac3436f4e100b3ea2b5b3c72ca8f1cc95ab 100644 (file)
@@ -1675,6 +1675,13 @@ static void r300SetupRSUnit(GLcontext * ctx)
                rs_col_count += count;
        }
 
+       if (InputsRead & FRAG_BIT_FOGC) {
+               /* XXX FIX THIS
+                * Just turn off the bit for now.
+                * Need to do something similar to the color/texcoord inputs.
+                */
+               InputsRead &= ~FRAG_BIT_FOGC;
+       }
 
        for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
                int swiz;
index 5ad50d2863ac07ef7a0daea5240d5b2e551c4f10..58bc0d5843ffa8010214718adfea847cfac0055c 100644 (file)
@@ -473,6 +473,11 @@ static void allocate_input_registers(struct pair_state *s)
                alloc_hw_reg(s, PROGRAM_INPUT, FRAG_ATTRIB_COL1, hwindex++);
        InputsRead &= ~FRAG_BIT_COL1;
 
+       /* Fog coordinate */
+       if (InputsRead & FRAG_BIT_FOGC)
+               alloc_hw_reg(s, PROGRAM_INPUT, FRAG_ATTRIB_FOGC, hwindex++);
+       InputsRead &= ~FRAG_BIT_FOGC;
+
        /* Anything else */
        if (InputsRead)
                error("Don't know how to handle inputs 0x%x\n", InputsRead);