mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 20:15:32 +00:00
D3D12Device: Fix incorrect state when texture uploaded 2x w/o use
This commit is contained in:
parent
b0172a0afc
commit
50e99dd1ff
@ -178,7 +178,14 @@ std::unique_ptr<GPUTexture> D3D12Device::CreateTexture(u32 width, u32 height, u3
|
|||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
tex->Update(0, 0, width, height, data, data_stride);
|
tex->Update(0, 0, width, height, data, data_stride);
|
||||||
tex->TransitionToState(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tex;
|
return tex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user