diff options
author | Mathias Fröhlich <[email protected]> | 2019-04-29 07:23:58 +0200 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2019-05-04 07:40:35 +0200 |
commit | c869387d8aa9c9c00a159a922dee4e66db49aa05 (patch) | |
tree | 0ecccf3de79e53527ddd281af87c789d406a09f7 /src | |
parent | 5ad54217ff88e34706995b8645a1be35e0c76441 (diff) |
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 <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/vbo/vbo_attrib_tmp.h | 14 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec_api.c | 14 | ||||
-rw-r--r-- | 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 @@ -458,6 +458,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. * \param A VBO_ATTRIB_x attribute index 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__); |