mesa/main: fix inverted condition
[mesa.git] / src / mesa / main / vtxfmt.c
index d3c83e5eb3ddf94195aa2bd08f8e9f5bc212ff58..c80b329137f42c5132e292d4adf5df5746deeccf 100644 (file)
 #include "glheader.h"
 #include "api_arrayelt.h"
 #include "context.h"
-#include "imports.h"
+
 #include "mtypes.h"
 #include "vtxfmt.h"
 #include "eval.h"
 #include "dlist.h"
 #include "main/dispatch.h"
-#include "vbo/vbo_context.h"
+#include "vbo/vbo.h"
 
 
 /**
@@ -111,7 +111,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
       SET_PrimitiveRestartNV(tab, vfmt->PrimitiveRestartNV);
    }
 
-   /* Originally for GL_NV_vertex_program, this is also used by dlist.c */
+   /* Originally for GL_NV_vertex_program, this is now only used by dlist.c */
    if (ctx->API == API_OPENGL_COMPAT) {
       SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);
       SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV);
@@ -205,9 +205,14 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
       SET_VertexAttribP2uiv(tab, vfmt->VertexAttribP2uiv);
       SET_VertexAttribP3uiv(tab, vfmt->VertexAttribP3uiv);
       SET_VertexAttribP4uiv(tab, vfmt->VertexAttribP4uiv);
+
+      /* GL_ARB_bindless_texture */
+      SET_VertexAttribL1ui64ARB(tab, vfmt->VertexAttribL1ui64ARB);
+      SET_VertexAttribL1ui64vARB(tab, vfmt->VertexAttribL1ui64vARB);
    }
 
-   if (ctx->API == API_OPENGL_CORE) {
+   if (_mesa_is_desktop_gl(ctx)) {
+      /* GL_ARB_vertex_attrib_64bit */
       SET_VertexAttribL1d(tab, vfmt->VertexAttribL1d);
       SET_VertexAttribL2d(tab, vfmt->VertexAttribL2d);
       SET_VertexAttribL3d(tab, vfmt->VertexAttribL3d);
@@ -217,10 +222,6 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
       SET_VertexAttribL2dv(tab, vfmt->VertexAttribL2dv);
       SET_VertexAttribL3dv(tab, vfmt->VertexAttribL3dv);
       SET_VertexAttribL4dv(tab, vfmt->VertexAttribL4dv);
-
-      /* GL_ARB_bindless_texture */
-      SET_VertexAttribL1ui64ARB(tab, vfmt->VertexAttribL1ui64ARB);
-      SET_VertexAttribL1ui64vARB(tab, vfmt->VertexAttribL1ui64vARB);
    }
 }
 
@@ -257,8 +258,7 @@ _mesa_install_save_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt)
 void
 _mesa_initialize_vbo_vtxfmt(struct gl_context *ctx)
 {
-   struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
-   _mesa_install_exec_vtxfmt(ctx, &exec->vtxfmt);
+   _vbo_install_exec_vtxfmt(ctx);
    if (ctx->API == API_OPENGL_COMPAT) {
       _mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt);
    }