Add forward shadow receiving support
This commit is contained in:
@@ -185,6 +185,21 @@ bool D3D12Texture::InitializeFromData(ID3D12Device* device, ID3D12GraphicsComman
|
||||
}
|
||||
|
||||
bool D3D12Texture::InitializeDepthStencil(ID3D12Device* device, uint32_t width, uint32_t height, DXGI_FORMAT format) {
|
||||
DXGI_FORMAT resourceFormat = format;
|
||||
switch (format) {
|
||||
case DXGI_FORMAT_D16_UNORM:
|
||||
resourceFormat = DXGI_FORMAT_R16_TYPELESS;
|
||||
break;
|
||||
case DXGI_FORMAT_D24_UNORM_S8_UINT:
|
||||
resourceFormat = DXGI_FORMAT_R24G8_TYPELESS;
|
||||
break;
|
||||
case DXGI_FORMAT_D32_FLOAT:
|
||||
resourceFormat = DXGI_FORMAT_R32_TYPELESS;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
D3D12_RESOURCE_DESC desc = {};
|
||||
desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
desc.Alignment = 0;
|
||||
@@ -192,7 +207,7 @@ bool D3D12Texture::InitializeDepthStencil(ID3D12Device* device, uint32_t width,
|
||||
desc.Height = height;
|
||||
desc.DepthOrArraySize = 1;
|
||||
desc.MipLevels = 1;
|
||||
desc.Format = format;
|
||||
desc.Format = resourceFormat;
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.SampleDesc.Quality = 0;
|
||||
desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
|
||||
|
||||
Reference in New Issue
Block a user