summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-05-24 12:40:14 -0700
committerIan Romanick <ian.d.romanick@intel.com>2013-06-26 10:58:22 -0700
commit54691913f996c0c8695753f3b7f9441654c1f519 (patch)
treec982635c22dd0d0ffef33b2b28881c5c5dc12762
parent2c54e79579419315c341c715c0c21cb4dc1bdabf (diff)
intel: Fix MRT handling of glBitmap().
We'd only hit color buffer 0 even if multiple draw buffers were bound. NOTE: This is a candidate for the stable branches. Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Paul Berry <stereotype441@gmail.com> (cherry picked from commit 1cb8de6fff24743e479e17f023bd3a7b455b756f)
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.h1
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_bitmap.c23
2 files changed, 15 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index f135dead3ee..390e762e3de 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -32,6 +32,7 @@
#include <assert.h>
#include "main/formats.h"
#include "intel_context.h"
+#include "intel_mipmap_tree.h"
#include "intel_screen.h"
#ifdef __cplusplus
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
index 954dfc50b14..c22d32c9da3 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
@@ -45,6 +45,7 @@
#include "intel_context.h"
#include "intel_batchbuffer.h"
#include "intel_blit.h"
+#include "intel_fbo.h"
#include "intel_regions.h"
#include "intel_buffers.h"
#include "intel_pixel.h"
@@ -176,8 +177,8 @@ do_blit_bitmap( struct gl_context *ctx,
const GLubyte *bitmap )
{
struct intel_context *intel = intel_context(ctx);
- struct intel_region *dst;
struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct intel_renderbuffer *irb;
GLfloat tmpColor[4];
GLubyte ubcolor[4];
GLuint color;
@@ -200,10 +201,14 @@ do_blit_bitmap( struct gl_context *ctx,
}
intel_prepare_render(intel);
- dst = intel_drawbuf_region(intel);
- if (!dst)
- return false;
+ if (fb->_NumColorDrawBuffers != 1) {
+ perf_debug("accelerated glBitmap() only supports rendering to a "
+ "single color buffer\n");
+ return false;
+ }
+
+ irb = intel_renderbuffer(fb->_ColorDrawBuffers[0]);
if (_mesa_is_bufferobj(unpack->BufferObj)) {
bitmap = map_pbo(ctx, width, height, unpack, bitmap);
@@ -222,7 +227,7 @@ do_blit_bitmap( struct gl_context *ctx,
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[2], tmpColor[2]);
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
- if (dst->cpp == 2)
+ if (irb->mt->cpp == 2)
color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]);
else
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
@@ -270,14 +275,14 @@ do_blit_bitmap( struct gl_context *ctx,
continue;
if (!intelEmitImmediateColorExpandBlit(intel,
- dst->cpp,
+ irb->mt->cpp,
(GLubyte *)stipple,
sz,
color,
- dst->pitch,
- dst->bo,
+ irb->mt->region->pitch,
+ irb->mt->region->bo,
0,
- dst->tiling,
+ irb->mt->region->tiling,
dstx + px,
dsty + py,
w, h,