WebGL2 glUniform1i: wrong uniform function for type

730 views
Skip to first unread message

Evgeny Demidov

unread,
Aug 10, 2015, 7:15:22 AM8/10/15
to WebGL Dev List
(I hope:) I can render into int16 textures in WebGL 2 (Google
46.0.2478.0 canary)
(no "FBOs are not complete" errors at last) in
http://www.ibiblio.org/e-notes/webgl/2/flat_wave2i300.htm

but I've got
[GroupMarkerNotSet(crbug.com/242999)!:24F76C05]GL ERROR :
GL_INVALID_OPERATION : glUniform1i: wrong uniform function for type

for something like
sampLoc = gl.getUniformLocation(prog, "samp");
...
gl.uniform1i(sampLoc, 0);
gl.uniform1i(samp1Loc, 1);
what is wrong here?

Evgeny

Jeff Dash

unread,
Aug 11, 2015, 10:13:00 PM8/11/15
to webgl-d...@googlegroups.com
It's hard to tell without taking a closer look, but I can tell you that R16I is renderable in WebGL 2, though it is not filterable. Neither of these should affect whether you can sample with NEAREST from an R16I texture, if that's all you need. (You can always do this)




Evgeny

--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Evgeny Demidov

unread,
Aug 12, 2015, 3:56:43 AM8/12/15
to webgl-d...@googlegroups.com
yes, I can render into
   gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA16I, n, n, 0, gl.RGBA_INTEGER, gl.SHORT, pix)

I can't set isampler value (e.g. 1,2,3...)
  uniform isampler2D samp;
void main(void) {
   fragColor = vec4(0.01*float(texture(samp, vTexCoord).r), 0., 0., 1.);
....
   var isampLoc  = gl.getUniformLocation(prog_show, "samp")
   gl.uniform1i(isampLoc, 0)        <- error is here

may be it is not implemented yet. I filled an issue at
https://code.google.com/p/chromium/issues/detail?id=519399


8/12/2015 5:12 AM, Jeff Dash:

Jeff Dash

unread,
Aug 12, 2015, 5:22:45 AM8/12/15
to webgl-d...@googlegroups.com

I believe it's not yet implemented.

Reply all
Reply to author
Forward
0 new messages