Mesa (master): haiku: Fix build through scons corrections and viewport fixes
Alexander von Gluck IV
kallisti5 at kemper.freedesktop.org
Tue Mar 25 00:01:57 UTC 2014
Module: Mesa
Branch: master
Commit: 7683fce8781ef0169333c5ee1276392d058cfaa8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7683fce8781ef0169333c5ee1276392d058cfaa8
Author: Alexander von Gluck IV <kallisti5 at unixzen.com>
Date: Wed Mar 19 00:58:01 2014 +0000
haiku: Fix build through scons corrections and viewport fixes
* Add HAVE_PTHREAD, we do have pthread support wrappers now for
non-native Haiku threaded applications.
* Viewport changed behavior recently breaking the build.
We fix this by looking at the gl_context ViewportArray
(Thanks Brian for the idea)
Acked-by: Brian Paul <brianp at vmware.com>
---
scons/gallium.py | 5 +++++
src/gallium/targets/haiku-softpipe/GalliumContext.cpp | 12 +++++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/scons/gallium.py b/scons/gallium.py
index f505a62..e11d4db 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -269,6 +269,11 @@ def generate(env):
cppdefines += ['HAVE_ALIAS']
else:
cppdefines += ['GLX_ALIAS_UNSUPPORTED']
+ if env['platform'] == 'haiku':
+ cppdefines += [
+ 'HAVE_PTHREAD',
+ 'HAVE_POSIX_MEMALIGN'
+ ]
if platform == 'windows':
cppdefines += [
'WIN32',
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
index 1078cb7..52cd764 100644
--- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
@@ -44,9 +44,15 @@ extern "C" {
static void
-hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
- GLsizei width, GLsizei height)
+hgl_viewport(struct gl_context* glContext)
{
+ // TODO: We should try to eliminate this function
+
+ GLint x = glContext->ViewportArray[0].X;
+ GLint y = glContext->ViewportArray[0].Y;
+ GLint width = glContext->ViewportArray[0].Width;
+ GLint height = glContext->ViewportArray[0].Height;
+
TRACE("%s(glContext: %p, x: %d, y: %d, w: %d, h: %d\n", __func__,
glContext, x, y, width, height);
@@ -525,7 +531,7 @@ GalliumContext::ResizeViewport(int32 width, int32 height)
for (context_id i = 0; i < CONTEXT_MAX; i++) {
if (fContext[i] && fContext[i]->st) {
struct st_context *stContext = (struct st_context*)fContext[i]->st;
- _mesa_set_viewport(stContext->ctx, 0, 0, width, height);
+ _mesa_set_viewport(stContext->ctx, 0, 0, 0, width, height);
st_manager_validate_framebuffers(stContext);
}
}
More information about the mesa-commit
mailing list