I am trying to create a depth view with 16 bit format
DXGI_FORMAT_D16_UNORM
However the texture chain creation fails
If I use a DXGI_FORMAT_D32_FLOAT it does work . However I need to make it work for 16 bit format
ID3D12DynamicRHI d3d12RHI = GetID3D12DynamicRHI();*
TArray textureChain;
D3D12_HEAP_PROPERTIES heapProps = {};
heapProps.Type = D3D12_HEAP_TYPE_DEFAULT;
D3D12_CLEAR_VALUE clearValue = {};
textureDesc.Format = DXGI_FORMAT_D16_UNORM;;
textureDesc.Alignment = 0;
textureDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
textureDesc.Width = sizeX;
textureDesc.Height = sizeY;
textureDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
textureDesc.DepthOrArraySize = 1;|
textureDesc.SampleDesc.Count = 1;|
textureDesc.SampleDesc.Quality = 0;|
textureDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
hr = pID3D12Device->CreateCommittedResource(
&heapProps,
D3D12_HEAP_FLAG_NONE,
&textureDesc,
D3D12_RESOURCE_STATE_DEPTH_WRITE,
&clearValue,
IID_PPV_ARGS(&pTexture));
textureChain.Add(static_cast((d3d12RHI-RHICreateTexture2DFromResource(EPixelFormat::PF_DepthStencil,
createFlags, clearValueBinding, pTexture))));