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

Re: [Public WebGL] Shader validator issue.



No, don't apologize, this is all good feedback that the validator is working :-)

    - Vlad

----- Original Message -----
> Oooohhhh...ikky!
> 
> So I can't control the LOD of a texture lookup in the frag
> shader?...Urgh!
> That's a pain in the butt! There is a significant class of shader
> algorithms related to image atlassing that kinda rely on that
> function. I
> may have to go talk to Microsoft about getting "WebD3D" working! :-)
> 
> Oh well, it's a really good thing that the validator works. I guess I
> owe
> someone my humblest apologies...again!
> 
> -- Steve
> 
> > 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: