[Tizen] Enabled sampler arrays in shader 25/296825/2
authorDavid Steele <david.steele@samsung.com>
Wed, 19 Apr 2023 16:22:49 +0000 (17:22 +0100)
committerseungho baek <sbsh.baek@samsung.com>
Wed, 23 Aug 2023 04:49:27 +0000 (13:49 +0900)
commitdef2b4e6adefddcdb421f1a952d120bb6bf61fd3
treea5d7d8d546625fec102a8aadfff261ecb786add1
parent5c8d642ad4f6c89ac001c6a8e05433cfb2eaac37
[Tizen] Enabled sampler arrays in shader

Previously, texture units were only bound to the first
element of any sampler array.

Modified the shader reflection parser to find sampler arrays
of the format
  uniform sampler2D mySamplers[16]

and store the number of elements in the sampler code.

Modified the binding code to ensure that textures are bound
to each element of a sampler array.

Made several assumptions in this code:
A) that GL returns sequential locations for each uniform array element
(It doesn't guarantee a strict sequence, but in practice, this is the
case).

B) that the dali-core implementation binds texture units in the order 0..N-1
with a binding index of 0..N-1. (A safe assumption, given we know how
dali-core works!)

Note, we don't really use locations for non-sampler uniform array elements,
either, we just offset from the first location.

Change-Id: I68c61f3e22303271d5d916c3588f4a3bd5898757
Signed-off-by: David Steele <david.steele@samsung.com>
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles-impl/gles-graphics-reflection.cpp