Aeva / m.grl

Midnight Graphics & Recreation Library
http://mgrl.midnightsisters.org
GNU Lesser General Public License v3.0
44 stars 3 forks source link

slow_bezier throws gl_error in debug builds #247

Closed Aeva closed 7 years ago

Aeva commented 7 years ago

But it otherwise works ok on non-debug builds, as far as I can test it. This issue affects the fast_graph branch (relates to #232).

Firefox provides this warning as well: drawArrays: Bound vertex attribute buffers do not have sufficient size for given first and count.

Relevant portion of the generated code:

this.prog.attrs['position'].enabled = true;
this.prog.attrs['normal'].enabled = true;
this.prog.attrs['tcoords'].enabled = false;
gl.bindBuffer(gl.ARRAY_BUFFER, please.gl.__buffers.all[10].id);
gl.vertexAttribPointer(this.prog.attrs['position'].loc, 3, 5126, false, 24, 0);
gl.vertexAttribPointer(this.prog.attrs['normal'].loc, 3, 5126, false, 24, 12);
this.prog.vars['world_matrix'] = this["421f9bfb-455f-44fb-b404-3d92df84b224"]();
this.prog.vars['normal_matrix'] = this["2112512a-bc54-4fea-b17b-9af52426dd80"]();
gl.uniform1f(this.prog.__ptrs['mode'], 1);
gl.drawArrays(4, 0, 6); //<--------------------------------- this causes error
Aeva commented 7 years ago

As noted in the commit message for e119c910cc3f047aa91697bc25de99f428620374, there is another regression in these demos, wrt location picking in the drag-and-drop phase.

Aeva commented 7 years ago

git bisect suggests that e39dfe8d375806519065b6cbe70828235198c24b is where it broke, which is weird because it was committed after this issue was first filed.

My guess right now is that it is that maybe something else is throwing the GL_INVALID_OPERATION...? And that the warning being printed might be wrong (buffers render fine w/ same invocation in non-picking pass).

Aeva commented 7 years ago

Ok - dynamic_glsl demo works again, and the gl errors are gone, though the picking behavior is not correct in the bezier demos.