Commit 623833fa by John Kessenich

Tessellation partial implementation (not ready for use yet), including:

- the built-in constants - built-in variable declarations, some dependent on gl_MaxPatchVertices - layout qualifier for vertices (shared with geometry shader max_vertices) - layout qualifiers for vertex spacing, vertex order, point mode, and primitive type - link semantics for layout qualifiers Still TBD: - patch qualifier and arrayed input handling - sizing of gl_out[] - additional semantic checking - supporting the extension on version 150 git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24468 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 2fcc9ff1
...@@ -123,7 +123,7 @@ const char* DefaultConfig = ...@@ -123,7 +123,7 @@ const char* DefaultConfig =
"MaxVertexUniformComponents 4096\n" "MaxVertexUniformComponents 4096\n"
"MaxVaryingFloats 64\n" "MaxVaryingFloats 64\n"
"MaxVertexTextureImageUnits 32\n" "MaxVertexTextureImageUnits 32\n"
"MaxCombinedTextureImageUnits 32\n" "MaxCombinedTextureImageUnits 80\n"
"MaxTextureImageUnits 32\n" "MaxTextureImageUnits 32\n"
"MaxFragmentUniformComponents 4096\n" "MaxFragmentUniformComponents 4096\n"
"MaxDrawBuffers 32\n" "MaxDrawBuffers 32\n"
......
#version 400 core #version 400 core
layout(vertices = 4) out;
int outa[gl_out.length()];
layout(quads) in; // ERROR
layout(ccw) out; // ERROR
layout(fractional_even_spacing) in; // ERROR
void main() void main()
{ {
barrier(); barrier();
int a = gl_MaxTessControlInputComponents +
gl_MaxTessControlOutputComponents +
gl_MaxTessControlTextureImageUnits +
gl_MaxTessControlUniformComponents +
gl_MaxTessControlTotalOutputComponents;
vec4 p = gl_in[1].gl_Position;
float ps = gl_in[1].gl_PointSize;
float cd = gl_in[1].gl_ClipDistance[2];
int pvi = gl_PatchVerticesIn;
int pid = gl_PrimitiveID;
int iid = gl_InvocationID;
gl_out[1].gl_Position = p;
gl_out[1].gl_PointSize = ps;
gl_out[1].gl_ClipDistance[1] = cd;
gl_TessLevelOuter[3] = 3.2;
gl_TessLevelInner[1] = 1.3;
} }
#version 400 core #version 400 core
layout(vertices = 4) out; // ERROR
layout(quads, cw) in;
layout(triangles) in; // ERROR
layout(isolines) in; // ERROR
layout(cw) in;
layout(ccw) in; // ERROR
layout(fractional_odd_spacing) in;
layout(equal_spacing) in; // ERROR
layout(fractional_even_spacing) in; // ERROR
layout(point_mode) in;
void main() void main()
{ {
barrier(); // ERROR barrier(); // ERROR
int a = gl_MaxTessEvaluationInputComponents +
gl_MaxTessEvaluationOutputComponents +
gl_MaxTessEvaluationTextureImageUnits +
gl_MaxTessEvaluationUniformComponents +
gl_MaxTessPatchComponents +
gl_MaxPatchVertices +
gl_MaxTessGenLevel;
vec4 p = gl_in[1].gl_Position;
float ps = gl_in[1].gl_PointSize;
float cd = gl_in[1].gl_ClipDistance[2];
int pvi = gl_PatchVerticesIn;
int pid = gl_PrimitiveID;
vec3 tc = gl_TessCoord;
float tlo = gl_TessLevelOuter[3];
float tli = gl_TessLevelInner[1];
gl_Position = p;
gl_PointSize = ps;
gl_ClipDistance[2] = cd;
} }
...@@ -71,9 +71,9 @@ layout(binding = 1) in inblock { int aoeua; }; // ERROR ...@@ -71,9 +71,9 @@ layout(binding = 1) in inblock { int aoeua; }; // ERROR
layout(binding = 100000) uniform anonblock2 { int aooeu; } ; layout(binding = 100000) uniform anonblock2 { int aooeu; } ;
layout(binding = 4) uniform sampler2D sampb1; layout(binding = 4) uniform sampler2D sampb1;
layout(binding = 5) uniform sampler2D sampb2[10]; layout(binding = 5) uniform sampler2D sampb2[10];
layout(binding = 32) uniform sampler2D sampb3; // ERROR, binding too big layout(binding = 80) uniform sampler2D sampb3; // ERROR, binding too big
layout(binding = 31) uniform sampler2D sampb4; layout(binding = 31) uniform sampler2D sampb4;
layout(binding = 31) uniform sampler2D sampb5[2]; // ERROR, binding too big layout(binding = 79) uniform sampler2D sampb5[2]; // ERROR, binding too big
int fgfg(float f, mediump int i); int fgfg(float f, mediump int i);
int fgfg(float f, highp int i); int fgfg(float f, highp int i);
......
...@@ -27,4 +27,6 @@ ERROR: node is still EOpNull! ...@@ -27,4 +27,6 @@ ERROR: node is still EOpNull!
Linked fragment stage: Linked fragment stage:
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
...@@ -146,4 +146,8 @@ ERROR: node is still EOpNull! ...@@ -146,4 +146,8 @@ ERROR: node is still EOpNull!
Linked geometry stage: Linked geometry stage:
invocations = 4
max_vertices = 300
input primitive = lines_adjancency
output primitive = triangle_strip
...@@ -77,7 +77,7 @@ ERROR: node is still EOpNull! ...@@ -77,7 +77,7 @@ ERROR: node is still EOpNull!
0:36 move second child to first child (highp int) 0:36 move second child to first child (highp int)
0:36 'c5' (highp int) 0:36 'c5' (highp int)
0:36 Constant: 0:36 Constant:
0:36 32 (const int) 0:36 80 (const int)
0:37 Sequence 0:37 Sequence
0:37 move second child to first child (highp int) 0:37 move second child to first child (highp int)
0:37 'c6' (highp int) 0:37 'c6' (highp int)
......
...@@ -209,4 +209,6 @@ ERROR: node is still EOpNull! ...@@ -209,4 +209,6 @@ ERROR: node is still EOpNull!
Linked fragment stage: Linked fragment stage:
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
...@@ -78,4 +78,8 @@ Linked geometry stage: ...@@ -78,4 +78,8 @@ Linked geometry stage:
ERROR: Linking geometry stage: At least one geometry shader must specify an output layout primitive ERROR: Linking geometry stage: At least one geometry shader must specify an output layout primitive
invocations = 4
max_vertices = 127
input primitive = triangles
output primitive = none
400.tesc 400.tesc
Warning, version 400 is not yet complete; some version-specific features are present, but many are missing. Warning, version 400 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:4: 'length' : array must be declared with a size before using this method
ERROR: 0:6: 'quads' : unrecognized layout identifier, or qualifier requires assignemnt (e.g., binding = 4)
ERROR: 0:7: 'ccw' : unrecognized layout identifier, or qualifier requires assignemnt (e.g., binding = 4)
ERROR: 0:8: 'fractional_even_spacing' : unrecognized layout identifier, or qualifier requires assignemnt (e.g., binding = 4)
ERROR: 4 compilation errors. No code generated.
0:? Sequence
0:3 Function Definition: main( (void) vertices = 4
0:3 Function Parameters: ERROR: node is still EOpNull!
0:5 Sequence 0:11 Function Definition: main( (void)
0:5 Barrier (void) 0:11 Function Parameters:
0:13 Sequence
0:13 Barrier (void)
0:15 Sequence
0:15 move second child to first child (int)
0:15 'a' (int)
0:15 Constant:
0:15 5392 (const int)
0:21 Sequence
0:21 move second child to first child (4-component vector of float)
0:21 'p' (4-component vector of float)
0:21 gl_Position: direct index for structure (4-component vector of float)
0:21 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:21 'gl_in' (in 32-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:21 Constant:
0:21 1 (const int)
0:21 Constant:
0:21 0 (const int)
0:22 Sequence
0:22 move second child to first child (float)
0:22 'ps' (float)
0:22 gl_PointSize: direct index for structure (float)
0:22 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:22 'gl_in' (in 32-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:22 Constant:
0:22 1 (const int)
0:22 Constant:
0:22 1 (const int)
0:23 Sequence
0:23 move second child to first child (float)
0:23 'cd' (float)
0:23 direct index (float)
0:23 gl_ClipDistance: direct index for structure (unsized array of float)
0:23 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:23 'gl_in' (in 32-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:23 Constant:
0:23 1 (const int)
0:23 Constant:
0:23 2 (const int)
0:23 Constant:
0:23 2 (const int)
0:25 Sequence
0:25 move second child to first child (int)
0:25 'pvi' (int)
0:25 'gl_PatchVerticesIn' (in int)
0:26 Sequence
0:26 move second child to first child (int)
0:26 'pid' (int)
0:26 'gl_PrimitiveID' (in int)
0:27 Sequence
0:27 move second child to first child (int)
0:27 'iid' (int)
0:27 'gl_InvocationID' (in int)
0:29 move second child to first child (4-component vector of float)
0:29 gl_Position: direct index for structure (4-component vector of float)
0:29 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:29 'gl_out' (out unsized array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:29 Constant:
0:29 1 (const int)
0:29 Constant:
0:29 0 (const int)
0:29 'p' (4-component vector of float)
0:30 move second child to first child (float)
0:30 gl_PointSize: direct index for structure (float)
0:30 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:30 'gl_out' (out unsized array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:30 Constant:
0:30 1 (const int)
0:30 Constant:
0:30 1 (const int)
0:30 'ps' (float)
0:31 move second child to first child (float)
0:31 direct index (float)
0:31 gl_ClipDistance: direct index for structure (unsized array of float)
0:31 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:31 'gl_out' (out unsized array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:31 Constant:
0:31 1 (const int)
0:31 Constant:
0:31 2 (const int)
0:31 Constant:
0:31 1 (const int)
0:31 'cd' (float)
0:33 move second child to first child (float)
0:33 direct index (patch float)
0:33 'gl_TessLevelOuter' (patch out 4-element array of float)
0:33 Constant:
0:33 3 (const int)
0:33 Constant:
0:33 3.200000
0:34 move second child to first child (float)
0:34 direct index (patch float)
0:34 'gl_TessLevelInner' (patch out 2-element array of float)
0:34 Constant:
0:34 1 (const int)
0:34 Constant:
0:34 1.300000
0:? Linker Objects 0:? Linker Objects
0:? 'outa' (1-element array of int)
0:? 'gl_out' (out unsized array of block{gl_Position,gl_PointSize,gl_ClipDistance})
Linked tessellation control stage: Linked tessellation control stage:
vertices = 4
400.tese 400.tese
Warning, version 400 is not yet complete; some version-specific features are present, but many are missing. Warning, version 400 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:5: 'barrier' : no matching overloaded function found ERROR: 0:3: 'vertices' : there is no such layout identifier for this stage taking an assigned value
ERROR: 1 compilation errors. No code generated. ERROR: 0:5: 'triangles' : cannot change previously set input primitive
ERROR: 0:6: 'isolines' : cannot change previously set input primitive
ERROR: 0:9: 'ccw' : cannot change previously set vertex order
ERROR: 0:12: 'equal_spacing' : cannot change previously set vertex spacing
ERROR: 0:13: 'fractional_even_spacing' : cannot change previously set vertex spacing
ERROR: 0:19: 'barrier' : no matching overloaded function found
ERROR: 7 compilation errors. No code generated.
input primitive = quads
vertex spacing = fractional_odd_spacing
triangle order = cw
using point mode
ERROR: node is still EOpNull! ERROR: node is still EOpNull!
0:3 Function Definition: main( (void) 0:17 Function Definition: main( (void)
0:3 Function Parameters: 0:17 Function Parameters:
0:5 Sequence 0:19 Sequence
0:5 Constant: 0:19 Constant:
0:5 0.000000 0:19 0.000000
0:21 Sequence
0:21 move second child to first child (int)
0:21 'a' (int)
0:21 Constant:
0:21 1512 (const int)
0:29 Sequence
0:29 move second child to first child (4-component vector of float)
0:29 'p' (4-component vector of float)
0:29 gl_Position: direct index for structure (4-component vector of float)
0:29 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:29 'gl_in' (in 32-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:29 Constant:
0:29 1 (const int)
0:29 Constant:
0:29 0 (const int)
0:30 Sequence
0:30 move second child to first child (float)
0:30 'ps' (float)
0:30 gl_PointSize: direct index for structure (float)
0:30 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:30 'gl_in' (in 32-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:30 Constant:
0:30 1 (const int)
0:30 Constant:
0:30 1 (const int)
0:31 Sequence
0:31 move second child to first child (float)
0:31 'cd' (float)
0:31 direct index (float)
0:31 gl_ClipDistance: direct index for structure (unsized array of float)
0:31 direct index (block{gl_Position,gl_PointSize,gl_ClipDistance})
0:31 'gl_in' (in 32-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:31 Constant:
0:31 1 (const int)
0:31 Constant:
0:31 2 (const int)
0:31 Constant:
0:31 2 (const int)
0:33 Sequence
0:33 move second child to first child (int)
0:33 'pvi' (int)
0:33 'gl_PatchVerticesIn' (in int)
0:34 Sequence
0:34 move second child to first child (int)
0:34 'pid' (int)
0:34 'gl_PrimitiveID' (in int)
0:35 Sequence
0:35 move second child to first child (3-component vector of float)
0:35 'tc' (3-component vector of float)
0:35 'gl_TessCoord' (in 3-component vector of float)
0:36 Sequence
0:36 move second child to first child (float)
0:36 'tlo' (float)
0:36 direct index (patch float)
0:36 'gl_TessLevelOuter' (patch in 4-element array of float)
0:36 Constant:
0:36 3 (const int)
0:37 Sequence
0:37 move second child to first child (float)
0:37 'tli' (float)
0:37 direct index (patch float)
0:37 'gl_TessLevelInner' (patch in 2-element array of float)
0:37 Constant:
0:37 1 (const int)
0:39 move second child to first child (4-component vector of float)
0:39 gl_Position: direct index for structure (gl_Position 4-component vector of float)
0:39 '__anon__1' (out block{gl_Position,gl_PointSize,gl_ClipDistance})
0:39 Constant:
0:39 0 (const uint)
0:39 'p' (4-component vector of float)
0:40 move second child to first child (float)
0:40 gl_PointSize: direct index for structure (gl_PointSize float)
0:40 '__anon__1' (out block{gl_Position,gl_PointSize,gl_ClipDistance})
0:40 Constant:
0:40 1 (const uint)
0:40 'ps' (float)
0:41 move second child to first child (float)
0:41 direct index (float)
0:41 gl_ClipDistance: direct index for structure (unsized array of float)
0:41 '__anon__1' (out block{gl_Position,gl_PointSize,gl_ClipDistance})
0:41 Constant:
0:41 2 (const uint)
0:41 Constant:
0:41 2 (const int)
0:41 'cd' (float)
0:? Linker Objects 0:? Linker Objects
Linked tessellation evaluation stage: Linked tessellation evaluation stage:
input primitive = quads
vertex spacing = fractional_odd_spacing
triangle order = cw
using point mode
...@@ -56,4 +56,8 @@ ERROR: Linking geometry stage: At least one geometry shader must specify an inpu ...@@ -56,4 +56,8 @@ ERROR: Linking geometry stage: At least one geometry shader must specify an inpu
ERROR: Linking geometry stage: At least one geometry shader must specify an output layout primitive ERROR: Linking geometry stage: At least one geometry shader must specify an output layout primitive
ERROR: Linking geometry stage: At least one geometry shader must specify a layout(max_vertices = value) ERROR: Linking geometry stage: At least one geometry shader must specify a layout(max_vertices = value)
invocations = 0
max_vertices = 0
input primitive = none
output primitive = none
...@@ -126,4 +126,8 @@ ERROR: Linking geometry stage: Missing entry point: Each stage requires one "voi ...@@ -126,4 +126,8 @@ ERROR: Linking geometry stage: Missing entry point: Each stage requires one "voi
ERROR: Linking geometry stage: At least one geometry shader must specify an output layout primitive ERROR: Linking geometry stage: At least one geometry shader must specify an output layout primitive
ERROR: Linking geometry stage: At least one geometry shader must specify a layout(max_vertices = value) ERROR: Linking geometry stage: At least one geometry shader must specify a layout(max_vertices = value)
invocations = 0
max_vertices = 0
input primitive = triangles
output primitive = none
...@@ -16,6 +16,9 @@ ERROR: 0:58: 'initializer list' : wrong number of structure members ...@@ -16,6 +16,9 @@ ERROR: 0:58: 'initializer list' : wrong number of structure members
ERROR: 13 compilation errors. No code generated. ERROR: 13 compilation errors. No code generated.
input primitive = none
vertex spacing = none
triangle order = none
ERROR: node is still EOpNull! ERROR: node is still EOpNull!
0:4 Sequence 0:4 Sequence
0:4 move second child to first child (2X2 matrix of float) 0:4 move second child to first child (2X2 matrix of float)
...@@ -160,5 +163,9 @@ ERROR: node is still EOpNull! ...@@ -160,5 +163,9 @@ ERROR: node is still EOpNull!
Linked tessellation evaluation stage: Linked tessellation evaluation stage:
ERROR: Linking tessellation evaluation stage: At least one tessellation shader must specify an input layout primitive
input primitive = none
vertex spacing = equal_spacing
triangle order = ccw
...@@ -127,9 +127,9 @@ ERROR: node is still EOpNull! ...@@ -127,9 +127,9 @@ ERROR: node is still EOpNull!
0:? '__anon__2' (layout(column_major shared ) uniform block{aooeu}) 0:? '__anon__2' (layout(column_major shared ) uniform block{aooeu})
0:? 'sampb1' (layout(binding=4 ) uniform sampler2D) 0:? 'sampb1' (layout(binding=4 ) uniform sampler2D)
0:? 'sampb2' (layout(binding=5 ) uniform 10-element array of sampler2D) 0:? 'sampb2' (layout(binding=5 ) uniform 10-element array of sampler2D)
0:? 'sampb3' (layout(binding=32 ) uniform sampler2D) 0:? 'sampb3' (layout(binding=80 ) uniform sampler2D)
0:? 'sampb4' (layout(binding=31 ) uniform sampler2D) 0:? 'sampb4' (layout(binding=31 ) uniform sampler2D)
0:? 'sampb5' (layout(binding=31 ) uniform 2-element array of sampler2D) 0:? 'sampb5' (layout(binding=79 ) uniform 2-element array of sampler2D)
0:? '__anon__3' (out block{gl_ClipDistance,}) 0:? '__anon__3' (out block{gl_ClipDistance,})
0:? 'gl_VertexID' (gl_VertexId int) 0:? 'gl_VertexID' (gl_VertexId int)
0:? 'gl_InstanceID' (gl_InstanceId int) 0:? 'gl_InstanceID' (gl_InstanceId int)
......
...@@ -302,4 +302,6 @@ ERROR: node is still EOpNull! ...@@ -302,4 +302,6 @@ ERROR: node is still EOpNull!
Linked fragment stage: Linked fragment stage:
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
...@@ -6,7 +6,7 @@ MaxVertexAttribs 64 ...@@ -6,7 +6,7 @@ MaxVertexAttribs 64
MaxVertexUniformComponents 4096 MaxVertexUniformComponents 4096
MaxVaryingFloats 64 MaxVaryingFloats 64
MaxVertexTextureImageUnits 32 MaxVertexTextureImageUnits 32
MaxCombinedTextureImageUnits 32 MaxCombinedTextureImageUnits 80
MaxTextureImageUnits 32 MaxTextureImageUnits 32
MaxFragmentUniformComponents 4096 MaxFragmentUniformComponents 4096
MaxDrawBuffers 32 MaxDrawBuffers 32
......
...@@ -110,8 +110,8 @@ Shader Functionality to Implement/Finish ...@@ -110,8 +110,8 @@ Shader Functionality to Implement/Finish
- patch in, patch out - patch in, patch out
- input/output arrays - input/output arrays
- unsized array sizing to gl_MaxPatchVertices, including gl_in/gl_out - unsized array sizing to gl_MaxPatchVertices, including gl_in/gl_out
- built-in variables, functions, and constants verification + built-in variables, functions, and constants verification
- layout qualifiers for primitive types + layout qualifiers for primitive types
- Polymorphic functions: Run-time selection of what function gets called, through the new keyword subroutine. - Polymorphic functions: Run-time selection of what function gets called, through the new keyword subroutine.
- 64bit floating point numbers with the new type keyword double. Built-in functions extended for doubles, and new function matching rules are added to both allow implicit conversions when calling a function and preserve most existing function matching once doubles are included. - 64bit floating point numbers with the new type keyword double. Built-in functions extended for doubles, and new function matching rules are added to both allow implicit conversions when calling a function and preserve most existing function matching once doubles are included.
+ More implicit conversions + More implicit conversions
...@@ -143,7 +143,7 @@ Shader Functionality to Implement/Finish ...@@ -143,7 +143,7 @@ Shader Functionality to Implement/Finish
+ Add streams out from geometry shader. Output can be directed to streams through + Add streams out from geometry shader. Output can be directed to streams through
+ EmitStreamVertex() and EndStreamPrimitive(). + EmitStreamVertex() and EndStreamPrimitive().
GLSL 4.1 GLSL 4.1
- Support for partitioning shaders into multiple programs to provide light-weight mixing of different shader stages. + Support for partitioning shaders into multiple programs to provide light-weight mixing of different shader stages.
(GL_ARB_separate_shader_objects) (GL_ARB_separate_shader_objects)
- layout qualifiers - layout qualifiers
- redeclaration of input/output blocks - redeclaration of input/output blocks
......
...@@ -221,6 +221,19 @@ enum TLayoutGeometry { ...@@ -221,6 +221,19 @@ enum TLayoutGeometry {
ElgIsolines, ElgIsolines,
}; };
enum TVertexSpacing {
EvsNone,
EvsEqual,
EvsFractionalEven,
EvsFractionalOdd
};
enum TVertexOrder {
EvoNone,
EvoCw,
EvoCcw
};
class TQualifier { class TQualifier {
public: public:
void clear() void clear()
...@@ -232,7 +245,7 @@ public: ...@@ -232,7 +245,7 @@ public:
smooth = false; smooth = false;
flat = false; flat = false;
nopersp = false; nopersp = false;
patch = false; patch = false; // TODO 4.0 tessellation: implement semantics of patch (all of 4.3 stuff...), including arrayed inputs
sample = false; sample = false;
shared = false; shared = false;
coherent = false; coherent = false;
...@@ -405,6 +418,23 @@ public: ...@@ -405,6 +418,23 @@ public:
default: return "none"; default: return "none";
} }
} }
static const char* getVertexSpacingString(TVertexSpacing spacing)
{
switch (spacing) {
case EvsEqual: return "equal_spacing";
case EvsFractionalEven: return "fractional_even_spacing";
case EvsFractionalOdd: return "fractional_odd_spacing";
default: return "none";
}
}
static const char* getVertexOrderString(TVertexOrder order)
{
switch (order) {
case EvoCw: return "cw";
case EvoCcw: return "ccw";
default: return "none";
}
}
static int mapGeometryToSize(TLayoutGeometry geometry) static int mapGeometryToSize(TLayoutGeometry geometry)
{ {
switch (geometry) { switch (geometry) {
...@@ -421,11 +451,14 @@ public: ...@@ -421,11 +451,14 @@ public:
// Qualifiers that don't need to be keep per object. They have shader scope, not object scope. // Qualifiers that don't need to be keep per object. They have shader scope, not object scope.
// So, they will not be part of TType, TQualifier, etc. // So, they will not be part of TType, TQualifier, etc.
struct TShaderQualifiers { struct TShaderQualifiers {
TLayoutGeometry geometry; // geometry shader in/out primitives TLayoutGeometry geometry; // geometry/tessellation shader in/out primitives
bool pixelCenterInteger; // fragment shader bool pixelCenterInteger; // fragment shader
bool originUpperLeft; // fragment shader bool originUpperLeft; // fragment shader
int invocations; // 0 means no declaration int invocations; // 0 means no declaration
int maxVertices; int vertices; // both for tessellation "vertices" and geometry "max_vertices"
TVertexSpacing spacing;
TVertexOrder order;
bool pointMode;
void init() void init()
{ {
...@@ -433,7 +466,10 @@ struct TShaderQualifiers { ...@@ -433,7 +466,10 @@ struct TShaderQualifiers {
originUpperLeft = false; originUpperLeft = false;
pixelCenterInteger = false; pixelCenterInteger = false;
invocations = 0; // 0 means no declaration invocations = 0; // 0 means no declaration
maxVertices = 0; vertices = 0;
spacing = EvsNone;
order = EvoNone;
pointMode = false;
} }
}; };
......
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
// source have to figure out how to create revision.h just to get a build // source have to figure out how to create revision.h just to get a build
// going. However, if it is not updated, it can be a version behind. // going. However, if it is not updated, it can be a version behind.
#define GLSLANG_REVISION "24406" #define GLSLANG_REVISION "24420"
#define GLSLANG_DATE "2013/12/08 17:37:46" #define GLSLANG_DATE "2013/12/09 17:25:14"
...@@ -2061,7 +2061,7 @@ void TParseContext::nonInitConstCheck(TSourceLoc loc, TString& identifier, TType ...@@ -2061,7 +2061,7 @@ void TParseContext::nonInitConstCheck(TSourceLoc loc, TString& identifier, TType
// //
TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString& identifier, const TQualifier& qualifier, const TShaderQualifiers& publicType, bool& newDeclaration) TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString& identifier, const TQualifier& qualifier, const TShaderQualifiers& publicType, bool& newDeclaration)
{ {
if (profile == EEsProfile || ! builtInName(identifier) || symbolTable.atBuiltInLevel()) if (profile == EEsProfile || ! builtInName(identifier) || symbolTable.atBuiltInLevel() || ! symbolTable.atGlobalLevel())
return 0; return 0;
// Potentially redeclaring a built-in variable... // Potentially redeclaring a built-in variable...
...@@ -2589,7 +2589,52 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType, ...@@ -2589,7 +2589,52 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType,
return; return;
} }
} else { } else {
// TODO: 4.0 tessellation evaluation // tessellation evaluation
// TODO: tessellation: semantic check these are on the in qualifier only
// input primitive
if (id == TQualifier::getGeometryString(ElgTriangles)) {
publicType.shaderQualifiers.geometry = ElgTriangles;
return;
}
if (id == TQualifier::getGeometryString(ElgQuads)) {
publicType.shaderQualifiers.geometry = ElgQuads;
return;
}
if (id == TQualifier::getGeometryString(ElgIsolines)) {
publicType.shaderQualifiers.geometry = ElgIsolines;
return;
}
// vertex spacing
if (id == TQualifier::getVertexSpacingString(EvsEqual)) {
publicType.shaderQualifiers.spacing = EvsEqual;
return;
}
if (id == TQualifier::getVertexSpacingString(EvsFractionalEven)) {
publicType.shaderQualifiers.spacing = EvsFractionalEven;
return;
}
if (id == TQualifier::getVertexSpacingString(EvsFractionalOdd)) {
publicType.shaderQualifiers.spacing = EvsFractionalOdd;
return;
}
// triangle order
if (id == TQualifier::getVertexOrderString(EvoCw)) {
publicType.shaderQualifiers.order = EvoCw;
return;
}
if (id == TQualifier::getVertexOrderString(EvoCcw)) {
publicType.shaderQualifiers.order = EvoCcw;
return;
}
// point mode
if (id == "point_mode") {
publicType.shaderQualifiers.pointMode = true;
return;
}
} }
} }
if (language == EShLangFragment) { if (language == EShLangFragment) {
...@@ -2636,14 +2681,30 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType, ...@@ -2636,14 +2681,30 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType,
publicType.qualifier.layoutBinding = value; publicType.qualifier.layoutBinding = value;
return; return;
} }
if (language == EShLangGeometry) { switch (language) {
case EShLangVertex:
break;
case EShLangTessControl:
if (id == "vertices") {
// TODO: tessellation: implement gl_out[] array sizing based on this
// TODO: tessellation: semantic check this is on the out qualifier only
publicType.shaderQualifiers.vertices = value;
return;
}
break;
case EShLangTessEvaluation:
break;
case EShLangGeometry:
if (id == "invocations") { if (id == "invocations") {
profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, 0, "invocations"); profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, 0, "invocations");
publicType.shaderQualifiers.invocations = value; publicType.shaderQualifiers.invocations = value;
return; return;
} }
if (id == "max_vertices") { if (id == "max_vertices") {
publicType.shaderQualifiers.maxVertices = value; publicType.shaderQualifiers.vertices = value;
if (value > resources.maxGeometryOutputVertices) if (value > resources.maxGeometryOutputVertices)
error(loc, "too large, must be less than gl_MaxGeometryOutputVertices", "max_vertices", ""); error(loc, "too large, must be less than gl_MaxGeometryOutputVertices", "max_vertices", "");
return; return;
...@@ -2652,7 +2713,18 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType, ...@@ -2652,7 +2713,18 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType,
publicType.qualifier.layoutStream = value; publicType.qualifier.layoutStream = value;
return; return;
} }
break;
case EShLangFragment:
break;
case EShLangCompute:
break;
default:
break;
} }
error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), ""); error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), "");
} }
...@@ -2666,8 +2738,8 @@ void TParseContext::mergeShaderLayoutQualifiers(TSourceLoc loc, TShaderQualifier ...@@ -2666,8 +2738,8 @@ void TParseContext::mergeShaderLayoutQualifiers(TSourceLoc loc, TShaderQualifier
dst.geometry = src.geometry; dst.geometry = src.geometry;
if (src.invocations != 0) if (src.invocations != 0)
dst.invocations = src.invocations; dst.invocations = src.invocations;
if (src.maxVertices != 0) if (src.vertices != 0)
dst.maxVertices = src.maxVertices; dst.vertices = src.vertices;
if (src.pixelCenterInteger) if (src.pixelCenterInteger)
dst.pixelCenterInteger = src.pixelCenterInteger; dst.pixelCenterInteger = src.pixelCenterInteger;
if (src.originUpperLeft) if (src.originUpperLeft)
...@@ -2819,7 +2891,7 @@ void TParseContext::checkNoShaderLayouts(TSourceLoc loc, const TShaderQualifiers ...@@ -2819,7 +2891,7 @@ void TParseContext::checkNoShaderLayouts(TSourceLoc loc, const TShaderQualifiers
error(loc, message, TQualifier::getGeometryString(shaderQualifiers.geometry), ""); error(loc, message, TQualifier::getGeometryString(shaderQualifiers.geometry), "");
if (shaderQualifiers.invocations > 0) if (shaderQualifiers.invocations > 0)
error(loc, message, "invocations", ""); error(loc, message, "invocations", "");
if (shaderQualifiers.maxVertices > 0) if (shaderQualifiers.vertices > 0)
error(loc, message, "max_vertices", ""); error(loc, message, "max_vertices", "");
} }
...@@ -3604,9 +3676,13 @@ void TParseContext::invariantCheck(TSourceLoc loc, const TType& type, const TStr ...@@ -3604,9 +3676,13 @@ void TParseContext::invariantCheck(TSourceLoc loc, const TType& type, const TStr
// //
void TParseContext::updateStandaloneQualifierDefaults(TSourceLoc loc, const TPublicType& publicType) void TParseContext::updateStandaloneQualifierDefaults(TSourceLoc loc, const TPublicType& publicType)
{ {
if (publicType.shaderQualifiers.maxVertices) { if (publicType.shaderQualifiers.vertices) {
if (! intermediate.setMaxVertices(publicType.shaderQualifiers.maxVertices)) if (! intermediate.setVertices(publicType.shaderQualifiers.vertices)) {
error(loc, "cannot change previously set layout value", "max_vertices", ""); if (language == EShLangGeometry)
error(loc, "cannot change previously set layout value", "max_vertices", "");
else
error(loc, "cannot change previously set layout value", "vertices", "");
}
} }
if (publicType.shaderQualifiers.invocations) { if (publicType.shaderQualifiers.invocations) {
if (! intermediate.setInvocations(publicType.shaderQualifiers.invocations)) if (! intermediate.setInvocations(publicType.shaderQualifiers.invocations))
...@@ -3620,6 +3696,8 @@ void TParseContext::updateStandaloneQualifierDefaults(TSourceLoc loc, const TPub ...@@ -3620,6 +3696,8 @@ void TParseContext::updateStandaloneQualifierDefaults(TSourceLoc loc, const TPub
case ElgLinesAdjacency: case ElgLinesAdjacency:
case ElgTriangles: case ElgTriangles:
case ElgTrianglesAdjacency: case ElgTrianglesAdjacency:
case ElgQuads:
case ElgIsolines:
if (intermediate.setInputPrimitive(publicType.shaderQualifiers.geometry)) if (intermediate.setInputPrimitive(publicType.shaderQualifiers.geometry))
checkInputArrayConsistency(loc); checkInputArrayConsistency(loc);
else else
...@@ -3642,6 +3720,16 @@ void TParseContext::updateStandaloneQualifierDefaults(TSourceLoc loc, const TPub ...@@ -3642,6 +3720,16 @@ void TParseContext::updateStandaloneQualifierDefaults(TSourceLoc loc, const TPub
} else } else
error(loc, "cannot be used here", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); error(loc, "cannot be used here", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), "");
} }
if (publicType.shaderQualifiers.spacing != EvsNone) {
if (! intermediate.setVertexSpacing(publicType.shaderQualifiers.spacing))
error(loc, "cannot change previously set vertex spacing", TQualifier::getVertexSpacingString(publicType.shaderQualifiers.spacing), "");
}
if (publicType.shaderQualifiers.order != EvoNone) {
if (! intermediate.setVertexOrder(publicType.shaderQualifiers.order))
error(loc, "cannot change previously set vertex order", TQualifier::getVertexOrderString(publicType.shaderQualifiers.order), "");
}
if (publicType.shaderQualifiers.pointMode)
intermediate.setPointMode();
const TQualifier& qualifier = publicType.qualifier; const TQualifier& qualifier = publicType.qualifier;
......
...@@ -523,7 +523,7 @@ bool CompileDeferred( ...@@ -523,7 +523,7 @@ bool CompileDeferred(
} }
if (messages & EShMsgAST) if (messages & EShMsgAST)
intermediate.outputTree(parseContext.infoSink); intermediate.output(parseContext.infoSink, true);
delete [] lengths; delete [] lengths;
delete [] strings; delete [] strings;
...@@ -1057,12 +1057,12 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages) ...@@ -1057,12 +1057,12 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
std::list<TShader*>::const_iterator it; std::list<TShader*>::const_iterator it;
for (it = stages[stage].begin(); it != stages[stage].end(); ++it) for (it = stages[stage].begin(); it != stages[stage].end(); ++it)
intermediate[stage]->merge(*infoSink, *(*it)->intermediate); intermediate[stage]->merge(*infoSink, *(*it)->intermediate);
if (messages & EShMsgAST)
intermediate[stage]->outputTree(*infoSink);
} }
intermediate[stage]->errorCheck(*infoSink); intermediate[stage]->finalCheck(*infoSink);
if (messages & EShMsgAST)
intermediate[stage]->output(*infoSink, stages[stage].size() > 1);
return intermediate[stage]->getNumErrors() == 0; return intermediate[stage]->getNumErrors() == 0;
} }
......
...@@ -161,6 +161,7 @@ void TParseContext::initializeExtensionBehavior() ...@@ -161,6 +161,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[GL_ARB_texture_gather] = EBhDisable; extensionBehavior[GL_ARB_texture_gather] = EBhDisable;
extensionBehavior[GL_ARB_gpu_shader5] = EBhDisablePartial; extensionBehavior[GL_ARB_gpu_shader5] = EBhDisablePartial;
extensionBehavior[GL_ARB_separate_shader_objects] = EBhDisable; extensionBehavior[GL_ARB_separate_shader_objects] = EBhDisable;
extensionBehavior[GL_ARB_tessellation_shader] = EBhDisable;
} }
// Get code that is not part of a shared symbol table, is specific to this shader, // Get code that is not part of a shared symbol table, is specific to this shader,
...@@ -183,6 +184,7 @@ const char* TParseContext::getPreamble() ...@@ -183,6 +184,7 @@ const char* TParseContext::getPreamble()
"#define GL_ARB_texture_gather 1\n" "#define GL_ARB_texture_gather 1\n"
"#define GL_ARB_gpu_shader5 1\n" "#define GL_ARB_gpu_shader5 1\n"
"#define GL_ARB_separate_shader_objects 1\n"; "#define GL_ARB_separate_shader_objects 1\n";
"#define GL_ARB_tessellation_shader 1\n";
} }
} }
......
...@@ -85,6 +85,7 @@ const char* const GL_ARB_shading_language_420pack = "GL_ARB_shading_language_420 ...@@ -85,6 +85,7 @@ const char* const GL_ARB_shading_language_420pack = "GL_ARB_shading_language_420
const char* const GL_ARB_texture_gather = "GL_ARB_texture_gather"; const char* const GL_ARB_texture_gather = "GL_ARB_texture_gather";
const char* const GL_ARB_gpu_shader5 = "GL_ARB_gpu_shader5"; const char* const GL_ARB_gpu_shader5 = "GL_ARB_gpu_shader5";
const char* const GL_ARB_separate_shader_objects = "GL_ARB_separate_shader_objects"; const char* const GL_ARB_separate_shader_objects = "GL_ARB_separate_shader_objects";
const char* const GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader"; // TODO: tessellation: make this extension work on version 150 and above shaders
} // end namespace glslang } // end namespace glslang
......
...@@ -577,22 +577,46 @@ bool OutputSwitch(bool /* preVisit */, TIntermSwitch* node, TIntermTraverser* it ...@@ -577,22 +577,46 @@ bool OutputSwitch(bool /* preVisit */, TIntermSwitch* node, TIntermTraverser* it
// Individual functions can be initialized to 0 to skip processing of that // Individual functions can be initialized to 0 to skip processing of that
// type of node. It's children will still be processed. // type of node. It's children will still be processed.
// //
void TIntermediate::outputTree(TInfoSink& infoSink) void TIntermediate::output(TInfoSink& infoSink, bool tree)
{ {
if (language == EShLangGeometry) { switch (language) {
case EShLangVertex:
break;
case EShLangTessControl:
infoSink.debug << "vertices = " << vertices << "\n";
break;
case EShLangTessEvaluation:
infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n";
infoSink.debug << "vertex spacing = " << TQualifier::getVertexSpacingString(vertexSpacing) << "\n";
infoSink.debug << "triangle order = " << TQualifier::getVertexOrderString(vertexOrder) << "\n";
if (pointMode)
infoSink.debug << "using point mode\n";
break;
case EShLangGeometry:
infoSink.debug << "invocations = " << invocations << "\n"; infoSink.debug << "invocations = " << invocations << "\n";
infoSink.debug << "max_vertices = " << maxVertices << "\n"; infoSink.debug << "max_vertices = " << vertices << "\n";
infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n"; infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n";
infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n"; infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n";
} break;
if (language == EShLangFragment) {
case EShLangFragment:
if (pixelCenterInteger) if (pixelCenterInteger)
infoSink.debug << "gl_FragCoord pixel center is integer\n"; infoSink.debug << "gl_FragCoord pixel center is integer\n";
if (originUpperLeft) if (originUpperLeft)
infoSink.debug << "gl_FragCoord origin is upper left\n"; infoSink.debug << "gl_FragCoord origin is upper left\n";
break;
case EShLangCompute:
break;
default:
break;
} }
if (treeRoot == 0) if (treeRoot == 0 || ! tree)
return; return;
TOutputTraverser it(infoSink); TOutputTraverser it(infoSink);
......
...@@ -80,15 +80,30 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) ...@@ -80,15 +80,30 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
inputPrimitive = unit.inputPrimitive; inputPrimitive = unit.inputPrimitive;
else if (inputPrimitive != unit.inputPrimitive) else if (inputPrimitive != unit.inputPrimitive)
error(infoSink, "Contradictory input layout primitives"); error(infoSink, "Contradictory input layout primitives");
if (outputPrimitive == ElgNone) if (outputPrimitive == ElgNone)
outputPrimitive = unit.outputPrimitive; outputPrimitive = unit.outputPrimitive;
else if (outputPrimitive != unit.outputPrimitive) else if (outputPrimitive != unit.outputPrimitive)
error(infoSink, "Contradictory output layout primitives"); error(infoSink, "Contradictory output layout primitives");
if (maxVertices == 0)
maxVertices = unit.maxVertices; if (vertices == 0)
else if (maxVertices != unit.maxVertices) vertices = unit.vertices;
else if (vertices != unit.vertices)
error(infoSink, "Contradictory layout max_vertices values"); error(infoSink, "Contradictory layout max_vertices values");
if (vertexSpacing == ElgNone)
vertexSpacing = unit.vertexSpacing;
else if (vertexSpacing != unit.vertexSpacing)
error(infoSink, "Contradictory input vertex spacing");
if (vertexOrder == EvoNone)
vertexOrder = unit.vertexOrder;
else if (vertexOrder != unit.vertexOrder)
error(infoSink, "Contradictory triangle ordering");
if (unit.pointMode)
pointMode = true;
if (unit.treeRoot == 0) if (unit.treeRoot == 0)
return; return;
...@@ -259,7 +274,9 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy ...@@ -259,7 +274,9 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
// Do final link-time error checking of a complete (merged) intermediate representation. // Do final link-time error checking of a complete (merged) intermediate representation.
// (Much error checking was done during merging). // (Much error checking was done during merging).
// //
void TIntermediate::errorCheck(TInfoSink& infoSink) // Also, lock in defaults of things not set.
//
void TIntermediate::finalCheck(TInfoSink& infoSink)
{ {
if (numMains < 1) if (numMains < 1)
error(infoSink, "Missing entry point: Each stage requires one \"void main()\" entry point"); error(infoSink, "Missing entry point: Each stage requires one \"void main()\" entry point");
...@@ -281,14 +298,21 @@ void TIntermediate::errorCheck(TInfoSink& infoSink) ...@@ -281,14 +298,21 @@ void TIntermediate::errorCheck(TInfoSink& infoSink)
switch (language) { switch (language) {
case EShLangVertex: case EShLangVertex:
case EShLangTessControl: case EShLangTessControl:
break;
case EShLangTessEvaluation: case EShLangTessEvaluation:
if (inputPrimitive == ElgNone)
error(infoSink, "At least one tessellation shader must specify an input layout primitive");
if (vertexSpacing == EvsNone)
vertexSpacing = EvsEqual;
if (vertexOrder == EvoNone)
vertexOrder = EvoCcw;
break; break;
case EShLangGeometry: case EShLangGeometry:
if (inputPrimitive == ElgNone) if (inputPrimitive == ElgNone)
error(infoSink, "At least one geometry shader must specify an input layout primitive"); error(infoSink, "At least one geometry shader must specify an input layout primitive");
if (outputPrimitive == ElgNone) if (outputPrimitive == ElgNone)
error(infoSink, "At least one geometry shader must specify an output layout primitive"); error(infoSink, "At least one geometry shader must specify an output layout primitive");
if (maxVertices == 0) if (vertices == 0)
error(infoSink, "At least one geometry shader must specify a layout(max_vertices = value)"); error(infoSink, "At least one geometry shader must specify a layout(max_vertices = value)");
break; break;
case EShLangFragment: case EShLangFragment:
......
...@@ -61,9 +61,10 @@ class TIntermediate { ...@@ -61,9 +61,10 @@ class TIntermediate {
public: public:
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v),
numMains(0), numErrors(0), recursive(false), numMains(0), numErrors(0), recursive(false),
invocations(0), maxVertices(0), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false) { } invocations(0), vertices(0), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false),
vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false) { }
bool postProcess(TIntermNode*, EShLanguage); bool postProcess(TIntermNode*, EShLanguage);
void outputTree(TInfoSink&); void output(TInfoSink&, bool tree);
void removeTree(); void removeTree();
void setVersion(int v) { version = v; } void setVersion(int v) { version = v; }
...@@ -121,11 +122,11 @@ public: ...@@ -121,11 +122,11 @@ public:
invocations = i; invocations = i;
return true; return true;
} }
bool setMaxVertices(int m) bool setVertices(int m)
{ {
if (maxVertices > 0) if (vertices > 0)
return maxVertices == m; return vertices == m;
maxVertices = m; vertices = m;
return true; return true;
} }
bool setInputPrimitive(TLayoutGeometry p) bool setInputPrimitive(TLayoutGeometry p)
...@@ -135,7 +136,22 @@ public: ...@@ -135,7 +136,22 @@ public:
inputPrimitive = p; inputPrimitive = p;
return true; return true;
} }
TLayoutGeometry getInputPrimitive() { return inputPrimitive; } TLayoutGeometry getInputPrimitive() const { return inputPrimitive; }
bool setVertexSpacing(TVertexSpacing s)
{
if (vertexSpacing != EvsNone)
return vertexSpacing == s;
vertexSpacing = s;
return true;
}
bool setVertexOrder(TVertexOrder o)
{
if (vertexOrder != EvoNone)
return vertexOrder == o;
vertexOrder = o;
return true;
}
void setPointMode() { pointMode = true; }
bool setOutputPrimitive(TLayoutGeometry p) bool setOutputPrimitive(TLayoutGeometry p)
{ {
if (outputPrimitive != ElgNone) if (outputPrimitive != ElgNone)
...@@ -150,7 +166,7 @@ public: ...@@ -150,7 +166,7 @@ public:
void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee); void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee);
void merge(TInfoSink&, TIntermediate&); void merge(TInfoSink&, TIntermediate&);
void errorCheck(TInfoSink&); void finalCheck(TInfoSink&);
void addIoAccessed(const TString& name) { ioAccessed.insert(name); } void addIoAccessed(const TString& name) { ioAccessed.insert(name); }
bool inIoAccessed(const TString& name) const { return ioAccessed.find(name) != ioAccessed.end(); } bool inIoAccessed(const TString& name) const { return ioAccessed.find(name) != ioAccessed.end(); }
...@@ -177,11 +193,14 @@ protected: ...@@ -177,11 +193,14 @@ protected:
int numErrors; int numErrors;
bool recursive; bool recursive;
int invocations; int invocations;
int maxVertices; int vertices;
TLayoutGeometry inputPrimitive; TLayoutGeometry inputPrimitive;
TLayoutGeometry outputPrimitive; TLayoutGeometry outputPrimitive;
bool pixelCenterInteger; bool pixelCenterInteger;
bool originUpperLeft; bool originUpperLeft;
TVertexSpacing vertexSpacing;
TVertexOrder vertexOrder;
bool pointMode;
// for detecting recursion: pair is <caller, callee> // for detecting recursion: pair is <caller, callee>
struct TCall { struct TCall {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment