Merge pull request #1740 from ewerness-nv/callableincoming

Callables shouldn't have incoming ray flags
This commit is contained in:
John Kessenich 2019-03-27 16:19:05 +07:00 committed by GitHub
commit 137e071ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 45 deletions

View File

@ -1,13 +1,13 @@
spv.RayCallable.rcall spv.RayCallable.rcall
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80007 // Generated by (magic number): 80007
// Id's are bound by 38 // Id's are bound by 30
Capability RayTracingNV Capability RayTracingNV
Extension "SPV_NV_ray_tracing" Extension "SPV_NV_ray_tracing"
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint CallableNV 4 "main" 11 14 19 EntryPoint CallableNV 4 "main" 11 14
Source GLSL 460 Source GLSL 460
SourceExtension "GL_NV_ray_tracing" SourceExtension "GL_NV_ray_tracing"
Name 4 "main" Name 4 "main"
@ -15,18 +15,15 @@ spv.RayCallable.rcall
Name 11 "gl_LaunchIDNV" Name 11 "gl_LaunchIDNV"
Name 13 "size" Name 13 "size"
Name 14 "gl_LaunchSizeNV" Name 14 "gl_LaunchSizeNV"
Name 17 "curFlags" Name 16 "dataBlock"
Name 19 "gl_IncomingRayFlagsNV" MemberName 16(dataBlock) 0 "data1"
Name 24 "dataBlock" Name 18 ""
MemberName 24(dataBlock) 0 "data1" Name 29 "data0"
Name 26 ""
Name 37 "data0"
Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV
Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV
Decorate 19(gl_IncomingRayFlagsNV) BuiltIn IncomingRayFlagsNV Decorate 16(dataBlock) Block
Decorate 24(dataBlock) Block Decorate 18 Location 1
Decorate 26 Location 1 Decorate 29(data0) Location 0
Decorate 37(data0) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 0 6: TypeInt 32 0
@ -35,39 +32,29 @@ spv.RayCallable.rcall
10: TypePointer Input 7(ivec3) 10: TypePointer Input 7(ivec3)
11(gl_LaunchIDNV): 10(ptr) Variable Input 11(gl_LaunchIDNV): 10(ptr) Variable Input
14(gl_LaunchSizeNV): 10(ptr) Variable Input 14(gl_LaunchSizeNV): 10(ptr) Variable Input
16: TypePointer Function 6(int) 16(dataBlock): TypeStruct 6(int)
18: TypePointer Input 6(int) 17: TypePointer IncomingCallableDataNV 16(dataBlock)
19(gl_IncomingRayFlagsNV): 18(ptr) Variable Input 18: 17(ptr) Variable IncomingCallableDataNV
22: 6(int) Constant 1 19: TypeInt 32 1
24(dataBlock): TypeStruct 6(int) 20: 19(int) Constant 0
25: TypePointer IncomingCallableDataNV 24(dataBlock) 21: 6(int) Constant 256
26: 25(ptr) Variable IncomingCallableDataNV 22: TypePointer IncomingCallableDataNV 6(int)
27: TypeInt 32 1 24: 6(int) Constant 2
28: 27(int) Constant 0 25: 19(int) Constant 1
29: 6(int) Constant 256 26: TypeFloat 32
30: TypePointer IncomingCallableDataNV 6(int) 27: TypeVector 26(float) 4
32: 6(int) Constant 2 28: TypePointer CallableDataNV 27(fvec4)
33: 27(int) Constant 1 29(data0): 28(ptr) Variable CallableDataNV
34: TypeFloat 32
35: TypeVector 34(float) 4
36: TypePointer CallableDataNV 35(fvec4)
37(data0): 36(ptr) Variable CallableDataNV
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(id): 8(ptr) Variable Function 9(id): 8(ptr) Variable Function
13(size): 8(ptr) Variable Function 13(size): 8(ptr) Variable Function
17(curFlags): 16(ptr) Variable Function
12: 7(ivec3) Load 11(gl_LaunchIDNV) 12: 7(ivec3) Load 11(gl_LaunchIDNV)
Store 9(id) 12 Store 9(id) 12
15: 7(ivec3) Load 14(gl_LaunchSizeNV) 15: 7(ivec3) Load 14(gl_LaunchSizeNV)
Store 13(size) 15 Store 13(size) 15
20: 6(int) Load 19(gl_IncomingRayFlagsNV) 23: 22(ptr) AccessChain 18 20
Store 17(curFlags) 20 Store 23 21
21: 6(int) Load 17(curFlags) ExecuteCallableNV 24 25
23: 6(int) BitwiseAnd 21 22
Store 17(curFlags) 23
31: 30(ptr) AccessChain 26 28
Store 31 29
ExecuteCallableNV 32 33
Return Return
FunctionEnd FunctionEnd

