summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-01-25 04:16:06 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-01-25 04:16:06 +0000
commit90ba135c30d63b97fcfbcc088d0dee9ed67a351e (patch)
tree17d81eb99a7ddc76ab703f61b5873b34f5e91edd /Graphics
parentUpdated MacOSDebug to use NSLog (diff)
downloadDiligentCore-90ba135c30d63b97fcfbcc088d0dee9ed67a351e.tar.gz
DiligentCore-90ba135c30d63b97fcfbcc088d0dee9ed67a351e.zip
Enabled File2String on Mac; updated GLSLDefinitions to disable functions unsupported in GL4.1
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions.h9
-rw-r--r--Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions_inc.h9
2 files changed, 10 insertions, 8 deletions
diff --git a/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions.h b/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions.h
index ccaddac2..86c8e0ce 100644
--- a/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions.h
+++ b/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions.h
@@ -160,10 +160,10 @@ uvec2 asuint( vec2 x ){ return floatBitsToUint(x); }
uvec3 asuint( vec3 x ){ return floatBitsToUint(x); }
uvec4 asuint( vec4 x ){ return floatBitsToUint(x); }
-
+#if !defined(GL_ES) && (__VERSION__>=420)
float f16tof32( uint u1 )
-{
- return unpackHalf2x16( u1 ).x;
+{
+ return unpackHalf2x16( u1 ).x;
}
vec2 f16tof32( uvec2 u2 )
{
@@ -185,7 +185,7 @@ vec4 f16tof32( ivec4 i4 ){ return f16tof32( uvec4( i4 ) ); }
uint f32tof16( float f )
{
- return packHalf2x16( vec2( f, 0.0 ) ) & 0x0ffffu;
+ return packHalf2x16( vec2( f, 0.0 ) ) & 0x0ffffu;
}
uvec2 f32tof16( vec2 f2 )
{
@@ -200,6 +200,7 @@ uvec4 f32tof16( vec4 f4 )
{
return uvec4( f32tof16( f4.xy ), f32tof16( f4.zw ) );
}
+#endif
#ifndef GL_ES // double is not supported on GLES
double asdouble(uint lowbits, uint highbits)
diff --git a/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions_inc.h b/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions_inc.h
index cf5dbfcf..18b8225b 100644
--- a/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions_inc.h
+++ b/Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions_inc.h
@@ -160,10 +160,10 @@
"uvec3 asuint( vec3 x ){ return floatBitsToUint(x); }\n"
"uvec4 asuint( vec4 x ){ return floatBitsToUint(x); }\n"
"\n"
-"\n"
+"#if !defined(GL_ES) && (__VERSION__>=420)\n"
"float f16tof32( uint u1 )\n"
-"{ \n"
-" return unpackHalf2x16( u1 ).x; \n"
+"{\n"
+" return unpackHalf2x16( u1 ).x;\n"
"}\n"
"vec2 f16tof32( uvec2 u2 )\n"
"{ \n"
@@ -185,7 +185,7 @@
"\n"
"uint f32tof16( float f )\n"
"{ \n"
-" return packHalf2x16( vec2( f, 0.0 ) ) & 0x0ffffu; \n"
+" return packHalf2x16( vec2( f, 0.0 ) ) & 0x0ffffu;\n"
"}\n"
"uvec2 f32tof16( vec2 f2 )\n"
"{ \n"
@@ -200,6 +200,7 @@
"{\n"
" return uvec4( f32tof16( f4.xy ), f32tof16( f4.zw ) );\n"
"}\n"
+"#endif\n"
"\n"
"#ifndef GL_ES // double is not supported on GLES\n"
"double asdouble(uint lowbits, uint highbits)\n"