Refactor: use CreateDesc for SRV
This commit is contained in:
@@ -567,11 +567,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
|
||||
ID3D12DescriptorHeap* descriptorHeaps[] = { srvHeap.GetDescriptorHeap() };
|
||||
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
|
||||
srvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
srvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
||||
srvDesc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
|
||||
srvDesc.Texture2D.MipLevels = 1;
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = XCEngine::RHI::D3D12ShaderResourceView::CreateDesc(XCEngine::RHI::Format::R8G8B8A8_UNorm);
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE srvHeapPtr = srvHeap.GetCPUDescriptorHandleForHeapStart();
|
||||
gTextureSRV.InitializeAt(d3dDevice, texture, srvHeapPtr, &srvDesc);
|
||||
|
||||
Reference in New Issue
Block a user