[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Shader validator issue.



>From a bit further up on page 77.. 

> The built-ins suffixed with “Lod” are allowed only in a vertex shader.

That sounds like the problem :-)

    - Vlad

----- Original Message -----
> I think I may have found a validator bug.
> 
> This shader is boiled down to the bare essentials from a much bigger
> example...
> 
> #ifdef GL_ES
> precision highp float;
> #endif
> 
> uniform sampler2D diffuseMap ;
> 
> void main()
> {
> gl_FragColor = texture2DLod ( diffuseMap, vec2(0.5,0.5), 0.0 ) ;
> }
> 
> It compiles and runs just fine under last nights' Firefox/Minefield in
> both Linux & Windows with the validator disabled - but fails with this
> error with the validator turned on:
> 
> Error compiling shader:
> ERROR: 0:10: 'texture2DLod' : no matching overloaded function found
> ERROR: 0:10: 'assign' : cannot convert from 'const mediump float'
> to 'FragColor mediump 4-component vector of float'
> ERROR: 2 compilation errors. No code generated.
> GL Error: 1281 in loadShaderPairFromString
> 
> (It also fails in more sane cases, like when the second parameter is a
> simple varying texCoord and when the third parameter is a float
> variable).
> 
> Is there a problem with texture2DLod? I think I'm using it correctly
> per
> page 77 of
> http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
> 
> It says:
> 
> vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod)
> 
> Eh?
> 
> -- Steve
> 
> 
> -----------------------------------------------------------
> You are currently subscribed to public_webgl@khronos.org.
> To unsubscribe, send an email to majordomo@khronos.org with
> the following command in the body of your email:

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: