r600: A shader is bound that exports Z as a float into Red channel
authorCooper Yuan <cooperyuan@gmail.com>
Wed, 12 Aug 2009 09:39:18 +0000 (17:39 +0800)
committerCooper Yuan <cooperyuan@gmail.com>
Wed, 12 Aug 2009 09:39:18 +0000 (17:39 +0800)
src/mesa/drivers/dri/r600/r700_assembler.c
src/mesa/drivers/dri/r600/r700_fragprog.c

index 0abf112b55f031785dabe1be8f8e30fa29499079..eaacd0611372f7976c380ee06246060eb71fdf33 100644 (file)
@@ -3839,6 +3839,9 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm,
     if (export_count == 1) 
     {
         ucWriteMask = pAsm->pucOutMask[starting_register_number - pAsm->starting_export_register_number];
+       /* exports Z as a float into Red channel */
+       if (GL_TRUE == is_depth_export)
+           ucWriteMask = 0x1;
 
         if( (ucWriteMask & 0x1) != 0)
         {
index efeea905c14c1c89e48f06f9b8f162bb4729510f..6249bde6f18e63f4b90574680b7df8ea3456fd11 100644 (file)
@@ -118,6 +118,7 @@ void Map_Fragment_Program(r700_AssemblerBase         *pAsm,
                pAsm->uiFP_OutputMap[FRAG_RESULT_DEPTH] = pAsm->number_used_registers++;
                pAsm->number_of_exports++;
                pAsm->number_of_colorandz_exports++;
+               pAsm->pR700Shader->depthIsExported = 1;
        }
 
     pAsm->pucOutMask = (unsigned char*) MALLOC(pAsm->number_of_exports);