more cleanup
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 29 May 2009 18:45:07 +0000 (14:45 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Fri, 29 May 2009 18:45:07 +0000 (14:45 -0400)
src/mesa/drivers/dri/r600/r700_chip.c
src/mesa/drivers/dri/r600/r700_chip.h
src/mesa/drivers/dri/r600/r700_ioctl.c
src/mesa/drivers/dri/r600/r700_render.c

index 5cd0d72d6e5dd135cc90d43906804d12a67f8814..3db03578ede03290e466444eed7526715be52b68 100644 (file)
@@ -53,16 +53,6 @@ static GLboolean r700DestroyChipObj(GLcontext * ctx)
 
     r700 = (R700_CHIP_CONTEXT *)(context->chipobj.pvChipObj);
 
-    if(0 != r700->pbo_vs_clear)
-    {
-        r600DeleteShader(context, r700->pbo_vs_clear);    
-    }
-
-    if(0 != r700->pbo_fs_clear)
-    {
-        r600DeleteShader(context, r700->pbo_fs_clear);
-    }
-
     FREE(r700->pStateList);
 
     FREE(r700);
@@ -512,8 +502,7 @@ inline GLboolean needRelocReg(context_t *context, unsigned int reg)
     return GL_FALSE;
 }
 
-inline GLboolean setRelocReg(context_t *context, unsigned int reg,
-                             GLboolean bUseStockShader)
+inline GLboolean setRelocReg(context_t *context, unsigned int reg)
 {
     BATCH_LOCALS(&context->radeon);
     R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context);
@@ -573,63 +562,35 @@ inline GLboolean setRelocReg(context_t *context, unsigned int reg,
                 return GL_TRUE;
             }
             break;
