mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 11:30:06 +00:00
Add support for GL_NV_ray_tracing_motion_blur.
This commit is contained in:
parent
e0f3fdf433
commit
fc60f77aa2
@ -69,6 +69,9 @@ const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader";
|
||||
//SPV_NV_raytracing
|
||||
const char* const E_SPV_NV_ray_tracing = "SPV_NV_ray_tracing";
|
||||
|
||||
//SPV_NV_ray_tracing_motion_blur
|
||||
const char* const E_SPV_NV_ray_tracing_motion_blur = "SPV_NV_ray_tracing_motion_blur";
|
||||
|
||||
//SPV_NV_shading_rate
|
||||
const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate";
|
||||
|
||||
|
@ -1033,6 +1033,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
||||
return spv::BuiltInIncomingRayFlagsKHR;
|
||||
case glslang::EbvGeometryIndex:
|
||||
return spv::BuiltInRayGeometryIndexKHR;
|
||||
case glslang::EbvCurrentRayTimeNV:
|
||||
builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur);
|
||||
builder.addCapability(spv::CapabilityRayTracingMotionBlurNV);
|
||||
return spv::BuiltInCurrentRayTimeNV;
|
||||
|
||||
// barycentrics
|
||||
case glslang::EbvBaryCoordNV:
|
||||
@ -3018,6 +3022,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
case glslang::EOpIgnoreIntersectionNV:
|
||||
case glslang::EOpTerminateRayNV:
|
||||
case glslang::EOpTraceNV:
|
||||
case glslang::EOpTraceRayMotionNV:
|
||||
case glslang::EOpTraceKHR:
|
||||
case glslang::EOpExecuteCallableNV:
|
||||
case glslang::EOpExecuteCallableKHR:
|
||||
@ -3317,9 +3322,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst();
|
||||
operands.push_back(builder.makeIntConstant(cond ? 1 : 0));
|
||||
} else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR)) {
|
||||
const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : 1;
|
||||
const int set = glslangOp == glslang::EOpTraceKHR ? 0 : 1;
|
||||
const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : (glslangOp == glslang::EOpTraceRayMotionNV ? 11 : 1);
|
||||
const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0;
|
||||
|
||||
const int location = glslangOperands[opdNum]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
auto itNode = locationToSymbol[set].find(location);
|
||||
visitSymbol(itNode->second);
|
||||
@ -8322,6 +8329,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
||||
case glslang::EOpTraceNV:
|
||||
builder.createNoResultOp(spv::OpTraceNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpTraceRayMotionNV:
|
||||
builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur);
|
||||
builder.addCapability(spv::CapabilityRayTracingMotionBlurNV);
|
||||
builder.createNoResultOp(spv::OpTraceRayMotionNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpTraceKHR:
|
||||
builder.createNoResultOp(spv::OpTraceRayKHR, operands);
|
||||
return 0;
|
||||
|
@ -426,6 +426,7 @@ const char* BuiltInString(int builtIn)
|
||||
case BuiltInSMCountNV: return "SMCountNV";
|
||||
case BuiltInWarpIDNV: return "WarpIDNV";
|
||||
case BuiltInSMIDNV: return "SMIDNV";
|
||||
case BuiltInCurrentRayTimeNV: return "CurrentRayTimeNV";
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
@ -916,6 +917,7 @@ const char* CapabilityString(int info)
|
||||
case CapabilityPerViewAttributesNV: return "PerViewAttributesNV";
|
||||
case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV";
|
||||
case CapabilityRayTracingNV: return "RayTracingNV";
|
||||
case CapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV";
|
||||
case CapabilityRayTracingKHR: return "RayTracingKHR";
|
||||
case CapabilityRayQueryKHR: return "RayQueryKHR";
|
||||
case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR";
|
||||
@ -1382,6 +1384,7 @@ const char* OpcodeString(int op)
|
||||
case OpTerminateRayNV: return "OpTerminateRayNV";
|
||||
case OpTerminateRayKHR: return "OpTerminateRayKHR";
|
||||
case OpTraceNV: return "OpTraceNV";
|
||||
case OpTraceRayMotionNV: return "OpTraceRayMotionNV";
|
||||
case OpTraceRayKHR: return "OpTraceRayKHR";
|
||||
case OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR";
|
||||
case OpExecuteCallableNV: return "OpExecuteCallableNV";
|
||||
@ -2812,6 +2815,20 @@ void Parameterize()
|
||||
InstructionDesc[OpTraceNV].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[OpTraceNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Flags'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Cull Mask'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Miss Index'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Origin'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Direction'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Time'");
|
||||
InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[OpTraceRayMotionNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Ray Flags'");
|
||||
InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Cull Mask'");
|
||||
|
@ -652,6 +652,7 @@ enum BuiltIn {
|
||||
BuiltInHitTNV = 5332,
|
||||
BuiltInHitKindKHR = 5333,
|
||||
BuiltInHitKindNV = 5333,
|
||||
BuiltInCurrentRayTimeNV = 5334,
|
||||
BuiltInIncomingRayFlagsKHR = 5351,
|
||||
BuiltInIncomingRayFlagsNV = 5351,
|
||||
BuiltInRayGeometryIndexKHR = 5352,
|
||||
@ -988,6 +989,7 @@ enum Capability {
|
||||
CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
|
||||
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
|
||||
CapabilityRayTracingNV = 5340,
|
||||
CapabilityRayTracingMotionBlurNV = 5341,
|
||||
CapabilityVulkanMemoryModel = 5345,
|
||||
CapabilityVulkanMemoryModelKHR = 5345,
|
||||
CapabilityVulkanMemoryModelDeviceScope = 5346,
|
||||
@ -1503,6 +1505,8 @@ enum Op {
|
||||
OpIgnoreIntersectionNV = 5335,
|
||||
OpTerminateRayNV = 5336,
|
||||
OpTraceNV = 5337,
|
||||
OpTraceMotionNV = 5338,
|
||||
OpTraceRayMotionNV = 5339,
|
||||
OpTypeAccelerationStructureKHR = 5341,
|
||||
OpTypeAccelerationStructureNV = 5341,
|
||||
OpExecuteCallableNV = 5344,
|
||||
@ -2090,6 +2094,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTraceNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
|
||||
case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
|
||||
|
33
Test/baseResults/spv.AnyHitShaderMotion.rahit.out
Normal file
33
Test/baseResults/spv.AnyHitShaderMotion.rahit.out
Normal file
@ -0,0 +1,33 @@
|
||||
spv.AnyHitShaderMotion.rahit
|
||||
// Module Version 10400
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 14
|
||||
|
||||
Capability RayTracingKHR
|
||||
Capability RayTracingMotionBlurNV
|
||||
Extension "SPV_KHR_ray_tracing"
|
||||
Extension "SPV_NV_ray_tracing_motion_blur"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint AnyHitKHR 4 "main" 10
|
||||
Source GLSL 460
|
||||
SourceExtension "GL_NV_ray_tracing_motion_blur"
|
||||
Name 4 "main"
|
||||
Name 8 "time"
|
||||
Name 10 "gl_CurrentRayTimeNV"
|
||||
Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypePointer Function 6(float)
|
||||
9: TypePointer Input 6(float)
|
||||
10(gl_CurrentRayTimeNV): 9(ptr) Variable Input
|
||||
12: 6(float) Constant 1056964608
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(time): 7(ptr) Variable Function
|
||||
11: 6(float) Load 10(gl_CurrentRayTimeNV)
|
||||
13: 6(float) FAdd 11 12
|
||||
Store 8(time) 13
|
||||
Return
|
||||
FunctionEnd
|
59
Test/baseResults/spv.ClosestHitShaderMotion.rchit.out
Normal file
59
Test/baseResults/spv.ClosestHitShaderMotion.rchit.out
Normal file
@ -0,0 +1,59 @@
|
||||
spv.ClosestHitShaderMotion.rchit
|
||||
// Module Version 10400
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 33
|
||||
|
||||
Capability RayTracingKHR
|
||||
Capability RayTracingMotionBlurNV
|
||||
Extension "SPV_KHR_ray_tracing"
|
||||
Extension "SPV_NV_ray_tracing_motion_blur"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint ClosestHitKHR 4 "main" 10 16 32
|
||||
Source GLSL 460
|
||||
SourceExtension "GL_EXT_ray_tracing"
|
||||
SourceExtension "GL_NV_ray_tracing_motion_blur"
|
||||
Name 4 "main"
|
||||
Name 8 "time"
|
||||
Name 10 "gl_CurrentRayTimeNV"
|
||||
Name 16 "accEXT"
|
||||
Name 32 "incomingPayloadEXT"
|
||||
Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV
|
||||
Decorate 16(accEXT) DescriptorSet 0
|
||||
Decorate 16(accEXT) Binding 0
|
||||
Decorate 32(incomingPayloadEXT) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypePointer Function 6(float)
|
||||
9: TypePointer Input 6(float)
|
||||
10(gl_CurrentRayTimeNV): 9(ptr) Variable Input
|
||||
12: 6(float) Constant 1056964608
|
||||
14: TypeAccelerationStructureKHR
|
||||
15: TypePointer UniformConstant 14
|
||||
16(accEXT): 15(ptr) Variable UniformConstant
|
||||
18: TypeInt 32 0
|
||||
19: 18(int) Constant 0
|
||||
20: 18(int) Constant 1
|
||||
21: 18(int) Constant 2
|
||||
22: 18(int) Constant 3
|
||||
23: TypeVector 6(float) 3
|
||||
24: 23(fvec3) ConstantComposite 12 12 12
|
||||
25: 6(float) Constant 1065353216
|
||||
26: 23(fvec3) ConstantComposite 25 25 25
|
||||
27: 6(float) Constant 1061158912
|
||||
28: TypeInt 32 1
|
||||
29: 28(int) Constant 0
|
||||
30: TypeVector 6(float) 4
|
||||
31: TypePointer IncomingRayPayloadKHR 30(fvec4)
|
||||
32(incomingPayloadEXT): 31(ptr) Variable IncomingRayPayloadKHR
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(time): 7(ptr) Variable Function
|
||||
11: 6(float) Load 10(gl_CurrentRayTimeNV)
|
||||
13: 6(float) FAdd 11 12
|
||||
Store 8(time) 13
|
||||
17: 14 Load 16(accEXT)
|
||||
TraceRayMotionNV 17 19 20 21 22 19 24 12 26 27 25 32(incomingPayloadEXT)
|
||||
Return
|
||||
FunctionEnd
|
33
Test/baseResults/spv.IntersectShaderMotion.rint.out
Normal file
33
Test/baseResults/spv.IntersectShaderMotion.rint.out
Normal file
@ -0,0 +1,33 @@
|
||||
spv.IntersectShaderMotion.rint
|
||||
// Module Version 10400
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 14
|
||||
|
||||
Capability RayTracingKHR
|
||||
Capability RayTracingMotionBlurNV
|
||||
Extension "SPV_KHR_ray_tracing"
|
||||
Extension "SPV_NV_ray_tracing_motion_blur"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint IntersectionKHR 4 "main" 10
|
||||
Source GLSL 460
|
||||
SourceExtension "GL_NV_ray_tracing_motion_blur"
|
||||
Name 4 "main"
|
||||
Name 8 "time"
|
||||
Name 10 "gl_CurrentRayTimeNV"
|
||||
Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypePointer Function 6(float)
|
||||
9: TypePointer Input 6(float)
|
||||
10(gl_CurrentRayTimeNV): 9(ptr) Variable Input
|
||||
12: 6(float) Constant 1056964608
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(time): 7(ptr) Variable Function
|
||||
11: 6(float) Load 10(gl_CurrentRayTimeNV)
|
||||
13: 6(float) FAdd 11 12
|
||||
Store 8(time) 13
|
||||
Return
|
||||
FunctionEnd
|
59
Test/baseResults/spv.MissShaderMotion.rmiss.out
Normal file
59
Test/baseResults/spv.MissShaderMotion.rmiss.out
Normal file
@ -0,0 +1,59 @@
|
||||
spv.MissShaderMotion.rmiss
|
||||
// Module Version 10400
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 33
|
||||
|
||||
Capability RayTracingKHR
|
||||
Capability RayTracingMotionBlurNV
|
||||
Extension "SPV_KHR_ray_tracing"
|
||||
Extension "SPV_NV_ray_tracing_motion_blur"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint MissKHR 4 "main" 10 16 32
|
||||
Source GLSL 460
|
||||
SourceExtension "GL_EXT_ray_tracing"
|
||||
SourceExtension "GL_NV_ray_tracing_motion_blur"
|
||||
Name 4 "main"
|
||||
Name 8 "time"
|
||||
Name 10 "gl_CurrentRayTimeNV"
|
||||
Name 16 "accEXT"
|
||||
Name 32 "localPayloadEXT"
|
||||
Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV
|
||||
Decorate 16(accEXT) DescriptorSet 0
|
||||
Decorate 16(accEXT) Binding 0
|
||||
Decorate 32(localPayloadEXT) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypePointer Function 6(float)
|
||||
9: TypePointer Input 6(float)
|
||||
10(gl_CurrentRayTimeNV): 9(ptr) Variable Input
|
||||
12: 6(float) Constant 1056964608
|
||||
14: TypeAccelerationStructureKHR
|
||||
15: TypePointer UniformConstant 14
|
||||
16(accEXT): 15(ptr) Variable UniformConstant
|
||||
18: TypeInt 32 0
|
||||
19: 18(int) Constant 0
|
||||
20: 18(int) Constant 1
|
||||
21: 18(int) Constant 2
|
||||
22: 18(int) Constant 3
|
||||
23: TypeVector 6(float) 3
|
||||
24: 23(fvec3) ConstantComposite 12 12 12
|
||||
25: 6(float) Constant 1065353216
|
||||
26: 23(fvec3) ConstantComposite 25 25 25
|
||||
27: 6(float) Constant 1061158912
|
||||
28: TypeInt 32 1
|
||||
29: 28(int) Constant 0
|
||||
30: TypeVector 6(float) 4
|
||||
31: TypePointer RayPayloadKHR 30(fvec4)
|
||||
32(localPayloadEXT): 31(ptr) Variable RayPayloadKHR
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(time): 7(ptr) Variable Function
|
||||
11: 6(float) Load 10(gl_CurrentRayTimeNV)
|
||||
13: 6(float) FAdd 11 12
|
||||
Store 8(time) 13
|
||||
17: 14 Load 16(accEXT)
|
||||
TraceRayMotionNV 17 19 20 21 22 19 24 12 26 27 25 32(localPayloadEXT)
|
||||
Return
|
||||
FunctionEnd
|
81
Test/baseResults/spv.RayGenShaderMotion.rgen.out
Normal file
81
Test/baseResults/spv.RayGenShaderMotion.rgen.out
Normal file
@ -0,0 +1,81 @@
|
||||
spv.RayGenShaderMotion.rgen
|
||||
// Module Version 10400
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 47
|
||||
|
||||
Capability RayTracingKHR
|
||||
Capability RayTracingMotionBlurNV
|
||||
Extension "SPV_KHR_ray_tracing"
|
||||
Extension "SPV_NV_ray_tracing_motion_blur"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint RayGenerationKHR 4 "main" 11 21 29 46
|
||||
Source GLSL 460
|
||||
SourceExtension "GL_EXT_ray_tracing"
|
||||
SourceExtension "GL_NV_ray_tracing_motion_blur"
|
||||
Name 4 "main"
|
||||
Name 8 "lx"
|
||||
Name 11 "gl_LaunchIDEXT"
|
||||
Name 16 "ly"
|
||||
Name 20 "sx"
|
||||
Name 21 "gl_LaunchSizeEXT"
|
||||
Name 24 "sy"
|
||||
Name 29 "accEXT"
|
||||
Name 46 "payloadEXT"
|
||||
Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR
|
||||
Decorate 21(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR
|
||||
Decorate 29(accEXT) DescriptorSet 0
|
||||
Decorate 29(accEXT) Binding 0
|
||||
Decorate 46(payloadEXT) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypePointer Function 6(int)
|
||||
9: TypeVector 6(int) 3
|
||||
10: TypePointer Input 9(ivec3)
|
||||
11(gl_LaunchIDEXT): 10(ptr) Variable Input
|
||||
12: 6(int) Constant 0
|
||||
13: TypePointer Input 6(int)
|
||||
17: 6(int) Constant 1
|
||||
21(gl_LaunchSizeEXT): 10(ptr) Variable Input
|
||||
27: TypeAccelerationStructureKHR
|
||||
28: TypePointer UniformConstant 27
|
||||
29(accEXT): 28(ptr) Variable UniformConstant
|
||||
35: TypeFloat 32
|
||||
36: TypeVector 35(float) 3
|
||||
37: 35(float) Constant 1056964608
|
||||
38: 36(fvec3) ConstantComposite 37 37 37
|
||||
39: 35(float) Constant 1065353216
|
||||
40: 36(fvec3) ConstantComposite 39 39 39
|
||||
41: 35(float) Constant 1061158912
|
||||
42: TypeInt 32 1
|
||||
43: 42(int) Constant 0
|
||||
44: TypeVector 35(float) 4
|
||||
45: TypePointer RayPayloadKHR 44(fvec4)
|
||||
46(payloadEXT): 45(ptr) Variable RayPayloadKHR
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(lx): 7(ptr) Variable Function
|
||||
16(ly): 7(ptr) Variable Function
|
||||
20(sx): 7(ptr) Variable Function
|
||||
24(sy): 7(ptr) Variable Function
|
||||
14: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 12
|
||||
15: 6(int) Load 14
|
||||
Store 8(lx) 15
|
||||
18: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 17
|
||||
19: 6(int) Load 18
|
||||
Store 16(ly) 19
|
||||
22: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 12
|
||||
23: 6(int) Load 22
|
||||
Store 20(sx) 23
|
||||
25: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 17
|
||||
26: 6(int) Load 25
|
||||
Store 24(sy) 26
|
||||
30: 27 Load 29(accEXT)
|
||||
31: 6(int) Load 8(lx)
|
||||
32: 6(int) Load 16(ly)
|
||||
33: 6(int) Load 20(sx)
|
||||
34: 6(int) Load 24(sy)
|
||||
TraceRayMotionNV 30 31 32 33 34 12 38 37 40 41 37 46(payloadEXT)
|
||||
Return
|
||||
FunctionEnd
|
6
Test/spv.AnyHitShaderMotion.rahit
Normal file
6
Test/spv.AnyHitShaderMotion.rahit
Normal file
@ -0,0 +1,6 @@
|
||||
#version 460
|
||||
#extension GL_NV_ray_tracing_motion_blur : enable
|
||||
void main()
|
||||
{
|
||||
float time = gl_CurrentRayTimeNV + 0.5f;
|
||||
}
|
10
Test/spv.ClosestHitShaderMotion.rchit
Normal file
10
Test/spv.ClosestHitShaderMotion.rchit
Normal file
@ -0,0 +1,10 @@
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_NV_ray_tracing_motion_blur : enable
|
||||
layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT;
|
||||
layout(location = 0) rayPayloadInEXT vec4 incomingPayloadEXT;
|
||||
void main()
|
||||
{
|
||||
float time = gl_CurrentRayTimeNV + 0.5f;
|
||||
traceRayMotionNV(accEXT, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1.0, 0);
|
||||
}
|
6
Test/spv.IntersectShaderMotion.rint
Normal file
6
Test/spv.IntersectShaderMotion.rint
Normal file
@ -0,0 +1,6 @@
|
||||
#version 460
|
||||
#extension GL_NV_ray_tracing_motion_blur : enable
|
||||
void main()
|
||||
{
|
||||
float time = gl_CurrentRayTimeNV + 0.5f;
|
||||
}
|
10
Test/spv.MissShaderMotion.rmiss
Normal file
10
Test/spv.MissShaderMotion.rmiss
Normal file
@ -0,0 +1,10 @@
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_NV_ray_tracing_motion_blur : enable
|
||||
layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT;
|
||||
layout(location = 0) rayPayloadEXT vec4 localPayloadEXT;
|
||||
void main()
|
||||
{
|
||||
float time = gl_CurrentRayTimeNV + 0.5f;
|
||||
traceRayMotionNV(accEXT, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1.0f, 0);
|
||||
}
|
13
Test/spv.RayGenShaderMotion.rgen
Normal file
13
Test/spv.RayGenShaderMotion.rgen
Normal file
@ -0,0 +1,13 @@
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_NV_ray_tracing_motion_blur : enable
|
||||
layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT;
|
||||
layout(location = 0) rayPayloadEXT vec4 payloadEXT;
|
||||
void main()
|
||||
{
|
||||
uint lx = gl_LaunchIDEXT.x;
|
||||
uint ly = gl_LaunchIDEXT.y;
|
||||
uint sx = gl_LaunchSizeEXT.x;
|
||||
uint sy = gl_LaunchSizeEXT.y;
|
||||
traceRayMotionNV(accEXT, lx, ly, sx, sy, 0u, vec3(0.5), 0.5f, vec3(1.0), 0.75f, 0.5, 0);
|
||||
}
|
@ -270,6 +270,7 @@ enum TBuiltInVariable {
|
||||
EbvWorldToObject,
|
||||
EbvWorldToObject3x4,
|
||||
EbvIncomingRayFlags,
|
||||
EbvCurrentRayTimeNV,
|
||||
// barycentrics
|
||||
EbvBaryCoordNV,
|
||||
EbvBaryCoordNoPerspNV,
|
||||
@ -475,6 +476,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
||||
case EbvIncomingRayFlags: return "IncomingRayFlagsNV";
|
||||
case EbvObjectToWorld: return "ObjectToWorldNV";
|
||||
case EbvWorldToObject: return "WorldToObjectNV";
|
||||
case EbvCurrentRayTimeNV: return "CurrentRayTimeNV";
|
||||
|
||||
case EbvBaryCoordNV: return "BaryCoordNV";
|
||||
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
|
||||
|
@ -926,6 +926,7 @@ enum TOperator {
|
||||
EOpMul32x16,
|
||||
|
||||
EOpTraceNV,
|
||||
EOpTraceRayMotionNV,
|
||||
EOpTraceKHR,
|
||||
EOpReportIntersection,
|
||||
EOpIgnoreIntersectionNV,
|
||||
|
@ -4661,7 +4661,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"\n");
|
||||
}
|
||||
|
||||
// Builtins for GL_NV_ray_tracing/GL_EXT_ray_tracing/GL_EXT_ray_query
|
||||
// Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query
|
||||
if (profile != EEsProfile && version >= 460) {
|
||||
commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);"
|
||||
"void rayQueryTerminateEXT(rayQueryEXT);"
|
||||
@ -4690,6 +4690,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
|
||||
stageBuiltins[EShLangRayGen].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
@ -4704,12 +4705,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"\n");
|
||||
stageBuiltins[EShLangClosestHit].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangMiss].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
@ -5918,6 +5921,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in mat3x4 gl_WorldToObject3x4EXT;"
|
||||
"in uint gl_IncomingRayFlagsNV;"
|
||||
"in uint gl_IncomingRayFlagsEXT;"
|
||||
"in float gl_CurrentRayTimeNV;"
|
||||
"\n";
|
||||
const char *hitDecls =
|
||||
"in uvec3 gl_LaunchIDNV;"
|
||||
@ -5953,6 +5957,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in mat3x4 gl_WorldToObject3x4EXT;"
|
||||
"in uint gl_IncomingRayFlagsNV;"
|
||||
"in uint gl_IncomingRayFlagsEXT;"
|
||||
"in float gl_CurrentRayTimeNV;"
|
||||
"\n";
|
||||
const char *missDecls =
|
||||
"in uvec3 gl_LaunchIDNV;"
|
||||
@ -5971,6 +5976,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in float gl_RayTmaxEXT;"
|
||||
"in uint gl_IncomingRayFlagsNV;"
|
||||
"in uint gl_IncomingRayFlagsEXT;"
|
||||
"in float gl_CurrentRayTimeNV;"
|
||||
"\n";
|
||||
|
||||
const char *callableDecls =
|
||||
@ -8789,11 +8795,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setVariableExtensions("gl_WorldToObject3x4EXT", 1, &E_GL_EXT_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur);
|
||||
|
||||
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
|
||||
|
||||
|
||||
symbolTable.setFunctionExtensions("traceNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setFunctionExtensions("traceRayMotionNV", 1, &E_GL_NV_ray_tracing_motion_blur);
|
||||
symbolTable.setFunctionExtensions("traceRayEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
symbolTable.setFunctionExtensions("reportIntersectionNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setFunctionExtensions("reportIntersectionEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
@ -8837,6 +8845,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlags, symbolTable);
|
||||
BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable);
|
||||
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
|
||||
BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable);
|
||||
|
||||
// GL_ARB_shader_ballot
|
||||
symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot);
|
||||
@ -9668,6 +9677,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
case EShLangMiss:
|
||||
if (profile != EEsProfile && version >= 460) {
|
||||
symbolTable.relateToOperator("traceNV", EOpTraceNV);
|
||||
symbolTable.relateToOperator("traceRayMotionNV", EOpTraceRayMotionNV);
|
||||
symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR);
|
||||
symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV);
|
||||
symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR);
|
||||
|
@ -2308,6 +2308,10 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
|
||||
if (!(*argp)[10]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "a");
|
||||
break;
|
||||
case EOpTraceRayMotionNV:
|
||||
if (!(*argp)[11]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "a");
|
||||
break;
|
||||
case EOpTraceKHR:
|
||||
if (!(*argp)[10]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "a");
|
||||
|
@ -165,7 +165,9 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
EShTargetLanguageVersion minSpvVersion;
|
||||
} extensionData;
|
||||
|
||||
const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4} };
|
||||
const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4},
|
||||
{E_GL_NV_ray_tracing_motion_blur, EShTargetSpv_1_4}
|
||||
};
|
||||
|
||||
for (size_t ii = 0; ii < sizeof(exts) / sizeof(exts[0]); ii++) {
|
||||
// Add only extensions which require > spv1.0 to save space in map
|
||||
@ -281,6 +283,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_shading_rate_image] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_ray_tracing] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_ray_tracing_motion_blur] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_fragment_shader_barycentric] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable;
|
||||
@ -518,6 +521,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_NV_shader_subgroup_partitioned 1\n"
|
||||
"#define GL_NV_shading_rate_image 1\n"
|
||||
"#define GL_NV_ray_tracing 1\n"
|
||||
"#define GL_NV_ray_tracing_motion_blur 1\n"
|
||||
"#define GL_NV_fragment_shader_barycentric 1\n"
|
||||
"#define GL_NV_compute_shader_derivatives 1\n"
|
||||
"#define GL_NV_shader_texture_footprint 1\n"
|
||||
|
@ -247,6 +247,7 @@ const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_
|
||||
const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned";
|
||||
const char* const E_GL_NV_shading_rate_image = "GL_NV_shading_rate_image";
|
||||
const char* const E_GL_NV_ray_tracing = "GL_NV_ray_tracing";
|
||||
const char* const E_GL_NV_ray_tracing_motion_blur = "GL_NV_ray_tracing_motion_blur";
|
||||
const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragment_shader_barycentric";
|
||||
const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives";
|
||||
const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint";
|
||||
|
@ -1089,6 +1089,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
||||
|
||||
case EOpTraceNV: out.debug << "traceNV"; break;
|
||||
case EOpTraceRayMotionNV: out.debug << "traceRayMotionNV"; break;
|
||||
case EOpTraceKHR: out.debug << "traceRayKHR"; break;
|
||||
case EOpReportIntersection: out.debug << "reportIntersectionNV"; break;
|
||||
case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break;
|
||||
|
@ -77,6 +77,7 @@ using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
|
||||
@ -204,6 +205,13 @@ TEST_P(CompileVulkanToSpirvTestNV, FromFile)
|
||||
Target::Spv);
|
||||
}
|
||||
|
||||
TEST_P(CompileVulkanToSpirv14TestNV, FromFile)
|
||||
{
|
||||
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
|
||||
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4,
|
||||
Target::Spv);
|
||||
}
|
||||
|
||||
TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
|
||||
{
|
||||
loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot,
|
||||
@ -765,6 +773,17 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Glsl, CompileVulkanToSpirv14TestNV,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
"spv.RayGenShaderMotion.rgen",
|
||||
"spv.IntersectShaderMotion.rint",
|
||||
"spv.AnyHitShaderMotion.rahit",
|
||||
"spv.ClosestHitShaderMotion.rchit",
|
||||
"spv.MissShaderMotion.rmiss",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
|
Loading…
Reference in New Issue
Block a user