summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/hgl
diff options
context:
space:
mode:
authorAlexander von Gluck IV <kallisti5@unixzen.com>2014-08-29 14:42:26 +0000
committerAlexander von Gluck IV <kallisti5@unixzen.com>2014-08-30 19:35:24 -0400
commit15da8d076110c39d3ce34ac45edf0f3c9ab13b7f (patch)
treeeee3ab31602a599dd55b64b8eebb4cc48ad7b149 /src/gallium/state_trackers/hgl
parentc06afcede2a0cf214aadc7d4ea149b361ee56ad2 (diff)
downloadexternal_mesa3d-15da8d076110c39d3ce34ac45edf0f3c9ab13b7f.zip
external_mesa3d-15da8d076110c39d3ce34ac45edf0f3c9ab13b7f.tar.gz
external_mesa3d-15da8d076110c39d3ce34ac45edf0f3c9ab13b7f.tar.bz2
st/hgl: Move st_manager create/destroy into hgl state_tracker
Diffstat (limited to 'src/gallium/state_trackers/hgl')
-rw-r--r--src/gallium/state_trackers/hgl/hgl.c50
-rw-r--r--src/gallium/state_trackers/hgl/hgl_context.h5
2 files changed, 54 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/hgl/hgl.c b/src/gallium/state_trackers/hgl/hgl.c
index 8dcd6e3..66abc61 100644
--- a/src/gallium/state_trackers/hgl/hgl.c
+++ b/src/gallium/state_trackers/hgl/hgl.c
@@ -131,6 +131,23 @@ hgl_st_framebuffer_validate(struct st_context_iface *stctx,
}
+static int
+hgl_st_manager_get_param(struct st_manager *smapi, enum st_manager_param param)
+{
+ CALLED();
+
+ switch (param) {
+ case ST_MANAGER_BROKEN_INVALIDATE:
+ TRACE("%s: TODO: How should we handle BROKEN_INVALIDATE calls?\n",
+ __func__);
+ // For now we force validation of the framebuffer.
+ return 1;
+ }
+
+ return 0;
+}
+
+
/**
* Create new framebuffer
*/
@@ -148,7 +165,7 @@ hgl_create_st_framebuffer(struct hgl_context* context)
// Copy context visual into framebuffer
memcpy(&buffer->visual, context->stVisual, sizeof(struct st_visual));
- // calloc our st_framebuffer interface
+ // calloc and configure our st_framebuffer interface
buffer->stfbi = CALLOC_STRUCT(st_framebuffer_iface);
if (!buffer->stfbi) {
ERROR("%s: Couldn't calloc framebuffer!\n", __func__);
@@ -167,3 +184,34 @@ hgl_create_st_framebuffer(struct hgl_context* context)
return buffer;
}
+
+
+struct st_manager *
+hgl_create_st_manager(struct pipe_screen* screen)
+{
+ CALLED();
+
+ assert(screen);
+ struct st_manager* manager = CALLOC_STRUCT(st_manager);
+
+ if (!manager) {
+ ERROR("%s: Couldn't allocate state tracker manager!\n", __func__);
+ return NULL;
+ }
+
+ //manager->display = dpy;
+ manager->screen = screen;
+ manager->get_param = hgl_st_manager_get_param;
+
+ return manager;
+}
+
+
+void
+hgl_destroy_st_manager(struct st_manager *manager)
+{
+ CALLED();
+
+ if (manager)
+ FREE(manager);
+}
diff --git a/src/gallium/state_trackers/hgl/hgl_context.h b/src/gallium/state_trackers/hgl/hgl_context.h
index f1f43fa..a520d49 100644
--- a/src/gallium/state_trackers/hgl/hgl_context.h
+++ b/src/gallium/state_trackers/hgl/hgl_context.h
@@ -73,7 +73,12 @@ struct hgl_context
};
+// hgl state_tracker framebuffer
struct hgl_buffer* hgl_create_st_framebuffer(struct hgl_context* context);
+// hgl state_tracker manager
+struct st_manager* hgl_create_st_manager(struct pipe_screen* screen);
+void hgl_destroy_st_manager(struct st_manager *manager);
+
#endif /* HGL_CONTEXT_H */