From: Kenneth Graunke Date: Mon, 7 Oct 2013 21:41:16 +0000 (-0700) Subject: i965/blorp: Add an is_render_target parameter to surface_info::set. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4b2e819e10138dba6961d44f07af6de13750a832;p=mesa.git i965/blorp: Add an is_render_target parameter to surface_info::set. This allows us to determine whether we're setting up a format for the source (as a texture) or destination (as a render target). Signed-off-by: Kenneth Graunke Reviewed-by: Ian Romanick Reviewed-by: Chad Versace Reviewed-by: Eric Anholt Reviewed-by: Daniel Vetter --- diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp index 1576ff2a384..e519cd91d8f 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp @@ -66,7 +66,8 @@ brw_blorp_mip_info::set(struct intel_mipmap_tree *mt, void brw_blorp_surface_info::set(struct brw_context *brw, struct intel_mipmap_tree *mt, - unsigned int level, unsigned int layer) + unsigned int level, unsigned int layer, + bool is_render_target) { brw_blorp_mip_info::set(mt, level, layer); this->num_samples = mt->num_samples; diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h index dceb4fcc41d..07ab80521b1 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.h +++ b/src/mesa/drivers/dri/i965/brw_blorp.h @@ -122,7 +122,8 @@ public: void set(struct brw_context *brw, struct intel_mipmap_tree *mt, - unsigned int level, unsigned int layer); + unsigned int level, unsigned int layer, + bool is_render_target); uint32_t compute_tile_offsets(uint32_t *tile_x, uint32_t *tile_y) const; diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 12e76983833..ec70217f2c6 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -2063,8 +2063,8 @@ brw_blorp_blit_params::brw_blorp_blit_params(struct brw_context *brw, struct gl_context *ctx = &brw->ctx; const struct gl_framebuffer *read_fb = ctx->ReadBuffer; - src.set(brw, src_mt, src_level, src_layer); - dst.set(brw, dst_mt, dst_level, dst_layer); + src.set(brw, src_mt, src_level, src_layer, false); + dst.set(brw, dst_mt, dst_level, dst_layer, true); /* Even though we do multisample resolves at the time of the blit, OpenGL * specification defines them as if they happen at the time of rendering, diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp index 18a29fbc07c..d1933ced754 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp @@ -188,7 +188,7 @@ brw_blorp_clear_params::brw_blorp_clear_params(struct brw_context *brw, struct gl_context *ctx = &brw->ctx; struct intel_renderbuffer *irb = intel_renderbuffer(rb); - dst.set(brw, irb->mt, irb->mt_level, irb->mt_layer); + dst.set(brw, irb->mt, irb->mt_level, irb->mt_layer, true); /* Override the surface format according to the context's sRGB rules. */ gl_format format = _mesa_get_render_format(ctx, irb->mt->format); @@ -307,7 +307,7 @@ brw_blorp_rt_resolve_params::brw_blorp_rt_resolve_params( struct brw_context *brw, struct intel_mipmap_tree *mt) { - dst.set(brw, mt, 0 /* level */, 0 /* layer */); + dst.set(brw, mt, 0 /* level */, 0 /* layer */, true); /* From the Ivy Bridge PRM, Vol2 Part1 11.9 "Render Target Resolve": *