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

Re: [Public WebGL] Error catching with getBufferSubData

Referencing https://www.khronos.org/opengles/sdk/docs/man3/ :

If an error occurs, glMapBufferRange returns a NULL pointer.

Looking at errors:
All of these errors indicate that your program is faulty.

When using gl.mapBufferRange there are two use-cases. Either you are checking for errors, or you are not.
  1. If you are checking for errors, you are doing so using gl.getError. This will reliably indicate an error in your invocation of gl.mapBufferRange without consulting a hypothetical return boolean.
  2. If you are not checking for errors, you are not using gl.getError, and you will also not consult the hypothetical gl.mapBufferRange return boolean.
Since neither usecase would rely as a best practice on the gl.mapBufferRange return value, I conclude that this return value would be superfluous and not necessary.