diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-09-16 00:13:03 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-09-16 00:13:03 +0000 |
| commit | 4a80b1fb5b5ddd333e2786370feb17b5e8d7aea6 (patch) | |
| tree | 4508e411854a73a43a2f14b783cbb4fd94f7af04 /Graphics/GraphicsEngineD3D12 | |
| parent | Fixed validation of Texture1D/Texture1DArray parameters for compressed formats (diff) | |
| download | DiligentCore-4a80b1fb5b5ddd333e2786370feb17b5e8d7aea6.tar.gz DiligentCore-4a80b1fb5b5ddd333e2786370feb17b5e8d7aea6.zip | |
Reworked texture format info reporting
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp index b91ac760..41327332 100644 --- a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp @@ -463,16 +463,27 @@ void RenderDeviceD3D12Impl::TestTextureFormat(TEXTURE_FORMAT TexFormat) return; } - // clang-format off - TexFormatInfo.Filterable = ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE) != 0) || - ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON) != 0); - TexFormatInfo.ColorRenderable = (FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET) != 0; - TexFormatInfo.DepthRenderable = (FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL) != 0; - TexFormatInfo.Tex1DFmt = (FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE1D) != 0; - TexFormatInfo.Tex2DFmt = (FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE2D) != 0; - TexFormatInfo.Tex3DFmt = (FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE3D) != 0; - TexFormatInfo.TexCubeFmt = (FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURECUBE) != 0; - // clang-format on + TexFormatInfo.Filterable = + ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE) != 0) || + ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON) != 0); + + TexFormatInfo.BindFlags = BIND_SHADER_RESOURCE; + if ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET) != 0) + TexFormatInfo.BindFlags |= BIND_RENDER_TARGET; + if ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL) != 0) + TexFormatInfo.BindFlags |= BIND_DEPTH_STENCIL; + if ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) != 0) + TexFormatInfo.BindFlags |= BIND_UNORDERED_ACCESS; + + TexFormatInfo.Dimensions = RESOURCE_DIMENSION_SUPPORT_NONE; + if ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE1D) != 0) + TexFormatInfo.Dimensions |= RESOURCE_DIMENSION_SUPPORT_TEX_1D | RESOURCE_DIMENSION_SUPPORT_TEX_1D_ARRAY; + if ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE2D) != 0) + TexFormatInfo.Dimensions |= RESOURCE_DIMENSION_SUPPORT_TEX_2D | RESOURCE_DIMENSION_SUPPORT_TEX_2D_ARRAY; + if ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE3D) != 0) + TexFormatInfo.Dimensions |= RESOURCE_DIMENSION_SUPPORT_TEX_3D; + if ((FormatSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURECUBE) != 0) + TexFormatInfo.Dimensions |= RESOURCE_DIMENSION_SUPPORT_TEX_CUBE | RESOURCE_DIMENSION_SUPPORT_TEX_CUBE_ARRAY; TexFormatInfo.SampleCounts = 0x0; for (Uint32 SampleCount = 1; SampleCount <= D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT; SampleCount *= 2) |
