mesa/st/nir: assign driver_location for images
[mesa.git] / src / gallium / state_trackers / hgl / hgl.c
index b75dc26bc39ed939e1d87331c5b5ef5e4da39767..bbc477a978c510e2467156de8a7e1199ae6d8dd4 100644 (file)
@@ -7,16 +7,18 @@
  *      Alexander von Gluck IV, kallisti5@unixzen.com
  */
 
+#include "hgl_context.h"
 
-#include "GLView.h"
+#include <stdio.h>
 
 #include "pipe/p_format.h"
 #include "util/u_atomic.h"
 #include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
+#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
 
-#include "hgl_context.h"
+#include "GLView.h"
 
 
 #ifdef DEBUG
@@ -30,7 +32,7 @@
 
 
 // Perform a safe void to hgl_context cast
-static INLINE struct hgl_context*
+static inline struct hgl_context*
 hgl_st_context(struct st_context_iface *stctxi)
 {
        struct hgl_context* context;
@@ -42,7 +44,7 @@ hgl_st_context(struct st_context_iface *stctxi)
 
 
 // Perform a safe void to hgl_buffer cast
-static INLINE struct hgl_buffer*
+static inline struct hgl_buffer*
 hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
 {
        struct hgl_buffer* buffer;
@@ -64,7 +66,7 @@ hgl_st_framebuffer_flush_front(struct st_context_iface *stctxi,
 
        #if 0
        struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
-       pipe_mutex_lock(stwfb->fb->mutex);
+       mtx_lock(&stwfb->fb->mutex);
 
        struct pipe_resource* resource = textures[statt];
        if (resource)
@@ -91,7 +93,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
                for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
                        pipe_resource_reference(&buffer->textures[i], NULL);
        }
-       
+
        memset(&templat, 0, sizeof(templat));
        templat.target = buffer->target;
        templat.width0 = width;
@@ -191,10 +193,8 @@ hgl_st_framebuffer_validate(struct st_context_iface *stctxi,
                //}
        }
 
-       for (i = 0; i < count; i++) {
-               out[i] = NULL;
+       for (i = 0; i < count; i++)
                pipe_resource_reference(&out[i], buffer->textures[statts[i]]);
-       }
 
        return TRUE;
 }
@@ -256,6 +256,14 @@ hgl_create_st_framebuffer(struct hgl_context* context)
 }
 
 
+struct st_api*
+hgl_create_st_api()
+{
+       CALLED();
+       return st_gl_api_create();
+}
+
+
 struct st_manager *
 hgl_create_st_manager(struct hgl_context* context)
 {