summaryrefslogtreecommitdiff
path: root/src/mesa/main/imports.h
diff options
context:
space:
mode:
authorMichal Krol <mjkrol@gmail.org>2006-02-27 14:41:41 +0000
committerMichal Krol <mjkrol@gmail.org>2006-02-27 14:41:41 +0000
commit9ac9605de156408580b81ba7e2780bd3f5372c6d (patch)
treee0dfe1127ed3b7f9674c450dea59b921e84c4dfc /src/mesa/main/imports.h
parentc56f2c49a51e7ad1106c46e3e86dfe2756ef87c4 (diff)
More GLSL code:
- add x86 code generator; - add full support for uniforms in ARB_shader_objects; - add assembly instruction: global_addr; - reorganize #includes; - built-in uniforms accessed by index, rather than by name; - add some entries to x86sse rtasm; - add configurations to VC6 projects: 'Release x86' and 'Debug x86'; - #define SLANG_X86 active only on VC6 x86 builds; - introduce code export table for a shader; - remove GNU license from the noise library;
Diffstat (limited to 'src/mesa/main/imports.h')
-rw-r--r--src/mesa/main/imports.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index c698312944..425ef825d1 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -572,7 +572,29 @@ do { \
_watcom_start_fast_math(&x,&mask); \
} while (0)
#endif
-#define END_FAST_MATH(x) _watcom_end_fast_math(&x)
+#define END_FAST_MATH(x) _watcom_end_fast_math(&x)
+
+#elif defined(_MSC_VER) && defined(_M_IX86)
+#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
+#define FAST_X86_FPU 0x003f /* See GCC comments above */
+#if defined(NO_FAST_MATH)
+#define START_FAST_MATH(x) do {\
+ static GLuint mask = DEFAULT_X86_FPU;\
+ __asm fnstcw word ptr [x]\
+ __asm fldcw word ptr [mask]\
+} while(0)
+#else
+#define START_FAST_MATH(x) do {\
+ static GLuint mask = FAST_X86_FPU;\
+ __asm fnstcw word ptr [x]\
+ __asm fldcw word ptr [mask]\
+} while(0)
+#endif
+#define END_FAST_MATH(x) do {\
+ __asm fnclex\
+ __asm fldcw word ptr [x]\
+} while(0)
+
#else
#define START_FAST_MATH(x) x = 0
#define END_FAST_MATH(x) (void)(x)
@@ -627,7 +649,10 @@ extern int
_mesa_memcmp( const void *s1, const void *s2, size_t n );
extern double
-_mesa_sin(double a);
+_mesa_sin(double a);
+
+extern float
+_mesa_sinf(float a);
extern double
_mesa_cos(double a);