aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_pixel_read.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-07-02 23:17:14 -0700
committerKenneth Graunke <[email protected]>2013-07-09 14:08:53 -0700
commitca437579b3974b91a5298707c459908a628c1098 (patch)
tree294ac2ad5aa080554c23ebb79552e50b23fbcf31 /src/mesa/drivers/dri/i965/intel_pixel_read.c
parent86f2711722dc10c25c2fabc09d8bd020a1ba6029 (diff)
i965: Pass brw_context to functions rather than intel_context.
This makes brw_context available in every function that used intel_context. This makes it possible to start migrating fields from intel_context to brw_context. Surprisingly, this actually removes some code, as functions that use OUT_BATCH don't need to declare "intel"; they just use "brw." Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Chris Forbes <[email protected]> Acked-by: Paul Berry <[email protected]> Acked-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_pixel_read.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_pixel_read.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c
index 7ada1376310..c1d5fb00eee 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
@@ -75,6 +75,7 @@ do_blit_readpixels(struct gl_context * ctx,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
{
+ struct brw_context *brw = brw_context(ctx);
struct intel_context *intel = intel_context(ctx);
struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
GLuint dst_offset;
@@ -124,25 +125,25 @@ do_blit_readpixels(struct gl_context * ctx,
}
dirty = intel->front_buffer_dirty;
- intel_prepare_render(intel);
+ intel_prepare_render(brw);
intel->front_buffer_dirty = dirty;
all = (width * height * irb->mt->cpp == dst->Base.Size &&
x == 0 && dst_offset == 0);
- dst_buffer = intel_bufferobj_buffer(intel, dst,
+ dst_buffer = intel_bufferobj_buffer(brw, dst,
all ? INTEL_WRITE_FULL :
INTEL_WRITE_PART);
struct intel_mipmap_tree *pbo_mt =
- intel_miptree_create_for_bo(intel,
+ intel_miptree_create_for_bo(brw,
dst_buffer,
irb->mt->format,
dst_offset,
width, height,
dst_stride, I915_TILING_NONE);
- if (!intel_miptree_blit(intel,
+ if (!intel_miptree_blit(brw,
irb->mt, irb->mt_level, irb->mt_layer,
x, y, _mesa_is_winsys_fbo(ctx->ReadBuffer),
pbo_mt, 0, 0,
@@ -164,6 +165,7 @@ intelReadPixels(struct gl_context * ctx,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
{
+ struct brw_context *brw = brw_context(ctx);
struct intel_context *intel = intel_context(ctx);
bool dirty;
@@ -182,7 +184,7 @@ intelReadPixels(struct gl_context * ctx,
/* glReadPixels() wont dirty the front buffer, so reset the dirty
* flag after calling intel_prepare_render(). */
dirty = intel->front_buffer_dirty;
- intel_prepare_render(intel);
+ intel_prepare_render(brw);
intel->front_buffer_dirty = dirty;
/* Update Mesa state before calling _mesa_readpixels().