mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
D3D12: Don't keep screenshot/encoder buffers mapped
Readback heaps do not support persistent mapping. See D3D12 docs.
This commit is contained in:
@ -89,8 +89,6 @@ void PSTextureEncoder::Init()
|
||||
|
||||
D3D::SetDebugObjectName12(m_out_readback_buffer, "efb encoder output staging buffer");
|
||||
|
||||
CheckHR(m_out_readback_buffer->Map(0, nullptr, &m_out_readback_buffer_data));
|
||||
|
||||
// Create constant buffer for uploading data to shaders. Need to align to 256 bytes.
|
||||
unsigned int encode_params_buffer_size = (sizeof(EFBEncodeParams) + 0xff) & ~0xff;
|
||||
|
||||
@ -220,8 +218,10 @@ void PSTextureEncoder::Encode(u8* dst, u32 format, u32 native_width, u32 bytes_p
|
||||
D3D::command_list_mgr->ExecuteQueuedWork(true);
|
||||
|
||||
// Transfer staging buffer to GameCube/Wii RAM
|
||||
void* readback_data_map;
|
||||
CheckHR(m_out_readback_buffer->Map(0, nullptr, &readback_data_map));
|
||||
|
||||
u8* src = static_cast<u8*>(m_out_readback_buffer_data);
|
||||
u8* src = static_cast<u8*>(readback_data_map);
|
||||
u32 read_stride = std::min(bytes_per_row, dst_location.PlacedFootprint.Footprint.RowPitch);
|
||||
for (unsigned int y = 0; y < num_blocks_y; ++y)
|
||||
{
|
||||
@ -231,6 +231,8 @@ void PSTextureEncoder::Encode(u8* dst, u32 format, u32 native_width, u32 bytes_p
|
||||
src += dst_location.PlacedFootprint.Footprint.RowPitch;
|
||||
}
|
||||
|
||||
m_out_readback_buffer->Unmap(0, nullptr);
|
||||
|
||||
// Restores proper viewport/scissor settings.
|
||||
g_renderer->RestoreAPIState();
|
||||
|
||||
|
Reference in New Issue
Block a user