Add support for GL_NV_displacement_micromap.

* Add support for GL_NV_displacement_micromap.
* Update known_good for spirv-headers and spirv-tools.
This commit is contained in:
alelenv 2023-10-02 12:07:50 -07:00 committed by GitHub
parent 86151772b2
commit 3f02132668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 838 additions and 11 deletions

View File

@ -84,4 +84,7 @@ const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins";
//SPV_NV_shader_execution_reorder
const char* const E_SPV_NV_shader_invocation_reorder = "SPV_NV_shader_invocation_reorder";
//SPV_NV_displacement_micromap
const char* const E_SPV_NV_displacement_micromap = "SPV_NV_displacement_micromap";
#endif // #ifndef GLSLextNV_H

View File

@ -1009,6 +1009,22 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur);
builder.addCapability(spv::CapabilityRayTracingMotionBlurNV);
return spv::BuiltInCurrentRayTimeNV;
case glslang::EbvMicroTrianglePositionNV:
builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV);
builder.addExtension("SPV_NV_displacement_micromap");
return spv::BuiltInHitMicroTriangleVertexPositionsNV;
case glslang::EbvMicroTriangleBaryNV:
builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV);
builder.addExtension("SPV_NV_displacement_micromap");
return spv::BuiltInHitMicroTriangleVertexBarycentricsNV;
case glslang::EbvHitKindFrontFacingMicroTriangleNV:
builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV);
builder.addExtension("SPV_NV_displacement_micromap");
return spv::BuiltInHitKindFrontFacingMicroTriangleNV;
case glslang::EbvHitKindBackFacingMicroTriangleNV:
builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV);
builder.addExtension("SPV_NV_displacement_micromap");
return spv::BuiltInHitKindBackFacingMicroTriangleNV;
// barycentrics
case glslang::EbvBaryCoordNV:
@ -3303,6 +3319,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
builder.addExtension(spv::E_SPV_QCOM_image_processing);
break;
case glslang::EOpFetchMicroTriangleVertexPositionNV:
case glslang::EOpFetchMicroTriangleVertexBarycentricNV:
builder.addExtension(spv::E_SPV_NV_displacement_micromap);
builder.addCapability(spv::CapabilityDisplacementMicromapNV);
break;
case glslang::EOpDebugPrintf:
noReturnValue = true;
break;
@ -3667,7 +3689,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3),
builder.makeUintConstant(3), 0);
// do the op
spv::Id result = builder.createOp(spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, typeId, idImmOps);
spv::Op spvOp = spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR;
spv::Id result = builder.createOp(spvOp, typeId, idImmOps);
// store the result to the pointer (out param 'm')
builder.createStore(result, operands[2]);
result = 0;
@ -7199,6 +7224,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
unaryOp = spv::OpHitObjectGetShaderRecordBufferHandleNV;
break;
case glslang::EOpFetchMicroTriangleVertexPositionNV:
unaryOp = spv::OpFetchMicroTriangleVertexPositionNV;
break;
case glslang::EOpFetchMicroTriangleVertexBarycentricNV:
unaryOp = spv::OpFetchMicroTriangleVertexBarycentricNV;
break;
case glslang::EOpCopyObject:
unaryOp = spv::OpCopyObject;
break;
@ -9083,6 +9116,17 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
addImageProcessingQCOMDecoration(operands[0], spv::DecorationBlockMatchTextureQCOM);
addImageProcessingQCOMDecoration(operands[2], spv::DecorationBlockMatchTextureQCOM);
break;
case glslang::EOpFetchMicroTriangleVertexBarycentricNV:
typeId = builder.makeVectorType(builder.makeFloatType(32), 2);
opCode = spv::OpFetchMicroTriangleVertexBarycentricNV;
break;
case glslang::EOpFetchMicroTriangleVertexPositionNV:
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
opCode = spv::OpFetchMicroTriangleVertexPositionNV;
break;
default:
return 0;
}

View File

@ -414,6 +414,10 @@ const char* BuiltInString(int builtIn)
case BuiltInRayTmaxKHR: return "RayTmaxKHR";
case BuiltInCullMaskKHR: return "CullMaskKHR";
case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR";
case BuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV";
case BuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV";
case BuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV";
case BuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV";
case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR";
case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR";
case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR";
@ -977,6 +981,8 @@ const char* CapabilityString(int info)
case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR";
case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR";
case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR";
case CapabilityDisplacementMicromapNV: return "DisplacementMicromapNV";
case CapabilityRayTracingDisplacementMicromapNV: return "CapabilityRayTracingDisplacementMicromapNV";
case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR";
case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV";
case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV";
@ -1542,6 +1548,9 @@ const char* OpcodeString(int op)
case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV";
case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV";
case OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV";
case OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV";
case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT";
case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT";
case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT";
@ -3082,7 +3091,7 @@ void Parameterize()
InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'RayQuery'");
InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'Committed'");
InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true);
InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].setResultAndType(true, true);
InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'");
InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'");
@ -3348,6 +3357,20 @@ void Parameterize()
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Payload'");
InstructionDesc[OpHitObjectTraceRayMotionNV].setResultAndType(false, false);
InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Acceleration Structure'");
InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Instance ID'");
InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Geometry Index'");
InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Primitive Index'");
InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Barycentrics'");
InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].setResultAndType(true, true);
InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Acceleration Structure'");
InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Instance ID'");
InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Geometry Index'");
InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Primitive Index'");
InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Barycentrics'");
InstructionDesc[OpFetchMicroTriangleVertexPositionNV].setResultAndType(true, true);
InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Attachment'");
InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Sample'", true);
InstructionDesc[OpStencilAttachmentReadEXT].operands.push(OperandId, "'Sample'", true);

