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 <hoegsberg@google.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4310>
This commit is contained in:
Mike Blumenkrantz
2020-03-24 11:58:29 -04:00
committed by Marge Bot
parent 1c8bcad81a
commit 328cc00d39
2 changed files with 17 additions and 12 deletions
+16 -12
View File
@@ -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,
+1
View File
@@ -179,6 +179,7 @@ iris_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_TGSI_BALLOT:
case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
case PIPE_CAP_CLEAR_TEXTURE:
case PIPE_CAP_CLEAR_SCISSORED:
case PIPE_CAP_TGSI_VOTE:
case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
case PIPE_CAP_TEXTURE_GATHER_SM5: