mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-29 20:44:18 +01:00
disable depth write if active FBO doesn't have a depth attachment
This commit is contained in:
parent
cda4799b54
commit
a9a4d7b4f8
@ -251,11 +251,11 @@ void SetFragmentState(T* desc, CachedFBOMtl* lastUsedFBO, CachedFBOMtl* activeFB
|
|||||||
if (lastUsedFBO->depthBuffer.texture)
|
if (lastUsedFBO->depthBuffer.texture)
|
||||||
{
|
{
|
||||||
auto texture = static_cast<LatteTextureViewMtl*>(lastUsedFBO->depthBuffer.texture);
|
auto texture = static_cast<LatteTextureViewMtl*>(lastUsedFBO->depthBuffer.texture);
|
||||||
desc->setDepthAttachmentPixelFormat(texture->GetRGBAView()->pixelFormat());
|
desc->setDepthAttachmentPixelFormat(texture->GetRGBAView()->pixelFormat());
|
||||||
if (lastUsedFBO->depthBuffer.hasStencil)
|
if (lastUsedFBO->depthBuffer.hasStencil)
|
||||||
{
|
{
|
||||||
desc->setStencilAttachmentPixelFormat(texture->GetRGBAView()->pixelFormat());
|
desc->setStencilAttachmentPixelFormat(texture->GetRGBAView()->pixelFormat());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32
|
|||||||
// Disable depth write when there is no depth attachment
|
// Disable depth write when there is no depth attachment
|
||||||
auto& depthControl = LatteGPUState.contextNew.DB_DEPTH_CONTROL;
|
auto& depthControl = LatteGPUState.contextNew.DB_DEPTH_CONTROL;
|
||||||
bool depthWriteEnable = depthControl.get_Z_WRITE_ENABLE();
|
bool depthWriteEnable = depthControl.get_Z_WRITE_ENABLE();
|
||||||
if (!m_state.m_lastUsedFBO->depthBuffer.texture)
|
if (!m_state.m_activeFBO->depthBuffer.texture)
|
||||||
depthControl.set_Z_WRITE_ENABLE(false);
|
depthControl.set_Z_WRITE_ENABLE(false);
|
||||||
|
|
||||||
MTL::DepthStencilState* depthStencilState = m_depthStencilCache->GetDepthStencilState(LatteGPUState.contextNew);
|
MTL::DepthStencilState* depthStencilState = m_depthStencilCache->GetDepthStencilState(LatteGPUState.contextNew);
|
||||||
|
Loading…
Reference in New Issue
Block a user