Skip to content

Conversation

@reosfire
Copy link
Contributor

No description provided.

if (webglVersion >= 2) {
gl.asDynamic().vertexAttribIPointer(index, size, type, stride, pointer.toInt())
} else {
TODO()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no fallback on this case ?

Copy link
Member

@ygdrasil-io ygdrasil-io Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reosfire can you put an explicit message at least ?

@ygdrasil-io ygdrasil-io self-assigned this May 26, 2025
@ygdrasil-io
Copy link
Member

Can you provide more context about what brings the improvement and how did you do the non-regression test?

@reosfire
Copy link
Contributor Author

@ygdrasil-io
I faced a problem when created an Attribute of SInt type and then read it in the shader.
image
image
The problem was that the index took weird values(not values that I've passed to the buffers)

In opengl there are two functions to describe vertex attributes
image
The difference between them is described here
image
When I changed code to what is present in this pr passed int become correct.

In the engine I can't see any places that use Ints as vertex attributes. So there should be very little regressions in client code (only if somebody used Ints in his own shaders and used them as described in docs)

Maybe the better approach would be to add a parameter to the Attribute class which will say which one of this two methods to use

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

Successfully merging this pull request may close these issues.

2 participants