From c146f64a63203e41eab2ea7cce6b1a323483bdaa Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Thu, 9 Apr 2009 00:35:23 +0000 Subject: [PATCH] * 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 --- src/kits/opengl/Jamfile | 8 +++---- src/kits/opengl/mesa/Jamfile | 32 +++++++++++++++++---------- src/kits/opengl/mesa/glapi/glthread.h | 18 +++------------ 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/kits/opengl/Jamfile b/src/kits/opengl/Jamfile index 3c405491fa..5a066fba5a 100644 --- a/src/kits/opengl/Jamfile +++ b/src/kits/opengl/Jamfile @@ -29,6 +29,8 @@ UseHeaders [ FDirName $(SUBDIR) mesa swrast_setup ] ; } else if $(TARGET_ARCH) = ppc { # Not yet supported, as current Mesa3D PPC assembly is Linux-dependent! # defines += USE_PPC_ASM ; + } else if $(TARGET_ARCH) = sparc { + defines += USE_SPARC_ASM ; } defines = [ FDefines $(defines) ] ; @@ -44,8 +46,8 @@ SharedLibrary libGL.so : : - # Mesa optimized GL dispatching code (if any) for this target architecture - mesa_arch_$(TARGET_ARCH).o + # Mesa GL API dispatching code + glapi-dispatching.o # GLU API is included in libGL.so under BeOS R5, not a separate libglu.so library 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.o - libmesa.a # For GL API dispatching, mostly - # External libs: be game # BWindowScreen needed by BGLScreen stub class diff --git a/src/kits/opengl/mesa/Jamfile b/src/kits/opengl/mesa/Jamfile index 2d9055f771..faf617ae2d 100644 --- a/src/kits/opengl/mesa/Jamfile +++ b/src/kits/opengl/mesa/Jamfile @@ -62,9 +62,11 @@ actions MkMaTypes1 if $(TARGET_ARCH) = x86 { 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! # defines += USE_PPC_ASM ; + } else if $(TARGET_ARCH) = sparc { + defines += USE_SPARC_ASM ; } defines = [ FDefines $(defines) ] ; @@ -115,18 +117,21 @@ if $(TARGET_ARCH) = x86 { arch_sources = common_ppc.c - t_vtx_generic.c ; + SEARCH_SOURCE += [ FDirName $(SUBDIR) ppc ] ; + } else if $(TARGET_ARCH) = sparc { arch_sources = sparc.c - t_vtx_generic.c + clip.S + norm.S + xform.S ; -} else { - arch_sources = t_vtx_generic.c ; + SEARCH_SOURCE += [ FDirName $(SUBDIR) sparc ] ; + } @@ -330,24 +335,27 @@ StaticLibrary libmesa.a : vbo_split_copy.c vbo_split_inplace.c + # arch specific assembly optimization $(arch_sources) - - # glapi - glapi.c - glthread.c ; local arch_sources ; +# Use the faster GL API dispatching assembly code for the platform, if any! if $(TARGET_ARCH) = x86 { - # On x86 platform, use the faster GL API dispatching assembly code! arch_sources = glapi_x86.S ; +} else if $(TARGET_ARCH) = sparc { + arch_sources = glapi_sparc.S ; } else { - # For non-X86 platforms, no assembly code yet. arch_sources = ; } -MergeObject mesa_arch_$(TARGET_ARCH).o : +MergeObject glapi-dispatching.o : + + dispatch.c + glapi.c + glthread.c + $(arch_sources) ; diff --git a/src/kits/opengl/mesa/glapi/glthread.h b/src/kits/opengl/mesa/glapi/glthread.h index 8594a90b60..796db8ec21 100644 --- a/src/kits/opengl/mesa/glapi/glthread.h +++ b/src/kits/opengl/mesa/glapi/glthread.h @@ -221,24 +221,12 @@ typedef xmutex_rec _glthread_Mutex; /* - * BeOS threads. R5.x required. + * BeOS threads. R5.x or sooner required. */ #ifdef BEOS_THREADS -/* Problem with OS.h and this file on haiku */ -#ifndef __HAIKU__ -#include -#endif - -#include - -/* 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 +#include +#include typedef struct { int32 key;