int absTest = sqrt(type3);\r
double absTest2 = sqrt(type3);\r
double absTest3 = sqrt(2);\r
-float dk = sqrt(11);
\ No newline at end of file
+float dk = sqrt(11);\r
+\r
+#extension GL_ARB_shader_bit_encoding: enable\r
+\r
+float f;\r
+vec4 v4;\r
+ivec4 iv4a;\r
+uvec2 uv2c;\r
+void bitEncodingPass()\r
+{\r
+ int i = floatBitsToInt(f);\r
+ uvec4 uv11 = floatBitsToUint(v4);\r
+ vec4 v14 = intBitsToFloat(iv4a);\r
+ vec2 v15 = uintBitsToFloat(uv2c);\r
+}\r
+\r
+#extension GL_ARB_shader_bit_encoding: disable\r
+\r
+void bitEncodingFail()\r
+{\r
+ int i = floatBitsToInt(f); // Error, extention GL_ARB_bit_encoding is diabled\r
+}\r
ERROR: 0:53: 'double' : not supported for this version or the enabled extensions
ERROR: 0:53: 'double' : must be qualified as flat in
ERROR: 0:57: '=' : cannot convert from ' global double' to ' global int'
-ERROR: 10 compilation errors. No code generated.
+ERROR: 0:80: 'floatBitsToInt' : required extension not requested: GL_ARB_shader_bit_encoding
+ERROR: 11 compilation errors. No code generated.
Shader version: 150
Requested GL_ARB_gpu_shader_fp64
+Requested GL_ARB_shader_bit_encoding
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
0:60 'dk' ( global float)
0:60 Constant:
0:60 3.316625
+0:68 Function Definition: bitEncodingPass( ( global void)
+0:68 Function Parameters:
+0:70 Sequence
+0:70 Sequence
+0:70 move second child to first child ( temp int)
+0:70 'i' ( temp int)
+0:70 floatBitsToInt ( global int)
+0:70 'f' ( global float)
+0:71 Sequence
+0:71 move second child to first child ( temp 4-component vector of uint)
+0:71 'uv11' ( temp 4-component vector of uint)
+0:71 floatBitsToUint ( global 4-component vector of uint)
+0:71 'v4' ( global 4-component vector of float)
+0:72 Sequence
+0:72 move second child to first child ( temp 4-component vector of float)
+0:72 'v14' ( temp 4-component vector of float)
+0:72 intBitsToFloat ( global 4-component vector of float)
+0:72 'iv4a' ( global 4-component vector of int)
+0:73 Sequence
+0:73 move second child to first child ( temp 2-component vector of float)
+0:73 'v15' ( temp 2-component vector of float)
+0:73 uintBitsToFloat ( global 2-component vector of float)
+0:73 'uv2c' ( global 2-component vector of uint)
+0:78 Function Definition: bitEncodingFail( ( global void)
+0:78 Function Parameters:
+0:80 Sequence
+0:80 Sequence
+0:80 move second child to first child ( temp int)
+0:80 'i' ( temp int)
+0:80 floatBitsToInt ( global int)
+0:80 'f' ( global float)
0:? Linker Objects
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'foo' ( smooth in 4-component vector of float)
0:? 'absTest2' ( global double)
0:? 'absTest3' ( global double)
0:? 'dk' ( global float)
+0:? 'f' ( global float)
+0:? 'v4' ( global 4-component vector of float)
+0:? 'iv4a' ( global 4-component vector of int)
+0:? 'uv2c' ( global 2-component vector of uint)
Linked fragment stage:
Shader version: 150
Requested GL_ARB_gpu_shader_fp64
+Requested GL_ARB_shader_bit_encoding
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
0:? 'absTest2' ( global double)
0:? 'absTest3' ( global double)
0:? 'dk' ( global float)
+0:? 'f' ( global float)
+0:? 'v4' ( global 4-component vector of float)
+0:? 'iv4a' ( global 4-component vector of int)
+0:? 'uv2c' ( global 2-component vector of uint)
#endif
if ((profile == EEsProfile && version >= 300) ||
- (profile != EEsProfile && version >= 330)) {
+ (profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding
commonBuiltins.append(
"int floatBitsToInt(highp float value);"
"ivec2 floatBitsToInt(highp vec2 value);"
symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic);
}
+ if (profile != EEsProfile && version < 330 ) {
+ symbolTable.setFunctionExtensions("floatBitsToInt", 1, &E_GL_ARB_shader_bit_encoding);
+ symbolTable.setFunctionExtensions("floatBitsToUint", 1, &E_GL_ARB_shader_bit_encoding);
+ symbolTable.setFunctionExtensions("intBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding);
+ symbolTable.setFunctionExtensions("uintBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding);
+ }
+
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
extensionBehavior[E_GL_ARB_shader_clock] = EBhDisable;
extensionBehavior[E_GL_ARB_uniform_buffer_object] = EBhDisable;
extensionBehavior[E_GL_ARB_sample_shading] = EBhDisable;
+ extensionBehavior[E_GL_ARB_shader_bit_encoding] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable;
"#define GL_ARB_post_depth_coverage 1\n"
"#define GL_ARB_fragment_shader_interlock 1\n"
"#define GL_ARB_uniform_buffer_object 1\n"
+ "#define GL_ARB_shader_bit_encoding 1\n"
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
"#define GL_EXT_shader_image_load_formatted 1\n"
"#define GL_EXT_post_depth_coverage 1\n"
const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock";
const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object";
const char* const E_GL_ARB_sample_shading = "GL_ARB_sample_shading";
+const char* const E_GL_ARB_shader_bit_encoding = "GL_ARB_shader_bit_encoding";
const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";