X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fvbo%2Fvbo_context.h;h=2ded6ccbff27eb5116a4b7b3efc34a607d7cb496;hb=066bee64e1611093c7e641ba77bbd43f70d08cec;hp=013f81bdd5c8b891cc59d08f91e978f7173e5f11;hpb=2cf5fd48d1586f961910a14324a457854cb66221;p=mesa.git diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index 013f81bdd5c..2ded6ccbff2 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -51,10 +51,11 @@ #ifndef _VBO_CONTEXT_H #define _VBO_CONTEXT_H +#include "main/mfeatures.h" #include "vbo.h" #include "vbo_attrib.h" -#include "vbo_save.h" #include "vbo_exec.h" +#include "vbo_save.h" struct vbo_context { @@ -66,15 +67,17 @@ struct vbo_context { struct gl_client_array *generic_currval; struct gl_client_array *mat_currval; - GLuint map_vp_none[32]; - GLuint map_vp_arb[32]; + GLuint map_vp_none[VERT_ATTRIB_MAX]; + GLuint map_vp_arb[VERT_ATTRIB_MAX]; GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->Current, ctx->Light.Material */ GLfloat CurrentFloatEdgeFlag; struct vbo_exec_context exec; +#if FEATURE_dlist struct vbo_save_context save; +#endif /* Callback into the driver. This must always succeed, the driver * is responsible for initiating any fallback actions required: @@ -83,21 +86,23 @@ struct vbo_context { }; -static INLINE struct vbo_context *vbo_context(GLcontext *ctx) +static INLINE struct vbo_context *vbo_context(struct gl_context *ctx) { return (struct vbo_context *)(ctx->swtnl_im); } -enum { - VP_NONE = 1, - VP_NV, - VP_ARB -}; -static INLINE GLuint get_program_mode( GLcontext *ctx ) +/** + * Return VP_x token to indicate whether we're running fixed-function + * vertex transformation, an NV vertex program or ARB vertex program/shader. + */ +static INLINE enum vp_mode +get_program_mode( struct gl_context *ctx ) { if (!ctx->VertexProgram._Current) return VP_NONE; + else if (ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) + return VP_NONE; else if (ctx->VertexProgram._Current->IsNVProgram) return VP_NV; else