Implement GL_EXT_terminate_invocation (#2454)

* Implement GL_EXT_terminate_invocation.

* terminateInvocation: declare the SPV extension

* Update test results for spirv-tools and bison version bumps

Co-authored-by: John Kessenich <cepheus@frii.com>
This commit is contained in:
Jesse Hall 2020-11-09 08:30:01 -08:00 committed by GitHub
parent 383eaf3293
commit 74e8f05b9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 6223 additions and 5846 deletions

View file

@ -1,7 +1,7 @@
cppDeepNest.frag
ERROR: 0:66: '#if/#ifdef/#ifndef' : maximum nesting depth exceeded
ERROR: 0:66: '' : missing #endif
ERROR: 0:66: '' : syntax error, unexpected $end
ERROR: 0:66: '' : syntax error, unexpected end of file
ERROR: 3 compilation errors. No code generated.

View file

@ -12,7 +12,7 @@ ERROR: 0:88: '' : float literal needs a decimal point or exponent
ERROR: 0:98: '' : numeric literal too big
ERROR: 0:101: '' : numeric literal too big
ERROR: 0:104: '#' : preprocessor directive cannot be preceded by another token
ERROR: 0:104: '' : syntax error, unexpected $end, expecting COMMA or SEMICOLON
ERROR: 0:104: '' : syntax error, unexpected end of file, expecting COMMA or SEMICOLON
ERROR: 14 compilation errors. No code generated.

View file

@ -0,0 +1,20 @@
spv.terminate.frag
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 7
Capability Shader
Extension "SPV_KHR_terminate_invocation"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Source GLSL 400
SourceExtension "GL_EXT_terminate_invocation"
Name 4 "main"
2: TypeVoid
3: TypeFunction 2
4(main): 2 Function None 3
5: Label
TerminateInvocation
FunctionEnd

View file

@ -0,0 +1,24 @@
terminate.frag
ERROR: 0:3: 'terminateInvocation' : undeclared identifier
ERROR: 0:9: '' : syntax error, unexpected TERMINATE_INVOCATION, expecting COMMA or SEMICOLON
ERROR: 2 compilation errors. No code generated.
Shader version: 400
Requested GL_EXT_terminate_invocation
ERROR: node is still EOpNull!
0:3 Function Definition: foo( ( global void)
0:3 Function Parameters:
0:3 Sequence
0:3 'terminateInvocation' ( temp float)
0:? Linker Objects
Linked fragment stage:
Shader version: 400
Requested GL_EXT_terminate_invocation
ERROR: node is still EOpNull!
0:? Linker Objects

View file

@ -0,0 +1,36 @@
terminate.vert
ERROR: 0:3: 'terminateInvocation' : undeclared identifier
ERROR: 0:9: 'terminateInvocation' : not supported in this stage: vertex
ERROR: 2 compilation errors. No code generated.
Shader version: 400
Requested GL_EXT_terminate_invocation
ERROR: node is still EOpNull!
0:3 Function Definition: foo( ( global void)
0:3 Function Parameters:
0:3 Sequence
0:3 'terminateInvocation' ( temp float)
0:7 Function Definition: main( ( global void)
0:7 Function Parameters:
0:9 Sequence
0:9 Branch: TerminateInvocation
0:? Linker Objects
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
Linked vertex stage:
Shader version: 400
Requested GL_EXT_terminate_invocation
ERROR: node is still EOpNull!
0:7 Function Definition: main( ( global void)
0:7 Function Parameters:
0:9 Sequence
0:9 Branch: TerminateInvocation
0:? Linker Objects
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)

8
Test/spv.terminate.frag Normal file
View file

@ -0,0 +1,8 @@
#version 400
#extension GL_EXT_terminate_invocation : enable
void main()
{
terminateInvocation;
}

10
Test/terminate.frag Normal file
View file

@ -0,0 +1,10 @@
#version 400
void foo() { terminateInvocation; } // ERROR: identifier undeclared
#extension GL_EXT_terminate_invocation : enable
void main()
{
int terminateInvocation; // syntax ERROR
}

10
Test/terminate.vert Normal file
View file

@ -0,0 +1,10 @@
#version 400
void foo() { terminateInvocation; } // ERROR: identifier undeclared
#extension GL_EXT_terminate_invocation : enable
void main()
{
terminateInvocation; // ERROR: wrong stage
}