mirror of https://github.com/AxioDL/boo.git
D3D12 DXT1 shader-resource-view
This commit is contained in:
parent
38326298a9
commit
8bfb883d59
|
@ -725,6 +725,17 @@ static const struct RGBATex2DViewDesc : D3D12_SHADER_RESOURCE_VIEW_DESC
|
||||||
}
|
}
|
||||||
} RGBATex2DViewDesc;
|
} 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
|
static const struct GreyTex2DViewDesc : D3D12_SHADER_RESOURCE_VIEW_DESC
|
||||||
{
|
{
|
||||||
GreyTex2DViewDesc()
|
GreyTex2DViewDesc()
|
||||||
|
@ -789,6 +800,9 @@ static ID3D12Resource* GetTextureGPUResource(const ITexture* tex, int idx,
|
||||||
case TextureFormat::I8:
|
case TextureFormat::I8:
|
||||||
descOut = GreyTex2DViewDesc;
|
descOut = GreyTex2DViewDesc;
|
||||||
break;
|
break;
|
||||||
|
case TextureFormat::DXT1:
|
||||||
|
descOut = DXTTex2DViewDesc;
|
||||||
|
break;
|
||||||
default:break;
|
default:break;
|
||||||
}
|
}
|
||||||
return ctex->m_gpuTex.Get();
|
return ctex->m_gpuTex.Get();
|
||||||
|
|
Loading…
Reference in New Issue