X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fprogramdata.h;fp=source%2Frender%2Fprogramdata.h;h=9d08219ef84368943f6cb4535466bc61a1c742af;hb=190a7e11237351f6b730c28f7b16f183e8adc69c;hp=4e8ee37302a90b23a7d64f05cd4ce7cb024586f2;hpb=be6ffe96ecb4707599fe1a6f620c348760213d46;p=libs%2Fgl.git diff --git a/source/render/programdata.h b/source/render/programdata.h index 4e8ee373..9d08219e 100644 --- a/source/render/programdata.h +++ b/source/render/programdata.h @@ -26,10 +26,11 @@ class UniformBlock; struct Color; /** -Stores uniform variables for shader programs. The uniforms are stored in a -program-independent way, and UniformBlocks are created to match the uniform -layouts of different programs. If multiple programs have the same layout, the -same block is used for them. +Stores uniform values for shader programs. + +The uniforms are stored in a program-independent way, and UniformBlocks are +created to match the uniform layouts of different programs. If multiple +programs have the same layout, the same block is used for them. The class is optimized for an access pattern where the set of uniforms and programs stays constants, with only the values changing. @@ -243,6 +244,8 @@ private: std::vector::const_iterator prepare_program(const Program &) const; public: + /** Creates or updates UniformBlocks for a specific program if necessary, + then sets them to the PipelineState. */ void apply(const Program &, PipelineState &) const; void set_debug_name(const std::string &);