diff options
author | Marek Olšák <[email protected]> | 2016-05-19 20:10:10 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-06-01 17:35:30 +0200 |
commit | ea68215c545ba9600d20718a372707be8e0f3905 (patch) | |
tree | c97c0da7540791bbd66dc0b6973dc7944aeadc5c /src | |
parent | 532a5af47fbc585c4132f9ad15f5e0a57c59320b (diff) |
winsys/amdgpu: set flags correctly when allocating depth-stencil buffers
This mimics Vulkan. It also documents how to fix stencil texturing.
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_surface.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c index 9da4faf0b8e..d68c68844b0 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c @@ -337,7 +337,6 @@ static int amdgpu_surface_init(struct radeon_winsys *rws, AddrSurfInfoIn.flags.color = !(surf->flags & RADEON_SURF_Z_OR_SBUFFER); AddrSurfInfoIn.flags.depth = (surf->flags & RADEON_SURF_ZBUFFER) != 0; - AddrSurfInfoIn.flags.stencil = (surf->flags & RADEON_SURF_SBUFFER) != 0; AddrSurfInfoIn.flags.cube = type == RADEON_SURF_TYPE_CUBEMAP; AddrSurfInfoIn.flags.display = (surf->flags & RADEON_SURF_SCANOUT) != 0; AddrSurfInfoIn.flags.pow2Pad = surf->last_level > 0; @@ -346,7 +345,12 @@ static int amdgpu_surface_init(struct radeon_winsys *rws, !(surf->flags & RADEON_SURF_SCANOUT) && !compressed && AddrDccIn.numSamples <= 1; - /* This disables incorrect calculations (hacks) in addrlib. */ + AddrSurfInfoIn.flags.noStencil = (surf->flags & RADEON_SURF_SBUFFER) == 0; + AddrSurfInfoIn.flags.compressZ = AddrSurfInfoIn.flags.depth; + + /* TODO: update addrlib to a newer version, remove this, and + * set flags.matchStencilTileCfg = 1 to fix stencil texturing. + */ AddrSurfInfoIn.flags.noStencil = 1; /* Set preferred macrotile parameters. This is usually required @@ -413,6 +417,8 @@ static int amdgpu_surface_init(struct radeon_winsys *rws, /* Calculate texture layout information for stencil. */ if (surf->flags & RADEON_SURF_SBUFFER) { AddrSurfInfoIn.bpp = 8; + AddrSurfInfoIn.flags.depth = 0; + AddrSurfInfoIn.flags.stencil = 1; /* This will be ignored if AddrSurfInfoIn.pTileInfo is NULL. */ AddrTileInfoIn.tileSplitBytes = surf->stencil_tile_split; |