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

Re: [Public WebGL] ARB_robustness and array bounds checking





On Mon, Oct 24, 2011 at 11:57 AM, Vladimir Vukicevic <vladimir@pobox.com> wrote:
On Mon, Oct 24, 2011 at 2:29 PM, Gregg Tavares (wrk) <gman@google.com> wrote:
> To be more constructive, (and I think this has been suggested before), if we
> could come up with an short list of acceptable behaviors then we could test
> for them. Hopefully it would only take a short list to be acceptable to all
> GPU vendors.
> Of the top of my head
> *) Clamp to the ends of the array
> As in:
>     someArray[clamp(someIndex, 0, lengthOfSomeArray - 1)];
> *) Return 0
> As in:
>     ((someIndex >= 0 || someIndex < lengthOfSomeArray)
> ? someArray[someIndex] : typeOfSomeArray(0.0));
> *) Mod the index
> As in:
>     someArray[mod(abs(someIndex), lengthOfSomeArray];
> Are there any other solutions that would need to be considered?
> That doesn't solve the consistent behavior problem but it would at least
> solve the testing problem.

Hmm -- I don't think having a short list helps WebGL itself though, as
it really needs just one behaviour.  Doesn't really matter if it's
testable if it's not consistent, unless we're talking about just being
able to test ARB_robustness++ itself, and not WebGL with that
extension.

There are 2 issues (1) testability (2) consistent behavior.

Having a fixed set of allowed solutions solves (1) but not (2) 

For this particular issue solving (1) is enough I hope.

(2) only needs to be solved for programs that are doing the wrong thing and various WebGL wrappers or debug flags could help devs find those issues if and when they run into them.


 

   - Vlad