R6xx/r7xx: VS export fog color as parameter
authorCooper Yuan <cooperyuan@gmail.com>
Wed, 29 Jul 2009 07:23:56 +0000 (15:23 +0800)
committerCooper Yuan <cooperyuan@gmail.com>
Wed, 29 Jul 2009 07:23:56 +0000 (15:23 +0800)
src/mesa/drivers/dri/r600/r700_assembler.c
src/mesa/drivers/dri/r600/r700_fragprog.c

index 1d41c5cf785b409ca07bd615e6dce7b38dd5a290..ebd5ff106befb0248c5677e7ca103344adabac5c 100644 (file)
@@ -4014,6 +4014,22 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode,
         export_starting_index++;
        }
 
+        unBit = 1 << VERT_RESULT_FOGC;
+        if(OutputsWritten & unBit)
+        {
+        if( GL_FALSE == Process_Export(pR700AsmCode,
+                                       SQ_EXPORT_PARAM,
+                                       export_starting_index,
+                                       1,
+                                       pR700AsmCode->ucVP_OutputMap[VERT_RESULT_FOGC],
+                                       GL_FALSE) )
+        {
+            return GL_FALSE;
+        }
+
+        export_starting_index++;
+        }
+
        for(i=0; i<8; i++)
        {
                unBit = 1 << (VERT_RESULT_TEX0 + i);
index 88e66491ba815ab5a124ffad37eca0f2c118e171..a473dfe88897a542662bcd4f37907a5995d95de9 100644 (file)
@@ -67,6 +67,12 @@ void Map_Fragment_Program(r700_AssemblerBase         *pAsm,
                pAsm->uiFP_AttributeMap[FRAG_ATTRIB_COL1] = pAsm->number_used_registers++;
        }
 
+        unBit = 1 << FRAG_ATTRIB_FOGC;
+        if(mesa_fp->Base.InputsRead & unBit)
+        {
+                pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FOGC] = pAsm->number_used_registers++;
+        }
+
        for(i=0; i<8; i++)
        {
                unBit = 1 << (FRAG_ATTRIB_TEX0 + i);