[Mesa-dev] [PATCH 09/10] mesa: Correct the is_vertex_position decision for dlists.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Thu May 2 09:27:19 UTC 2019


From: Mathias Fröhlich <mathias.froehlich at web.de>

We have to use _mesa_inside_dlist_begin_end instead of
_mesa_inside_begin_end to see if we are inside a glBegin/glEnd block in
case of display lists.
So split the is_vertex_position function used in vertex attribute processing
into a imm and dlist variant and use the appropriate _mesa_inside_begin_end
variant.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/vbo/vbo_attrib_tmp.h | 14 --------------
 src/mesa/vbo/vbo_exec_api.c   | 14 ++++++++++++++
 src/mesa/vbo/vbo_save_api.c   | 14 ++++++++++++++
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h
index 796b3883633..5c4beb540bf 100644
--- a/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/src/mesa/vbo/vbo_attrib_tmp.h
@@ -522,20 +522,6 @@ TAG(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
 }


-/**
- * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
- * It depends on a few things, including whether we're inside or outside
- * of glBegin/glEnd.
- */
-static inline bool
-is_vertex_position(const struct gl_context *ctx, GLuint index)
-{
-   return (index == 0 &&
-           _mesa_attr_zero_aliases_vertex(ctx) &&
-           _mesa_inside_begin_end(ctx));
-}
-
-
 static void GLAPIENTRY
 TAG(VertexAttrib1fARB)(GLuint index, GLfloat x)
 {
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 749a5ebe65a..5b1549d96de 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -457,6 +457,20 @@ vbo_exec_begin_vertices(struct gl_context *ctx)
 }


+/**
+ * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
+ * It depends on a few things, including whether we're inside or outside
+ * of glBegin/glEnd.
+ */
+static inline bool
+is_vertex_position(const struct gl_context *ctx, GLuint index)
+{
+   return (index == 0 &&
+           _mesa_attr_zero_aliases_vertex(ctx) &&
+           _mesa_inside_begin_end(ctx));
+}
+
+
 /**
  * This macro is used to implement all the glVertex, glColor, glTexCoord,
  * glVertexAttrib, etc functions.
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index b33dfa5fd8e..d378bdb058d 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -979,6 +979,20 @@ reset_vertex(struct gl_context *ctx)
 }


+/**
+ * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
+ * It depends on a few things, including whether we're inside or outside
+ * of glBegin/glEnd.
+ */
+static inline bool
+is_vertex_position(const struct gl_context *ctx, GLuint index)
+{
+   return (index == 0 &&
+           _mesa_attr_zero_aliases_vertex(ctx) &&
+           _mesa_inside_dlist_begin_end(ctx));
+}
+
+

 #define ERROR(err)   _mesa_compile_error(ctx, err, __func__);

--
2.20.1



More information about the mesa-dev mailing list