diff options
author | Topi Pohjolainen <[email protected]> | 2016-04-04 11:28:03 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2016-04-21 10:20:02 +0300 |
commit | 9d79235e4ec68c72876f8afd5d472571d2e7f0e3 (patch) | |
tree | 69920465d889b0d3c30cef873af06ea89ed171d2 /src | |
parent | 2757d723dab3d0d4010f3c02b50670ba67fac7d2 (diff) |
i965/meta: Expose resolve clear rectangle calculation
Signed-off-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_meta_util.h | 6 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c index 885c09c611d..be6d5845c02 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c +++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c @@ -808,9 +808,11 @@ brw_meta_fast_clear(struct brw_context *brw, struct gl_framebuffer *fb, return true; } -static void -get_resolve_rect(struct brw_context *brw, - struct intel_mipmap_tree *mt, struct rect *rect) +void +brw_get_resolve_rect(const struct brw_context *brw, + const struct intel_mipmap_tree *mt, + unsigned *x0, unsigned *y0, + unsigned *x1, unsigned *y1) { unsigned x_align, y_align; unsigned x_scaledown, y_scaledown; @@ -838,9 +840,9 @@ get_resolve_rect(struct brw_context *brw, x_scaledown = x_align / 2; y_scaledown = y_align / 2; } - rect->x0 = rect->y0 = 0; - rect->x1 = ALIGN(mt->logical_width0, x_scaledown) / x_scaledown; - rect->y1 = ALIGN(mt->logical_height0, y_scaledown) / y_scaledown; + *x0 = *y0 = 0; + *x1 = ALIGN(mt->logical_width0, x_scaledown) / x_scaledown; + *y1 = ALIGN(mt->logical_height0, y_scaledown) / y_scaledown; } void @@ -885,7 +887,7 @@ brw_meta_resolve_color(struct brw_context *brw, set_fast_clear_op(brw, GEN7_PS_RENDER_TARGET_RESOLVE_ENABLE); mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_RESOLVED; - get_resolve_rect(brw, mt, &rect); + brw_get_resolve_rect(brw, mt, &rect.x0, &rect.y0, &rect.x1, &rect.y1); brw_draw_rectlist(brw, &rect, 1); diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.h b/src/mesa/drivers/dri/i965/brw_meta_util.h index 756cc594108..35222d239fc 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_util.h +++ b/src/mesa/drivers/dri/i965/brw_meta_util.h @@ -49,6 +49,12 @@ brw_get_fast_clear_rect(const struct brw_context *brw, unsigned *x0, unsigned *y0, unsigned *x1, unsigned *y1); +void +brw_get_resolve_rect(const struct brw_context *brw, + const struct intel_mipmap_tree *mt, + unsigned *x0, unsigned *y0, + unsigned *x1, unsigned *y1); + #ifdef __cplusplus } #endif |