[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



The idea's not bad, but I should hope we're discussing webgl.uniform1i, not uniform1f.

I don't think, though, that this is really necessary, since it's possible to emit JS warnings for this sort of stuff. I think these are plenty sufficient for detecting these issues for developers.

Also, if we do go down this path, we should consider checking for valid ranges for other types.

-Jeff

----- Original Message -----
From: "Kenneth Russell" <kbr@google.com>
To: "Gregg Tavares (勤)" <gman@google.com>
Cc: "public webgl" <public_webgl@khronos.org>
Sent: Tuesday, May 1, 2012 4:45:37 PM
Subject: Re: [Public WebGL] Proposal: Generate INVALID_VALUE if value >= MAX_TEXTURE_IMAGE_UNITS on uniform1f(v) for samplers


On Tue, May 1, 2012 at 3:13 PM, Gregg Tavares (勤) <gman@google.com> wrote:
> A developer ran into a bug today where their app was working on Linux but
> not Mac and Windows.
>
> The issue was they were calling
>
>    gl.uniform1f(someSamplerLocation, gl.TEXTURE0);
>
> 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 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?

This sounds good to me.

-Ken

-----------------------------------------------------------
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:
unsubscribe public_webgl
-----------------------------------------------------------


-----------------------------------------------------------
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:
unsubscribe public_webgl
-----------------------------------------------------------