-        case mmSQ_PGM_START_VS:   
-            {                
-                if(GL_TRUE == bUseStockShader)
-                {
-                    if(NULL != r700->pbo_vs_clear)
-                    {
-                        pbo = (struct radeon_bo *)(r700->pbo_vs_clear);
-                    }
-                    else
-                    {
-                        return GL_FALSE;
-                    }
-                }
-                else
-                {
-                    pbo = (struct radeon_bo *)r700GetActiveVpShaderBo(GL_CONTEXT(context));
-                }
+        case mmSQ_PGM_START_VS:
+            {
+                pbo = (struct radeon_bo *)r700GetActiveVpShaderBo(GL_CONTEXT(context));
 
                 offset_mod.shift     = NO_SHIFT;
                 offset_mod.shiftbits = 0;
-                offset_mod.mask      = 0xFFFFFFFF;           
+                offset_mod.mask      = 0xFFFFFFFF;
 
-                R600_OUT_BATCH_RELOC(r700->SQ_PGM_START_VS.u32All, 
-                                     pbo, 
+                R600_OUT_BATCH_RELOC(r700->SQ_PGM_START_VS.u32All,
+                                     pbo,
                                      r700->SQ_PGM_START_VS.u32All,
                                                         RADEON_GEM_DOMAIN_GTT, 0, 0, &offset_mod);
                 return GL_TRUE;
             }
             break;
-        case mmSQ_PGM_START_FS:            
-        case mmSQ_PGM_START_ES:            
-        case mmSQ_PGM_START_GS:            
-        case mmSQ_PGM_START_PS:        
+        case mmSQ_PGM_START_FS:
+        case mmSQ_PGM_START_ES:
+        case mmSQ_PGM_START_GS:
+        case mmSQ_PGM_START_PS:
             {
-                if(GL_TRUE == bUseStockShader)
-                {
-                    if(NULL != r700->pbo_fs_clear)
-                    {
-                        pbo = (struct radeon_bo *)(r700->pbo_fs_clear);
-                    }
-                    else
-                    {
-                        return GL_FALSE;
-                    }
-                }
-                else
-                {
-                    pbo = (struct radeon_bo *)r700GetActiveFpShaderBo(GL_CONTEXT(context));
-                }
+                pbo = (struct radeon_bo *)r700GetActiveFpShaderBo(GL_CONTEXT(context));
 
                 offset_mod.shift     = NO_SHIFT;
                 offset_mod.shiftbits = 0;
                 offset_mod.mask      = 0xFFFFFFFF;
 
                 voffset = 0;
-                R600_OUT_BATCH_RELOC(r700->SQ_PGM_START_PS.u32All, 
-                                     pbo, 
+                R600_OUT_BATCH_RELOC(r700->SQ_PGM_START_PS.u32All,
+                                     pbo,
                                      r700->SQ_PGM_START_PS.u32All,
                                                         RADEON_GEM_DOMAIN_GTT, 0, 0, &offset_mod);
                 return GL_TRUE;
@@ -640,7 +601,7 @@ inline GLboolean setRelocReg(context_t *context, unsigned int reg,
     return GL_FALSE;
 }
 
-GLboolean r700SendContextStates(context_t *context, GLboolean bUseStockShader)
+GLboolean r700SendContextStates(context_t *context)
 {
     BATCH_LOCALS(&context->radeon);
 
@@ -676,11 +637,11 @@ GLboolean r700SendContextStates(context_t *context, GLboolean bUseStockShader)
 
         pState = pState->pNext;
 
-        BEGIN_BATCH_NO_AUTOSTATE(toSend + 2);        
+        BEGIN_BATCH_NO_AUTOSTATE(toSend + 2);
         R600_OUT_BATCH_REGSEQ(((pInit->unOffset + ASIC_CONTEXT_BASE_INDEX)<<2), toSend);
         for(ui=0; ui<toSend; ui++)
         {
-            if( GL_FALSE == setRelocReg(context, pInit->unOffset, bUseStockShader) )
+            if( GL_FALSE == setRelocReg(context, pInit->unOffset) )
             {
                 /* for not reloc reg. */
                 R600_OUT_BATCH(*(pInit->puiValue));
index c8d9cbfbda15c9b00c543a0bd42c717ebf65ebd1..88b507547990fc86282e5c04e9a0d61015b8bd19 100644 (file)
@@ -447,8 +447,6 @@ typedef struct _R700_CHIP_CONTEXT
 
     R700_TEXTURE_STATES texture_states;
 
-    void *    pbo_vs_clear;
-    void *    pbo_fs_clear;
     GLboolean bEnablePerspective;
        
 } R700_CHIP_CONTEXT;
@@ -456,7 +454,7 @@ typedef struct _R700_CHIP_CONTEXT
 #define R700_CONTEXT_STATES(context) ((R700_CHIP_CONTEXT *)(context->chipobj.pvChipObj))
 
 extern GLboolean r700InitChipObject(context_t *context);
-extern GLboolean r700SendContextStates(context_t *context, GLboolean bUseStockShader);
+extern GLboolean r700SendContextStates(context_t *context);
 extern int       r700SetupStreams(GLcontext * ctx);
 extern void      r700SetupVTXConstants(GLcontext  * ctx, 
                                       unsigned int nStreamID,
index 1ab3ee7de5c39a285250d78dfdc6f0d1a73de811..f8c3359a47d076885a9645fa5613fca061f9b8e8 100644 (file)
@@ -60,8 +60,8 @@ static void r700Flush(GLcontext *ctx)
        if (radeon->dma.flush)
                radeon->dma.flush( ctx );
 
-       r700SendContextStates(context, GL_FALSE);
-   
+       r700SendContextStates(context);
+
        if (radeon->cmdbuf.cs->cdw)
                rcommonFlushCmdBuf(radeon, __FUNCTION__);
 }
index 78b92d695e47080f0c483cb18512ce361c23aa5b..1f0604da5d31a1077383db23fa79e3139021e067 100644 (file)
@@ -294,7 +294,7 @@ static GLboolean r700RunRender(GLcontext * ctx,
     /* flush vtx */
     //r700SyncSurf(context); /*  */
 
-    r700SendContextStates(context, GL_FALSE);
+    r700SendContextStates(context);
 
     /* richard test code */
     for (i = 0; i < vb->PrimitiveCount; i++)