Merge branch 'mesa_7_6_branch'
[mesa.git] / src / mesa / main / context.c
index a9e520716d3c8c66e6d7cd89a75f687c2cdf6b59..f6d4ac459579dde85c03b3f69034fae8d431e7a3 100644 (file)
 #if FEATURE_ARB_occlusion_query
 #include "queryobj.h"
 #endif
+#if FEATURE_ARB_sync
+#include "syncobj.h"
+#endif
 #if FEATURE_drawpix
 #include "rastpos.h"
 #endif
@@ -487,7 +490,7 @@ init_program_limits(GLenum type, struct gl_program_constants *prog)
    prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
 
    if (type == GL_VERTEX_PROGRAM_ARB) {
-      prog->MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS;
+      prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS;
       prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
       prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
    }
@@ -497,15 +500,17 @@ init_program_limits(GLenum type, struct gl_program_constants *prog)
       prog->MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS;
    }
 
-   /* copy the above limits to init native limits */
-   prog->MaxNativeInstructions = prog->MaxInstructions;
-   prog->MaxNativeAluInstructions = prog->MaxAluInstructions;
-   prog->MaxNativeTexInstructions = prog->MaxTexInstructions;
-   prog->MaxNativeTexIndirections = prog->MaxTexIndirections;
-   prog->MaxNativeAttribs = prog->MaxAttribs;
-   prog->MaxNativeTemps = prog->MaxTemps;
-   prog->MaxNativeAddressRegs = prog->MaxAddressRegs;
-   prog->MaxNativeParameters = prog->MaxParameters;
+   /* Set the native limits to zero.  This implies that there is no native
+    * support for shaders.  Let the drivers fill in the actual values.
+    */
+   prog->MaxNativeInstructions = 0;
+   prog->MaxNativeAluInstructions = 0;
+   prog->MaxNativeTexInstructions = 0;
+   prog->MaxNativeTexIndirections = 0;
+   prog->MaxNativeAttribs = 0;
+   prog->MaxNativeTemps = 0;
+   prog->MaxNativeAddressRegs = 0;
+   prog->MaxNativeParameters = 0;
 }
 
 
@@ -590,6 +595,9 @@ _mesa_init_constants(GLcontext *ctx)
    /* GL_ARB_framebuffer_object */
    ctx->Const.MaxSamples = 0;
 
+   /* GL_ARB_sync */
+   ctx->Const.MaxServerWaitTimeout = (GLuint64) ~0;
+
    /* GL_ATI_envmap_bumpmap */
    ctx->Const.SupportedBumpUnits = SUPPORTED_ATI_BUMP_UNITS;
 
@@ -713,6 +721,9 @@ init_attrib_groups(GLcontext *ctx)
 #if FEATURE_ARB_occlusion_query
    _mesa_init_query( ctx );
 #endif
+#if FEATURE_ARB_sync
+   _mesa_init_sync( ctx );
+#endif
 #if FEATURE_drawpix
    _mesa_init_rastpos( ctx );
 #endif
@@ -1011,6 +1022,9 @@ _mesa_free_context_data( GLcontext *ctx )
    _mesa_free_shader_state(ctx);
 #if FEATURE_ARB_occlusion_query
    _mesa_free_query_data(ctx);
+#endif
+#if FEATURE_ARB_sync
+   _mesa_free_sync_data(ctx);
 #endif
    _mesa_free_varray_data(ctx);