From 8bfb883d59cbd88c858f034622d95324a6d266fa Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 18 Feb 2016 10:51:44 -1000 Subject: [PATCH] D3D12 DXT1 shader-resource-view --- lib/graphicsdev/D3D12.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/graphicsdev/D3D12.cpp b/lib/graphicsdev/D3D12.cpp index 0c88aaa..93f282e 100644 --- a/lib/graphicsdev/D3D12.cpp +++ b/lib/graphicsdev/D3D12.cpp @@ -725,6 +725,17 @@ static const struct RGBATex2DViewDesc : D3D12_SHADER_RESOURCE_VIEW_DESC } } RGBATex2DViewDesc; +static const struct DXTTex2DViewDesc : D3D12_SHADER_RESOURCE_VIEW_DESC +{ + DXTTex2DViewDesc() + { + Format = DXGI_FORMAT_BC1_UNORM; + ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; + Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + Texture2D = {UINT(0), UINT(-1), UINT(0), 0.0f}; + } +} DXTTex2DViewDesc; + static const struct GreyTex2DViewDesc : D3D12_SHADER_RESOURCE_VIEW_DESC { GreyTex2DViewDesc() @@ -789,6 +800,9 @@ static ID3D12Resource* GetTextureGPUResource(const ITexture* tex, int idx, case TextureFormat::I8: descOut = GreyTex2DViewDesc; break; + case TextureFormat::DXT1: + descOut = DXTTex2DViewDesc; + break; default:break; } return ctex->m_gpuTex.Get();