Mesa (master): intel: Use depth buffer from ctx. DrawBuffer in copypix_src_region()
Kristian Høgsberg
krh at kemper.freedesktop.org
Tue Jan 5 15:32:14 UTC 2010
Module: Mesa
Branch: master
Commit: ee49ac8742c52696cba8cc5ca50459f8a13153a1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee49ac8742c52696cba8cc5ca50459f8a13153a1
Author: Kristian Høgsberg <krh at bitplanet.net>
Date: Fri Jan 1 21:15:04 2010 -0500
intel: Use depth buffer from ctx.DrawBuffer in copypix_src_region()
This function was using intel->depth_region, which is the static region
for the DRI1 depth buffer. This code has always been broken with DRI2
but I suspect it doesn't get excersized much.
---
src/mesa/drivers/dri/intel/intel_pixel_copy.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
index 01c4409..e002516 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
@@ -35,28 +35,33 @@
#include "intel_buffers.h"
#include "intel_regions.h"
#include "intel_pixel.h"
+#include "intel_fbo.h"
#define FILE_DEBUG_FLAG DEBUG_PIXEL
static struct intel_region *
copypix_src_region(struct intel_context *intel, GLenum type)
{
+ struct intel_renderbuffer *depth;
+
+ depth = (struct intel_renderbuffer *)
+ &intel->ctx.DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
+
switch (type) {
case GL_COLOR:
return intel_readbuf_region(intel);
case GL_DEPTH:
- /* Don't think this is really possible execpt at 16bpp, when we have no stencil.
- */
- if (intel->depth_region && intel->depth_region->cpp == 2)
- return intel->depth_region;
+ /* Don't think this is really possible execpt at 16bpp, when we
+ * have no stencil. */
+ if (depth && depth->region->cpp == 2)
+ return depth->region;
case GL_STENCIL:
- /* Don't think this is really possible.
- */
+ /* Don't think this is really possible. */
break;
case GL_DEPTH_STENCIL_EXT:
/* Does it matter whether it is stencil/depth or depth/stencil?
*/
- return intel->depth_region;
+ return depth->region;
default:
break;
}
More information about the mesa-commit
mailing list