Bug 29572 - [glsl2] MSVC build fails with some C99 math functions
Summary: [glsl2] MSVC build fails with some C99 math functions
Status: CLOSED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86 (IA32) Windows (All)
: medium blocker
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-13 19:35 UTC by Vinson Lee
Modified: 2010-08-26 10:58 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Work-arounds for platforms that lack C99 math functions (1.51 KB, patch)
2010-08-13 20:24 UTC, Ian Romanick
Details | Splinter Review

Description Vinson Lee 2010-08-13 19:35:46 UTC
mesa: 8f8cdbfba43550d0b8985fb087961864e4cd92b6 (glsl2)

Build with MSVC.

$ scons quiet=no
...
cl /Fobuild\windows-x86-debug\glsl\ir_constant_expression.obj /c src\glsl\ir_constant_expression.cpp /TP /nologo /Od /Oi /Oy- /GL- /fp:fast /W3 /MTd /LDd /DDEBUG /DWIN32 /D_WINDOWS /D_WIN32_WINNT=0x0601 /DWINVER=0x0601 /DVC_EXTRALEAN /D_USE_MATH_DEFINES /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_DEPRECATE /D_DEBUG /DPIPE_SUBSYSTEM_WINDOWS_USER /Isrc\talloc /Isrc\mapi /Isrc\mesa /Iinclude /Isrc\gallium\include /Isrc\gallium\auxiliary /Isrc\gallium\drivers /Isrc\gallium\winsys /Iinclude\c99 /Z7
ir_constant_expression.cpp
src\glsl\ir_constant_expression.cpp(112) : warning C4244: '=' : conversion from 'float' to 'int', possible loss of data
src\glsl\ir_constant_expression.cpp(118) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(124) : warning C4244: '=' : conversion from 'unsigned int' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(130) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(136) : warning C4800: 'float' : forcing value to bool 'true' or 'false' (performance warning)
src\glsl\ir_constant_expression.cpp(148) : warning C4800: 'unsigned int' : forcing value to bool 'true' or 'false' (performance warning)
src\glsl\ir_constant_expression.cpp(155) : error C3861: 'truncf': identifier not found
src\glsl\ir_constant_expression.cpp(209) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
src\glsl\ir_constant_expression.cpp(275) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(286) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(307) : error C3861: 'exp2f': identifier not found
src\glsl\ir_constant_expression.cpp(321) : error C3861: 'log2f': identifier not found
src\glsl\ir_constant_expression.cpp(883) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(1068) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(1077) : warning C4244: 'initializing' : conversion from 'double' to 'const float', possible loss of data
src\glsl\ir_constant_expression.cpp(1117) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
scons: *** [build\windows-x86-debug\glsl\ir_constant_expression.obj] Error 2
scons: building terminated because of errors.
Comment 1 Ian Romanick 2010-08-13 20:24:30 UTC
Created attachment 37855 [details] [review]
Work-arounds for platforms that lack C99 math functions
Comment 2 Vinson Lee 2010-08-13 22:32:58 UTC
Review of attachment 37855 [details] [review]:

ciel should be ceil.
exp2, log2, and trunc are not available on MSVC. See http://msdn.microsoft.com/en-us/library/aa272724%28v=VS.60%29.aspx.
Comment 3 Vinson Lee 2010-08-26 10:58:44 UTC
mesa: 9b4384c32233c6d75021bcc67552b7ea9dc56de6 (master)

The MSVC build no longer fails on C99 math functions.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.