summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-24 21:39:42 +0100
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commit566defad138161a321ef11b528a7c4fcae273f6e (patch)
treec3f2d7e80b1bca7cc8c4796f053f3ed8a8dc11cc /src/gallium/winsys
parentfc3c503b5d7fc9843220c8d89c6394f145f096af (diff)
radeonsi/gfx9: add a workaround for 1D depth textures
The same workaround is used by Vulkan. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_surface.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
index 512d56bc03b..dd3a154c14b 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
@@ -847,15 +847,11 @@ static int gfx9_surface_init(struct radeon_winsys *rws,
AddrSurfInfoIn.numFrags = AddrSurfInfoIn.numSamples;
switch (tex->target) {
+ /* GFX9 doesn't support 1D depth textures, so allocate all 1D textures
+ * as 2D to avoid having shader variants for 1D vs 2D, so all shaders
+ * must sample 1D textures as 2D. */
case PIPE_TEXTURE_1D:
case PIPE_TEXTURE_1D_ARRAY:
- AddrSurfInfoIn.resourceType = ADDR_RSRC_TEX_1D;
- AddrSurfInfoIn.width = tex->width0;
- AddrSurfInfoIn.height = 1;
- AddrSurfInfoIn.numSlices = tex->array_size;
- AddrSurfInfoIn.swizzleMode = ADDR_SW_LINEAR; /* the only allowed mode */
- break;
-
case PIPE_TEXTURE_2D:
case PIPE_TEXTURE_2D_ARRAY:
case PIPE_TEXTURE_RECT:
@@ -901,6 +897,8 @@ static int gfx9_surface_init(struct radeon_winsys *rws,
assert(0);
}
+ surf->u.gfx9.resource_type = AddrSurfInfoIn.resourceType;
+
surf->surf_size = 0;
surf->dcc_size = 0;
surf->htile_size = 0;