Commit 105704ef by John Kessenich

glslang: Finish turn on of AEP geometry shaders for ES 3.1.

parent 6626cadb
...@@ -179,6 +179,17 @@ layout(depth_any) out float gl_FragDepth; // ERROR, non-ES ...@@ -179,6 +179,17 @@ layout(depth_any) out float gl_FragDepth; // ERROR, non-ES
void foo_IO() void foo_IO()
{ {
gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared
gl_Layer; // ERROR, not present
gl_PrimitiveID; // ERROR, not present
bool f = gl_FrontFacing;
} }
out float gl_FragDepth; out float gl_FragDepth;
#extension GL_OES_geometry_shader : enable
void foo_GS()
{
highp int l = gl_Layer;
highp int p = gl_PrimitiveID;
}
#version 310 es #version 310 es
#ifdef GL_EXT_geometry_shader
#extension GL_EXT_geometry_shader : enable #extension GL_EXT_geometry_shader : enable
#else
#error no GL_EXT_geometry_shader
#endif
#ifndef GL_OES_geometry_shader
#error no GL_OES_geometry_shader
#endif
precision mediump float; precision mediump float;
...@@ -18,15 +26,15 @@ out fromVertex { // okay to reuse a block name for another block name ...@@ -18,15 +26,15 @@ out fromVertex { // okay to reuse a block name for another block name
vec3 color; vec3 color;
}; };
out fooB { out fooB { // ERROR, cannot reuse block name as block instance
vec2 color; vec2 color;
} fromVertex; // ERROR, cannot reuse block name as block instance } fromVertex;
int fromVertex; // ERROR, cannot reuse a block name for something else int fromVertex; // ERROR, cannot reuse a block name for something else
out fooC { out fooC { // ERROR, cannot have same name for block and instance name
vec2 color; vec2 color;
} fooC; // ERROR, cannot have same name for block and instance name } fooC;
void main() void main()
{ {
...@@ -74,7 +82,7 @@ layout(lines) out; // ERROR, not on output ...@@ -74,7 +82,7 @@ layout(lines) out; // ERROR, not on output
layout(lines_adjacency) in; layout(lines_adjacency) in;
layout(triangles) in; // ERROR, can't change it layout(triangles) in; // ERROR, can't change it
layout(triangles_adjacency) in; // ERROR, can't change it layout(triangles_adjacency) in; // ERROR, can't change it
layout(invocations = 4) in; // ERROR, not until 4.0 layout(invocations = 4) in;
in sameName { in sameName {
int a15; int a15;
...@@ -107,4 +115,25 @@ void fooe1() ...@@ -107,4 +115,25 @@ void fooe1()
{ {
gl_ViewportIndex; // ERROR, not in ES gl_ViewportIndex; // ERROR, not in ES
gl_MaxViewports; // ERROR, not in ES gl_MaxViewports; // ERROR, not in ES
insn.length(); // 4: lines_adjacency
int inv = gl_InvocationID;
}
in vec4 explArray[4];
in vec4 explArrayBad[5]; // ERROR, wrong size
in vec4 nonArrayed; // ERROR, not an array
flat out vec3 myColor1;
centroid out vec3 myColor2;
centroid in vec3 centr[];
sample out vec4 perSampleColor; // ERROR without sample extensions
layout(max_vertices = 200) out; // matching redecl
layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component
void notHere()
{
gl_MaxGeometryVaryingComponents; // ERROR, not in ES
gl_VerticesIn; // ERROR, not in ES
} }
...@@ -54,11 +54,19 @@ ERROR: 0:173: 'pixel_center_integer' : not supported with this profile: es ...@@ -54,11 +54,19 @@ ERROR: 0:173: 'pixel_center_integer' : not supported with this profile: es
ERROR: 0:173: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord ERROR: 0:173: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord
ERROR: 0:177: 'depth layout qualifier' : not supported with this profile: es ERROR: 0:177: 'depth layout qualifier' : not supported with this profile: es
ERROR: 0:181: 'assign' : l-value required "gl_FragDepth" (can't modify gl_FragDepth if using early_fragment_tests) ERROR: 0:181: 'assign' : l-value required "gl_FragDepth" (can't modify gl_FragDepth if using early_fragment_tests)
ERROR: 54 compilation errors. No code generated. ERROR: 0:182: 'gl_Layer' : required extension not requested: Possible extensions include:
GL_EXT_geometry_shader
GL_OES_geometry_shader
ERROR: 0:183: 'gl_PrimitiveID' : required extension not requested: Possible extensions include:
GL_EXT_geometry_shader
GL_OES_geometry_shader
ERROR: 56 compilation errors. No code generated.
Shader version: 310 Shader version: 310
Requested GL_EXT_shader_io_blocks Requested GL_EXT_shader_io_blocks
Requested GL_OES_geometry_shader
Requested GL_OES_shader_io_blocks
gl_FragCoord pixel center is integer gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left gl_FragCoord origin is upper left
using early_fragment_tests using early_fragment_tests
...@@ -315,6 +323,23 @@ ERROR: node is still EOpNull! ...@@ -315,6 +323,23 @@ ERROR: node is still EOpNull!
0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth) 0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
0:181 Constant: 0:181 Constant:
0:181 0.200000 0:181 0.200000
0:182 'gl_Layer' (flat in highp int Layer)
0:183 'gl_PrimitiveID' (flat in highp int PrimitiveID)
0:184 Sequence
0:184 move second child to first child (temp bool)
0:184 'f' (temp bool)
0:184 'gl_FrontFacing' (gl_FrontFacing bool Face)
0:191 Function Definition: foo_GS( (global void)
0:191 Function Parameters:
0:193 Sequence
0:193 Sequence
0:193 move second child to first child (temp highp int)
0:193 'l' (temp highp int)
0:193 'gl_Layer' (flat in highp int Layer)
0:194 Sequence
0:194 move second child to first child (temp highp int)
0:194 'p' (temp highp int)
0:194 'gl_PrimitiveID' (flat in highp int PrimitiveID)
0:? Linker Objects 0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float) 0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float) 0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
...@@ -371,6 +396,8 @@ ERROR: Linking fragment stage: when more than one fragment shader output, all mu ...@@ -371,6 +396,8 @@ ERROR: Linking fragment stage: when more than one fragment shader output, all mu
Shader version: 310 Shader version: 310
Requested GL_EXT_shader_io_blocks Requested GL_EXT_shader_io_blocks
Requested GL_OES_geometry_shader
Requested GL_OES_shader_io_blocks
gl_FragCoord pixel center is integer gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left gl_FragCoord origin is upper left
using early_fragment_tests using early_fragment_tests
...@@ -627,6 +654,23 @@ ERROR: node is still EOpNull! ...@@ -627,6 +654,23 @@ ERROR: node is still EOpNull!
0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth) 0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
0:181 Constant: 0:181 Constant:
0:181 0.200000 0:181 0.200000
0:182 'gl_Layer' (flat in highp int Layer)
0:183 'gl_PrimitiveID' (flat in highp int PrimitiveID)
0:184 Sequence
0:184 move second child to first child (temp bool)
0:184 'f' (temp bool)
0:184 'gl_FrontFacing' (gl_FrontFacing bool Face)
0:191 Function Definition: foo_GS( (global void)
0:191 Function Parameters:
0:193 Sequence
0:193 Sequence
0:193 move second child to first child (temp highp int)
0:193 'l' (temp highp int)
0:193 'gl_Layer' (flat in highp int Layer)
0:194 Sequence
0:194 move second child to first child (temp highp int)
0:194 'p' (temp highp int)
0:194 'gl_PrimitiveID' (flat in highp int PrimitiveID)
0:? Linker Objects 0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float) 0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float) 0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
......
...@@ -1474,7 +1474,7 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -1474,7 +1474,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
stageBuiltins[EShLangVertex].append( stageBuiltins[EShLangVertex].append(
"out gl_PerVertex {" "out gl_PerVertex {"
"highp vec4 gl_Position;" // needs qualifier fixed later "highp vec4 gl_Position;" // needs qualifier fixed later
"highp float gl_PointSize;" // needs qualifier fixed later "highp float gl_PointSize;" // needs qualifier fixed later
"};" "};"
); );
} }
...@@ -1674,7 +1674,7 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -1674,7 +1674,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
stageBuiltins[EShLangTessEvaluation].append( stageBuiltins[EShLangTessEvaluation].append(
"};" "};"
"\n"); "\n");
} else { } else if (profile == EEsProfile && version >= 310) {
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
// as it depends on the resource sizing of gl_MaxPatchVertices. // as it depends on the resource sizing of gl_MaxPatchVertices.
...@@ -1792,7 +1792,9 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -1792,7 +1792,9 @@ void TBuiltIns::initialize(int version, EProfile profile)
); );
if (version >= 310) if (version >= 310)
stageBuiltins[EShLangFragment].append( stageBuiltins[EShLangFragment].append(
"bool gl_HelperInvocation;" // needs qualifier fixed later "bool gl_HelperInvocation;" // needs qualifier fixed later
"flat in highp int gl_PrimitiveID;" // needs qualifier fixed later
"flat in highp int gl_Layer;" // needs qualifier fixed later
); );
} }
stageBuiltins[EShLangFragment].append( stageBuiltins[EShLangFragment].append(
...@@ -2946,6 +2948,8 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb ...@@ -2946,6 +2948,8 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
} }
symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &GL_EXT_frag_depth); symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &GL_EXT_frag_depth);
symbolTable.setVariableExtensions("gl_PrimitiveID", Num_AEP_geometry_shader, AEP_geometry_shader);
symbolTable.setVariableExtensions("gl_Layer", Num_AEP_geometry_shader, AEP_geometry_shader);
break; break;
case EShLangCompute: case EShLangCompute:
......
...@@ -181,7 +181,7 @@ void TParseContext::initializeExtensionBehavior() ...@@ -181,7 +181,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[GL_OES_shader_image_atomic] = EBhDisablePartial; extensionBehavior[GL_OES_shader_image_atomic] = EBhDisablePartial;
extensionBehavior[GL_OES_shader_multisample_interpolation] = EBhDisablePartial; extensionBehavior[GL_OES_shader_multisample_interpolation] = EBhDisablePartial;
extensionBehavior[GL_OES_texture_storage_multisample_2d_array] = EBhDisablePartial; extensionBehavior[GL_OES_texture_storage_multisample_2d_array] = EBhDisablePartial;
extensionBehavior[GL_EXT_geometry_shader] = EBhDisablePartial; extensionBehavior[GL_EXT_geometry_shader] = EBhDisable;
extensionBehavior[GL_EXT_geometry_point_size] = EBhDisablePartial; extensionBehavior[GL_EXT_geometry_point_size] = EBhDisablePartial;
extensionBehavior[GL_EXT_gpu_shader5] = EBhDisablePartial; extensionBehavior[GL_EXT_gpu_shader5] = EBhDisablePartial;
extensionBehavior[GL_EXT_primitive_bounding_box] = EBhDisablePartial; extensionBehavior[GL_EXT_primitive_bounding_box] = EBhDisablePartial;
...@@ -192,7 +192,7 @@ void TParseContext::initializeExtensionBehavior() ...@@ -192,7 +192,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[GL_EXT_texture_cube_map_array] = EBhDisablePartial; extensionBehavior[GL_EXT_texture_cube_map_array] = EBhDisablePartial;
// OES matching AEP // OES matching AEP
extensionBehavior[GL_OES_geometry_shader] = EBhDisablePartial; extensionBehavior[GL_OES_geometry_shader] = EBhDisable;
extensionBehavior[GL_OES_gpu_shader5] = EBhDisablePartial; extensionBehavior[GL_OES_gpu_shader5] = EBhDisablePartial;
extensionBehavior[GL_OES_primitive_bounding_box] = EBhDisablePartial; extensionBehavior[GL_OES_primitive_bounding_box] = EBhDisablePartial;
extensionBehavior[GL_OES_shader_io_blocks] = EBhDisable; extensionBehavior[GL_OES_shader_io_blocks] = EBhDisable;
......
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