mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-11 18:50:55 +00:00
d3d12: set max_depth_value based on depth format
This commit is contained in:
parent
da923f8a3d
commit
482a371bb0
1 changed files with 10 additions and 4 deletions
|
@ -522,7 +522,10 @@ void D3D12GSRender::ExecCMD(u32 cmd)
|
||||||
|
|
||||||
// TODO: Merge depth and stencil clear when possible
|
// TODO: Merge depth and stencil clear when possible
|
||||||
if (m_clear_surface_mask & 0x1)
|
if (m_clear_surface_mask & 0x1)
|
||||||
commandList->ClearDepthStencilView(m_rtts.m_depthStencilDescriptorHeap->GetCPUDescriptorHandleForHeapStart(), D3D12_CLEAR_FLAG_DEPTH, m_clear_surface_z / (float)0xffffff, 0, 0, nullptr);
|
{
|
||||||
|
u32 max_depth_value = m_surface_depth_format == CELL_GCM_SURFACE_Z16 ? 0x0000ffff : 0x00ffffff;
|
||||||
|
commandList->ClearDepthStencilView(m_rtts.m_depthStencilDescriptorHeap->GetCPUDescriptorHandleForHeapStart(), D3D12_CLEAR_FLAG_DEPTH, m_clear_surface_z / (float)max_depth_value, 0, 0, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_clear_surface_mask & 0x2)
|
if (m_clear_surface_mask & 0x2)
|
||||||
commandList->ClearDepthStencilView(m_rtts.m_depthStencilDescriptorHeap->GetCPUDescriptorHandleForHeapStart(), D3D12_CLEAR_FLAG_STENCIL, 0.f, m_clear_surface_s, 0, nullptr);
|
commandList->ClearDepthStencilView(m_rtts.m_depthStencilDescriptorHeap->GetCPUDescriptorHandleForHeapStart(), D3D12_CLEAR_FLAG_STENCIL, 0.f, m_clear_surface_s, 0, nullptr);
|
||||||
|
@ -807,9 +810,12 @@ void D3D12GSRender::Flip()
|
||||||
|
|
||||||
commandList->ResourceBarrier(2, barriers);
|
commandList->ResourceBarrier(2, barriers);
|
||||||
D3D12_TEXTURE_COPY_LOCATION src = {}, dst = {};
|
D3D12_TEXTURE_COPY_LOCATION src = {}, dst = {};
|
||||||
src.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
|
src.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
|
||||||
src.SubresourceIndex = 0, dst.SubresourceIndex = 0;
|
src.SubresourceIndex = 0;
|
||||||
src.pResource = m_rtts.m_currentlyBoundRenderTargets[0], dst.pResource = m_backBuffer[m_swapChain->GetCurrentBackBufferIndex()];
|
src.pResource = m_rtts.m_currentlyBoundRenderTargets[0],
|
||||||
|
dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
|
||||||
|
dst.SubresourceIndex = 0;
|
||||||
|
dst.pResource = m_backBuffer[m_swapChain->GetCurrentBackBufferIndex()];
|
||||||
D3D12_BOX box = { 0, 0, 0, m_surface_clip_w, m_surface_clip_h, 1 };
|
D3D12_BOX box = { 0, 0, 0, m_surface_clip_w, m_surface_clip_h, 1 };
|
||||||
commandList->CopyTextureRegion(&dst, 0, 0, 0, &src, &box);
|
commandList->CopyTextureRegion(&dst, 0, 0, 0, &src, &box);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue