diff options
author | Mike Blumenkrantz <[email protected]> | 2020-03-24 11:58:29 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-29 18:05:06 +0000 |
commit | 328cc00d39808191529fa359cc21fb935c9acc89 (patch) | |
tree | 0d56fcfb8dfa85d49a99641cd27e0fc8dfd0c15c /src/gallium/drivers/iris/iris_clear.c | |
parent | 1c8bcad81a7ce106b37f1ee4a75b817651d6545e (diff) |
iris: handle PIPE_CAP_CLEAR_SCISSORED
this allows passing scissored clear calls through the driver where it can
be handled by a repclear shader
fix kwg/mesa#61
Reviewed-by: Kristian H. Kristensen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4310>
Diffstat (limited to 'src/gallium/drivers/iris/iris_clear.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_clear.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index 4c3adfdc39f..7e905019bbd 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -646,15 +646,23 @@ iris_clear(struct pipe_context *ctx, assert(buffers != 0); + struct pipe_box box = { + .width = cso_fb->width, + .height = cso_fb->height, + }; + + if (scissor_state) { + box.x = scissor_state->minx; + box.y = scissor_state->miny; + box.width = MIN2(box.width, scissor_state->maxx - scissor_state->minx); + box.height = MIN2(box.height, scissor_state->maxy - scissor_state->miny); + } + if (buffers & PIPE_CLEAR_DEPTHSTENCIL) { struct pipe_surface *psurf = cso_fb->zsbuf; - struct pipe_box box = { - .width = cso_fb->width, - .height = cso_fb->height, - .depth = psurf->u.tex.last_layer - psurf->u.tex.first_layer + 1, - .z = psurf->u.tex.first_layer, - }; + box.depth = psurf->u.tex.last_layer - psurf->u.tex.first_layer + 1; + box.z = psurf->u.tex.first_layer, clear_depth_stencil(ice, psurf->texture, psurf->u.tex.level, &box, true, buffers & PIPE_CLEAR_DEPTH, buffers & PIPE_CLEAR_STENCIL, @@ -669,12 +677,8 @@ iris_clear(struct pipe_context *ctx, if (buffers & (PIPE_CLEAR_COLOR0 << i)) { struct pipe_surface *psurf = cso_fb->cbufs[i]; struct iris_surface *isurf = (void *) psurf; - struct pipe_box box = { - .width = cso_fb->width, - .height = cso_fb->height, - .depth = psurf->u.tex.last_layer - psurf->u.tex.first_layer + 1, - .z = psurf->u.tex.first_layer, - }; + box.depth = psurf->u.tex.last_layer - psurf->u.tex.first_layer + 1, + box.z = psurf->u.tex.first_layer, clear_color(ice, psurf->texture, psurf->u.tex.level, &box, true, isurf->view.format, isurf->view.swizzle, |