View File

@ -720,6 +720,10 @@ enum BuiltIn {
BuiltInHitKindNV = 5333,
BuiltInCurrentRayTimeNV = 5334,
BuiltInHitTriangleVertexPositionsKHR = 5335,
BuiltInHitMicroTriangleVertexPositionsNV = 5337,
BuiltInHitMicroTriangleVertexBarycentricsNV = 5344,
BuiltInHitKindFrontFacingMicroTriangleNV = 5405,
BuiltInHitKindBackFacingMicroTriangleNV = 5406,
BuiltInIncomingRayFlagsKHR = 5351,
BuiltInIncomingRayFlagsNV = 5351,
BuiltInRayGeometryIndexKHR = 5352,
@ -1094,6 +1098,8 @@ enum Capability {
CapabilityFragmentShaderPixelInterlockEXT = 5378,
CapabilityDemoteToHelperInvocation = 5379,
CapabilityDemoteToHelperInvocationEXT = 5379,
CapabilityDisplacementMicromapNV = 5380,
CapabilityRayTracingDisplacementMicromapNV = 5409,
CapabilityRayTracingOpacityMicromapEXT = 5381,
CapabilityShaderInvocationReorderNV = 5383,
CapabilityBindlessTextureNV = 5390,
@ -1736,6 +1742,8 @@ enum Op {
OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpFetchMicroTriangleVertexPositionNV = 5300,
OpFetchMicroTriangleVertexBarycentricNV = 5301,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,

View File

@ -0,0 +1,96 @@
spv.nv.dmm-allops.comp
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 59
Capability Shader
Capability RayQueryKHR
Capability DisplacementMicromapNV
Extension "SPV_KHR_ray_query"
Extension "SPV_NV_displacement_micromap"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 11 16
ExecutionMode 4 LocalSize 16 1 1
Source GLSL 460
SourceExtension "GL_EXT_ray_query"
SourceExtension "GL_NV_displacement_micromap"
Name 4 "main"
Name 9 "block"
MemberName 9(block) 0 "op_pos"
MemberName 9(block) 1 "op_bary"
Name 11 ""
Name 16 "as"
MemberDecorate 9(block) 0 Offset 0
MemberDecorate 9(block) 1 Offset 16
Decorate 9(block) Block
Decorate 11 DescriptorSet 0
Decorate 11 Binding 0
Decorate 16(as) DescriptorSet 0
Decorate 16(as) Binding 1
Decorate 58 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 3
8: TypeVector 6(float) 2
9(block): TypeStruct 7(fvec3) 8(fvec2)
10: TypePointer StorageBuffer 9(block)
11: 10(ptr) Variable StorageBuffer
12: TypeInt 32 1
13: 12(int) Constant 0
14: TypeAccelerationStructureKHR
15: TypePointer UniformConstant 14
16(as): 15(ptr) Variable UniformConstant
18: 12(int) Constant 1
19: TypeVector 12(int) 2
20: 19(ivec2) ConstantComposite 13 13
22: TypePointer StorageBuffer 7(fvec3)
25: 19(ivec2) ConstantComposite 13 18
32: 19(ivec2) ConstantComposite 18 13
40: TypePointer StorageBuffer 8(fvec2)
54: TypeInt 32 0
55: TypeVector 54(int) 3
56: 54(int) Constant 16
57: 54(int) Constant 1
58: 55(ivec3) ConstantComposite 56 57 57
4(main): 2 Function None 3
5: Label
17: 14 Load 16(as)
21: 7(fvec3) FetchMicroTriangleVertexPositionNV 17 18 18 18 20
23: 22(ptr) AccessChain 11 13
Store 23 21
24: 14 Load 16(as)
26: 7(fvec3) FetchMicroTriangleVertexPositionNV 24 18 18 18 25
27: 22(ptr) AccessChain 11 13
28: 7(fvec3) Load 27
29: 7(fvec3) FAdd 28 26
30: 22(ptr) AccessChain 11 13
Store 30 29
31: 14 Load 16(as)
33: 7(fvec3) FetchMicroTriangleVertexPositionNV 31 18 18 18 32
34: 22(ptr) AccessChain 11 13
35: 7(fvec3) Load 34
36: 7(fvec3) FAdd 35 33
37: 22(ptr) AccessChain 11 13
Store 37 36
38: 14 Load 16(as)
39: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 38 18 18 18 20
41: 40(ptr) AccessChain 11 18
Store 41 39
42: 14 Load 16(as)
43: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 42 18 18 18 25
44: 40(ptr) AccessChain 11 18
45: 8(fvec2) Load 44
46: 8(fvec2) FAdd 45 43
47: 40(ptr) AccessChain 11 18
Store 47 46
48: 14 Load 16(as)
49: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 48 18 18 18 32
50: 40(ptr) AccessChain 11 18
51: 8(fvec2) Load 50
52: 8(fvec2) FAdd 51 49
53: 40(ptr) AccessChain 11 18
Store 53 52
Return
FunctionEnd

View File

@ -0,0 +1,95 @@
spv.nv.dmm-allops.mesh
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 54
Capability RayQueryKHR
Capability MeshShadingNV
Capability DisplacementMicromapNV
Extension "SPV_KHR_ray_query"
Extension "SPV_NV_displacement_micromap"
Extension "SPV_NV_mesh_shader"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint MeshNV 4 "main" 11 16
ExecutionMode 4 LocalSize 1 1 1
ExecutionMode 4 OutputVertices 8
ExecutionMode 4 OutputPrimitivesNV 16
ExecutionMode 4 OutputTrianglesNV
Source GLSL 460
SourceExtension "GL_EXT_ray_query"
SourceExtension "GL_NV_displacement_micromap"
SourceExtension "GL_NV_mesh_shader"
Name 4 "main"
Name 9 "block"
MemberName 9(block) 0 "op_pos"
MemberName 9(block) 1 "op_bary"
Name 11 ""
Name 16 "as"
MemberDecorate 9(block) 0 Offset 0
MemberDecorate 9(block) 1 Offset 16
Decorate 9(block) Block
Decorate 11 DescriptorSet 0
Decorate 11 Binding 0
Decorate 16(as) DescriptorSet 0
Decorate 16(as) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 3
8: TypeVector 6(float) 2
9(block): TypeStruct 7(fvec3) 8(fvec2)
10: TypePointer StorageBuffer 9(block)
11: 10(ptr) Variable StorageBuffer
12: TypeInt 32 1
13: 12(int) Constant 0
14: TypeAccelerationStructureKHR
15: TypePointer UniformConstant 14
16(as): 15(ptr) Variable UniformConstant
18: 12(int) Constant 1
19: TypeVector 12(int) 2
20: 19(ivec2) ConstantComposite 13 13
22: TypePointer StorageBuffer 7(fvec3)
25: 19(ivec2) ConstantComposite 13 18
32: 19(ivec2) ConstantComposite 18 13
40: TypePointer StorageBuffer 8(fvec2)
4(main): 2 Function None 3
5: Label
17: 14 Load 16(as)
21: 7(fvec3) FetchMicroTriangleVertexPositionNV 17 18 18 18 20
23: 22(ptr) AccessChain 11 13
Store 23 21
24: 14 Load 16(as)
26: 7(fvec3) FetchMicroTriangleVertexPositionNV 24 18 18 18 25
27: 22(ptr) AccessChain 11 13
28: 7(fvec3) Load 27
29: 7(fvec3) FAdd 28 26
30: 22(ptr) AccessChain 11 13
Store 30 29
31: 14 Load 16(as)
33: 7(fvec3) FetchMicroTriangleVertexPositionNV 31 18 18 18 32
34: 22(ptr) AccessChain 11 13
35: 7(fvec3) Load 34
36: 7(fvec3) FAdd 35 33
37: 22(ptr) AccessChain 11 13
Store 37 36
38: 14 Load 16(as)
39: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 38 18 18 18 20
41: 40(ptr) AccessChain 11 18
Store 41 39
42: 14 Load 16(as)
43: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 42 18 18 18 25
44: 40(ptr) AccessChain 11 18
45: 8(fvec2) Load 44
46: 8(fvec2) FAdd 45 43
47: 40(ptr) AccessChain 11 18
Store 47 46
48: 14 Load 16(as)
49: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 48 18 18 18 32
50: 40(ptr) AccessChain 11 18
51: 8(fvec2) Load 50
52: 8(fvec2) FAdd 51 49
53: 40(ptr) AccessChain 11 18
Store 53 52
Return
FunctionEnd

View File

@ -0,0 +1,126 @@
spv.nv.dmm-allops.rahit
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 77
Capability RayTracingKHR
Capability CapabilityRayTracingDisplacementMicromapNV
Extension "SPV_KHR_ray_tracing"
Extension "SPV_NV_displacement_micromap"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint AnyHitKHR 4 "main" 12 18 40 59 64 67 76
Source GLSL 460
SourceExtension "GL_EXT_ray_query"
SourceExtension "GL_EXT_ray_tracing"
SourceExtension "GL_NV_displacement_micromap"
Name 4 "main"
Name 10 "block"
MemberName 10(block) 0 "op_pos"
MemberName 10(block) 1 "op_bary"
MemberName 10(block) 2 "op_hit"
Name 12 ""
Name 18 "gl_HitMicroTriangleVertexPositionsNV"
Name 40 "gl_HitMicroTriangleVertexBarycentricsNV"
Name 59 "gl_HitKindEXT"
Name 64 "gl_HitKindFrontFacingMicroTriangleNV"
Name 67 "gl_HitKindBackFacingMicroTriangleNV"
Name 76 "as"
MemberDecorate 10(block) 0 Offset 0
MemberDecorate 10(block) 1 Offset 16
MemberDecorate 10(block) 2 Offset 24
Decorate 10(block) Block
Decorate 12 DescriptorSet 0
Decorate 12 Binding 0
Decorate 18(gl_HitMicroTriangleVertexPositionsNV) BuiltIn HitMicroTriangleVertexPositionsNV
Decorate 40(gl_HitMicroTriangleVertexBarycentricsNV) BuiltIn HitMicroTriangleVertexBarycentricsNV
Decorate 59(gl_HitKindEXT) BuiltIn HitKindKHR
Decorate 64(gl_HitKindFrontFacingMicroTriangleNV) BuiltIn HitKindFrontFacingMicroTriangleNV
Decorate 67(gl_HitKindBackFacingMicroTriangleNV) BuiltIn HitKindBackFacingMicroTriangleNV
Decorate 76(as) DescriptorSet 0
Decorate 76(as) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 3
8: TypeVector 6(float) 2
9: TypeInt 32 0
10(block): TypeStruct 7(fvec3) 8(fvec2) 9(int)
11: TypePointer StorageBuffer 10(block)
12: 11(ptr) Variable StorageBuffer
13: TypeInt 32 1
14: 13(int) Constant 0
15: 9(int) Constant 3
16: TypeArray 7(fvec3) 15
17: TypePointer Input 16
18(gl_HitMicroTriangleVertexPositionsNV): 17(ptr) Variable Input
19: TypePointer Input 7(fvec3)
22: TypePointer StorageBuffer 7(fvec3)
24: 13(int) Constant 1
31: 13(int) Constant 2
38: TypeArray 8(fvec2) 15
39: TypePointer Input 38
40(gl_HitMicroTriangleVertexBarycentricsNV): 39(ptr) Variable Input
41: TypePointer Input 8(fvec2)
44: TypePointer StorageBuffer 8(fvec2)
58: TypePointer Input 9(int)
59(gl_HitKindEXT): 58(ptr) Variable Input
61: TypePointer StorageBuffer 9(int)
63: 9(int) Constant 255
64(gl_HitKindFrontFacingMicroTriangleNV): 58(ptr) Variable Input
67(gl_HitKindBackFacingMicroTriangleNV): 58(ptr) Variable Input
74: TypeAccelerationStructureKHR
75: TypePointer UniformConstant 74
76(as): 75(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
20: 19(ptr) AccessChain 18(gl_HitMicroTriangleVertexPositionsNV) 14
21: 7(fvec3) Load 20
23: 22(ptr) AccessChain 12 14
Store 23 21
25: 19(ptr) AccessChain 18(gl_HitMicroTriangleVertexPositionsNV) 24
26: 7(fvec3) Load 25
27: 22(ptr) AccessChain 12 14
28: 7(fvec3) Load 27
29: 7(fvec3) FAdd 28 26
30: 22(ptr) AccessChain 12 14
Store 30 29
32: 19(ptr) AccessChain 18(gl_HitMicroTriangleVertexPositionsNV) 31
33: 7(fvec3) Load 32
34: 22(ptr) AccessChain 12 14
35: 7(fvec3) Load 34
36: 7(fvec3) FAdd 35 33
37: 22(ptr) AccessChain 12 14
Store 37 36
42: 41(ptr) AccessChain 40(gl_HitMicroTriangleVertexBarycentricsNV) 14
43: 8(fvec2) Load 42
45: 44(ptr) AccessChain 12 24
Store 45 43
46: 41(ptr) AccessChain 40(gl_HitMicroTriangleVertexBarycentricsNV) 24
47: 8(fvec2) Load 46
48: 44(ptr) AccessChain 12 24
49: 8(fvec2) Load 48
50: 8(fvec2) FAdd 49 47
51: 44(ptr) AccessChain 12 24
Store 51 50
52: 41(ptr) AccessChain 40(gl_HitMicroTriangleVertexBarycentricsNV) 31
53: 8(fvec2) Load 52
54: 44(ptr) AccessChain 12 24
55: 8(fvec2) Load 54
56: 8(fvec2) FAdd 55 53
57: 44(ptr) AccessChain 12 24
Store 57 56
60: 9(int) Load 59(gl_HitKindEXT)
62: 61(ptr) AccessChain 12 31
Store 62 60
65: 9(int) Load 64(gl_HitKindFrontFacingMicroTriangleNV)
66: 9(int) BitwiseOr 63 65
68: 9(int) Load 67(gl_HitKindBackFacingMicroTriangleNV)
69: 9(int) BitwiseOr 66 68
70: 61(ptr) AccessChain 12 31
71: 9(int) Load 70
72: 9(int) BitwiseAnd 71 69
73: 61(ptr) AccessChain 12 31
Store 73 72
Return
FunctionEnd

View File

@ -0,0 +1,126 @@
spv.nv.dmm-allops.rchit
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 77
Capability RayTracingKHR
Capability CapabilityRayTracingDisplacementMicromapNV
Extension "SPV_KHR_ray_tracing"
Extension "SPV_NV_displacement_micromap"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint ClosestHitKHR 4 "main" 12 18 40 59 64 67 76
Source GLSL 460
SourceExtension "GL_EXT_ray_query"
SourceExtension "GL_EXT_ray_tracing"
SourceExtension "GL_NV_displacement_micromap"
Name 4 "main"
Name 10 "block"
MemberName 10(block) 0 "op_pos"
MemberName 10(block) 1 "op_bary"
MemberName 10(block) 2 "op_hit"
Name 12 ""
Name 18 "gl_HitMicroTriangleVertexPositionsNV"
Name 40 "gl_HitMicroTriangleVertexBarycentricsNV"
Name 59 "gl_HitKindEXT"
Name 64 "gl_HitKindFrontFacingMicroTriangleNV"
Name 67 "gl_HitKindBackFacingMicroTriangleNV"
Name 76 "as"
MemberDecorate 10(block) 0 Offset 0
MemberDecorate 10(block) 1 Offset 16
MemberDecorate 10(block) 2 Offset 24
Decorate 10(block) Block
Decorate 12 DescriptorSet 0
Decorate 12 Binding 0
Decorate 18(gl_HitMicroTriangleVertexPositionsNV) BuiltIn HitMicroTriangleVertexPositionsNV
Decorate 40(gl_HitMicroTriangleVertexBarycentricsNV) BuiltIn HitMicroTriangleVertexBarycentricsNV
Decorate 59(gl_HitKindEXT) BuiltIn HitKindKHR
Decorate 64(gl_HitKindFrontFacingMicroTriangleNV) BuiltIn HitKindFrontFacingMicroTriangleNV
Decorate 67(gl_HitKindBackFacingMicroTriangleNV) BuiltIn HitKindBackFacingMicroTriangleNV
Decorate 76(as) DescriptorSet 0
Decorate 76(as) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 3
8: TypeVector 6(float) 2
9: TypeInt 32 0
10(block): TypeStruct 7(fvec3) 8(fvec2) 9(int)
11: TypePointer StorageBuffer 10(block)
12: 11(ptr) Variable StorageBuffer
13: TypeInt 32 1
14: 13(int) Constant 0
15: 9(int) Constant 3
16: TypeArray 7(fvec3) 15
17: TypePointer Input 16
18(gl_HitMicroTriangleVertexPositionsNV): 17(ptr) Variable Input
19: TypePointer Input 7(fvec3)
22: TypePointer StorageBuffer 7(fvec3)
24: 13(int) Constant 1
31: 13(int) Constant 2
38: TypeArray 8(fvec2) 15
39: TypePointer Input 38
40(gl_HitMicroTriangleVertexBarycentricsNV): 39(ptr) Variable Input
41: TypePointer Input 8(fvec2)
44: TypePointer StorageBuffer 8(fvec2)
58: TypePointer Input 9(int)
59(gl_HitKindEXT): 58(ptr) Variable Input
61: TypePointer StorageBuffer 9(int)
63: 9(int) Constant 255
64(gl_HitKindFrontFacingMicroTriangleNV): 58(ptr) Variable Input
67(gl_HitKindBackFacingMicroTriangleNV): 58(ptr) Variable Input
74: TypeAccelerationStructureKHR
75: TypePointer UniformConstant 74
76(as): 75(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
20: 19(ptr) AccessChain 18(gl_HitMicroTriangleVertexPositionsNV) 14
21: 7(fvec3) Load 20
23: 22(ptr) AccessChain 12 14
Store 23 21
25: 19(ptr) AccessChain 18(gl_HitMicroTriangleVertexPositionsNV) 24
26: 7(fvec3) Load 25
27: 22(ptr) AccessChain 12 14
28: 7(fvec3) Load 27
29: 7(fvec3) FAdd 28 26
30: 22(ptr) AccessChain 12 14
Store 30 29
32: 19(ptr) AccessChain 18(gl_HitMicroTriangleVertexPositionsNV) 31
33: 7(fvec3) Load 32
34: 22(ptr) AccessChain 12 14
35: 7(fvec3) Load 34
36: 7(fvec3) FAdd 35 33
37: 22(ptr) AccessChain 12 14
Store 37 36
42: 41(ptr) AccessChain 40(gl_HitMicroTriangleVertexBarycentricsNV) 14
43: 8(fvec2) Load 42
45: 44(ptr) AccessChain 12 24
Store 45 43
46: 41(ptr) AccessChain 40(gl_HitMicroTriangleVertexBarycentricsNV) 24
47: 8(fvec2) Load 46
48: 44(ptr) AccessChain 12 24
49: 8(fvec2) Load 48
50: 8(fvec2) FAdd 49 47
51: 44(ptr) AccessChain 12 24
Store 51 50
52: 41(ptr) AccessChain 40(gl_HitMicroTriangleVertexBarycentricsNV) 31
53: 8(fvec2) Load 52
54: 44(ptr) AccessChain 12 24
55: 8(fvec2) Load 54
56: 8(fvec2) FAdd 55 53
57: 44(ptr) AccessChain 12 24
Store 57 56
60: 9(int) Load 59(gl_HitKindEXT)
62: 61(ptr) AccessChain 12 31
Store 62 60
65: 9(int) Load 64(gl_HitKindFrontFacingMicroTriangleNV)
66: 9(int) BitwiseOr 63 65
68: 9(int) Load 67(gl_HitKindBackFacingMicroTriangleNV)
69: 9(int) BitwiseOr 66 68
70: 61(ptr) AccessChain 12 31
71: 9(int) Load 70
72: 9(int) BitwiseAnd 71 69
73: 61(ptr) AccessChain 12 31
Store 73 72
Return
FunctionEnd

View File

@ -0,0 +1,108 @@
spv.nv.dmm-allops.rgen
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 66
Capability RayTracingKHR
Capability DisplacementMicromapNV
Capability CapabilityRayTracingDisplacementMicromapNV
Extension "SPV_KHR_ray_tracing"
Extension "SPV_NV_displacement_micromap"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint RayGenerationKHR 4 "main" 12 17 58 61
Source GLSL 460
SourceExtension "GL_EXT_ray_query"
SourceExtension "GL_NV_displacement_micromap"
Name 4 "main"
Name 10 "block"
MemberName 10(block) 0 "op_pos"
MemberName 10(block) 1 "op_bary"
MemberName 10(block) 2 "op_hitmask"
Name 12 ""
Name 17 "as"
Name 58 "gl_HitKindFrontFacingMicroTriangleNV"
Name 61 "gl_HitKindBackFacingMicroTriangleNV"
MemberDecorate 10(block) 0 Offset 0
MemberDecorate 10(block) 1 Offset 16
MemberDecorate 10(block) 2 Offset 24
Decorate 10(block) Block
Decorate 12 DescriptorSet 0
Decorate 12 Binding 0
Decorate 17(as) DescriptorSet 0
Decorate 17(as) Binding 1
Decorate 58(gl_HitKindFrontFacingMicroTriangleNV) BuiltIn HitKindFrontFacingMicroTriangleNV
Decorate 61(gl_HitKindBackFacingMicroTriangleNV) BuiltIn HitKindBackFacingMicroTriangleNV
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 3
8: TypeVector 6(float) 2
9: TypeInt 32 0
10(block): TypeStruct 7(fvec3) 8(fvec2) 9(int)
11: TypePointer StorageBuffer 10(block)
12: 11(ptr) Variable StorageBuffer
13: TypeInt 32 1
14: 13(int) Constant 0
15: TypeAccelerationStructureKHR
16: TypePointer UniformConstant 15
17(as): 16(ptr) Variable UniformConstant
19: 13(int) Constant 1
20: TypeVector 13(int) 2
21: 20(ivec2) ConstantComposite 14 14
23: TypePointer StorageBuffer 7(fvec3)
26: 20(ivec2) ConstantComposite 14 19
33: 20(ivec2) ConstantComposite 19 14
41: TypePointer StorageBuffer 8(fvec2)
55: 13(int) Constant 2
56: 9(int) Constant 255
57: TypePointer Input 9(int)
58(gl_HitKindFrontFacingMicroTriangleNV): 57(ptr) Variable Input
61(gl_HitKindBackFacingMicroTriangleNV): 57(ptr) Variable Input
64: TypePointer StorageBuffer 9(int)
4(main): 2 Function None 3
5: Label
18: 15 Load 17(as)
22: 7(fvec3) FetchMicroTriangleVertexPositionNV 18 19 19 19 21
24: 23(ptr) AccessChain 12 14
Store 24 22
25: 15 Load 17(as)
27: 7(fvec3) FetchMicroTriangleVertexPositionNV 25 19 19 19 26
28: 23(ptr) AccessChain 12 14
29: 7(fvec3) Load 28
30: 7(fvec3) FAdd 29 27
31: 23(ptr) AccessChain 12 14
Store 31 30
32: 15 Load 17(as)
34: 7(fvec3) FetchMicroTriangleVertexPositionNV 32 19 19 19 33
35: 23(ptr) AccessChain 12 14
36: 7(fvec3) Load 35
37: 7(fvec3) FAdd 36 34
38: 23(ptr) AccessChain 12 14
Store 38 37
39: 15 Load 17(as)
40: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 39 19 19 19 21
42: 41(ptr) AccessChain 12 19
Store 42 40
43: 15 Load 17(as)
44: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 43 19 19 19 26
45: 41(ptr) AccessChain 12 19
46: 8(fvec2) Load 45
47: 8(fvec2) FAdd 46 44
48: 41(ptr) AccessChain 12 19
Store 48 47
49: 15 Load 17(as)
50: 8(fvec2) FetchMicroTriangleVertexBarycentricNV 49 19 19 19 33
51: 41(ptr) AccessChain 12 19
52: 8(fvec2) Load 51
53: 8(fvec2) FAdd 52 50
54: 41(ptr) AccessChain 12 19
Store 54 53
59: 9(int) Load 58(gl_HitKindFrontFacingMicroTriangleNV)
60: 9(int) BitwiseOr 56 59
62: 9(int) Load 61(gl_HitKindBackFacingMicroTriangleNV)
63: 9(int) BitwiseOr 60 62
65: 64(ptr) AccessChain 12 55
Store 65 63
Return
FunctionEnd

View File

@ -0,0 +1,19 @@
#version 460
#extension GL_NV_displacement_micromap : enable
#extension GL_EXT_ray_query : enable
layout(local_size_x = 16) in;
layout(binding = 1) uniform accelerationStructureEXT as;
layout(binding = 0) buffer block {
vec3 op_pos;
vec2 op_bary;
};
void main()
{
op_pos = fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(0,0));
op_pos += fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(0,1));
op_pos += fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(1,0));
op_bary = fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(0,0));
op_bary += fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(0,1));
op_bary += fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(1,0));
}

