Skip to content

Major overhaul of shader generation, result struct, temporary resources, identifiers, ~50%-70% reduction of CPU footprint

Niklas Haas requested to merge sh_ident_nores into master

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 through pl_shader_finalize() called by external API user, or when actually needing to execute pl_pass_create at shader compilation time)
  • sh_subpass no 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_info is 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_shader directly, instead of all existing as independent allocations
  • Various minor improvements to the pl_alloc subsystem 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

Merge request reports

Loading