D3D12Device: Transition all uploaded subresources

Use an all-subresource barrier after initial uploads so tracked state matches
every texture slice and mip level.
pull/3782/head
Stenzek 2 months ago
parent 2273890101
commit b5f821bf4f
No known key found for this signature in database

@ -68,7 +68,7 @@ std::unique_ptr<GPUTexture> D3D12Device::CreateTexture(u32 width, u32 height, u3
case GPUTexture::Type::Texture:
{
desc.Flags = D3D12_RESOURCE_FLAG_NONE;
state = D3D12_RESOURCE_STATE_COPY_DEST;
state = data ? D3D12_RESOURCE_STATE_COPY_DEST : D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
}
break;
@ -182,9 +182,7 @@ std::unique_ptr<GPUTexture> D3D12Device::CreateTexture(u32 width, u32 height, u3
if (type == GPUTexture::Type::Texture)
{
// resource barrier must be in the same command buffer as the upload
tex->TransitionSubresourceToState(GetInitCommandList(), 0u, 0u, D3D12_RESOURCE_STATE_COPY_DEST,
D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
tex->m_resource_state = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
tex->TransitionToState(GetInitCommandList(), D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
}
}

Loading…
Cancel
Save