Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Metal uniform buffer overhaul.
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.
- Loading branch information
Showing
2 changed files
with
249 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.