Major overhaul of shader generation, result struct, temporary resources, identifiers, ~50%-70% reduction of CPU footprint
This is a big series representing a major rewrite of the shader generation system. Notable changes:
- We stick to numeric identifiers throughout the shader generation process, never templating out to
const char *names until absolutely necessary (either throughpl_shader_finalize()called by external API user, or when actually needing to executepl_pass_createat shader compilation time) -
sh_subpassno longer preserves the subpass shader, and therefore we can stop having to refcount all shader resources in favor of simply treating them as normal tmp allocations -
pl_shader_infois now a refcounted struct in order to avoid users from having to strcpy around its contents. (Supersedes !425 (closed)) - Shader temporary allocations are now pooled into small scratch buffers attached to the
pl_shaderdirectly, instead of all existing as independent allocations - Various minor improvements to the
pl_allocsubsystem aimed at reducing the number of unnecessary re-allocations
After all is said and done, CPU overhead of shader generation has been reduced by anywhere from 50% to 70% (under -DPL_STRIP_SHADERS) vs the master status quo.
Edited by Niklas Haas