mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-01 21:44:17 +01:00
only set buffer offset if needed
This commit is contained in:
parent
aa81070e87
commit
f03c0a2769
@ -1318,7 +1318,27 @@ void MetalRenderer::SetBuffer(MTL::RenderCommandEncoder* renderCommandEncoder, M
|
|||||||
if (buffer == boundBuffer.m_buffer && offset == boundBuffer.m_offset)
|
if (buffer == boundBuffer.m_buffer && offset == boundBuffer.m_offset)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: only set the offset if only offset changed
|
if (buffer == boundBuffer.m_buffer)
|
||||||
|
{
|
||||||
|
// Just update the offset
|
||||||
|
boundBuffer.m_offset = offset;
|
||||||
|
|
||||||
|
switch (shaderType)
|
||||||
|
{
|
||||||
|
case METAL_SHADER_TYPE_VERTEX:
|
||||||
|
renderCommandEncoder->setVertexBufferOffset(offset, index);
|
||||||
|
break;
|
||||||
|
case METAL_SHADER_TYPE_OBJECT:
|
||||||
|
renderCommandEncoder->setObjectBufferOffset(offset, index);
|
||||||
|
break;
|
||||||
|
case METAL_SHADER_TYPE_MESH:
|
||||||
|
renderCommandEncoder->setMeshBufferOffset(offset, index);
|
||||||
|
break;
|
||||||
|
case METAL_SHADER_TYPE_FRAGMENT:
|
||||||
|
renderCommandEncoder->setFragmentBufferOffset(offset, index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boundBuffer = {buffer, offset};
|
boundBuffer = {buffer, offset};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user