[Mesa-dev] [PATCH 1/7] i965/blorp: Add an is_render_target parameter to surface_info::set.
Kenneth Graunke
kenneth at whitecape.org
Mon Oct 7 16:31:17 PDT 2013
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 <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_blorp.cpp | 3 ++-
src/mesa/drivers/dri/i965/brw_blorp.h | 3 ++-
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 4 ++--
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 4 ++--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp
index 1576ff2..e519cd9 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 dceb4fc..07ab805 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 027c72e..f581871 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 4ff776f..5a507a7 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -186,7 +186,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);
@@ -305,7 +305,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":
*
--
1.8.3.2
More information about the mesa-dev
mailing list