Merge remote branch 'origin/7.8'
authorJerome Glisse <jglisse@redhat.com>
Fri, 23 Apr 2010 10:08:36 +0000 (12:08 +0200)
committerJerome Glisse <jglisse@redhat.com>
Fri, 23 Apr 2010 10:08:36 +0000 (12:08 +0200)
1  2 
src/mesa/drivers/dri/r600/r700_state.c

index 1da31e7b2b4e2dec09ab62ac58b1b23912a8d377,0d7cb8ecfe5c14b73bd57159217e8bc4eaf1e3a3..ac64bbf874f283063674c79bd63ee891c4a4a546
@@@ -39,7 -39,6 +39,7 @@@
  #include "swrast_setup/swrast_setup.h"
  #include "main/api_arrayelt.h"
  #include "main/framebuffer.h"
 +#include "drivers/common/meta.h"
  
  #include "shader/prog_parameter.h"
  #include "shader/prog_statevars.h"
@@@ -253,12 -252,15 +253,15 @@@ void r700UpdateShaderStates(GLcontext 
  
  static void r700SetDepthState(GLcontext * ctx)
  {
+       struct radeon_renderbuffer *rrb;
        context_t *context = R700_CONTEXT(ctx);
        R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
  
        R600_STATECHANGE(context, db);
  
-     if (ctx->Depth.Test)
+       rrb = radeon_get_depthbuffer(&context->radeon);
+     if (ctx->Depth.Test && rrb && rrb->bo)
      {
          SETbit(r700->DB_DEPTH_CONTROL.u32All, Z_ENABLE_bit);
          if (ctx->Depth.Mask)
@@@ -1817,7 -1819,7 +1820,7 @@@ void r700InitState(GLcontext * ctx) //-
  
  }
  
 -void r700InitStateFuncs(struct dd_function_table *functions) //-----------------
 +void r700InitStateFuncs(radeonContextPtr radeon, struct dd_function_table *functions)
  {
        functions->UpdateState = r700InvalidateState;
        functions->AlphaFunc = r700AlphaFunc;
  
        functions->Scissor = radeonScissor;
  
 -      functions->DrawBuffer           = radeonDrawBuffer;
 -      functions->ReadBuffer           = radeonReadBuffer;
 +      functions->DrawBuffer = radeonDrawBuffer;
 +      functions->ReadBuffer = radeonReadBuffer;
  
 +      functions->CopyPixels = _mesa_meta_CopyPixels;
 +      functions->DrawPixels = _mesa_meta_DrawPixels;
 +      if (radeon->radeonScreen->kernel_mm)
 +              functions->ReadPixels = radeonReadPixels;
  }