X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fstate_trackers%2Fhgl%2Fhgl.c;h=bbc477a978c510e2467156de8a7e1199ae6d8dd4;hb=0006b860ce83769e3d030ab1fec45a4de04dcadc;hp=b75dc26bc39ed939e1d87331c5b5ef5e4da39767;hpb=290553b6d637779cb733549a582230437545d335;p=mesa.git diff --git a/src/gallium/state_trackers/hgl/hgl.c b/src/gallium/state_trackers/hgl/hgl.c index b75dc26bc39..bbc477a978c 100644 --- a/src/gallium/state_trackers/hgl/hgl.c +++ b/src/gallium/state_trackers/hgl/hgl.c @@ -7,16 +7,18 @@ * Alexander von Gluck IV, kallisti5@unixzen.com */ +#include "hgl_context.h" -#include "GLView.h" +#include #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) {