View File

@ -0,0 +1,20 @@
#version 460
#extension GL_NV_displacement_micromap : enable
#extension GL_NV_mesh_shader : enable
#extension GL_EXT_ray_query : enable
layout(max_vertices = 8, max_primitives = 16, triangles) out;
layout(binding = 1) uniform accelerationStructureEXT as;
layout(binding = 0) buffer block {
vec3 op_pos;
vec2 op_bary;
};
void main()
{
op_pos = fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(0,0));
op_pos += fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(0,1));
op_pos += fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(1,0));
op_bary = fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(0,0));
op_bary += fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(0,1));
op_bary += fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(1,0));
}

View File

@ -0,0 +1,26 @@
#version 460
#extension GL_EXT_ray_tracing : enable
#extension GL_EXT_ray_query : enable
#extension GL_NV_displacement_micromap : enable
layout(binding = 1) uniform accelerationStructureEXT as;
layout(binding = 0) buffer block {
vec3 op_pos;
vec2 op_bary;
uint op_hit;
};
void main()
{
op_pos = gl_HitMicroTriangleVertexPositionsNV[0];
op_pos += gl_HitMicroTriangleVertexPositionsNV[1];
op_pos += gl_HitMicroTriangleVertexPositionsNV[2];
op_bary = gl_HitMicroTriangleVertexBarycentricsNV[0];
op_bary += gl_HitMicroTriangleVertexBarycentricsNV[1];
op_bary += gl_HitMicroTriangleVertexBarycentricsNV[2];
op_hit = gl_HitKindEXT;
op_hit &= gl_HitKindFrontFacingTriangleEXT |
gl_HitKindBackFacingTriangleEXT |
gl_HitKindFrontFacingMicroTriangleNV |
gl_HitKindBackFacingMicroTriangleNV;
}

