* Reworked Mesa's GL API dispatching/implementation separation:
Before, it was spread in libmesa.a *and* mesa_arch_$(TARGET_ARCH).o, the later was broken for non-x86 targets. Now, GL API dispatching is entirely in glapi-dispatching.o, while libmesa.a contains only the software GL implementation. * This should fix PPC libGL.so build - UNTESTED * Added SPARC assembly code introduced by Mesa 7.2 and sooner - UNTESTED * Removed a non-longer need workaround in glthread.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30050 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -29,6 +29,8 @@ UseHeaders [ FDirName $(SUBDIR) mesa swrast_setup ] ;
|
|||||||
} else if $(TARGET_ARCH) = ppc {
|
} else if $(TARGET_ARCH) = ppc {
|
||||||
# Not yet supported, as current Mesa3D PPC assembly is Linux-dependent!
|
# Not yet supported, as current Mesa3D PPC assembly is Linux-dependent!
|
||||||
# defines += USE_PPC_ASM ;
|
# defines += USE_PPC_ASM ;
|
||||||
|
} else if $(TARGET_ARCH) = sparc {
|
||||||
|
defines += USE_SPARC_ASM ;
|
||||||
}
|
}
|
||||||
|
|
||||||
defines = [ FDefines $(defines) ] ;
|
defines = [ FDefines $(defines) ] ;
|
||||||
@@ -44,8 +46,8 @@ SharedLibrary libGL.so :
|
|||||||
|
|
||||||
:
|
:
|
||||||
|
|
||||||
# Mesa optimized GL dispatching code (if any) for this target architecture
|
# Mesa GL API dispatching code
|
||||||
<opengl>mesa_arch_$(TARGET_ARCH).o
|
<mesa>glapi-dispatching.o
|
||||||
|
|
||||||
# GLU API is included in libGL.so under BeOS R5, not a separate libglu.so library
|
# GLU API is included in libGL.so under BeOS R5, not a separate libglu.so library
|
||||||
<opengl>sgi-glu.o
|
<opengl>sgi-glu.o
|
||||||
@@ -53,8 +55,6 @@ SharedLibrary libGL.so :
|
|||||||
# GLUT API is included in libGL.so under Haiku, not a separate libglut.so library
|
# GLUT API is included in libGL.so under Haiku, not a separate libglut.so library
|
||||||
<opengl>glut.o
|
<opengl>glut.o
|
||||||
|
|
||||||
libmesa.a # For GL API dispatching, mostly
|
|
||||||
|
|
||||||
# External libs:
|
# External libs:
|
||||||
be
|
be
|
||||||
game # BWindowScreen needed by BGLScreen stub class
|
game # BWindowScreen needed by BGLScreen stub class
|
||||||
|
|||||||
@@ -62,9 +62,11 @@ actions MkMaTypes1
|
|||||||
|
|
||||||
if $(TARGET_ARCH) = x86 {
|
if $(TARGET_ARCH) = x86 {
|
||||||
defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ;
|
defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ;
|
||||||
} else {
|
} else if $(TARGET_ARCH) = ppc {
|
||||||
# Not yet supported, as current Mesa3D PPC assembly is Linux-dependent!
|
# Not yet supported, as current Mesa3D PPC assembly is Linux-dependent!
|
||||||
# defines += USE_PPC_ASM ;
|
# defines += USE_PPC_ASM ;
|
||||||
|
} else if $(TARGET_ARCH) = sparc {
|
||||||
|
defines += USE_SPARC_ASM ;
|
||||||
}
|
}
|
||||||
|
|
||||||
defines = [ FDefines $(defines) ] ;
|
defines = [ FDefines $(defines) ] ;
|
||||||
@@ -115,18 +117,21 @@ if $(TARGET_ARCH) = x86 {
|
|||||||
|
|
||||||
arch_sources =
|
arch_sources =
|
||||||
common_ppc.c
|
common_ppc.c
|
||||||
t_vtx_generic.c
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) ppc ] ;
|
||||||
|
|
||||||
} else if $(TARGET_ARCH) = sparc {
|
} else if $(TARGET_ARCH) = sparc {
|
||||||
|
|
||||||
arch_sources =
|
arch_sources =
|
||||||
sparc.c
|
sparc.c
|
||||||
t_vtx_generic.c
|
clip.S
|
||||||
|
norm.S
|
||||||
|
xform.S
|
||||||
;
|
;
|
||||||
|
|
||||||
} else {
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) sparc ] ;
|
||||||
arch_sources = t_vtx_generic.c ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -330,24 +335,27 @@ StaticLibrary libmesa.a :
|
|||||||
vbo_split_copy.c
|
vbo_split_copy.c
|
||||||
vbo_split_inplace.c
|
vbo_split_inplace.c
|
||||||
|
|
||||||
|
# arch specific assembly optimization
|
||||||
$(arch_sources)
|
$(arch_sources)
|
||||||
|
|
||||||
# glapi
|
|
||||||
glapi.c
|
|
||||||
glthread.c
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
local arch_sources ;
|
local arch_sources ;
|
||||||
|
# Use the faster GL API dispatching assembly code for the platform, if any!
|
||||||
if $(TARGET_ARCH) = x86 {
|
if $(TARGET_ARCH) = x86 {
|
||||||
# On x86 platform, use the faster GL API dispatching assembly code!
|
|
||||||
arch_sources = glapi_x86.S ;
|
arch_sources = glapi_x86.S ;
|
||||||
|
} else if $(TARGET_ARCH) = sparc {
|
||||||
|
arch_sources = glapi_sparc.S ;
|
||||||
} else {
|
} else {
|
||||||
# For non-X86 platforms, no assembly code yet.
|
|
||||||
arch_sources = ;
|
arch_sources = ;
|
||||||
}
|
}
|
||||||
|
|
||||||
MergeObject <opengl>mesa_arch_$(TARGET_ARCH).o :
|
MergeObject <mesa>glapi-dispatching.o :
|
||||||
|
|
||||||
|
dispatch.c
|
||||||
|
glapi.c
|
||||||
|
glthread.c
|
||||||
|
|
||||||
$(arch_sources)
|
$(arch_sources)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -221,24 +221,12 @@ typedef xmutex_rec _glthread_Mutex;
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BeOS threads. R5.x required.
|
* BeOS threads. R5.x or sooner required.
|
||||||
*/
|
*/
|
||||||
#ifdef BEOS_THREADS
|
#ifdef BEOS_THREADS
|
||||||
|
|
||||||
/* Problem with OS.h and this file on haiku */
|
#include <OS.h>
|
||||||
#ifndef __HAIKU__
|
#include <TLS.h>
|
||||||
#include <kernel/OS.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <support/TLS.h>
|
|
||||||
|
|
||||||
/* The only two typedefs required here
|
|
||||||
* this is cause of the OS.h problem
|
|
||||||
*/
|
|
||||||
#ifdef __HAIKU__
|
|
||||||
typedef int32 thread_id;
|
|
||||||
typedef int32 sem_id;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32 key;
|
int32 key;
|
||||||
|
|||||||
Reference in New Issue
Block a user