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>
#include "intel_context.h"
#include "intel_batchbuffer.h"
#include "intel_blit.h"
#include "intel_context.h"
#include "intel_batchbuffer.h"
#include "intel_blit.h"
#include "intel_regions.h"
#include "intel_buffers.h"
#include "intel_pixel.h"
#include "intel_regions.h"
#include "intel_buffers.h"
#include "intel_pixel.h"
const GLubyte *bitmap )
{
struct intel_context *intel = intel_context(ctx);
const GLubyte *bitmap )
{
struct intel_context *intel = intel_context(ctx);
- struct intel_region *dst;
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct intel_renderbuffer *irb;
GLfloat tmpColor[4];
GLubyte ubcolor[4];
GLuint color;
GLfloat tmpColor[4];
GLubyte ubcolor[4];
GLuint color;
}
intel_prepare_render(intel);
}
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);
if (_mesa_is_bufferobj(unpack->BufferObj)) {
bitmap = map_pbo(ctx, width, height, unpack, bitmap);
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[2], tmpColor[2]);
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[2], tmpColor[2]);
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]);
else
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]);
else
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
continue;
if (!intelEmitImmediateColorExpandBlit(intel,
continue;
if (!intelEmitImmediateColorExpandBlit(intel,
(GLubyte *)stipple,
sz,
color,
(GLubyte *)stipple,
sz,
color,
+ irb->mt->region->pitch,
+ irb->mt->region->bo,
+ irb->mt->region->tiling,
dstx + px,
dsty + py,
w, h,
dstx + px,
dsty + py,
w, h,