View File

@ -0,0 +1,26 @@
#version 460
#extension GL_EXT_ray_tracing : enable
#extension GL_EXT_ray_query : enable
#extension GL_NV_displacement_micromap : enable
layout(binding = 1) uniform accelerationStructureEXT as;
layout(binding = 0) buffer block {
vec3 op_pos;
vec2 op_bary;
uint op_hit;
};
void main()
{
op_pos = gl_HitMicroTriangleVertexPositionsNV[0];
op_pos += gl_HitMicroTriangleVertexPositionsNV[1];
op_pos += gl_HitMicroTriangleVertexPositionsNV[2];
op_bary = gl_HitMicroTriangleVertexBarycentricsNV[0];
op_bary += gl_HitMicroTriangleVertexBarycentricsNV[1];
op_bary += gl_HitMicroTriangleVertexBarycentricsNV[2];
op_hit = gl_HitKindEXT;
op_hit &= gl_HitKindFrontFacingTriangleEXT |
gl_HitKindBackFacingTriangleEXT |
gl_HitKindFrontFacingMicroTriangleNV |
gl_HitKindBackFacingMicroTriangleNV;
}

View File

@ -0,0 +1,24 @@
#version 460
#extension GL_NV_displacement_micromap : enable
#extension GL_EXT_ray_query : enable
layout(binding = 1) uniform accelerationStructureEXT as;
layout(binding = 0) buffer block {
vec3 op_pos;
vec2 op_bary;
uint op_hitmask;
};
void main()
{
op_pos = fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(0,0));
op_pos += fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(0,1));
op_pos += fetchMicroTriangleVertexPositionNV(as, 1, 1, 1, ivec2(1,0));
op_bary = fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(0,0));
op_bary += fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(0,1));
op_bary += fetchMicroTriangleVertexBarycentricNV(as, 1, 1, 1, ivec2(1,0));
op_hitmask = gl_HitKindFrontFacingTriangleEXT |
gl_HitKindBackFacingTriangleEXT |
gl_HitKindFrontFacingMicroTriangleNV |
gl_HitKindBackFacingMicroTriangleNV;
}

