Don’t do inline vertex buffer updates

Somehow broke zero buff MTLVertexDescriptor, but fixes broken geoemtry so I’m pushing anyway
This commit is contained in:
Isaac Marovitz 2024-07-01 18:01:53 +01:00 committed by Isaac Marovitz
parent 6f6ccb7898
commit 6aff6401fb
2 changed files with 7 additions and 19 deletions

View file

@ -22,13 +22,12 @@ namespace Ryujinx.Graphics.Metal
StencilRef = 1 << 7, StencilRef = 1 << 7,
Viewports = 1 << 8, Viewports = 1 << 8,
Scissors = 1 << 9, Scissors = 1 << 9,
VertexBuffers = 1 << 10, Buffers = 1 << 10,
Buffers = 1 << 11, VertexTextures = 1 << 11,
VertexTextures = 1 << 12, FragmentTextures = 1 << 12,
FragmentTextures = 1 << 13, ComputeTextures = 1 << 13,
ComputeTextures = 1 << 14,
RenderAll = RenderPipeline | DepthStencil | DepthClamp | DepthBias | CullMode | FrontFace | StencilRef | Viewports | Scissors | VertexBuffers | Buffers | VertexTextures | FragmentTextures, RenderAll = RenderPipeline | DepthStencil | DepthClamp | DepthBias | CullMode | FrontFace | StencilRef | Viewports | Scissors | Buffers | VertexTextures | FragmentTextures,
ComputeAll = ComputePipeline | Buffers | ComputeTextures, ComputeAll = ComputePipeline | Buffers | ComputeTextures,
All = RenderAll | ComputeAll, All = RenderAll | ComputeAll,
} }

View file

@ -179,6 +179,7 @@ namespace Ryujinx.Graphics.Metal
{ {
if (_currentState.Dirty.HasFlag(DirtyFlags.RenderPipeline)) if (_currentState.Dirty.HasFlag(DirtyFlags.RenderPipeline))
{ {
SetVertexBuffers(renderCommandEncoder, _currentState.VertexBuffers);
SetRenderPipelineState(renderCommandEncoder); SetRenderPipelineState(renderCommandEncoder);
} }
@ -222,11 +223,6 @@ namespace Ryujinx.Graphics.Metal
SetScissors(renderCommandEncoder); SetScissors(renderCommandEncoder);
} }
if (_currentState.Dirty.HasFlag(DirtyFlags.VertexBuffers))
{
SetVertexBuffers(renderCommandEncoder, _currentState.VertexBuffers);
}
if (_currentState.Dirty.HasFlag(DirtyFlags.Buffers)) if (_currentState.Dirty.HasFlag(DirtyFlags.Buffers))
{ {
SetRenderBuffers(renderCommandEncoder, _currentState.UniformBuffers, _currentState.StorageBuffers); SetRenderBuffers(renderCommandEncoder, _currentState.UniformBuffers, _currentState.StorageBuffers);
@ -683,15 +679,8 @@ namespace Ryujinx.Graphics.Metal
// Update the buffers on the pipeline // Update the buffers on the pipeline
UpdatePipelineVertexState(_currentState.VertexBuffers, _currentState.VertexAttribs); UpdatePipelineVertexState(_currentState.VertexBuffers, _currentState.VertexAttribs);
// Inline update
if (_pipeline.Encoders.TryGetRenderEncoder(out MTLRenderCommandEncoder renderCommandEncoder))
{
SetVertexBuffers(renderCommandEncoder, _currentState.VertexBuffers);
return;
}
// Mark dirty // Mark dirty
_currentState.Dirty |= DirtyFlags.RenderPipeline | DirtyFlags.VertexBuffers; _currentState.Dirty |= DirtyFlags.RenderPipeline;
} }
public void UpdateUniformBuffers(ReadOnlySpan<BufferAssignment> buffers) public void UpdateUniformBuffers(ReadOnlySpan<BufferAssignment> buffers)