mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-01 21:44:17 +01:00
clip mode
This commit is contained in:
parent
3439b3259e
commit
b7a1adec91
@ -947,10 +947,6 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32
|
|||||||
uint32 cullBack = polygonControlReg.get_CULL_BACK();
|
uint32 cullBack = polygonControlReg.get_CULL_BACK();
|
||||||
uint32 polyOffsetFrontEnable = polygonControlReg.get_OFFSET_FRONT_ENABLED();
|
uint32 polyOffsetFrontEnable = polygonControlReg.get_OFFSET_FRONT_ENABLED();
|
||||||
|
|
||||||
// TODO
|
|
||||||
//cemu_assert_debug(LatteGPUState.contextNew.PA_CL_CLIP_CNTL.get_ZCLIP_NEAR_DISABLE() == LatteGPUState.contextNew.PA_CL_CLIP_CNTL.get_ZCLIP_FAR_DISABLE()); // near or far clipping can be disabled individually
|
|
||||||
//bool zClipEnable = LatteGPUState.contextNew.PA_CL_CLIP_CNTL.get_ZCLIP_FAR_DISABLE() == false;
|
|
||||||
|
|
||||||
if (polyOffsetFrontEnable)
|
if (polyOffsetFrontEnable)
|
||||||
{
|
{
|
||||||
uint32 frontScaleU32 = LatteGPUState.contextNew.PA_SU_POLY_OFFSET_FRONT_SCALE.getRawValue();
|
uint32 frontScaleU32 = LatteGPUState.contextNew.PA_SU_POLY_OFFSET_FRONT_SCALE.getRawValue();
|
||||||
@ -984,6 +980,16 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Depth clip mode
|
||||||
|
cemu_assert_debug(LatteGPUState.contextNew.PA_CL_CLIP_CNTL.get_ZCLIP_NEAR_DISABLE() == LatteGPUState.contextNew.PA_CL_CLIP_CNTL.get_ZCLIP_FAR_DISABLE()); // near or far clipping can be disabled individually
|
||||||
|
bool zClipEnable = LatteGPUState.contextNew.PA_CL_CLIP_CNTL.get_ZCLIP_FAR_DISABLE() == false;
|
||||||
|
|
||||||
|
if (zClipEnable != encoderState.m_depthClipEnable)
|
||||||
|
{
|
||||||
|
renderCommandEncoder->setDepthClipMode(zClipEnable ? MTL::DepthClipModeClip : MTL::DepthClipModeClamp);
|
||||||
|
encoderState.m_depthClipEnable = zClipEnable;
|
||||||
|
}
|
||||||
|
|
||||||
// todo - how does culling behave with rects?
|
// todo - how does culling behave with rects?
|
||||||
// right now we just assume that their winding is always CW
|
// right now we just assume that their winding is always CW
|
||||||
if (isPrimitiveRect)
|
if (isPrimitiveRect)
|
||||||
|
@ -98,6 +98,7 @@ struct MetalEncoderState
|
|||||||
uint32 m_depthBias = 0;
|
uint32 m_depthBias = 0;
|
||||||
uint32 m_depthSlope = 0;
|
uint32 m_depthSlope = 0;
|
||||||
uint32 m_depthClamp = 0;
|
uint32 m_depthClamp = 0;
|
||||||
|
bool m_depthClipEnable = true;
|
||||||
struct {
|
struct {
|
||||||
MTL::Buffer* m_buffer;
|
MTL::Buffer* m_buffer;
|
||||||
size_t m_offset;
|
size_t m_offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user