Closed kovaxis closed 1 year ago
Yes, this is intentional. If you use another type that implements Context
, like the WebGL version, this code wouldn't work.
Right, the uniform location is an opaque type on WebGL (see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getUniformLocation) so we can't construct it directly. Instead we can query the uniform location and use that instead.
Oh, I see, I was confusing uniform locations with uniform indices, since they are the same in practice. Seems like in order to do shader introspection correctly, one must round-trip through uniform names.
Thanks!
There is currently no way to construct a
UniformLocation
from a raw index without hardcoding a reference toNativeUniformLocation
.The following code fails to compile:
With:
Is this intended?