Improved correctness of Program::GetActiveSamplerUniforms(). 57/225257/6
authorGyörgy Straub <g.straub@partner.samsung.com>
Tue, 18 Feb 2020 09:13:36 +0000 (09:13 +0000)
committerGyörgy Straub <g.straub@partner.samsung.com>
Wed, 19 Feb 2020 11:00:34 +0000 (11:00 +0000)
commite6100d52fde6d90d0aece0d733b28f4288b29964
tree75d435ecd031bcadbec13b980c64540828f56ac5
parenta5201cc4a07837103f97015fd8f3afda308688a1
Improved correctness of Program::GetActiveSamplerUniforms().

Problems:
- The current implementation picks up samplers that are declared as other
  than uniforms (e.g. function arguments etc.), then, failing to find a
  location associated with the same name, issues warnings about them.
- Tabs are ignored when tokenizing the shader source;

Solution: find declarations starting with "uniform" and ending with
a semicolon, then tokenize on whitespace (only), looking for the name
following a sampler* type declaration.

This also eliminates the need to tokenize the whole shader source.

- Also made some global const c-strings const pointers too;

Change-Id: Ibaa026d2e7873c28142300c149e6295f3cdbf7c5
Signed-off-by: György Straub <g.straub@partner.samsung.com>
dali/internal/render/shaders/program.cpp