diff options
author | Tim Rowley <[email protected]> | 2016-08-17 14:30:32 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-08-17 17:08:55 -0500 |
commit | 0ff57446e3786243c6d752c91be2108595f2663e (patch) | |
tree | c2c4c830729736554c65663e9f50a8a065e0dbcd /src/gallium/drivers/swr/swr_draw.cpp | |
parent | 6209dbf5a44c8fc3f4e5b0eeb16619a11d5657bf (diff) |
swr: [rasterizer core] only use Viewport/Scissors during SwrDraw* operations
Add explicit rects for:
- SwrClearRenderTarget
- SwrDiscardRect
- SwrInvalidateTiles
- SwrStoreTiles
Signed-off-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_draw.cpp')
-rw-r--r-- | src/gallium/drivers/swr/swr_draw.cpp | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp index 0f6a8c6d88c..a46aef924ab 100644 --- a/src/gallium/drivers/swr/swr_draw.cpp +++ b/src/gallium/drivers/swr/swr_draw.cpp @@ -258,37 +258,13 @@ swr_store_render_target(struct pipe_context *pipe, /* Only proceed if there's a valid surface to store to */ if (renderTarget->pBaseAddress) { - /* Set viewport to full renderTarget width/height and disable scissor - * before StoreTiles */ - boolean change_viewport = - (ctx->derived.vp.x != 0.0f || ctx->derived.vp.y != 0.0f - || ctx->derived.vp.width != renderTarget->width - || ctx->derived.vp.height != renderTarget->height); - if (change_viewport) { - SWR_VIEWPORT vp = {0}; - vp.width = renderTarget->width; - vp.height = renderTarget->height; - SwrSetViewports(ctx->swrContext, 1, &vp, NULL); - } - - boolean scissor_enable = ctx->derived.rastState.scissorEnable; - if (scissor_enable) { - ctx->derived.rastState.scissorEnable = FALSE; - SwrSetRastState(ctx->swrContext, &ctx->derived.rastState); - } - swr_update_draw_context(ctx); + SWR_RECT full_rect = + {0, 0, (int32_t)renderTarget->width, (int32_t)renderTarget->height}; SwrStoreTiles(ctx->swrContext, (enum SWR_RENDERTARGET_ATTACHMENT)attachment, - post_tile_state); - - /* Restore viewport and scissor enable */ - if (change_viewport) - SwrSetViewports(ctx->swrContext, 1, &ctx->derived.vp, &ctx->derived.vpm); - if (scissor_enable) { - ctx->derived.rastState.scissorEnable = scissor_enable; - SwrSetRastState(ctx->swrContext, &ctx->derived.rastState); - } + post_tile_state, + full_rect); } } |