Callables shouldn't have incoming ray flags
authorEric Werness <ewerness@banahogg.com>
Mon, 25 Mar 2019 16:53:52 +0000 (09:53 -0700)
committerEric Werness <ewerness@banahogg.com>
Tue, 26 Mar 2019 00:09:13 +0000 (17:09 -0700)
Test/baseResults/spv.RayCallable.rcall.out
Test/baseResults/spv.RayCallable_Errors.rcall.out
Test/spv.RayCallable.rcall
Test/spv.RayCallable_Errors.rcall
glslang/MachineIndependent/Initialize.cpp

index 198d686..e399e63 100644 (file)
@@ -1,13 +1,13 @@
 spv.RayCallable.rcall
 // Module Version 10000
 // Generated by (magic number): 80007
-// Id's are bound by 38
+// Id's are bound by 30
 
                               Capability RayTracingNV
                               Extension  "SPV_NV_ray_tracing"
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint CallableNV 4  "main" 11 14 19
+                              EntryPoint CallableNV 4  "main" 11 14
                               Source GLSL 460
                               SourceExtension  "GL_NV_ray_tracing"
                               Name 4  "main"
@@ -15,18 +15,15 @@ spv.RayCallable.rcall
                               Name 11  "gl_LaunchIDNV"
                               Name 13  "size"
                               Name 14  "gl_LaunchSizeNV"
-                              Name 17  "curFlags"
-                              Name 19  "gl_IncomingRayFlagsNV"
-                              Name 24  "dataBlock"
-                              MemberName 24(dataBlock) 0  "data1"
-                              Name 26  ""
-                              Name 37  "data0"
+                              Name 16  "dataBlock"
+                              MemberName 16(dataBlock) 0  "data1"
+                              Name 18  ""
+                              Name 29  "data0"
                               Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV
                               Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV
-                              Decorate 19(gl_IncomingRayFlagsNV) BuiltIn IncomingRayFlagsNV
-                              Decorate 24(dataBlock) Block
-                              Decorate 26 Location 1
-                              Decorate 37(data0) Location 0
+                              Decorate 16(dataBlock) Block
+                              Decorate 18 Location 1
+                              Decorate 29(data0) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -35,39 +32,29 @@ spv.RayCallable.rcall
               10:             TypePointer Input 7(ivec3)
 11(gl_LaunchIDNV):     10(ptr) Variable Input
 14(gl_LaunchSizeNV):     10(ptr) Variable Input
-              16:             TypePointer Function 6(int)
-              18:             TypePointer Input 6(int)
-19(gl_IncomingRayFlagsNV):     18(ptr) Variable Input
-              22:      6(int) Constant 1
-   24(dataBlock):             TypeStruct 6(int)
-              25:             TypePointer IncomingCallableDataNV 24(dataBlock)
-              26:     25(ptr) Variable IncomingCallableDataNV
-              27:             TypeInt 32 1
-              28:     27(int) Constant 0
-              29:      6(int) Constant 256
-              30:             TypePointer IncomingCallableDataNV 6(int)
-              32:      6(int) Constant 2
-              33:     27(int) Constant 1
-              34:             TypeFloat 32
-              35:             TypeVector 34(float) 4
-              36:             TypePointer CallableDataNV 35(fvec4)
-       37(data0):     36(ptr) Variable CallableDataNV
+   16(dataBlock):             TypeStruct 6(int)
+              17:             TypePointer IncomingCallableDataNV 16(dataBlock)
+              18:     17(ptr) Variable IncomingCallableDataNV
+              19:             TypeInt 32 1
+              20:     19(int) Constant 0
+              21:      6(int) Constant 256
+              22:             TypePointer IncomingCallableDataNV 6(int)
+              24:      6(int) Constant 2
+              25:     19(int) Constant 1
+              26:             TypeFloat 32
+              27:             TypeVector 26(float) 4
+              28:             TypePointer CallableDataNV 27(fvec4)
+       29(data0):     28(ptr) Variable CallableDataNV
          4(main):           2 Function None 3
                5:             Label
            9(id):      8(ptr) Variable Function
         13(size):      8(ptr) Variable Function
-    17(curFlags):     16(ptr) Variable Function
               12:    7(ivec3) Load 11(gl_LaunchIDNV)
                               Store 9(id) 12
               15:    7(ivec3) Load 14(gl_LaunchSizeNV)
                               Store 13(size) 15
-              20:      6(int) Load 19(gl_IncomingRayFlagsNV)
-                              Store 17(curFlags) 20
-              21:      6(int) Load 17(curFlags)
-              23:      6(int) BitwiseAnd 21 22
-                              Store 17(curFlags) 23
-              31:     30(ptr) AccessChain 26 28
-                              Store 31 29
-                              ExecuteCallableNV 32 33
+              23:     22(ptr) AccessChain 18 20
+                              Store 23 21
+                              ExecuteCallableNV 24 25
                               Return
                               FunctionEnd
index a807a57..e7f45cb 100644 (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:20: 'gl_HitTNV' : undeclared identifier 
 ERROR: 0:21: 'gl_HitKindNV' : undeclared identifier 
-ERROR: 0:22: 'reportIntersectionNV' : no matching overloaded function found 
-ERROR: 0:23: 'ignoreIntersectionNV' : no matching overloaded function found 
-ERROR: 0:24: 'terminateRayNV' : no matching overloaded function found 
-ERROR: 28 compilation errors.  No code generated.
+ERROR: 0:22: 'gl_IncomingRayFlagsNV' : undeclared identifier 
+ERROR: 0:22: '=' :  cannot convert from ' temp float' to ' temp highp uint'
+ERROR: 0:23: 'reportIntersectionNV' : no matching overloaded function found 
+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
index 12f2884..992cce6 100644 (file)
@@ -8,8 +8,6 @@ void main()
 {
        uvec3 id = gl_LaunchIDNV;
        uvec3 size = gl_LaunchSizeNV;
-    uint curFlags = gl_IncomingRayFlagsNV;
-       curFlags = curFlags & gl_RayFlagsOpaqueNV;
        data1 = 256U;
        executeCallableNV(2,1);
 }
index 7339682..f6126a6 100644 (file)
@@ -19,6 +19,7 @@ void main()
     mat4x3 e11 = gl_WorldToObjectNV;                        // ERROR, unsupported builtin in stage
     float e12 = gl_HitTNV;                                  // 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
     ignoreIntersectionNV();                                 // ERROR, unsupported builtin in stage
     terminateRayNV();                                       // ERROR, unsupported builtin in stage
index 24a5dcd..4533171 100644 (file)
@@ -6240,7 +6240,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
         const char *callableDecls =
             "in    uvec3  gl_LaunchIDNV;"
             "in    uvec3  gl_LaunchSizeNV;"
-            "in    uint   gl_IncomingRayFlagsNV;"
             "\n";
 
         stageBuiltins[EShLangRayGenNV].append(rayGenDecls);