Mesa (master): r600: Process exports for all written fragment outputs.

Alex Deucher agd5f at kemper.freedesktop.org
Tue Jun 8 12:40:54 PDT 2010


Module: Mesa
Branch: master
Commit: 1ec492a366e236569dc68f4de32e641c88cbcd63
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ec492a366e236569dc68f4de32e641c88cbcd63

Author: Henri Verbeet <hverbeet at gmail.com>
Date:   Tue Jun  8 15:28:32 2010 -0400

r600: Process exports for all written fragment outputs.

---

 src/mesa/drivers/dri/r600/r700_assembler.c |   38 +++++++++-------------------
 1 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c
index 0677c54..2e64a57 100644
--- a/src/mesa/drivers/dri/r600/r700_assembler.c
+++ b/src/mesa/drivers/dri/r600/r700_assembler.c
@@ -6437,6 +6437,7 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode,
 { 
     unsigned int unBit;
     GLuint export_count = 0;
+    unsigned int i;
 
     if(pR700AsmCode->depth_export_register_number >= 0) 
     {
@@ -6446,34 +6447,19 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode,
 		}
     }
 
-    unBit = 1 << FRAG_RESULT_COLOR;
-	if(OutputsWritten & unBit)
-	{
-		if( GL_FALSE == Process_Export(pR700AsmCode,
-                                       SQ_EXPORT_PIXEL, 
-                                       0, 
-                                       1, 
-                                       pR700AsmCode->uiFP_OutputMap[FRAG_RESULT_COLOR], 
-                                       GL_FALSE) ) 
-        {
-            return GL_FALSE;
-        }
-        export_count++;
-	}
-	unBit = 1 << FRAG_RESULT_DEPTH;
-	if(OutputsWritten & unBit)
-	{
-        if( GL_FALSE == Process_Export(pR700AsmCode,
-                                       SQ_EXPORT_PIXEL, 
-                                       0, 
-                                       1, 
-                                       pR700AsmCode->uiFP_OutputMap[FRAG_RESULT_DEPTH], 
-                                       GL_TRUE)) 
+    for (i = 0; i < FRAG_RESULT_MAX; ++i)
+    {
+        unBit = 1 << i;
+
+        if (OutputsWritten & unBit)
         {
-            return GL_FALSE;
+            GLboolean is_depth = i == FRAG_RESULT_DEPTH ? GL_TRUE : GL_FALSE;
+            if (!Process_Export(pR700AsmCode, SQ_EXPORT_PIXEL, 0, 1, pR700AsmCode->uiFP_OutputMap[i], is_depth))
+                return GL_FALSE;
+            ++export_count;
         }
-        export_count++;
-	}
+    }
+
     /* Need to export something, otherwise we'll hang
      * results are undefined anyway */
     if(export_count == 0)



More information about the mesa-commit mailing list