Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've implemented a draft for a possible pipeline caching system.
The user can call
SDL_CreateGPUPipelineCache
to create aSDL_GPUPipelineCache
object, which can then be used to accelerate pipeline compilations by passing it as a SDL_PropertiesID toSDL_CreateGPUGraphicsPipeline
andSDL_CreateGPUGraphicsPipeline
.SDL_CreateGPUPipelineCache
takes aSDL_GPUPipelineCacheCreateInfo
struct, which supplies both a checksum binary blob (opaque to the user), a normal pipeline cache blob, and their respective sizes, or NULL/zero if no data is yet present.On application exit, the user can call
SDL_FetchGPUPipelineCacheData
to fill a newSDL_GPUPipelineCacheCreateInfo
with new/update pipeline data, which can then be written to disk and loaded on the next run.Currently the Vulkan implementation is functional except the checksum control part, as I don't know which hash algorithm would be more suitable or preferred for SDL, the DirectX 12 implementation is in the process of being written.
Regarding Metal, I've left a commented implementation for all the necessary function, problem being that Apple wants me to write the entire
MTLBinaryArchive
object to disk, and doesn't provide neither a binary blob which I can use, nor a definition for whatMTLBinaryArchive
actually is internally