View File

@ -24,10 +24,12 @@ ERROR: 0:19: 'gl_WorldToObjectNV' : undeclared identifier
ERROR: 0:19: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' ERROR: 0:19: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float'
ERROR: 0:20: 'gl_HitTNV' : undeclared identifier ERROR: 0:20: 'gl_HitTNV' : undeclared identifier
ERROR: 0:21: 'gl_HitKindNV' : undeclared identifier ERROR: 0:21: 'gl_HitKindNV' : undeclared identifier
ERROR: 0:22: 'reportIntersectionNV' : no matching overloaded function found ERROR: 0:22: 'gl_IncomingRayFlagsNV' : undeclared identifier
ERROR: 0:23: 'ignoreIntersectionNV' : no matching overloaded function found ERROR: 0:22: '=' : cannot convert from ' temp float' to ' temp highp uint'
ERROR: 0:24: 'terminateRayNV' : no matching overloaded function found ERROR: 0:23: 'reportIntersectionNV' : no matching overloaded function found
ERROR: 28 compilation errors. No code generated. ERROR: 0:24: 'ignoreIntersectionNV' : no matching overloaded function found
ERROR: 0:25: 'terminateRayNV' : no matching overloaded function found
ERROR: 30 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link SPIR-V is not generated for failed compile or link

View File

@ -8,8 +8,6 @@ void main()
{ {
uvec3 id = gl_LaunchIDNV; uvec3 id = gl_LaunchIDNV;
uvec3 size = gl_LaunchSizeNV; uvec3 size = gl_LaunchSizeNV;
uint curFlags = gl_IncomingRayFlagsNV;
curFlags = curFlags & gl_RayFlagsOpaqueNV;
data1 = 256U; data1 = 256U;
executeCallableNV(2,1); executeCallableNV(2,1);
} }

View File

@ -19,6 +19,7 @@ void main()
mat4x3 e11 = gl_WorldToObjectNV; // ERROR, unsupported builtin in stage mat4x3 e11 = gl_WorldToObjectNV; // ERROR, unsupported builtin in stage
float e12 = gl_HitTNV; // ERROR, unsupported builtin in stage float e12 = gl_HitTNV; // ERROR, unsupported builtin in stage
float e13 = gl_HitKindNV; // ERROR, unsupported builtin in stage float e13 = gl_HitKindNV; // ERROR, unsupported builtin in stage
uint curFlags = gl_IncomingRayFlagsNV; // ERROR, unsupported builtin in stage
reportIntersectionNV(1.0, 1U); // ERROR, unsupported builtin in stage reportIntersectionNV(1.0, 1U); // ERROR, unsupported builtin in stage
ignoreIntersectionNV(); // ERROR, unsupported builtin in stage ignoreIntersectionNV(); // ERROR, unsupported builtin in stage
terminateRayNV(); // ERROR, unsupported builtin in stage terminateRayNV(); // ERROR, unsupported builtin in stage

View File

@ -6242,7 +6242,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
const char *callableDecls = const char *callableDecls =
"in uvec3 gl_LaunchIDNV;" "in uvec3 gl_LaunchIDNV;"
"in uvec3 gl_LaunchSizeNV;" "in uvec3 gl_LaunchSizeNV;"
"in uint gl_IncomingRayFlagsNV;"
"\n"; "\n";
stageBuiltins[EShLangRayGenNV].append(rayGenDecls); stageBuiltins[EShLangRayGenNV].append(rayGenDecls);