diff options
author | Christoph Bumiller <[email protected]> | 2011-10-13 21:27:09 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-10-21 23:00:38 +0200 |
commit | 5b6f3a2e3c1d364d243f170b0c9628f746301dea (patch) | |
tree | 7daf47f67b54a9b92ea225ad4513b1cba872bc98 /src/gallium/state_trackers/d3d1x/gd3d11 | |
parent | 845808f105f216861e725ce1bce67338357bba8d (diff) |
d3d1x: use ZS formats for TYPELESS resources with DS binding
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/gd3d11')
-rw-r--r-- | src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h index 8f740ba5af9..dfa0d9e1804 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h @@ -744,6 +744,16 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen else templat.last_level = MAX2(MAX2(util_logbase2(templat.width0), util_logbase2(templat.height0)), util_logbase2(templat.depth0)); templat.format = dxgi_to_pipe_format[format]; + if(bind_flags & D3D11_BIND_DEPTH_STENCIL) { + // colour formats are not depth-renderable, but depth/stencil-formats may be colour-renderable + switch(format) + { + case DXGI_FORMAT_R32_TYPELESS: templat.format = PIPE_FORMAT_Z32_FLOAT; break; + case DXGI_FORMAT_R16_TYPELESS: templat.format = PIPE_FORMAT_Z16_UNORM; break; + default: + break; + } + } templat.bind = d3d11_to_pipe_bind_flags(bind_flags); if(c_p_u_access_flags & D3D11_CPU_ACCESS_READ) templat.bind |= PIPE_BIND_TRANSFER_READ; |