From 3b6857e97490663ee5e4de288d1d89d9b4ce57f8 Mon Sep 17 00:00:00 2001 From: Gregor Anich Date: Fri, 4 Nov 2005 14:52:02 +0000 Subject: [PATCH] Put back reactos specific changes from old mesa32 directory. svn path=/trunk/; revision=18991 --- reactos/lib/mesa32/README.ReactOS | 8 + reactos/lib/mesa32/include/GL/gl.h | 4 +- reactos/lib/mesa32/include/GL/mesa_wgl.h | 6 +- reactos/lib/mesa32/include/GL/wmesa.h | 2 +- reactos/lib/mesa32/mesa32.def | 110 +++++++++ reactos/lib/mesa32/mesa32.xml | 209 ++++++++++++++++++ .../mesa32/src/drivers/windows/gdi/wmesa.c | 10 +- .../mesa32/src/drivers/windows/gdi/wmesadef.h | 2 +- reactos/lib/mesa32/src/main/glheader.h | 4 +- .../lib/mesa32/src/main/texcompress_s3tc.c | 8 +- reactos/lib/mesa32/src/main/texformat_tmp.h | 44 ++-- reactos/lib/mesa32/src/x86/common_x86.c | 68 ++++++ reactos/lib/mesa32/src/x86/glapi_x86.S | 2 +- 13 files changed, 432 insertions(+), 45 deletions(-) create mode 100644 reactos/lib/mesa32/README.ReactOS create mode 100644 reactos/lib/mesa32/mesa32.def create mode 100644 reactos/lib/mesa32/mesa32.xml diff --git a/reactos/lib/mesa32/README.ReactOS b/reactos/lib/mesa32/README.ReactOS new file mode 100644 index 00000000000..bed2fc32c90 --- /dev/null +++ b/reactos/lib/mesa32/README.ReactOS @@ -0,0 +1,8 @@ +This is Mesa-6.2 (http://www.mesa3d.org/) with an ICD interface. + +The ICD functions are in src/drivers/windows/icd/icd.c +I have created a new Makefile for ReactOS which will build Mesa with the ICD +interface. I have not adjusted the Visual C++ project/workspace files. + + --blight + diff --git a/reactos/lib/mesa32/include/GL/gl.h b/reactos/lib/mesa32/include/GL/gl.h index 3f3f310f855..2bfdb693342 100644 --- a/reactos/lib/mesa32/include/GL/gl.h +++ b/reactos/lib/mesa32/include/GL/gl.h @@ -53,9 +53,9 @@ #endif #if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) -# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ # define GLAPI __declspec(dllimport) # else /* for use with static link lib build of Win32 edition only */ # define GLAPI extern diff --git a/reactos/lib/mesa32/include/GL/mesa_wgl.h b/reactos/lib/mesa32/include/GL/mesa_wgl.h index a331bb3514b..21473763ed5 100644 --- a/reactos/lib/mesa32/include/GL/mesa_wgl.h +++ b/reactos/lib/mesa32/include/GL/mesa_wgl.h @@ -32,7 +32,7 @@ #define _mesa_wgl_h_ -#include +#include #ifdef __cplusplus extern "C" { @@ -40,10 +40,10 @@ extern "C" { #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) # define WGLAPI __declspec(dllexport) -# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ # define GLAPI __declspec(dllimport) # define WGLAPI __declspec(dllimport) # else /* for use with static link lib build of Win32 edition only */ diff --git a/reactos/lib/mesa32/include/GL/wmesa.h b/reactos/lib/mesa32/include/GL/wmesa.h index 79b3c823029..0a6e8b64246 100644 --- a/reactos/lib/mesa32/include/GL/wmesa.h +++ b/reactos/lib/mesa32/include/GL/wmesa.h @@ -50,7 +50,7 @@ extern "C" { #endif -#include "gl\gl.h" +#include "GL/gl.h" #if defined(_MSV_VER) && !defined(__GNUC__) # pragma warning (disable:4273) diff --git a/reactos/lib/mesa32/mesa32.def b/reactos/lib/mesa32/mesa32.def new file mode 100644 index 00000000000..263b9d48401 --- /dev/null +++ b/reactos/lib/mesa32/mesa32.def @@ -0,0 +1,110 @@ +DESCRIPTION 'Mesa (OpenGL driver) for Win32' +VERSION 6.1 + +EXPORTS +; +; ICD API + DrvCopyContext + DrvCreateContext + DrvCreateLayerContext + DrvDeleteContext + DrvDescribeLayerPlane + DrvDescribePixelFormat + DrvGetLayerPaletteEntries + DrvGetProcAddress + DrvReleaseContext + DrvRealizeLayerPalette + DrvSetContext + DrvSetLayerPaletteEntries + DrvSetPixelFormat + DrvShareLists + DrvSwapBuffers + DrvSwapLayerBuffers + DrvValidateVersion + +; +; Mesa internals - mostly for OSMESA + _ac_CreateContext + _ac_DestroyContext + _ac_InvalidateState + _glapi_get_context + _glapi_get_proc_address + _mesa_buffer_data + _mesa_buffer_map + _mesa_buffer_subdata + _mesa_bzero + _mesa_calloc + _mesa_choose_tex_format + _mesa_compressed_texture_size + _mesa_create_framebuffer + _mesa_create_visual + _mesa_delete_buffer_object + _mesa_delete_texture_object + _mesa_destroy_framebuffer + _mesa_destroy_visual + _mesa_enable_1_3_extensions + _mesa_enable_1_4_extensions + _mesa_enable_1_5_extensions + _mesa_enable_sw_extensions + _mesa_error + _mesa_free + _mesa_free_context_data + _mesa_get_current_context + _mesa_init_default_imports + _mesa_init_driver_functions + _mesa_initialize_context + _mesa_make_current + _mesa_memcpy + _mesa_memset + _mesa_new_buffer_object + _mesa_new_texture_object + _mesa_problem + _mesa_ResizeBuffersMESA + _mesa_store_compressed_teximage1d + _mesa_store_compressed_teximage2d + _mesa_store_compressed_teximage3d + _mesa_store_compressed_texsubimage1d + _mesa_store_compressed_texsubimage2d + _mesa_store_compressed_texsubimage3d + _mesa_store_teximage1d + _mesa_store_teximage2d + _mesa_store_teximage3d + _mesa_store_texsubimage1d + _mesa_store_texsubimage2d + _mesa_store_texsubimage3d + _mesa_strcmp + _mesa_test_proxy_teximage + _mesa_Viewport + _swrast_Accum + _swrast_alloc_buffers + _swrast_Bitmap + _swrast_CopyPixels + _swrast_DrawBuffer + _swrast_DrawPixels + _swrast_GetDeviceDriverReference + _swrast_Clear + _swrast_choose_line + _swrast_choose_triangle + _swrast_CopyColorSubTable + _swrast_CopyColorTable + _swrast_CopyConvolutionFilter1D + _swrast_CopyConvolutionFilter2D + _swrast_copy_teximage1d + _swrast_copy_teximage2d + _swrast_copy_texsubimage1d + _swrast_copy_texsubimage2d + _swrast_copy_texsubimage3d + _swrast_CreateContext + _swrast_DestroyContext + _swrast_InvalidateState + _swrast_ReadPixels + _swrast_zbuffer_address + _swsetup_Wakeup + _swsetup_CreateContext + _swsetup_DestroyContext + _swsetup_InvalidateState + _tnl_CreateContext + _tnl_DestroyContext + _tnl_InvalidateState + _tnl_MakeCurrent + _tnl_run_pipeline diff --git a/reactos/lib/mesa32/mesa32.xml b/reactos/lib/mesa32/mesa32.xml new file mode 100644 index 00000000000..f0ebc93d74c --- /dev/null +++ b/reactos/lib/mesa32/mesa32.xml @@ -0,0 +1,209 @@ + + + -Wl,--enable-stdcall-fixup + include + src + src/main + src/glapi + src/math + src/tnl + src/shader + src/swrast + src/swrast_setup + + + + + + + + + + ntdll + kernel32 + gdi32 + + + ac_context.c + ac_import.c + + + + driverfuncs.c + + + + wmesa.c + + + icd.c + + + + + glapi.c + glthread.c + + + api_arrayelt.c + api_loopback.c + api_noop.c + api_validate.c + accum.c + attrib.c + blend.c + bufferobj.c + buffers.c + clip.c + colortab.c + context.c + convolve.c + debug.c + depth.c + dispatch.c + dlist.c + drawpix.c + enable.c + enums.c + eval.c + extensions.c + feedback.c + fog.c + get.c + hash.c + hint.c + histogram.c + image.c + imports.c + light.c + lines.c + matrix.c + occlude.c + pixel.c + points.c + polygon.c + rastpos.c + state.c + stencil.c + texcompress.c + texcompress_s3tc.c + texcompress_fxt1.c + texformat.c + teximage.c + texobj.c + texstate.c + texstore.c + varray.c + vtxfmt.c + + + m_debug_clip.c + m_debug_norm.c + m_debug_xform.c + m_eval.c + m_matrix.c + m_translate.c + m_vector.c + m_xform.c + + + s_fragprog_to_c.c + s_aaline.c + s_aatriangle.c + s_accum.c + s_alpha.c + s_alphabuf.c + s_auxbuffer.c + s_bitmap.c + s_blend.c + s_buffers.c + s_copypix.c + s_context.c + s_depth.c + s_drawpix.c + s_feedback.c + s_fog.c + s_imaging.c + s_lines.c + s_logic.c + s_masking.c + s_nvfragprog.c + s_pixeltex.c + s_points.c + s_readpix.c + s_span.c + s_stencil.c + s_tcc.c + s_texture.c + s_texstore.c + s_triangle.c + s_zoom.c + + + ss_context.c + ss_triangle.c + + + arbfragparse.c + arbprogparse.c + arbprogram.c + arbvertparse.c + grammar_mesa.c + nvfragparse.c + nvprogram.c + nvvertexec.c + nvvertparse.c + program.c + + + t_array_api.c + t_array_import.c + t_context.c + t_pipeline.c + t_save_api.c + t_save_loopback.c + t_save_playback.c + t_vb_fog.c + t_vb_light.c + t_vb_normals.c + t_vb_points.c + t_vb_program.c + t_vb_render.c + t_vb_texgen.c + t_vb_texmat.c + t_vb_vertex.c + t_vertex.c + t_vertex_c.c + t_vertex_codegen.c + t_vtx_api.c + t_vtx_generic.c + t_vtx_eval.c + t_vtx_exec.c + t_vtx_x86.c + t_vtx_x86_gcc.S + + + 3dnow.c + 3dnow_normal.S + 3dnow_xform1.S + 3dnow_xform2.S + 3dnow_xform3.S + 3dnow_xform4.S + common_x86.c + common_x86_asm.S + glapi_x86.S + mmx_blend.S + sse.c + sse_normal.S + sse_xform1.S + sse_xform2.S + sse_xform3.S + sse_xform4.S + x86.c + x86_xform2.S + x86_xform3.S + x86_xform4.S + x86_cliptest.S + + + diff --git a/reactos/lib/mesa32/src/drivers/windows/gdi/wmesa.c b/reactos/lib/mesa32/src/drivers/windows/gdi/wmesa.c index ea13a31c42b..09040c519ea 100644 --- a/reactos/lib/mesa32/src/drivers/windows/gdi/wmesa.c +++ b/reactos/lib/mesa32/src/drivers/windows/gdi/wmesa.c @@ -18,7 +18,7 @@ * Updated for Mesa 4.0 by Karl Schultz (kschultz@sourceforge.net) */ -#ifdef NDEBUG +#if defined(NDEBUG) && defined(_MSC_VER) #pragma auto_inline(on) #pragma inline_depth(255) #pragma inline_recursion(on) @@ -72,7 +72,7 @@ /* Stereo and parallel not tested for Mesa 4.0. */ #define NO_STEREO #if !defined(NO_STEREO) -#include "gl\glu.h" +#include "GL/glu.h" #include "stereo.h" #endif @@ -112,6 +112,8 @@ WMesaContext WC = NULL; #if defined(_MSC_VER) && _MSC_VER >= 1200 #define FORCEINLINE __forceinline +#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#define FORCEINLINE __attribute__((always_inline)) #else #define FORCEINLINE __inline #endif @@ -470,7 +472,7 @@ static void clear(GLcontext* ctx, GLbitfield mask, mask &= ~DD_BACK_LEFT_BIT; #endif // DDRAW #else - DWORD dwColor; + DWORD dwColor = 0; WORD wColor; BYTE bColor; LPDWORD lpdw = (LPDWORD)Current->pbPixels; @@ -521,8 +523,6 @@ static void clear(GLcontext* ctx, GLbitfield mask, GetGValue(Current->clearpixel), GetBValue(Current->clearpixel)); } - else - dwColor = 0; if (nBypp != 3) { diff --git a/reactos/lib/mesa32/src/drivers/windows/gdi/wmesadef.h b/reactos/lib/mesa32/src/drivers/windows/gdi/wmesadef.h index 3c267aa0f6a..d43e990ed3c 100644 --- a/reactos/lib/mesa32/src/drivers/windows/gdi/wmesadef.h +++ b/reactos/lib/mesa32/src/drivers/windows/gdi/wmesadef.h @@ -70,7 +70,7 @@ #include -#include +#include #include "context.h" #ifdef DDRAW #define DIRECTDRAW_VERSION 0x0100 diff --git a/reactos/lib/mesa32/src/main/glheader.h b/reactos/lib/mesa32/src/main/glheader.h index 025b3a5857d..e1315aff8a7 100644 --- a/reactos/lib/mesa32/src/main/glheader.h +++ b/reactos/lib/mesa32/src/main/glheader.h @@ -98,10 +98,10 @@ # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ # endif # endif -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) # define WGLAPI __declspec(dllexport) -# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ # define GLAPI __declspec(dllimport) # define WGLAPI __declspec(dllimport) # else /* for use with static link lib build of Win32 edition only */ diff --git a/reactos/lib/mesa32/src/main/texcompress_s3tc.c b/reactos/lib/mesa32/src/main/texcompress_s3tc.c index 572cdd25614..9644c5def18 100644 --- a/reactos/lib/mesa32/src/main/texcompress_s3tc.c +++ b/reactos/lib/mesa32/src/main/texcompress_s3tc.c @@ -286,7 +286,7 @@ fetch_texel_2d_f_rgb_dxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; + GLchan rgba[4] = {0, 0, 0, 0}; fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); @@ -308,7 +308,7 @@ fetch_texel_2d_f_rgba_dxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; + GLchan rgba[4] = {0, 0, 0, 0}; fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); @@ -330,7 +330,7 @@ fetch_texel_2d_f_rgba_dxt3( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; + GLchan rgba[4] = {0, 0, 0, 0}; fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); @@ -352,7 +352,7 @@ fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { /* just sample as GLchan and convert to float here */ - GLchan rgba[4]; + GLchan rgba[4] = {0, 0, 0, 0}; fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); diff --git a/reactos/lib/mesa32/src/main/texformat_tmp.h b/reactos/lib/mesa32/src/main/texformat_tmp.h index d341c7864ae..5a920a8094e 100644 --- a/reactos/lib/mesa32/src/main/texformat_tmp.h +++ b/reactos/lib/mesa32/src/main/texformat_tmp.h @@ -1,6 +1,7 @@ +/* $XFree86$ */ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.2 * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * @@ -44,46 +45,34 @@ #if DIM == 1 #define CHAN_SRC( t, i, j, k, sz ) \ - ((void) (j), (void) (k), \ - ((GLchan *)(t)->Data + (i) * (sz))) + ((GLchan *)(t)->Data + (i) * (sz)) #define UBYTE_SRC( t, i, j, k, sz ) \ - ((void) (j), (void) (k), \ - ((GLubyte *)(t)->Data + (i) * (sz))) + ((GLubyte *)(t)->Data + (i) * (sz)) #define USHORT_SRC( t, i, j, k ) \ - ((void) (j), (void) (k), \ - ((GLushort *)(t)->Data + (i))) + ((GLushort *)(t)->Data + (i)) #define UINT_SRC( t, i, j, k ) \ - ((void) (j), (void) (k), \ - ((GLuint *)(t)->Data + (i))) + ((GLuint *)(t)->Data + (i)) #define FLOAT_SRC( t, i, j, k, sz ) \ - ((void) (j), (void) (k), \ - ((GLfloat *)(t)->Data + (i) * (sz))) + ((GLfloat *)(t)->Data + (i) * (sz)) #define HALF_SRC( t, i, j, k, sz ) \ - ((void) (j), (void) (k), \ - ((GLhalfARB *)(t)->Data + (i) * (sz))) + ((GLhalfARB *)(t)->Data + (i) * (sz)) #define FETCH(x) fetch_texel_1d_##x #elif DIM == 2 #define CHAN_SRC( t, i, j, k, sz ) \ - ((void) (k), \ - ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) + ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) #define UBYTE_SRC( t, i, j, k, sz ) \ - ((void) (k), \ - ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) + ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) #define USHORT_SRC( t, i, j, k ) \ - ((void) (k), \ - ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i)))) + ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i))) #define UINT_SRC( t, i, j, k ) \ - ((void) (k), \ - ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i)))) + ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i))) #define FLOAT_SRC( t, i, j, k, sz ) \ - ((void) (k), \ - ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) + ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) #define HALF_SRC( t, i, j, k, sz ) \ - ((void) (k), \ - ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) + ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) #define FETCH(x) fetch_texel_2d_##x @@ -1023,9 +1012,9 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); - const GLuint index = *src; const struct gl_color_table *palette; const GLchan *table; + GLuint index; GET_CURRENT_CONTEXT(ctx); if (ctx->Texture.SharedPalette) { @@ -1039,6 +1028,9 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, ASSERT(palette->Type != GL_FLOAT); table = (const GLchan *) palette->Table; + /* Mask the index against size of palette to avoid going out of bounds */ + index = (*src) & (palette->Size - 1); + switch (palette->Format) { case GL_ALPHA: texel[RCOMP] = diff --git a/reactos/lib/mesa32/src/x86/common_x86.c b/reactos/lib/mesa32/src/x86/common_x86.c index 90fa7e48ff3..b8ff39d159e 100644 --- a/reactos/lib/mesa32/src/x86/common_x86.c +++ b/reactos/lib/mesa32/src/x86/common_x86.c @@ -132,6 +132,36 @@ static void sigfpe_handler( int signal, struct sigcontext sc ) } #endif /* __linux__ && _POSIX_SOURCE && X86_FXSR_MAGIC */ +#if defined(WIN32) +#ifndef STATUS_FLOAT_MULTIPLE_TRAPS +# define STATUS_FLOAT_MULTIPLE_TRAPS (0xC00002B5L) +#endif +static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp) +{ + PEXCEPTION_RECORD rec = exp->ExceptionRecord; + PCONTEXT ctx = exp->ContextRecord; + + if ( rec->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION ) { + message( "EXCEPTION_ILLEGAL_INSTRUCTION, " ); + _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); + } else if ( rec->ExceptionCode == STATUS_FLOAT_MULTIPLE_TRAPS ) { + message( "STATUS_FLOAT_MULTIPLE_TRAPS, " ); + /* Windows seems to clear the exception flag itself, we just have to increment Eip */ + } else { + message( "UNEXPECTED EXCEPTION (0x%08x), terminating!" ); + return EXCEPTION_EXECUTE_HANDLER; + } + + if ( (ctx->ContextFlags & CONTEXT_CONTROL) != CONTEXT_CONTROL ) { + message( "Context does not contain control registers, terminating!" ); + return EXCEPTION_EXECUTE_HANDLER; + } + ctx->Eip += 3; + + return EXCEPTION_CONTINUE_EXECUTION; +} +#endif /* WIN32 */ + /* If we're running on a processor that can do SSE, let's see if we * are allowed to or not. This will catch 2.4.0 or later kernels that * haven't been configured for a Pentium III but are running on one, @@ -226,6 +256,44 @@ static void check_os_sse_support( void ) if (ret || !enabled) _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); } +#elif defined(WIN32) + LPTOP_LEVEL_EXCEPTION_FILTER oldFilter; + + /* Install our ExceptionFilter */ + oldFilter = SetUnhandledExceptionFilter( ExceptionFilter ); + + if ( cpu_has_xmm ) { + message( "Testing OS support for SSE... " ); + + _mesa_test_os_sse_support(); + + if ( cpu_has_xmm ) { + message( "yes.\n" ); + } else { + message( "no!\n" ); + } + } + + if ( cpu_has_xmm ) { + message( "Testing OS support for SSE unmasked exceptions... " ); + + _mesa_test_os_sse_exception_support(); + + if ( cpu_has_xmm ) { + message( "yes.\n" ); + } else { + message( "no!\n" ); + } + } + + /* Restore previous exception filter */ + SetUnhandledExceptionFilter( oldFilter ); + + if ( cpu_has_xmm ) { + message( "Tests of OS support for SSE passed.\n" ); + } else { + message( "Tests of OS support for SSE failed!\n" ); + } #else /* Do nothing on other platforms for now. */ diff --git a/reactos/lib/mesa32/src/x86/glapi_x86.S b/reactos/lib/mesa32/src/x86/glapi_x86.S index 0d4d19db16e..c0e427ef762 100644 --- a/reactos/lib/mesa32/src/x86/glapi_x86.S +++ b/reactos/lib/mesa32/src/x86/glapi_x86.S @@ -29,7 +29,7 @@ #include "assyntax.h" #include "glapioffsets.h" -#ifndef __WIN32__ +#if 1 //ndef __WIN32__ #if defined(STDCALL_API) # if defined(USE_MGL_NAMESPACE)