st/mesa: call is_format_supported() for compressed formats
[mesa.git] / src / mesa / state_tracker / st_manager.c
index 26f9554c9eca46d82fbb796c20b53155e2bb1d65..44d59d447635d56109bd629f3b9398353fafb915 100644 (file)
@@ -26,7 +26,7 @@
  *    Chia-I Wu <olv@lunarg.com>
  */
 
-#include "state_tracker/st_api.h"
+#include "state_tracker/st_gl_api.h"
 
 #include "pipe/p_context.h"
 #include "pipe/p_screen.h"
@@ -556,7 +556,6 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target
       _mesa_clear_texture_image(ctx, texImage);
    }
 
-   stObj->pipe = st->pipe;
    pipe_resource_reference(&stImage->pt, tex);
 
    _mesa_dirty_texobj(ctx, texObj, GL_TRUE);
@@ -693,7 +692,6 @@ st_api_get_proc_address(struct st_api *stapi, const char *procname)
 static void
 st_api_destroy(struct st_api *stapi)
 {
-   FREE(stapi);
 }
 
 /**
@@ -792,24 +790,22 @@ st_manager_add_color_renderbuffer(struct st_context *st, GLframebuffer *fb,
    return TRUE;
 }
 
+struct st_api st_gl_api = {
+   st_api_destroy,
+   st_api_get_proc_address,
+   st_api_is_visual_supported,
+   st_api_create_context,
+   st_api_make_current,
+   st_api_get_current,
+};
+
 /**
- * Create an st_api to manage the state tracker.
+ * Return the st_api for this state tracker. This might either be GL, GLES1,
+ * GLES2 that mostly depends on the build and link options. But these
+ * functions remain the same either way.
  */
 struct st_api *
-st_manager_create_api(void)
+st_gl_api_create(void)
 {
-   struct st_api *stapi;
-
-   stapi = CALLOC_STRUCT(st_api);
-   if (stapi) {
-      stapi->destroy = st_api_destroy;
-      stapi->get_proc_address = st_api_get_proc_address;
-      stapi->is_visual_supported = st_api_is_visual_supported;
-
-      stapi->create_context = st_api_create_context;
-      stapi->make_current = st_api_make_current;
-      stapi->get_current = st_api_get_current;
-   }
-
-   return stapi;
+   return &st_gl_api;
 }