summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_draw.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-11-09 17:16:36 -0500
committerIlia Mirkin <[email protected]>2016-11-22 20:27:20 -0500
commit7cfb364b1a373bce6b0b273556953fbb78c139e9 (patch)
treee05dc9618e147c13553360900bdef49ea069a8c2 /src/gallium/drivers/swr/swr_draw.cpp
parent5d2b5996e1e85e3b4c167570f1eecb5a131d5837 (diff)
swr: rework resource layout and surface setup
This is a bit of a mega-commit, but unfortunately there's no great way to break this up since a lot of different pieces have to match up. Here we do the following: - change surface layout to match swr's Load/StoreTile expectations - fix sampler settings to respect all sampler view parameters - fix stencil sampling to read from secondary resource - respect pipe surface format, level, and layer settings - fix resource map/unmap based on the new layout logic - fix resource map/unmap to copy proper parts of stencil values in and out of the matching depth texture These fix a massive quantity of piglits, including all the tex-miplevel-selection ones. Note that the swr native miptree layout isn't extremely space-efficient, and we end up using it for all textures, not just the renderable ones. A back-of-the-envelope calculation suggests about 10%-25% increased memory usage for miptrees, depending on the number of LODs. Single-LOD textures should be unaffected. There are a handful of regressions as a result of this change: - Some textureGrad tests, these failures match llvmpipe. (There are debug settings allowing improved gallivm sampling accurancy.) - Some layered clearing tests as swr doesn't currently support that. It was getting lucky before because enough other things were broken. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_draw.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_draw.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp
index 920ca9f582c..e8c5b23f11d 100644
--- a/src/gallium/drivers/swr/swr_draw.cpp
+++ b/src/gallium/drivers/swr/swr_draw.cpp
@@ -281,7 +281,9 @@ swr_store_dirty_resource(struct pipe_context *pipe,
swr_draw_context *pDC = &ctx->swrDC;
SWR_SURFACE_STATE *renderTargets = pDC->renderTargets;
for (uint32_t i = 0; i < SWR_NUM_ATTACHMENTS; i++)
- if (renderTargets[i].pBaseAddress == spr->swr.pBaseAddress) {
+ if (renderTargets[i].pBaseAddress == spr->swr.pBaseAddress ||
+ (spr->secondary.pBaseAddress &&
+ renderTargets[i].pBaseAddress == spr->secondary.pBaseAddress)) {
swr_store_render_target(pipe, i, post_tile_state);
/* Mesa thinks depth/stencil are fused, so we'll never get an