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

uint32 attribute GL_INVALID_ENUM: glVertexAttribPointer: type was GL_UNSIGNED_INT #458

Open
dy opened this issue Feb 19, 2018 · 2 comments
Assignees

Comments

@dy
Copy link
Contributor

dy commented Feb 19, 2018

'use strict'

const regl = require('regl')()

let draw = regl({
	vert: `
		attribute float c;

		void main() {
			gl_Position = vec4(c,0,0,1);
			gl_PointSize = 100.;
		}
	`,

	frag: `
		void main() {
			gl_FragColor = vec4(0,0,0,1);
		}
	`,

	attributes: {
		c: regl.buffer({type:'uint32', data: [0.]})
	},

	primitive: 'points',
	count: 1
})

draw()

gives
image

Changing type to uint16 works fine.

@grovesNL
Copy link

That extension is for elements (the index buffer) in drawElements/drawElementsInstanced, not attributes. So you can't use uint32 as the type there. Even when using the other integer types, they will be converted to floating-point in the shader.

WebGL2 does allow true integer types though.

@dy
Copy link
Contributor Author

dy commented Feb 19, 2018

Makes sense. The documentation needs updating then.

@dy dy self-assigned this May 4, 2018
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

2 participants