[Mesa-dev] [PATCH 21/30] i965: Move framebuffer fetch to the new resolve functions
Jason Ekstrand
jason at jlekstrand.net
Fri May 26 23:30:25 UTC 2017
---
src/mesa/drivers/dri/i965/brw_context.c | 6 ++---
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 37 ++++++++++++++++++++++-----
src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 4 +++
3 files changed, 36 insertions(+), 11 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 6e60237..671af42 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -285,10 +285,8 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
intel_renderbuffer(fb->_ColorDrawBuffers[i]);
if (irb) {
- intel_miptree_resolve_color(brw, irb->mt,
- irb->mt_level, 1,
- irb->mt_layer, irb->layer_count,
- INTEL_MIPTREE_IGNORE_CCS_E);
+ intel_miptree_prepare_fb_fetch(brw, irb->mt, irb->mt_level,
+ irb->mt_layer, irb->layer_count);
}
}
}
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 1774ed5..76fe8b8 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2401,11 +2401,13 @@ intel_texture_view_requires_resolve(struct brw_context *brw,
return true;
}
-void
-intel_miptree_prepare_texture(struct brw_context *brw,
- struct intel_mipmap_tree *mt,
- mesa_format view_format,
- bool *aux_supported_out)
+static void
+intel_miptree_prepare_texture_slices(struct brw_context *brw,
+ struct intel_mipmap_tree *mt,
+ mesa_format view_format,
+ uint32_t start_level, uint32_t num_levels,
+ uint32_t start_layer, uint32_t num_layers,
+ bool *aux_supported_out)
{
bool aux_supported;
if (_mesa_is_format_color_format(mt->format)) {
@@ -2417,14 +2419,35 @@ intel_miptree_prepare_texture(struct brw_context *brw,
aux_supported = intel_miptree_sample_with_hiz(brw, mt);
}
- intel_miptree_prepare_access(brw, mt, 0, INTEL_REMAINING_LEVELS,
- 0, INTEL_REMAINING_LAYERS,
+ intel_miptree_prepare_access(brw, mt, start_level, num_levels,
+ start_layer, num_layers,
aux_supported, aux_supported);
if (aux_supported_out)
*aux_supported_out = aux_supported;
}
void
+intel_miptree_prepare_texture(struct brw_context *brw,
+ struct intel_mipmap_tree *mt,
+ mesa_format view_format,
+ bool *aux_supported_out)
+{
+ intel_miptree_prepare_texture_slices(brw, mt, view_format,
+ 0, INTEL_REMAINING_LEVELS,
+ 0, INTEL_REMAINING_LAYERS,
+ aux_supported_out);
+}
+
+void
+intel_miptree_prepare_fb_fetch(struct brw_context *brw,
+ struct intel_mipmap_tree *mt, uint32_t level,
+ uint32_t start_layer, uint32_t num_layers)
+{
+ intel_miptree_prepare_texture_slices(brw, mt, mt->format, level, 1,
+ start_layer, num_layers, NULL);
+}
+
+void
intel_miptree_prepare_render(struct brw_context *brw,
struct intel_mipmap_tree *mt, uint32_t level,
uint32_t start_layer, uint32_t layer_count,
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index 0392935..9ab9039 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -1016,6 +1016,10 @@ intel_miptree_prepare_texture(struct brw_context *brw,
mesa_format view_format,
bool *aux_supported_out);
void
+intel_miptree_prepare_fb_fetch(struct brw_context *brw,
+ struct intel_mipmap_tree *mt, uint32_t level,
+ uint32_t start_layer, uint32_t num_layers);
+void
intel_miptree_prepare_render(struct brw_context *brw,
struct intel_mipmap_tree *mt, uint32_t level,
uint32_t start_layer, uint32_t layer_count,
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list