Skip to content
Snippets Groups Projects
Commit 58f5a5e7 authored by John Kessenich's avatar John Kessenich
Browse files

Add fma(), tie the 2x16 stuff to the correct versions.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27739 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 0a335928
No related branches found
No related tags found
No related merge requests found
...@@ -58,3 +58,14 @@ layout(location = 4) in vec4 ivlc[]; // ERROR ...@@ -58,3 +58,14 @@ layout(location = 4) in vec4 ivlc[]; // ERROR
layout(location = 3) out vec4 ovla[]; layout(location = 3) out vec4 ovla[];
layout(location = 4) out vec4 ovlb[]; layout(location = 4) out vec4 ovlb[];
layout(location = 4) out vec4 ovlc[]; // ERROR layout(location = 4) out vec4 ovlc[]; // ERROR
precise vec3 pv3;
void foop()
{
precise double d;
pv3 *= pv3;
pv3 = fma(pv3, pv3, pv3);
d = fma(d, d, d);
}
...@@ -341,6 +341,24 @@ ERROR: node is still EOpNull! ...@@ -341,6 +341,24 @@ ERROR: node is still EOpNull!
0:44 4 (const int) 0:44 4 (const int)
0:44 Constant: 0:44 Constant:
0:44 1 (const int) 0:44 1 (const int)
0:64 Function Definition: foop( (void)
0:64 Function Parameters:
0:? Sequence
0:68 multiply second child into first child (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:69 move second child to first child (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 Function Call: fma(vf3;vf3;vf3; (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:70 move second child to first child (double)
0:70 'd' (double)
0:70 Function Call: fma(d1;d1;d1; (double)
0:70 'd' (double)
0:70 'd' (double)
0:70 'd' (double)
0:? Linker Objects 0:? Linker Objects
0:? 'gl_out' (out 4-element array of block{out 4-component vector of float gl_Position, out float gl_PointSize, out implicitly-sized array of float gl_ClipDistance}) 0:? 'gl_out' (out 4-element array of block{out 4-component vector of float gl_Position, out float gl_PointSize, out implicitly-sized array of float gl_ClipDistance})
0:? 'outa' (4-element array of int) 0:? 'outa' (4-element array of int)
...@@ -356,6 +374,7 @@ ERROR: node is still EOpNull! ...@@ -356,6 +374,7 @@ ERROR: node is still EOpNull!
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (3-component vector of float)
400.tese 400.tese
Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. Warning, version 400 is not yet complete; most version-specific features are present, but some are missing.
...@@ -1020,6 +1039,24 @@ vertices = 4 ...@@ -1020,6 +1039,24 @@ vertices = 4
0:44 4 (const int) 0:44 4 (const int)
0:44 Constant: 0:44 Constant:
0:44 1 (const int) 0:44 1 (const int)
0:64 Function Definition: foop( (void)
0:64 Function Parameters:
0:? Sequence
0:68 multiply second child into first child (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:69 move second child to first child (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 Function Call: fma(vf3;vf3;vf3; (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:70 move second child to first child (double)
0:70 'd' (double)
0:70 Function Call: fma(d1;d1;d1; (double)
0:70 'd' (double)
0:70 'd' (double)
0:70 'd' (double)
0:8 Function Definition: main( (void) 0:8 Function Definition: main( (void)
0:8 Function Parameters: 0:8 Function Parameters:
0:15 Function Definition: main( (void) 0:15 Function Definition: main( (void)
...@@ -1098,6 +1135,7 @@ vertices = 4 ...@@ -1098,6 +1135,7 @@ vertices = 4
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (3-component vector of float)
0:? 'a' (out 3-element array of int) 0:? 'a' (out 3-element array of int)
0:? 'outb' (out 5-element array of int) 0:? 'outb' (out 5-element array of int)
0:? 'outc' (out 4-element array of int) 0:? 'outc' (out 4-element array of int)
......
...@@ -126,6 +126,24 @@ ERROR: node is still EOpNull! ...@@ -126,6 +126,24 @@ ERROR: node is still EOpNull!
0:44 4 (const int) 0:44 4 (const int)
0:44 Constant: 0:44 Constant:
0:44 1 (const int) 0:44 1 (const int)
0:64 Function Definition: foop( (void)
0:64 Function Parameters:
0:? Sequence
0:68 multiply second child into first child (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:69 move second child to first child (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 Function Call: fma(vf3;vf3;vf3; (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:70 move second child to first child (double)
0:70 'd' (double)
0:70 Function Call: fma(d1;d1;d1; (double)
0:70 'd' (double)
0:70 'd' (double)
0:70 'd' (double)
0:? Linker Objects 0:? Linker Objects
0:? 'gl_out' (out 4-element array of block{out 4-component vector of float gl_Position, out float gl_PointSize, out implicitly-sized array of float gl_ClipDistance}) 0:? 'gl_out' (out 4-element array of block{out 4-component vector of float gl_Position, out float gl_PointSize, out implicitly-sized array of float gl_ClipDistance})
0:? 'outa' (4-element array of int) 0:? 'outa' (4-element array of int)
...@@ -141,6 +159,7 @@ ERROR: node is still EOpNull! ...@@ -141,6 +159,7 @@ ERROR: node is still EOpNull!
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (3-component vector of float)
Linked tessellation control stage: Linked tessellation control stage:
...@@ -258,6 +277,24 @@ ERROR: node is still EOpNull! ...@@ -258,6 +277,24 @@ ERROR: node is still EOpNull!
0:44 4 (const int) 0:44 4 (const int)
0:44 Constant: 0:44 Constant:
0:44 1 (const int) 0:44 1 (const int)
0:64 Function Definition: foop( (void)
0:64 Function Parameters:
0:? Sequence
0:68 multiply second child into first child (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:68 'pv3' (3-component vector of float)
0:69 move second child to first child (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 Function Call: fma(vf3;vf3;vf3; (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:69 'pv3' (3-component vector of float)
0:70 move second child to first child (double)
0:70 'd' (double)
0:70 Function Call: fma(d1;d1;d1; (double)
0:70 'd' (double)
0:70 'd' (double)
0:70 'd' (double)
0:? Linker Objects 0:? Linker Objects
0:? 'gl_out' (out 4-element array of block{out 4-component vector of float gl_Position, out float gl_PointSize, out 1-element array of float gl_ClipDistance}) 0:? 'gl_out' (out 4-element array of block{out 4-component vector of float gl_Position, out float gl_PointSize, out 1-element array of float gl_ClipDistance})
0:? 'outa' (4-element array of int) 0:? 'outa' (4-element array of int)
...@@ -273,4 +310,5 @@ ERROR: node is still EOpNull! ...@@ -273,4 +310,5 @@ ERROR: node is still EOpNull!
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (3-component vector of float)
...@@ -147,7 +147,7 @@ Shader Functionality to Implement/Finish ...@@ -147,7 +147,7 @@ Shader Functionality to Implement/Finish
+ Sampler arrays can take a variable index now, as long as it's value is uniform for all uses. + Sampler arrays can take a variable index now, as long as it's value is uniform for all uses.
- Per-sample shading. Including sample input mask gl_SampleMaskIn[] and per-sample interpolation, with explicit interpolation built-ins interpolateAtCentroid(), interpolateAtSample(), and interpolateAtOffset(). - Per-sample shading. Including sample input mask gl_SampleMaskIn[] and per-sample interpolation, with explicit interpolation built-ins interpolateAtCentroid(), interpolateAtSample(), and interpolateAtOffset().
- New precise qualifier to disallow optimizations that re-order operations or treat different instances of the same operator with different precision. - New precise qualifier to disallow optimizations that re-order operations or treat different instances of the same operator with different precision.
- Add a fused multiply and add built-in, fma(), in relation to the new precise qualifier. (Because “a * b + c” will require two operations under new rules for precise.) + Add a fused multiply and add built-in, fma(), in relation to the new precise qualifier. (Because “a * b + c” will require two operations under new rules for precise.)
+ Added new built-in floating-point functions + Added new built-in floating-point functions
+ frexp() and ldexp() + frexp() and ldexp()
+ packUnorm2x16(), unpackUnorm2x16(), + packUnorm2x16(), unpackUnorm2x16(),
...@@ -203,9 +203,9 @@ Shader Functionality to Implement/Finish ...@@ -203,9 +203,9 @@ Shader Functionality to Implement/Finish
+ Add a new atomic_uint type to support atomic counters. Also, add built-in functions for manipulating atomic counters. + Add a new atomic_uint type to support atomic counters. Also, add built-in functions for manipulating atomic counters.
+ atomicCounterIncrement, atomicCounterDecrement, and atomicCounter + atomicCounterIncrement, atomicCounterDecrement, and atomicCounter
- Add layout qualifier identifiers binding and offset to bind units to sampler and image variable declarations, atomic counters, and uniform blocks. - Add layout qualifier identifiers binding and offset to bind units to sampler and image variable declarations, atomic counters, and uniform blocks.
- Add built-in functions to pack/unpack 16 bit floating-point numbers (ARB_shading_language_pack2f). + Add built-in functions to pack/unpack 16 bit floating-point numbers (ARB_shading_language_pack2f).
- packHalf2x16 and unpackHalf2x16 + packHalf2x16 and unpackHalf2x16
- packSnorm2x16and unpackSnorm2x16 + packSnorm2x16and unpackSnorm2x16
- Add gl_FragDepth layout qualifiers to communicate what kind of changes will be made to gl_FragDepth (GL_AMD_conservative depth). - Add gl_FragDepth layout qualifiers to communicate what kind of changes will be made to gl_FragDepth (GL_AMD_conservative depth).
+ Add C-style curly brace initializer lists syntax for initializers. Full initialization of aggregates is required when these are used. + Add C-style curly brace initializer lists syntax for initializers. Full initialization of aggregates is required when these are used.
+ Allow .length() to be applied to vectors and matrices, returning the number of components or columns. + Allow .length() to be applied to vectors and matrices, returning the number of components or columns.
......
...@@ -492,6 +492,21 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -492,6 +492,21 @@ void TBuiltIns::initialize(int version, EProfile profile)
"\n"); "\n");
} }
if (profile != EEsProfile && version >= 400) {
commonBuiltins.append(
"float fma(float, float, float );"
"vec2 fma(vec2, vec2, vec2 );"
"vec3 fma(vec3, vec3, vec3 );"
"vec4 fma(vec4, vec4, vec4 );"
"double fma(double, double, double);"
"dvec2 fma(dvec2, dvec2, dvec2 );"
"dvec3 fma(dvec3, dvec3, dvec3 );"
"dvec4 fma(dvec4, dvec4, dvec4 );"
"\n");
}
if ((profile == EEsProfile && version >= 310) || if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 400)) { (profile != EEsProfile && version >= 400)) {
commonBuiltins.append( commonBuiltins.append(
...@@ -529,10 +544,16 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -529,10 +544,16 @@ void TBuiltIns::initialize(int version, EProfile profile)
if ((profile == EEsProfile && version >= 300) || if ((profile == EEsProfile && version >= 300) ||
(profile != EEsProfile && version >= 400)) { (profile != EEsProfile && version >= 400)) {
commonBuiltins.append( commonBuiltins.append(
"highp uint packSnorm2x16(vec2);"
"highp vec2 unpackSnorm2x16(highp uint);"
"highp uint packUnorm2x16(vec2);" "highp uint packUnorm2x16(vec2);"
"highp vec2 unpackUnorm2x16(highp uint);" "highp vec2 unpackUnorm2x16(highp uint);"
"\n");
}
if ((profile == EEsProfile && version >= 300) ||
(profile != EEsProfile && version >= 420)) {
commonBuiltins.append(
"highp uint packSnorm2x16(vec2);"
"highp vec2 unpackSnorm2x16(highp uint);"
"highp uint packHalf2x16(mediump vec2);" "highp uint packHalf2x16(mediump vec2);"
"mediump vec2 unpackHalf2x16(highp uint);" "mediump vec2 unpackHalf2x16(highp uint);"
"\n"); "\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment