summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/haiku-softpipe
diff options
context:
space:
mode:
authorAlexander von Gluck IV <kallisti5@unixzen.com>2015-05-14 17:30:35 -0500
committerAlexander von Gluck IV <kallisti5@unixzen.com>2015-05-15 13:55:59 -0400
commit7de484871dae1643cbecf346066968f61684f06f (patch)
tree4fbd6c5600b28385401252bb03e56dbaf6164b70 /src/gallium/targets/haiku-softpipe
parent9b5da7f06a4052b1298e4684d992a319fb4153ba (diff)
downloadexternal_mesa3d-7de484871dae1643cbecf346066968f61684f06f.zip
external_mesa3d-7de484871dae1643cbecf346066968f61684f06f.tar.gz
external_mesa3d-7de484871dae1643cbecf346066968f61684f06f.tar.bz2
target/haiku-softpipe: Move api init into st code
We also reduce the amount of need-to-know information about st_api to require one less extern "C" in st_manager.h Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/targets/haiku-softpipe')
-rw-r--r--src/gallium/targets/haiku-softpipe/GalliumContext.cpp23
-rw-r--r--src/gallium/targets/haiku-softpipe/GalliumContext.h6
2 files changed, 10 insertions, 19 deletions
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
index b24aef7..1e3874b 100644
--- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
@@ -15,14 +15,13 @@
#include "GLView.h"
#include "bitmap_wrapper.h"
-extern "C" {
+
#include "glapi/glapi.h"
#include "pipe/p_format.h"
-#include "state_tracker/st_cb_fbo.h"
-#include "state_tracker/st_cb_flush.h"
+//#include "state_tracker/st_cb_fbo.h"
+//#include "state_tracker/st_cb_flush.h"
#include "state_tracker/st_context.h"
#include "state_tracker/st_gl_api.h"
-#include "state_tracker/st_manager.h"
#include "state_tracker/sw_winsys.h"
#include "sw/hgl/hgl_sw_winsys.h"
#include "util/u_atomic.h"
@@ -30,7 +29,6 @@ extern "C" {
#include "target-helpers/inline_sw_helper.h"
#include "target-helpers/inline_debug_helper.h"
-}
#ifdef DEBUG
@@ -127,7 +125,8 @@ GalliumContext::CreateContext(Bitmap *bitmap)
context->read = NULL;
context->st = NULL;
- context->api = st_gl_api_create();
+ // Create st_gl_api
+ context->api = hgl_create_st_api();
if (!context->api) {
ERROR("%s: Couldn't obtain Mesa state tracker API!\n", __func__);
return -1;
@@ -159,12 +158,10 @@ GalliumContext::CreateContext(Bitmap *bitmap)
attribs.minor = 0;
//attribs.flags |= ST_CONTEXT_FLAG_DEBUG;
- struct st_api* api = context->api;
-
// Create context using state tracker api call
enum st_context_error result;
- context->st = api->create_context(api, context->manager, &attribs,
- &result, context->st);
+ context->st = context->api->create_context(context->api, context->manager,
+ &attribs, &result, context->st);
if (!context->st) {
ERROR("%s: Couldn't create mesa state tracker context!\n",
@@ -289,10 +286,8 @@ GalliumContext::SetCurrentContext(Bitmap *bitmap, context_id contextID)
return B_ERROR;
}
- struct st_api* api = context->api;
-
if (!bitmap) {
- api->make_current(context->api, NULL, NULL, NULL);
+ context->api->make_current(context->api, NULL, NULL, NULL);
return B_OK;
}
@@ -305,7 +300,7 @@ GalliumContext::SetCurrentContext(Bitmap *bitmap, context_id contextID)
}
// We need to lock and unlock framebuffers before accessing them
- api->make_current(context->api, context->st, context->draw->stfbi,
+ context->api->make_current(context->api, context->st, context->draw->stfbi,
context->read->stfbi);
//if (context->textures[ST_ATTACHMENT_BACK_LEFT]
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.h b/src/gallium/targets/haiku-softpipe/GalliumContext.h
index b50d528..22076cb 100644
--- a/src/gallium/targets/haiku-softpipe/GalliumContext.h
+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.h
@@ -12,14 +12,10 @@
#include <stddef.h>
#include <kernel/image.h>
-extern "C" {
-//#include "state_tracker/st_api.h"
#include "pipe/p_compiler.h"
#include "pipe/p_screen.h"
#include "postprocess/filters.h"
-#include "os/os_thread.h"
#include "hgl_context.h"
-}
#include "bitmap_wrapper.h"
@@ -56,6 +52,6 @@ private:
context_id fCurrentContext;
pipe_mutex fMutex;
};
-
+
#endif /* GALLIUMCONTEXT_H */