st/mesa: Use API-aware context constructor
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 22 Apr 2010 13:32:11 +0000 (09:32 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 22 Apr 2010 15:44:13 +0000 (11:44 -0400)
The mesa state tracker is currently the only place where we create a
context and expect it to implement GLES1/2.  Use the API-aware constructor
to communicate this to core mesa.

src/mesa/state_tracker/st_context.c

index 5fcb6b9dcf9c87c8ebb0ce12b8532482af984ba0..48fc86cd525bd3d9485c5bf13e671aa7d05f00c9 100644 (file)
@@ -199,7 +199,16 @@ struct st_context *st_create_context(struct pipe_context *pipe,
    memset(&funcs, 0, sizeof(funcs));
    st_init_driver_functions(&funcs);
 
-   ctx = _mesa_create_context(visual, shareCtx, &funcs, NULL);
+#if FEATURE_ES1
+   ctx = _mesa_create_context_for_api(API_OPENGLES,
+                                     visual, shareCtx, &funcs, NULL);
+#elif FEATURE_ES2
+   ctx = _mesa_create_context_for_api(API_OPENGLES2,
+                                     visual, shareCtx, &funcs, NULL);
+#else
+   ctx = _mesa_create_context_for_api(API_OPENGL,
+                                     visual, shareCtx, &funcs, NULL);
+#endif
 
    /* XXX: need a capability bit in gallium to query if the pipe
     * driver prefers DP4 or MUL/MAD for vertex transformation.