Major changes include:
1) Metal now uses a single, ~1MB uniform buffer per frame that is shared among all shaders. From my testing this should be more than enough room for the FNA catalog (aside from possibly Little Racers Street with its memory leak). This is a major boon for Metal memory management since it only requires one buffer instead of 3,000 (in LRS's case)! And it simplifies the internal workings of mojoshader_metal dramatically.
2) Metal now has a MOJOSHADER_mtlMakeContextCurrent API to match GL and Vulkan. Other parts of the context API have been rewritten as well to match the behavior you'd expect.
3) The MOJOSHADER_mtlGetUniformBuffers function has been replaced with MOJOSHADER_mtlGetUniformData. Now that we only use a single uniform buffer, there's no need to return one for each of the shaders.
4) The MOJOSHADER_mtlGetFunctionHandle function no longer allocates memory. Instead, all MTLFunction handles are cached in the MOJOSHADER_mtlShader structs at library creation time. This removes the burden of memory management from the user.
5) A variety of formatting and documentation updates.
Major changes include: 1) Metal now uses a single, ~1MB uniform buffer per frame that is shared among all shaders. From my testing this should be more than enough room for the FNA catalog (aside from possibly Little Racers Street with its memory leak). This is a major boon for Metal memory management since it only requires one buffer instead of 3,000 (in LRS's case)! And it simplifies the internal workings of mojoshader_metal dramatically. 2) Metal now has a
MOJOSHADER_mtlMakeContextCurrent
API to match GL and Vulkan. Other parts of the context API have been rewritten as well to match the behavior you'd expect. 3) TheMOJOSHADER_mtlGetUniformBuffers
function has been replaced withMOJOSHADER_mtlGetUniformData
. Now that we only use a single uniform buffer, there's no need to return one for each of the shaders. 4) TheMOJOSHADER_mtlGetFunctionHandle
function no longer allocates memory. Instead, all MTLFunction handles are cached in the MOJOSHADER_mtlShader structs at library creation time. This removes the burden of memory management from the user. 5) A variety of formatting and documentation updates.