From e76116982a45f8d2793d42c2d06bd0b37eb56928 Mon Sep 17 00:00:00 2001 From: ZhiqianXia Date: Mon, 2 Aug 2021 11:10:33 +0800 Subject: [PATCH] Add the GL_EXT_shader_integer_mix Preamble for glsl. Signed-off-by: ZhiqianXia --- Test/GL_EXT_shader_integer_mix.vert | 13 +++++ .../GL_EXT_shader_integer_mix.vert.out | 47 +++++++++++++++++++ glslang/MachineIndependent/Versions.cpp | 1 + gtests/AST.FromFile.cpp | 3 +- 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 Test/GL_EXT_shader_integer_mix.vert create mode 100644 Test/baseResults/GL_EXT_shader_integer_mix.vert.out diff --git a/Test/GL_EXT_shader_integer_mix.vert b/Test/GL_EXT_shader_integer_mix.vert new file mode 100644 index 00000000..3616e58c --- /dev/null +++ b/Test/GL_EXT_shader_integer_mix.vert @@ -0,0 +1,13 @@ +#version 330 +#extension GL_EXT_shader_integer_mix: require + + +#if !defined GL_EXT_shader_integer_mix +# error GL_EXT_shader_integer_mix is not defined +#elif GL_EXT_shader_integer_mix != 1 +# error GL_EXT_shader_integer_mix is not equal to 1 +#endif + +void main(void) { + gl_Position = vec4(0); +} diff --git a/Test/baseResults/GL_EXT_shader_integer_mix.vert.out b/Test/baseResults/GL_EXT_shader_integer_mix.vert.out new file mode 100644 index 00000000..4a62b579 --- /dev/null +++ b/Test/baseResults/GL_EXT_shader_integer_mix.vert.out @@ -0,0 +1,47 @@ +GL_EXT_shader_integer_mix.vert +Shader version: 330 +Requested GL_EXT_shader_integer_mix +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:12 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:12 Constant: +0:12 0 (const uint) +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:? Linker Objects +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 330 +Requested GL_EXT_shader_integer_mix +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:12 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:12 Constant: +0:12 0 (const uint) +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:? Linker Objects +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +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 097ee845..70a5d5e4 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -482,6 +482,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_debug_printf 1\n" "#define GL_EXT_fragment_shading_rate 1\n" "#define GL_EXT_shared_memory_block 1\n" + "#define GL_EXT_shader_integer_mix 1\n" // GL_KHR_shader_subgroup "#define GL_KHR_shader_subgroup_basic 1\n" diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp index 6e7a659e..0db97541 100644 --- a/gtests/AST.FromFile.cpp +++ b/gtests/AST.FromFile.cpp @@ -284,7 +284,8 @@ INSTANTIATE_TEST_SUITE_P( "textureoffset_sampler2darrayshadow.vert", "atomicAdd.comp", "GL_ARB_gpu_shader5.u2i.vert", - "atomicCounterARBOps.vert" + "atomicCounterARBOps.vert", + "GL_EXT_shader_integer_mix.vert" })), FileNameAsCustomTestSuffix );