-
Notifications
You must be signed in to change notification settings - Fork 323
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
Incorrect state management after VAO emulation #633
Comments
rreusser
changed the title
State management error when using VAO emulation
Incorrect state management after using VAO emulation
Nov 22, 2021
rreusser
changed the title
Incorrect state management after using VAO emulation
Incorrect state management after VAO emulation
Nov 22, 2021
Confirmed, here is a notebook which reproduces the issue: https://observablehq.com/d/243a0f078d6865bd To reproduce:
If the const regl = createREGL({
extensions: ['ANGLE_instanced_arrays', 'OES_vertex_array_object']
});
const vao = regl.vao([
{ divisor: 0, buffer: regl.buffer([[-0.1, -0.1], [0.1, -0.1], [0, 0.1]]) },
{ divisor: 1, buffer: regl.buffer([[-0.2, 0.4], [0.2, .4]]) }
]);
const drawTrianglesWithVAO = regl({
vert: `
precision highp float;
attribute vec2 xy, tri;
void main () {
gl_Position = vec4(xy + tri, 0, 1);
}`,
frag: `
precision highp float;
void main () {
gl_FragColor = vec4(0,0,0,1);
}`,
attributes: { tri: 0, xy: 1 },
vao,
count: 3,
instances: 2
});
const drawTriangle = regl({
vert: `
precision highp float;
attribute vec2 xy;
attribute vec3 color;
varying vec3 vColor;
void main () {
vColor = color;
gl_Position = vec4(xy, 0, 1);
}`,
frag: `
precision highp float;
varying vec3 vColor;
void main () {
gl_FragColor = vec4(pow(vColor, vec3(0.454)),1);
}`,
attributes: {
xy: [[-0.1, -0.5], [0.1, -0.5], [0, -0.3]],
color: [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
},
count: 3
});
regl.poll();
drawTrianglesWithVAO();
drawTriangle(); |
Can still reproduce this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this notebook: https://observablehq.com/@rreusser/strange-attractors-on-the-gpu-part-2
The particles use a VAO. It should look like this:
but when I disable the VAO extension, causing the particles to fall back to VAO emulation, the particles render correctly but the grid is incorrect:
I'll see if I can, but I don't yet have a more focused reproduction of the bug.See below for reproduction.Attribute 0 of particle rendering has divisor 0, all others have divisor 1. That could potentially be a cause.
The text was updated successfully, but these errors were encountered: