#define VBO_VERT_BUFFER_SIZE (1024*64) /* bytes */
-/** Current vertex program mode */
-enum vp_mode {
- VP_NONE, /**< fixed function */
- VP_ARB /**< ARB vertex program or GLSL vertex shader */
-};
-
-
struct vbo_exec_eval1_map {
struct gl_1d_map *map;
GLuint sz;
GLbitfield const_inputs = 0x0;
GLuint i;
- switch (get_program_mode(ctx)) {
- case VP_NONE:
+ switch (get_vp_mode(ctx)) {
+ case VP_FF:
/* When no vertex program is active (or the vertex program is generated
* from fixed-function state). We put the material values into the
* generic slots. This is the only situation where material values
}
break;
- case VP_ARB:
+ case VP_SHADER:
/* There are no shaders in OpenGL ES 1.x, so this code path should be
* impossible to reach. The meta code is careful to not use shaders in
* ES1.
}
/* Overlay other active attributes */
- switch (get_program_mode(exec->ctx)) {
- case VP_NONE:
+ switch (get_vp_mode(exec->ctx)) {
+ case VP_FF:
+ /* Point the generic attributes at the legacy material values */
for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) {
assert(VERT_ATTRIB_GENERIC(attr) < ARRAY_SIZE(exec->vtx.inputs));
exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] =
}
map = vbo->map_vp_none;
break;
- case VP_ARB:
+ case VP_SHADER:
for (attr = 0; attr < VERT_ATTRIB_GENERIC_MAX; attr++) {
assert(VERT_ATTRIB_GENERIC(attr) < ARRAY_SIZE(exec->vtx.inputs));
exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] =
/**
- * Return VP_x token to indicate whether we're running fixed-function
- * vertex transformation, an NV vertex program or ARB vertex program/shader.
+ * Current vertex processing mode: fixed function vs. shader.
+ * In reality, fixed function is probably implemented by a shader but that's
+ * not what we care about here.
+ */
+enum vp_mode {
+ VP_FF, /**< legacy / fixed function */
+ VP_SHADER /**< ARB vertex program or GLSL vertex shader */
+};
+
+
+/**
+ * Get current vertex processing mode (fixed function vs. shader).
*/
static inline enum vp_mode
-get_program_mode( struct gl_context *ctx )
+get_vp_mode( struct gl_context *ctx )
{
if (!ctx->VertexProgram._Current)
- return VP_NONE;
+ return VP_FF;
else if (ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram)
- return VP_NONE;
+ return VP_FF;
else
- return VP_ARB;
+ return VP_SHADER;
}
}
/* Overlay other active attributes */
- switch (get_program_mode(ctx)) {
- case VP_NONE:
+ switch (get_vp_mode(ctx)) {
+ case VP_FF:
+ /* Point the generic attributes at the legacy material values */
for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) {
save->inputs[VERT_ATTRIB_GENERIC(attr)] =
&vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT+attr];
}
map = vbo->map_vp_none;
break;
- case VP_ARB:
+ case VP_SHADER:
for (attr = 0; attr < VERT_ATTRIB_GENERIC_MAX; attr++) {
save->inputs[VERT_ATTRIB_GENERIC(attr)] =
&vbo->currval[VBO_ATTRIB_GENERIC0+attr];