Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniformAsync #133

Open
mludlum opened this issue Jun 3, 2023 · 0 comments
Open

UniformAsync #133

mludlum opened this issue Jun 3, 2023 · 0 comments

Comments

@mludlum
Copy link

mludlum commented Jun 3, 2023

I know the last post is in 2022, but I see active forks. Hopefully someone will see this and comment...

I don't think UniformAsync implements the uniform* bindings correctly (if not, completely). My understanding is that in OpenGL, you call Uniform1 to upload a float, or an array of floats. Uinform2/3/4 for float vectors 2/3/4 or an array of vectors of those lengths.

This UniformAsync implementation assumes a single 1/2/3/4 vector and does not support an array of vectors.

UniformAsync should be split into Uniform1Async, Uniform2Async, Uniform3Async, Uniform4Async and validate that the input float array is a multiple of 1/2/3/4 floats, respectively.

I'm porting a Windows OpenTK application to WebAssembly, and one of my shaders takes an array of vector4s as a color lookup table. So, I may pass 100 vector4s to the shader, and index that lookup table. UniformAsync doesn't support that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant