summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_resource.h
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_resource.h
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_resource.h')
-rw-r--r--src/gallium/drivers/swr/swr_resource.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gallium/drivers/swr/swr_resource.h b/src/gallium/drivers/swr/swr_resource.h
index 00001e94f79..41abd77cba0 100644
--- a/src/gallium/drivers/swr/swr_resource.h
+++ b/src/gallium/drivers/swr/swr_resource.h
@@ -41,17 +41,13 @@ struct swr_resource {
bool has_depth;
bool has_stencil;
- UINT alignedWidth;
- UINT alignedHeight;
-
SWR_SURFACE_STATE swr;
SWR_SURFACE_STATE secondary; /* for faking depth/stencil merged formats */
struct sw_displaytarget *display_target;
- unsigned row_stride[PIPE_MAX_TEXTURE_LEVELS];
- unsigned img_stride[PIPE_MAX_TEXTURE_LEVELS];
- unsigned mip_offsets[PIPE_MAX_TEXTURE_LEVELS];
+ size_t mip_offsets[PIPE_MAX_TEXTURE_LEVELS];
+ size_t secondary_mip_offsets[PIPE_MAX_TEXTURE_LEVELS];
enum swr_resource_status status;
};