diff options
author | Topi Pohjolainen <[email protected]> | 2016-04-04 13:43:24 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2016-04-21 10:20:02 +0300 |
commit | fb14a2fc782e040c2d09706b277b783b4f26697f (patch) | |
tree | f0267a901203ecd9011663ae49bc22aba03b7199 | |
parent | 9d79235e4ec68c72876f8afd5d472571d2e7f0e3 (diff) |
i965/meta: Expose non-fast clear rectangle calculation
Signed-off-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 26 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_meta_util.h | 5 |
2 files changed, 21 insertions, 10 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 be6d5845c02..409e0216e4a 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c +++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c @@ -343,17 +343,19 @@ brw_get_fast_clear_rect(const struct brw_context *brw, *y1 = ALIGN(*y1, y_align) / y_scaledown; } -static void -get_buffer_rect(const struct gl_framebuffer *fb, struct rect *rect) +void +brw_meta_get_buffer_rect(const struct gl_framebuffer *fb, + unsigned *x0, unsigned *y0, + unsigned *x1, unsigned *y1) { - rect->x0 = fb->_Xmin; - rect->x1 = fb->_Xmax; + *x0 = fb->_Xmin; + *x1 = fb->_Xmax; if (fb->Name != 0) { - rect->y0 = fb->_Ymin; - rect->y1 = fb->_Ymax; + *y0 = fb->_Ymin; + *y1 = fb->_Ymax; } else { - rect->y0 = fb->Height - fb->_Ymax; - rect->y1 = fb->Height - fb->_Ymin; + *y0 = fb->Height - fb->_Ymax; + *y1 = fb->Height - fb->_Ymin; } } @@ -689,12 +691,16 @@ brw_meta_fast_clear(struct brw_context *brw, struct gl_framebuffer *fb, case REP_CLEAR: rep_clear_buffers |= 1 << index; - get_buffer_rect(fb, &clear_rect); + brw_meta_get_buffer_rect(fb, + &clear_rect.x0, &clear_rect.y0, + &clear_rect.x1, &clear_rect.y1); break; case PLAIN_CLEAR: plain_clear_buffers |= 1 << index; - get_buffer_rect(fb, &clear_rect); + brw_meta_get_buffer_rect(fb, + &clear_rect.x0, &clear_rect.y0, + &clear_rect.x1, &clear_rect.y1); continue; } } diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.h b/src/mesa/drivers/dri/i965/brw_meta_util.h index 35222d239fc..c43810871c1 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_util.h +++ b/src/mesa/drivers/dri/i965/brw_meta_util.h @@ -55,6 +55,11 @@ brw_get_resolve_rect(const struct brw_context *brw, unsigned *x0, unsigned *y0, unsigned *x1, unsigned *y1); +void +brw_meta_get_buffer_rect(const struct gl_framebuffer *fb, + unsigned *x0, unsigned *y0, + unsigned *x1, unsigned *y1); + #ifdef __cplusplus } #endif |