diff options
author | Bruce Cherniak <[email protected]> | 2017-06-26 10:26:26 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-06-26 11:30:08 -0500 |
commit | 6fafba0e677ec9a6dfa551e34b59814e6f643e21 (patch) | |
tree | 5be814aa225592c094948fd9db0145455c0eb2ef /src/gallium/drivers | |
parent | 0e1e5a2b14cb602030928431bec45af394be43e3 (diff) |
swr: set an explicit clear_rect if scissor is not enabled.
Fix regression of "no rendering" on simple apps like glxgears by
setting an explicit full surface clear_rect when scissor is not
enabled.
This regressed with commit 00173d91 "st/mesa: don't set 16
scissors and 16 viewports if they're unused" due to an assumption
that a default scissor rect is always set, which was the case prior
to this optimization.
Reviewed-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/swr/swr_clear.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/swr_clear.cpp b/src/gallium/drivers/swr/swr_clear.cpp index 53f4e02d452..3a35805a7ac 100644 --- a/src/gallium/drivers/swr/swr_clear.cpp +++ b/src/gallium/drivers/swr/swr_clear.cpp @@ -68,11 +68,19 @@ swr_clear(struct pipe_context *pipe, ((union pipe_color_union *)color)->f[3] = 1.0; /* cast off your const'd-ness */ #endif + SWR_RECT clear_rect; + /* If enabled, clear to scissor; otherwise clear full surface */ + if (ctx->rasterizer && ctx->rasterizer->scissor) { + clear_rect = ctx->swr_scissor; + } else { + clear_rect = {0, 0, (int32_t)fb->width, (int32_t)fb->height}; + } + for (unsigned i = 0; i < layers; ++i) { swr_update_draw_context(ctx); SwrClearRenderTarget(ctx->swrContext, clearMask, i, color->f, depth, stencil, - ctx->swr_scissor); + clear_rect); // Mask out the attachments that are out of layers. if (fb->zsbuf && |