[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
- To: Gregg Tavares (勤) <email@example.com>
- Subject: Re: [Public WebGL] Proposal: Generate INVALID_VALUE if value >= MAX_TEXTURE_IMAGE_UNITS on uniform1f(v) for samplers
- From: Florian Bösch <firstname.lastname@example.org>
- Date: Wed, 2 May 2012 00:30:10 +0200
- Cc: public webgl <email@example.com>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7kPs3LN0Ozr1tm8ZEQ7jqrb4kA6ZJbwB7LNQIze1kwI=; b=dRwbyRAOyhtQdMijqxwfPGrxX3B+Xa80LCAFkGMQ861FFvU2XL6afdFWEgH3YCOr0j 96t4qjC+boLNJftMT+u9Hztba7jotPq4H8hleY5DF5/DQVYH4KLLWVeqLJjfM2JHdaKJ CET1GviLkMtdPVKtybv7c5BcQizT9EIpT6t545H6hMaqeVkyVe5MuV6Ndr8FhVC5zifF 9I5RPv4jmcFOPPhBLogKUN1EllXur690xV+zupzXKr8EQQMfx0brCvmPpa1z2w4n5Df1 Q9JOwdX5DPNihTEdZNbOeaVbRKIHPlilcd8sbQllT5P2YOaGs3Tw5PPfbHq+D7yXY/be GA0A==
- In-reply-to: <CAKZ+BNp5aWSmriR+6Mvk7pJe_jmdW6PnpKr1ZA-Zdd_gUF_xfA@mail.gmail.com>
- List-id: Public WebGL Mailing List <public_webgl.khronos.org>
- References: <CAKZ+BNp5aWSmriR+6Mvk7pJe_jmdW6PnpKr1ZA-Zdd_gUF_xfA@mail.gmail.com>
- Sender: firstname.lastname@example.org
On Wed, May 2, 2012 at 12:13 AM, Gregg Tavares (勤) <email@example.com> wrote:
Happens a lot, I've had that a couple times too from typos.
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.
The glValidateProgram call verifies validity of the configuration of samplers with the current state.
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?
It'd be an obvious solution, although that would deviate from the OpenGL ES specification (not that I think it would matter). The texture unit indirection is a bit of an inelegant solution (and that's where such mixups come from in the end). DSA would've been much nicer to implement, as in setSampler(program, location, texture), alas that would break completely with the current specification and would probably be deemed a nogo (regardless, it'd also be somewhat hard to implement for platforms that don't have proprietary DSA extensions).
I'm in favor of generating INVALID_VALUE