View File

@ -290,6 +290,12 @@ enum TBuiltInVariable {
EbvLayerPerViewNV,
EbvMeshViewCountNV,
EbvMeshViewIndicesNV,
EbvMicroTrianglePositionNV,
EbvMicroTriangleBaryNV,
EbvHitKindFrontFacingMicroTriangleNV,
EbvHitKindBackFacingMicroTriangleNV,
//GL_EXT_mesh_shader
EbvPrimitivePointIndicesEXT,
EbvPrimitiveLineIndicesEXT,
@ -523,6 +529,9 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvShadingRateKHR: return "ShadingRateKHR";
case EbvPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR";
case EbvHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV";
case EbvHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV";
default: return "unknown built-in variable";
}
}

View File

@ -1006,6 +1006,8 @@ enum TOperator {
EOpHitObjectGetAttributesNV,
EOpHitObjectGetCurrentTimeNV,
EOpReorderThreadNV,
EOpFetchMicroTriangleVertexPositionNV,
EOpFetchMicroTriangleVertexBarycentricNV,
// HLSL operations
//

View File

@ -4730,6 +4730,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"void reorderThreadNV(uint, uint);"
"void reorderThreadNV(hitObjectNV);"
"void reorderThreadNV(hitObjectNV, uint, uint);"
"vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);"
"vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);"
"\n");
stageBuiltins[EShLangIntersect].append(
"bool reportIntersectionNV(float, uint);"
@ -4847,6 +4849,19 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"void SetMeshOutputsEXT(uint, uint);"
"\n");
}
// Builtins for GL_NV_displacement_micromap
if ((profile != EEsProfile && version >= 460) || (profile == EEsProfile && version >= 320)) {
stageBuiltins[EShLangMesh].append(
"vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);"
"vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);"
"\n");
stageBuiltins[EShLangCompute].append(
"vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);"
"vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);"
"\n");
}
// GL_EXT_texture_shadow_lod overloads
if (profile == EEsProfile) { // ES
@ -6056,6 +6071,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"const uint gl_RayFlagsForceOpacityMicromap2StateEXT = 1024U;"
"const uint gl_HitKindFrontFacingTriangleEXT = 254U;"
"const uint gl_HitKindBackFacingTriangleEXT = 255U;"
"in uint gl_HitKindFrontFacingMicroTriangleNV;"
"in uint gl_HitKindBackFacingMicroTriangleNV;"
"\n";
const char *constRayQueryIntersection =
@ -6144,7 +6161,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in float gl_CurrentRayTimeNV;"
"in uint gl_CullMaskEXT;"
"in vec3 gl_HitTriangleVertexPositionsEXT[3];"
"in vec3 gl_HitMicroTriangleVertexPositionsNV[3];"
"in vec2 gl_HitMicroTriangleVertexBarycentricsNV[3];"
"\n";
const char *missDecls =
"in uvec3 gl_LaunchIDNV;"
"in uvec3 gl_LaunchIDEXT;"
@ -8963,6 +8983,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
}
if ((profile != EEsProfile && version >= 460)) {
symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap);
symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap);
}
break;
case EShLangRayGen:
@ -9009,6 +9034,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
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_HitTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch);
symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexPositionsNV", 1, &E_GL_NV_displacement_micromap);
symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexBarycentricsNV", 1, &E_GL_NV_displacement_micromap);
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
@ -9054,6 +9081,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexNV", 1, &E_GL_NV_shader_invocation_reorder);
symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleNV", 1, &E_GL_NV_shader_invocation_reorder);
symbolTable.setFunctionExtensions("reorderThreadNV", 1, &E_GL_NV_shader_invocation_reorder);
symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap);
symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap);
BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable);
@ -9093,6 +9122,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable);
BuiltInVariable("gl_HitTriangleVertexPositionsEXT", EbvPositionFetch, symbolTable);
BuiltInVariable("gl_HitMicroTriangleVertexPositionsNV", EbvMicroTrianglePositionNV, symbolTable);
BuiltInVariable("gl_HitMicroTriangleVertexBarycentricsNV", EbvMicroTriangleBaryNV, symbolTable);
BuiltInVariable("gl_HitKindFrontFacingMicroTriangleNV", EbvHitKindFrontFacingMicroTriangleNV, symbolTable);
BuiltInVariable("gl_HitKindBackFacingMicroTriangleNV", EbvHitKindBackFacingMicroTriangleNV, symbolTable);
// GL_ARB_shader_ballot
symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot);
@ -9394,6 +9427,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
}
// Builtins for GL_NV_displacment_micromap
if ((profile != EEsProfile && version >= 460)) {
symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap);
symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap);
}
break;
case EShLangTask:
@ -10067,9 +10107,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("coopMatLoad", EOpCooperativeMatrixLoad);
symbolTable.relateToOperator("coopMatStore", EOpCooperativeMatrixStore);
symbolTable.relateToOperator("coopMatMulAdd", EOpCooperativeMatrixMulAdd);
if (profile != EEsProfile && version >= 460) {
symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV);
symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV);
}
break;
case EShLangRayGen:
if (profile != EEsProfile && version >= 460) {
symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV);
symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV);
} // fallthrough
case EShLangClosestHit:
case EShLangMiss:
if (profile != EEsProfile && version >= 460) {
@ -10141,6 +10190,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
if (profile != EEsProfile && version >= 450) {
symbolTable.relateToOperator("SetMeshOutputsEXT", EOpSetMeshOutputsEXT);
}
if (profile != EEsProfile && version >= 460) {
// Builtins for GL_NV_displacement_micromap.
symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV);
symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV);
}
break;
case EShLangTask:
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {

View File

@ -1073,12 +1073,18 @@ int TScanContext::tokenizeIdentifier()
parseContext.extensionTurnedOn(E_GL_NV_ray_tracing))
return keyword;
return identifierOrType();
case ACCSTRUCTEXT:
if (parseContext.symbolTable.atBuiltInLevel() ||
parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) ||
parseContext.extensionTurnedOn(E_GL_EXT_ray_query) ||
parseContext.extensionTurnedOn(E_GL_NV_displacement_micromap))
return keyword;
return identifierOrType();
case PAYLOADEXT:
case PAYLOADINEXT:
case HITATTREXT:
case CALLDATAEXT:
case CALLDATAINEXT:
case ACCSTRUCTEXT:
if (parseContext.symbolTable.atBuiltInLevel() ||
parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) ||
parseContext.extensionTurnedOn(E_GL_EXT_ray_query))

