diff options
author | Jason Ekstrand <[email protected]> | 2016-07-19 19:19:12 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-08-17 14:46:22 -0700 |
commit | 8fccdf85ba329dc4ccd5764e430ae8d9abce0c69 (patch) | |
tree | d5d3ab52909a2469ba34f86d98681c86b2bab00d /src | |
parent | 75deae9c9064382976aa261e1ff3057939c22cd5 (diff) |
i965/blorp: Make the guts of brw_blorp_blit_miptrees miptree-unaware
Now that we have the brw_blorp_surf struct, we can start to make bits of
blorp completely miptree-unaware. To start things off, we split the guts
of brw_blorp_blit_miptrees into a brw_blorp_blit function which knows
nothing about miptrees.
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp.h | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 58 |
2 files changed, 53 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h index ed6af838b4e..72174a05156 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.h +++ b/src/mesa/drivers/dri/i965/brw_blorp.h @@ -62,6 +62,20 @@ brw_blorp_to_isl_format(struct brw_context *brw, mesa_format format, bool is_render_target); void +brw_blorp_blit(struct brw_context *brw, + const struct brw_blorp_surf *src_surf, + unsigned src_level, unsigned src_layer, + enum isl_format src_format, int src_swizzle, + const struct brw_blorp_surf *dst_surf, + unsigned dst_level, unsigned dst_layer, + enum isl_format dst_format, + float src_x0, float src_y0, + float src_x1, float src_y1, + float dst_x0, float dst_y0, + float dst_x1, float dst_y1, + GLenum filter, bool mirror_x, bool mirror_y); + +void brw_blorp_blit_miptrees(struct brw_context *brw, struct intel_mipmap_tree *src_mt, unsigned src_level, unsigned src_layer, diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 4849c570101..87f064130f7 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -1750,23 +1750,48 @@ brw_blorp_blit_miptrees(struct brw_context *brw, intel_miptree_check_level_layer(dst_mt, dst_level, dst_layer); intel_miptree_used_for_rendering(dst_mt); - struct brw_blorp_params params; - brw_blorp_params_init(¶ms); - - struct isl_surf isl_tmp[4]; + struct isl_surf tmp_surfs[4]; struct brw_blorp_surf src_surf, dst_surf; brw_blorp_surf_for_miptree(brw, &src_surf, src_mt, false, - &src_level, &isl_tmp[0]); - brw_blorp_surface_info_init(brw, ¶ms.src, - &src_surf, src_level, src_layer, - brw_blorp_to_isl_format(brw, src_format, false), - false); + &src_level, &tmp_surfs[0]); brw_blorp_surf_for_miptree(brw, &dst_surf, dst_mt, true, - &dst_level, &isl_tmp[2]); - brw_blorp_surface_info_init(brw, ¶ms.dst, - &dst_surf, dst_level, dst_layer, - brw_blorp_to_isl_format(brw, dst_format, true), - true); + &dst_level, &tmp_surfs[2]); + + brw_blorp_blit(brw, &src_surf, src_level, src_layer, + brw_blorp_to_isl_format(brw, src_format, false), src_swizzle, + &dst_surf, dst_level, dst_layer, + brw_blorp_to_isl_format(brw, dst_format, true), + src_x0, src_y0, src_x1, src_y1, + dst_x0, dst_y0, dst_x1, dst_y1, + filter, mirror_x, mirror_y); + + intel_miptree_slice_set_needs_hiz_resolve(dst_mt, dst_level, dst_layer); + + if (intel_miptree_is_lossless_compressed(brw, dst_mt)) + dst_mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_UNRESOLVED; +} + +void +brw_blorp_blit(struct brw_context *brw, + const struct brw_blorp_surf *src_surf, + unsigned src_level, unsigned src_layer, + enum isl_format src_format, int src_swizzle, + const struct brw_blorp_surf *dst_surf, + unsigned dst_level, unsigned dst_layer, + enum isl_format dst_format, + float src_x0, float src_y0, + float src_x1, float src_y1, + float dst_x0, float dst_y0, + float dst_x1, float dst_y1, + GLenum filter, bool mirror_x, bool mirror_y) +{ + struct brw_blorp_params params; + brw_blorp_params_init(¶ms); + + brw_blorp_surface_info_init(brw, ¶ms.src, src_surf, src_level, + src_layer, src_format, false); + brw_blorp_surface_info_init(brw, ¶ms.dst, dst_surf, dst_level, + dst_layer, dst_format, true); struct brw_blorp_blit_prog_key wm_prog_key; memset(&wm_prog_key, 0, sizeof(wm_prog_key)); @@ -2011,9 +2036,4 @@ brw_blorp_blit_miptrees(struct brw_context *brw, } brw_blorp_exec(brw, ¶ms); - - intel_miptree_slice_set_needs_hiz_resolve(dst_mt, dst_level, dst_layer); - - if (intel_miptree_is_lossless_compressed(brw, dst_mt)) - dst_mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_UNRESOLVED; } |