From: Mathias Fröhlich Date: Mon, 29 Apr 2019 05:23:58 +0000 (+0200) Subject: mesa: Correct the is_vertex_position decision for dlists. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c869387d8aa9c9c00a159a922dee4e66db49aa05;p=mesa.git mesa: Correct the is_vertex_position decision for dlists. 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. Reviewed-by: Brian Paul Signed-off-by: Mathias Fröhlich --- 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__);