[Public WebGL] ANGLE Dynamic Indexing of Arrays of Samplers
Tim Johansson
[email protected]
Mon May 30 04:39:39 PDT 2011
On 2011-05-27 18:12, Gregg Tavares (wrk) wrote:
>
>
> On Thu, May 26, 2011 at 11:58 PM, Tim Johansson <[email protected]
> <mailto:[email protected]>> wrote:
>
> On 2011-05-26 19:19, Chris Marrin wrote:
>
>
> I'm adding the following statement to the differences section:
>
> The GLSL ES spec<a href="#refsGLES20GLSL">[GLES20GLSL]</a>
> allows but does not mandate support for dynamic
> indexing of arrays of samplers. WebGL disallows this support.
>
> This is in support of tightening the language about array
> bounds checking. Does ANGLE currently make this check and
> disallow such indexing?
>
> I would be very surprised if it did as it could not possible pass
> the conformance tests if it did.
>
> The test gl-min-textures.html has a shader which looks like:
>
> "uniform sampler2D uni[8];
> void main()
> {
> vec4 c = vec4(0,0,0,0);
> for (int ii = 0; ii < NUM_TEXTURES; ++ii) {
> c += texture2D(uni[ii], vec2(0.5, 0.5));
> }
> gl_FragColor = c;
> }"
>
>
>
> Is that dynamic indexing? I thought since NUM_TEXTURES is replaced by
> a constant it's static. I assumed dynamic meant that the indices can
> change depending on the input. For example
>
You're right of cause, it is not dynamic so it must be a bug in the that
specific OpenGL ES implementation. I'll just try to add a workaround for
it instead.
//Tim
> uniform sampler2D ab[2];
> uniform int aOrB;
>
> void main () {
> gl_FragColor = texture2D(ab[aOrB], vec2(0.5, 0.5));
> }
>
> is dynamic indexing since it can not be unrolled.
>
>
> That is preventing us from passing the conformance tests on some
> GLES implementations.
>
> There is also an unrolled version of the test which does not use
> dynamic indexing of sampler arrays - gl-min-textures-unroll.html.
> Do the persons who wrote those two tests (svn indicates Gregg and
> Mo) know if there are any known problems with the unrolled version
> or if we can just switch to using that?
>
> //Tim
>
>
> -----
> ~Chris
> [email protected] <mailto:[email protected]>
>
>
>
>
> -----------------------------------------------------------
> You are currently subscribed to [email protected]
> <mailto:[email protected]>.
> To unsubscribe, send an email to [email protected]
> <mailto:[email protected]> with
> the following command in the body of your email:
> unsubscribe public_webgl
> -----------------------------------------------------------
>
>
>
-----------------------------------------------------------
You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------
More information about the public_webgl
mailing list