Thanks for the patches, Olivier!
I'm a bit short on time, but I'll test/commit them ASAP. I'll take a
closer look at the VBO issue too.
-Brian
On 07/06/2017 09:45 AM, Olivier Lauffenburger wrote:
glPrimitiveRestartNV crashes when it is called during the compilation
of a render list.
There are two reasons:
- ctx->Driver.CurrentSavePrimitive is not set to the current primitive
- save_PrimitiveRestartNV() calls _save_Begin() which only sets an
OpenGL error, instead of calling vbo_save_NotifyBegin().
This patch correctly calls vbo_save_NotifyBegin() but it detects
the current primitive mode by looking at the latest saved primitive.
It works but it is not the most elegant method.
However, correctly setting ctx->Driver.CurrentSavePrimitive requires
an deeper understanding of the code than I have.
Signed-off-by: Olivier Lauffenburger <o.lauffenbur...@topsolid.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101464
---
src/mesa/vbo/vbo_save_api.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index a0735f63f2..cb10921ce7 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1116,10 +1116,16 @@ _save_PrimitiveRestartNV(void)
GLenum curPrim;
GET_CURRENT_CONTEXT(ctx);
- curPrim = ctx->Driver.CurrentSavePrimitive;
+ /* get current primitive mode */
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ if (save->prim_count == 0) return;
+
+ curPrim = save->prim[save->prim_count - 1].mode;
- _save_End();
- _save_Begin(curPrim);
+ /* restart primitive */
+ CALL_End(GET_DISPATCH(), ());
+ vbo_save_NotifyBegin(ctx, (curPrim | VBO_SAVE_PRIM_WEAK
+ | VBO_SAVE_PRIM_NO_CURRENT_UPDATE));
}
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev