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

x/mobile/gl: Mismatch in Uniform and Attrib Value types #9438

Open
mokiat opened this Issue Dec 24, 2014 · 2 comments

Comments

Projects
None yet
5 participants
@mokiat
Copy link

mokiat commented Dec 24, 2014

Hi,

I noticed that the Value field of the Attrib and Uniform types is of different type - uint and int32 respectively.
http://godoc.org/golang.org/x/mobile/gl#Attrib
http://godoc.org/golang.org/x/mobile/gl#Uniform

According to the documentation, they both should be uint.
https://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttribLocation.xhtml
https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformLocation.xhtml

So I see no sense in them being of different type.

Furthermore, shouldn't the type of Attrib be a bit more strictly specified - for example uint32 - similar to other ID types in the mobile/gl API?

Regards,
Momchil Atanasov

@crawshaw crawshaw self-assigned this Dec 24, 2014

@crawshaw

This comment has been minimized.

Copy link
Contributor

crawshaw commented Dec 24, 2014

I'm not sure why this ended up this way, I'll take a look.

@hyangah hyangah added the repo-mobile label Dec 31, 2014

@mikioh mikioh changed the title mobile/gl Mismatch in Uniform and Attrib Value types gl: Mismatch in Uniform and Attrib Value types Jan 4, 2015

@bryanturley

This comment has been minimized.

Copy link

bryanturley commented Jan 13, 2015

Using opengl in Go I have found many places where opengl writes either uint32 or int32 into []int32.
It is slightly annoying but I don't know if we can really do anything about it.

So far for me this has been the worst one
https://www.opengl.org/sdk/docs/man/html/glGetActiveUniformsiv.xhtml
The *params parameter returns an array that can be GLint, GLuint or GLenum and since C doesn't care and the type size doesn't change it is acceptable to that world.

Things like this are why I kept the types as basic as possible (uint32 vs Enum for instance).
I am in favor of the named types, they will just require some extra casting every now and then.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc changed the title gl: Mismatch in Uniform and Attrib Value types x/mobile/gl: Mismatch in Uniform and Attrib Value types Apr 14, 2015

@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015

@rsc rsc removed the repo-mobile label Apr 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.