View File

@ -297,12 +297,11 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable;
extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable;
extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable;
extensionBehavior[E_GL_NV_cooperative_matrix] = EBhDisable;
extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable;
extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable;
extensionBehavior[E_GL_NV_shader_invocation_reorder] = EBhDisable;
extensionBehavior[E_GL_NV_displacement_micromap] = EBhDisable;
// ARM
extensionBehavior[E_GL_ARM_shader_core_builtins] = EBhDisable;

View File

@ -266,7 +266,12 @@ const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragmen
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";
const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader";
const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix";
const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins";
const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix";
const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder";
const char* const E_GL_EXT_ray_tracing_position_fetch = "GL_EXT_ray_tracing_position_fetch";
const char* const E_GL_NV_displacement_micromap = "GL_NV_displacement_micromap";
// ARM
const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins";
@ -276,10 +281,6 @@ const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader
const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 };
const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix";
const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins";
const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix";
const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder";
const char* const E_GL_QCOM_image_processing = "GL_QCOM_image_processing";

View File

@ -1141,6 +1141,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpHitObjectGetShaderBindingTableRecordIndexNV: out.debug << "HitObjectGetShaderBindingTableRecordIndexNV"; break;
case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break;
case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break;
case EOpFetchMicroTriangleVertexPositionNV: out.debug << "MicroTriangleVertexPositionNV"; break;
case EOpFetchMicroTriangleVertexBarycentricNV: out.debug << "MicroTriangleVertexBarycentricNV"; break;
case EOpSpirvInst: out.debug << "spirv_instruction"; break;
case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break;

View File

@ -708,6 +708,15 @@ INSTANTIATE_TEST_SUITE_P(
"spv.nv.hitobject-allops.rgen",
"spv.nv.hitobject-allops.rchit",
"spv.nv.hitobject-allops.rmiss",
// SPV_NV_displacment_micromap
"spv.nv.dmm-allops.rgen",
"spv.nv.dmm-allops.rchit",
"spv.nv.dmm-allops.rahit",
"spv.nv.dmm-allops.mesh",
"spv.nv.dmm-allops.comp",
})),
FileNameAsCustomTestSuffix
);

View File

@ -5,14 +5,14 @@
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Tools",
"subdir" : "External/spirv-tools",
"commit" : "89ca3aa571fe238944b31e88d5d8fe75fab0227a"
"commit" : "a996591b1c67e789e88e99ae3881272f5fc47374"
},
{
"name" : "spirv-tools/external/spirv-headers",
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Headers",
"subdir" : "External/spirv-tools/external/spirv-headers",
"commit" : "124a9665e464ef98b8b718d572d5f329311061eb"
"commit" : "f8a4f5d876e56c9930344041171192f04f244f61"
}
]
}