mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-04 18:52:25 -07:00
don't recreate render pipeline unless we're about to draw, pass view depth properly (#22)
This commit is contained in:
committed by
Isaac Marovitz
parent
58b3e2e82b
commit
02de48a6f2
@@ -122,7 +122,7 @@ namespace Ryujinx.Graphics.Metal
|
||||
|
||||
fixed (float* ptr = region)
|
||||
{
|
||||
_pipeline.GetOrCreateRenderEncoder().SetVertexBytes((IntPtr)ptr, RegionBufferSize, 0);
|
||||
_pipeline.GetOrCreateRenderEncoder(true).SetVertexBytes((IntPtr)ptr, RegionBufferSize, 0);
|
||||
}
|
||||
|
||||
_pipeline.Draw(4, 1, 0, 0);
|
||||
@@ -191,7 +191,7 @@ namespace Ryujinx.Graphics.Metal
|
||||
|
||||
fixed (float* ptr = region)
|
||||
{
|
||||
_pipeline.GetOrCreateRenderEncoder().SetVertexBytes((IntPtr)ptr, RegionBufferSize, 0);
|
||||
_pipeline.GetOrCreateRenderEncoder(true).SetVertexBytes((IntPtr)ptr, RegionBufferSize, 0);
|
||||
}
|
||||
|
||||
_pipeline.Draw(4, 1, 0, 0);
|
||||
@@ -234,7 +234,7 @@ namespace Ryujinx.Graphics.Metal
|
||||
|
||||
fixed (float* ptr = clearColor)
|
||||
{
|
||||
_pipeline.GetOrCreateRenderEncoder().SetFragmentBytes((IntPtr)ptr, ClearColorBufferSize, 0);
|
||||
_pipeline.GetOrCreateRenderEncoder(true).SetFragmentBytes((IntPtr)ptr, ClearColorBufferSize, 0);
|
||||
}
|
||||
|
||||
_pipeline.Draw(4, 1, 0, 0);
|
||||
@@ -276,7 +276,7 @@ namespace Ryujinx.Graphics.Metal
|
||||
_pipeline.SetViewports(viewports);
|
||||
_pipeline.SetDepthTest(new DepthTestDescriptor(true, depthMask, CompareOp.Always));
|
||||
// _pipeline.SetStencilTest(CreateStencilTestDescriptor(stencilMask != 0, stencilValue, 0xFF, stencilMask));
|
||||
_pipeline.GetOrCreateRenderEncoder().SetFragmentBytes(ptr, ClearDepthBufferSize, 0);
|
||||
_pipeline.GetOrCreateRenderEncoder(true).SetFragmentBytes(ptr, ClearDepthBufferSize, 0);
|
||||
_pipeline.Draw(4, 1, 0, 0);
|
||||
|
||||
// Restore previous state
|
||||
|
Reference in New Issue
Block a user