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

Re: [Public WebGL] Proposal: Generate INVALID_VALUE if value >= MAX_TEXTURE_IMAGE_UNITS on uniform1f(v) for samplers

On Tue, May 1, 2012 at 5:13 PM, Gregg Tavares (勤) <gman@google.com> wrote:
when they should have been calling

   gl.uniform1f(someSamplerLocation, 0);

You could say this is their fault for writing bad code but the thing is there are no errors for this condition defined by OpenGL ES or WebGL AFAIK.

(It's the job of Web APIs to not have these sorts of interoperability problems, so it would be wrong to blame the developer for being bitten by them.)

It just happens that on Linux calling gl.uniform1f(someSamplerLocation, 33984) uses texture unit 0 and on Mac and Windows it does something else.

Given that uniforms are program specific and given that at runtime we know whether or not a particular location is a sampler, should we generate an INVALID_VALUE
if the value set for a sampler uniform is greater than or MAX_TEXTURE_IMAGE_UNITS?

Either that, or the behavior of gl.uniform1f(someSamplerLocation, 33984) should be more strictly defined.

Glenn Maynard