diff --git a/gfx/common/d3d11_common.c b/gfx/common/d3d11_common.c index a815f04538..7ae98d995d 100644 --- a/gfx/common/d3d11_common.c +++ b/gfx/common/d3d11_common.c @@ -137,6 +137,9 @@ void d3d11_update_texture( D3D11_MAPPED_SUBRESOURCE mapped_texture; D3D11_BOX frame_box = { 0, 0, 0, width, height, 1 }; + if (!texture || !texture->staging) + return; + D3D11MapTexture2D(ctx, texture->staging, 0, D3D11_MAP_WRITE, 0, &mapped_texture); dxgi_copy( diff --git a/gfx/common/d3d12_common.c b/gfx/common/d3d12_common.c index b6143c4cf9..163fd676f5 100644 --- a/gfx/common/d3d12_common.c +++ b/gfx/common/d3d12_common.c @@ -733,6 +733,9 @@ void d3d12_update_texture( uint8_t* dst; D3D12_RANGE read_range = { 0, 0 }; + if (!texture || !texture->upload_buffer) + return; + D3D12Map(texture->upload_buffer, 0, &read_range, (void**)&dst); dxgi_copy(