diff --git a/Test/GL_ARB_fragment_coord_conventions.vert b/Test/GL_ARB_fragment_coord_conventions.vert new file mode 100644 index 00000000..962734f4 --- /dev/null +++ b/Test/GL_ARB_fragment_coord_conventions.vert @@ -0,0 +1,27 @@ +#version 140 + +#extension GL_ARB_fragment_coord_conventions: require +#extension GL_ARB_explicit_attrib_location : enable + + +#if !defined GL_ARB_fragment_coord_conventions +# error GL_ARB_fragment_coord_conventions is not defined +#elif GL_ARB_fragment_coord_conventions != 1 +# error GL_ARB_fragment_coord_conventions is not equal to 1 +#endif + + +layout (location = 0) in vec4 pos; +out vec4 i; + +uniform float gtf_windowWidth; +uniform float gtf_windowHeight; +uniform float n; +uniform float f; + +void main() +{ + gl_Position = pos; + i = vec4((pos.x+1.0)*0.5*gtf_windowWidth, (pos.y+1.0)*0.5*gtf_windowHeight, (f-n)*0.5*pos.z + (f+n)*0.5, pos.w); +} + diff --git a/Test/baseResults/GL_ARB_fragment_coord_conventions.vert.out b/Test/baseResults/GL_ARB_fragment_coord_conventions.vert.out new file mode 100644 index 00000000..3b55ae0d --- /dev/null +++ b/Test/baseResults/GL_ARB_fragment_coord_conventions.vert.out @@ -0,0 +1,143 @@ +GL_ARB_fragment_coord_conventions.vert +Shader version: 140 +Requested GL_ARB_explicit_attrib_location +Requested GL_ARB_fragment_coord_conventions +0:? Sequence +0:22 Function Definition: main( ( global void) +0:22 Function Parameters: +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'gl_Position' ( gl_Position 4-component vector of float Position) +0:24 'pos' (layout( location=0) in 4-component vector of float) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'i' ( smooth out 4-component vector of float) +0:25 Construct vec4 ( temp 4-component vector of float) +0:25 component-wise multiply ( temp float) +0:25 component-wise multiply ( temp float) +0:25 add ( temp float) +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 1.000000 +0:25 Constant: +0:25 0.500000 +0:25 'gtf_windowWidth' ( uniform float) +0:25 component-wise multiply ( temp float) +0:25 component-wise multiply ( temp float) +0:25 add ( temp float) +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 1.000000 +0:25 Constant: +0:25 0.500000 +0:25 'gtf_windowHeight' ( uniform float) +0:25 add ( temp float) +0:25 component-wise multiply ( temp float) +0:25 component-wise multiply ( temp float) +0:25 subtract ( temp float) +0:25 'f' ( uniform float) +0:25 'n' ( uniform float) +0:25 Constant: +0:25 0.500000 +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 2 (const int) +0:25 component-wise multiply ( temp float) +0:25 add ( temp float) +0:25 'f' ( uniform float) +0:25 'n' ( uniform float) +0:25 Constant: +0:25 0.500000 +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 3 (const int) +0:? Linker Objects +0:? 'pos' (layout( location=0) in 4-component vector of float) +0:? 'i' ( smooth out 4-component vector of float) +0:? 'gtf_windowWidth' ( uniform float) +0:? 'gtf_windowHeight' ( uniform float) +0:? 'n' ( uniform float) +0:? 'f' ( uniform float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 140 +Requested GL_ARB_explicit_attrib_location +Requested GL_ARB_fragment_coord_conventions +0:? Sequence +0:22 Function Definition: main( ( global void) +0:22 Function Parameters: +0:24 Sequence +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'gl_Position' ( gl_Position 4-component vector of float Position) +0:24 'pos' (layout( location=0) in 4-component vector of float) +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'i' ( smooth out 4-component vector of float) +0:25 Construct vec4 ( temp 4-component vector of float) +0:25 component-wise multiply ( temp float) +0:25 component-wise multiply ( temp float) +0:25 add ( temp float) +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 1.000000 +0:25 Constant: +0:25 0.500000 +0:25 'gtf_windowWidth' ( uniform float) +0:25 component-wise multiply ( temp float) +0:25 component-wise multiply ( temp float) +0:25 add ( temp float) +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 1.000000 +0:25 Constant: +0:25 0.500000 +0:25 'gtf_windowHeight' ( uniform float) +0:25 add ( temp float) +0:25 component-wise multiply ( temp float) +0:25 component-wise multiply ( temp float) +0:25 subtract ( temp float) +0:25 'f' ( uniform float) +0:25 'n' ( uniform float) +0:25 Constant: +0:25 0.500000 +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 2 (const int) +0:25 component-wise multiply ( temp float) +0:25 add ( temp float) +0:25 'f' ( uniform float) +0:25 'n' ( uniform float) +0:25 Constant: +0:25 0.500000 +0:25 direct index ( temp float) +0:25 'pos' (layout( location=0) in 4-component vector of float) +0:25 Constant: +0:25 3 (const int) +0:? Linker Objects +0:? 'pos' (layout( location=0) in 4-component vector of float) +0:? 'i' ( smooth out 4-component vector of float) +0:? 'gtf_windowWidth' ( uniform float) +0:? 'gtf_windowHeight' ( uniform float) +0:? 'n' ( uniform float) +0:? 'f' ( uniform float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 2fc0d9e0..8d96e0e1 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -226,6 +226,8 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_texture_query_lod] = EBhDisable; extensionBehavior[E_GL_ARB_vertex_attrib_64bit] = EBhDisable; extensionBehavior[E_GL_ARB_draw_instanced] = EBhDisable; + extensionBehavior[E_GL_ARB_fragment_coord_conventions] = EBhDisable; + extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable; @@ -467,6 +469,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_ARB_texture_query_lod 1\n" "#define GL_ARB_vertex_attrib_64bit 1\n" "#define GL_ARB_draw_instanced 1\n" + "#define GL_ARB_fragment_coord_conventions 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" diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index 2dbac0b4..96a6e1fc 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -162,6 +162,7 @@ const char* const E_GL_ARB_shading_language_packing = "GL_ARB_shading_langua const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_lod"; const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_64bit"; const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced"; +const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions"; 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"; diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp index f9680dd6..a9c57944 100644 --- a/gtests/AST.FromFile.cpp +++ b/gtests/AST.FromFile.cpp @@ -287,6 +287,7 @@ INSTANTIATE_TEST_SUITE_P( "atomicCounterARBOps.vert", "GL_EXT_shader_integer_mix.vert", "GL_ARB_draw_instanced.vert", + "GL_ARB_fragment_coord_conventions.vert" })), FileNameAsCustomTestSuffix );