Quantcast
Viewing all articles
Browse latest Browse all 335

Metal uniform buffer overhaul.

changeset b1f51cfa8933
branch
bookmark
tag
user Caleb Cornett <caleb.cornett@outlook.com>
description 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.
files mojoshader.h
mojoshader_metal.c

Viewing all articles
Browse latest Browse all 335

Trending Articles