Add-support-for-SPV_NVX_raytracing

This commit is contained in:
Chao Chen 2018-09-19 11:42:24 -07:00
parent 3c3669904c
commit b50c02ef53
50 changed files with 5970 additions and 4184 deletions

View File

@ -33,7 +33,7 @@ enum Op;
enum Capability;
static const int GLSLextNVVersion = 100;
static const int GLSLextNVRevision = 9;
static const int GLSLextNVRevision = 10;
//SPV_NV_sample_mask_override_coverage
const char* const E_SPV_NV_sample_mask_override_coverage = "SPV_NV_sample_mask_override_coverage";
@ -66,4 +66,7 @@ const char* const E_SPV_NV_shader_image_footprint = "SPV_NV_shader_image_footpri
//SPV_NV_mesh_shader
const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader";
#endif // #ifndef GLSLextNV_H
//SPV_NVX_raytracing
const char* const E_SPV_NVX_raytracing = "SPV_NVX_raytracing";
#endif // #ifndef GLSLextNV_H

View File

@ -276,6 +276,12 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
case EShLangFragment: return spv::ExecutionModelFragment;
case EShLangCompute: return spv::ExecutionModelGLCompute;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV: return spv::ExecutionModelRayGenerationNVX;
case EShLangIntersectNV: return spv::ExecutionModelIntersectionNVX;
case EShLangAnyHitNV: return spv::ExecutionModelAnyHitNVX;
case EShLangClosestHitNV: return spv::ExecutionModelClosestHitNVX;
case EShLangMissNV: return spv::ExecutionModelMissNVX;
case EShLangCallableNV: return spv::ExecutionModelCallableNVX;
case EShLangTaskNV: return spv::ExecutionModelTaskNV;
case EShLangMeshNV: return spv::ExecutionModelMeshNV;
#endif
@ -328,6 +334,11 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto
case glslang::EvqBuffer: return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock;
case glslang::EvqVaryingIn: return spv::DecorationBlock;
case glslang::EvqVaryingOut: return spv::DecorationBlock;
#ifdef NV_EXTENSIONS
case glslang::EvqPayloadNV: return spv::DecorationBlock;
case glslang::EvqPayloadInNV: return spv::DecorationBlock;
case glslang::EvqHitAttrNV: return spv::DecorationBlock;
#endif
default:
assert(0);
break;
@ -396,6 +407,12 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T
assert(type.getQualifier().layoutPacking == glslang::ElpNone);
}
return spv::DecorationMax;
#ifdef NV_EXTENSIONS
case glslang::EvqPayloadNV:
case glslang::EvqPayloadInNV:
case glslang::EvqHitAttrNV:
return spv::DecorationMax;
#endif
default:
assert(0);
return spv::DecorationMax;
@ -847,6 +864,34 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered);
builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT);
return spv::BuiltInFullyCoveredEXT;
// raytracing
case glslang::EbvLaunchIdNV:
return spv::BuiltInLaunchIdNVX;
case glslang::EbvLaunchSizeNV:
return spv::BuiltInLaunchSizeNVX;
case glslang::EbvWorldRayOriginNV:
return spv::BuiltInWorldRayOriginNVX;
case glslang::EbvWorldRayDirectionNV:
return spv::BuiltInWorldRayDirectionNVX;
case glslang::EbvObjectRayOriginNV:
return spv::BuiltInObjectRayOriginNVX;
case glslang::EbvObjectRayDirectionNV:
return spv::BuiltInObjectRayDirectionNVX;
case glslang::EbvRayTminNV:
return spv::BuiltInRayTminNVX;
case glslang::EbvRayTmaxNV:
return spv::BuiltInRayTmaxNVX;
case glslang::EbvInstanceCustomIndexNV:
return spv::BuiltInInstanceCustomIndexNVX;
case glslang::EbvHitTNV:
return spv::BuiltInHitTNVX;
case glslang::EbvHitKindNV:
return spv::BuiltInHitKindNVX;
case glslang::EbvObjectToWorldNV:
return spv::BuiltInObjectToWorldNVX;
case glslang::EbvWorldToObjectNV:
return spv::BuiltInWorldToObjectNVX;
case glslang::EbvBaryCoordNV:
builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric);
builder.addCapability(spv::CapabilityFragmentBarycentricNV);
@ -1027,6 +1072,10 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
if (type.getQualifier().isUniformOrBuffer()) {
if (type.getQualifier().layoutPushConstant)
return spv::StorageClassPushConstant;
#ifdef NV_EXTENSIONS
if (type.getQualifier().layoutShaderRecordNV)
return spv::StorageClassShaderRecordBufferNVX;
#endif
if (type.getBasicType() == glslang::EbtBlock)
return spv::StorageClassUniform;
return spv::StorageClassUniformConstant;
@ -1037,6 +1086,11 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
case glslang::EvqGlobal: return spv::StorageClassPrivate;
case glslang::EvqConstReadOnly: return spv::StorageClassFunction;
case glslang::EvqTemporary: return spv::StorageClassFunction;
#ifdef NV_EXTENSIONS
case glslang::EvqPayloadNV: return spv::StorageClassRayPayloadNVX;
case glslang::EvqPayloadInNV: return spv::StorageClassIncomingRayPayloadNVX;
case glslang::EvqHitAttrNV: return spv::StorageClassHitAttributeNVX;
#endif
default:
assert(0);
break;
@ -1092,7 +1146,11 @@ bool IsDescriptorResource(const glslang::TType& type)
{
// uniform and buffer blocks are included, unless it is a push_constant
if (type.getBasicType() == glslang::EbtBlock)
return type.getQualifier().isUniformOrBuffer() && ! type.getQualifier().layoutPushConstant;
return type.getQualifier().isUniformOrBuffer() &&
#ifdef NV_EXTENSIONS
! type.getQualifier().layoutShaderRecordNV &&
#endif
! type.getQualifier().layoutPushConstant;
// non block...
// basically samplerXXX/subpass/sampler/texture are all included
@ -1358,6 +1416,15 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
break;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV:
case EShLangIntersectNV:
case EShLangAnyHitNV:
case EShLangClosestHitNV:
case EShLangMissNV:
case EShLangCallableNV:
builder.addCapability(spv::CapabilityRaytracingNVX);
builder.addExtension("SPV_NVX_raytracing");
break;
case EShLangTaskNV:
case EShLangMeshNV:
builder.addCapability(spv::CapabilityMeshShadingNV);
@ -2189,6 +2256,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
break;
#ifdef NV_EXTENSIONS
case glslang::EOpIgnoreIntersectionNV:
case glslang::EOpTerminateRayNV:
case glslang::EOpTraceNV:
case glslang::EOpWritePackedPrimitiveIndices4x8NV:
noReturnValue = true;
break;
@ -2860,6 +2930,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
builder.addCapability(spv::CapabilityAtomicStorage);
spvType = builder.makeUintType(32);
break;
#ifdef NV_EXTENSIONS
case glslang::EbtAccStructNV:
spvType = builder.makeAccelerationStructureNVType();
break;
#endif
case glslang::EbtSampler:
{
const glslang::TSampler& sampler = type.getSampler();
@ -6784,6 +6859,18 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
break;
#ifdef NV_EXTENSIONS
case glslang::EOpReportIntersectionNV:
{
typeId = builder.makeBoolType();
opCode = spv::OpReportIntersectionNVX;
}
break;
case glslang::EOpTraceNV:
{
builder.createNoResultOp(spv::OpTraceNVX, operands);
return 0;
}
break;
case glslang::EOpWritePackedPrimitiveIndices4x8NV:
builder.createNoResultOp(spv::OpWritePackedPrimitiveIndices4x8NV, operands);
return 0;
@ -6961,6 +7048,14 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
spv::Id id = builder.createBuiltinCall(typeId, getExtBuiltins(spv::E_SPV_AMD_gcn_shader), spv::TimeAMD, args);
return builder.setPrecision(id, precision);
}
#endif
#ifdef NV_EXTENSIONS
case glslang::EOpIgnoreIntersectionNV:
builder.createNoResultOp(spv::OpIgnoreIntersectionNVX);
return 0;
case glslang::EOpTerminateRayNV:
builder.createNoResultOp(spv::OpTerminateRayNVX);
return 0;
#endif
default:
logger->missingFunctionality("unknown operation with no arguments");

View File

@ -503,6 +503,21 @@ Id Builder::makeSampledImageType(Id imageType)
return type->getResultId();
}
#ifdef NV_EXTENSIONS
Id Builder::makeAccelerationStructureNVType()
{
Instruction *type;
if (groupedTypes[OpTypeAccelerationStructureNVX].size() == 0) {
type = new Instruction(getUniqueId(), NoType, OpTypeAccelerationStructureNVX);
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
} else {
type = groupedTypes[OpTypeAccelerationStructureNVX].back();
}
return type->getResultId();
}
#endif
Id Builder::getDerefTypeId(Id resultId) const
{
Id typeId = getTypeId(resultId);
@ -1377,7 +1392,7 @@ void Builder::createNoResultOp(Op opCode, Id operand)
buildPoint->addInstruction(std::unique_ptr<Instruction>(op));
}
// An opcode that has multiple operands, no result id, and no type
// An opcode that has one or more operands, no result id, and no type
void Builder::createNoResultOp(Op opCode, const std::vector<Id>& operands)
{
Instruction* op = new Instruction(opCode);

View File

@ -131,6 +131,11 @@ public:
Id makeSamplerType();
Id makeSampledImageType(Id imageType);
#ifdef NV_EXTENSIONS
// accelerationStructureNV type
Id makeAccelerationStructureNVType();
#endif
// For querying about types.
Id getTypeId(Id resultId) const { return module.getTypeId(resultId); }
Id getDerefTypeId(Id resultId) const;

View File

@ -104,6 +104,16 @@ const char* ExecutionModelString(int model)
#endif
default: return "Bad";
#ifdef NV_EXTENSIONS
case ExecutionModelRayGenerationNVX: return "RayGenerationNVX";
case ExecutionModelIntersectionNVX: return "IntersectionNVX";
case ExecutionModelAnyHitNVX: return "AnyHitNVX";
case ExecutionModelClosestHitNVX: return "ClosestHitNVX";
case ExecutionModelMissNVX: return "MissNVX";
case ExecutionModelCallableNVX: return "CallableNVX";
#endif
}
}
@ -201,6 +211,13 @@ const char* StorageClassString(int StorageClass)
case 11: return "Image";
case 12: return "StorageBuffer";
#ifdef NV_EXTENSIONS
case StorageClassRayPayloadNVX: return "RayPayloadNVX";
case StorageClassHitAttributeNVX: return "HitAttributeNVX";
case StorageClassIncomingRayPayloadNVX: return "IncomingRayPayloadNVX";
case StorageClassShaderRecordBufferNVX: return "ShaderRecordBufferNVX";
#endif
default: return "Bad";
}
}
@ -350,13 +367,26 @@ const char* BuiltInString(int builtIn)
#endif
#ifdef NV_EXTENSIONS
case 5253: return "ViewportMaskNV";
case 5257: return "SecondaryPositionNV";
case 5258: return "SecondaryViewportMaskNV";
case 5261: return "PositionPerViewNV";
case 5262: return "ViewportMaskPerViewNV";
case BuiltInBaryCoordNV: return "BaryCoordNV";
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
case BuiltInLaunchIdNVX: return "LaunchIdNVX";
case BuiltInLaunchSizeNVX: return "LaunchSizeNVX";
case BuiltInWorldRayOriginNVX: return "WorldRayOriginNVX";
case BuiltInWorldRayDirectionNVX: return "WorldRayDirectionNVX";
case BuiltInObjectRayOriginNVX: return "ObjectRayOriginNVX";
case BuiltInObjectRayDirectionNVX: return "ObjectRayDirectionNVX";
case BuiltInRayTminNVX: return "RayTminNVX";
case BuiltInRayTmaxNVX: return "RayTmaxNVX";
case BuiltInInstanceCustomIndexNVX: return "InstanceCustomIndexNVX";
case BuiltInObjectToWorldNVX: return "ObjectToWorldNVX";
case BuiltInWorldToObjectNVX: return "WorldToObjectNVX";
case BuiltInHitTNVX: return "HitTNVX";
case BuiltInHitKindNVX: return "HitKindNVX";
case BuiltInViewportMaskNV: return "ViewportMaskNV";
case BuiltInSecondaryPositionNV: return "SecondaryPositionNV";
case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
case BuiltInPositionPerViewNV: return "PositionPerViewNV";
case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
case BuiltInBaryCoordNV: return "BaryCoordNV";
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
#endif
case 5264: return "FullyCoveredEXT";
@ -857,6 +887,7 @@ const char* CapabilityString(int info)
case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV";
case CapabilityPerViewAttributesNV: return "PerViewAttributesNV";
case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV";
case CapabilityRaytracingNVX: return "RaytracingNVX";
case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV";
case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV";
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
@ -1274,6 +1305,11 @@ const char* OpcodeString(int op)
#ifdef NV_EXTENSIONS
case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
case OpReportIntersectionNVX: return "OpReportIntersectionNVX";
case OpIgnoreIntersectionNVX: return "OpIgnoreIntersectionNVX";
case OpTerminateRayNVX: return "OpTerminateRayNVX";
case OpTraceNVX: return "OpTraceNVX";
case OpTypeAccelerationStructureNVX: return "OpTypeAccelerationStructureNVX";
case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
#endif
@ -2622,6 +2658,28 @@ void Parameterize()
#ifdef NV_EXTENSIONS
InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X");
InstructionDesc[OpTypeAccelerationStructureNVX].setResultAndType(true, false);
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'NV Acceleration Structure'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'Ray Flags'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'Cull Mask'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'SBT Record Offset'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'SBT Record Stride'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'Miss Index'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'Ray Origin'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'TMin'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'Ray Direction'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'TMax'");
InstructionDesc[OpTraceNVX].operands.push(OperandId, "'Payload'");
InstructionDesc[OpTraceNVX].setResultAndType(false, false);
InstructionDesc[OpReportIntersectionNVX].operands.push(OperandId, "'Hit Parameter'");
InstructionDesc[OpReportIntersectionNVX].operands.push(OperandId, "'Hit Kind'");
InstructionDesc[OpIgnoreIntersectionNVX].setResultAndType(false, false);
InstructionDesc[OpTerminateRayNVX].setResultAndType(false, false);
InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'");
InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'");

View File

@ -245,6 +245,12 @@ const char* GetBinaryName(EShLanguage stage)
case EShLangFragment: name = "frag.spv"; break;
case EShLangCompute: name = "comp.spv"; break;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV: name = "rgen.spv"; break;
case EShLangIntersectNV: name = "rint.spv"; break;
case EShLangAnyHitNV: name = "rahit.spv"; break;
case EShLangClosestHitNV: name = "rchit.spv"; break;
case EShLangMissNV: name = "rmiss.spv"; break;
case EShLangCallableNV: name = "rcall.spv"; break;
case EShLangMeshNV: name = "mesh.spv"; break;
case EShLangTaskNV: name = "task.spv"; break;
#endif
@ -1210,7 +1216,12 @@ int C_DECL main(int argc, char* argv[])
// .geom = geometry
// .frag = fragment
// .comp = compute
//
// .rgen = ray generation
// .rint = ray intersection
// .rahit = ray any hit
// .rchit = ray closest hit
// .rmiss = ray miss
// .rcall = ray callable
// Additionally, the file names may end in .<stage>.glsl and .<stage>.hlsl
// where <stage> is one of the stages listed above.
//
@ -1255,6 +1266,18 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName)
else if (stageName == "comp")
return EShLangCompute;
#ifdef NV_EXTENSIONS
else if (stageName == "rgen")
return EShLangRayGenNV;
else if (stageName == "rint")
return EShLangIntersectNV;
else if (stageName == "rahit")
return EShLangAnyHitNV;
else if (stageName == "rchit")
return EShLangClosestHitNV;
else if (stageName == "rmiss")
return EShLangMissNV;
else if (stageName == "rcall")
return EShLangCallableNV;
else if (stageName == "mesh")
return EShLangMeshNV;
else if (stageName == "task")
@ -1332,6 +1355,12 @@ void usage()
#ifdef NV_EXTENSIONS
" .mesh for a mesh shader\n"
" .task for a task shader\n"
" .rgen for a ray generation shader\n"
" .rint for a ray intersection shader\n"
" .rahit for a ray any hit shader\n"
" .rchit for a ray closest hit shader\n"
" .rmiss for a ray miss shader\n"
" .rcall for a ray callable shader"
#endif
" .glsl for .vert.glsl, .tesc.glsl, ..., .comp.glsl compound suffixes\n"
" .hlsl for .vert.hlsl, .tesc.hlsl, ..., .comp.hlsl compound suffixes\n"

View File

@ -0,0 +1,163 @@
spv.AnyHitShader.rahit
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 81
Capability RaytracingNVX
Extension "SPV_NVX_raytracing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint AnyHitNVX 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67
Source GLSL 460
SourceExtension "GL_NVX_raytracing"
Name 4 "main"
Name 9 "v0"
Name 11 "gl_LaunchIDNVX"
Name 13 "v1"
Name 14 "gl_LaunchSizeNVX"
Name 18 "v2"
Name 20 "gl_PrimitiveID"
Name 22 "v3"
Name 23 "gl_InstanceID"
Name 25 "v4"
Name 26 "gl_InstanceCustomIndexNVX"
Name 31 "v5"
Name 33 "gl_WorldRayOriginNVX"
Name 35 "v6"
Name 36 "gl_WorldRayDirectionNVX"
Name 38 "v7"
Name 39 "gl_ObjectRayOriginNVX"
Name 41 "v8"
Name 42 "gl_ObjectRayDirectionNVX"
Name 45 "v9"
Name 47 "gl_RayTminNVX"
Name 49 "v10"
Name 50 "gl_RayTmaxNVX"
Name 52 "v11"
Name 53 "gl_HitTNVX"
Name 56 "v12"
Name 58 "gl_HitKindNVX"
Name 62 "v13"
Name 64 "gl_ObjectToWorldNVX"
Name 66 "v14"
Name 67 "gl_WorldToObjectNVX"
Name 71 "incomingPayload"
Decorate 11(gl_LaunchIDNVX) BuiltIn LaunchIdNVX
Decorate 14(gl_LaunchSizeNVX) BuiltIn LaunchSizeNVX
Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId
Decorate 23(gl_InstanceID) BuiltIn InstanceId
Decorate 26(gl_InstanceCustomIndexNVX) BuiltIn InstanceCustomIndexNVX
Decorate 33(gl_WorldRayOriginNVX) BuiltIn WorldRayOriginNVX
Decorate 36(gl_WorldRayDirectionNVX) BuiltIn WorldRayDirectionNVX
Decorate 39(gl_ObjectRayOriginNVX) BuiltIn ObjectRayOriginNVX
Decorate 42(gl_ObjectRayDirectionNVX) BuiltIn ObjectRayDirectionNVX
Decorate 47(gl_RayTminNVX) BuiltIn RayTminNVX
Decorate 50(gl_RayTmaxNVX) BuiltIn RayTmaxNVX
Decorate 53(gl_HitTNVX) BuiltIn HitTNVX
Decorate 58(gl_HitKindNVX) BuiltIn HitKindNVX
Decorate 64(gl_ObjectToWorldNVX) BuiltIn ObjectToWorldNVX
Decorate 67(gl_WorldToObjectNVX) BuiltIn WorldToObjectNVX
Decorate 71(incomingPayload) Location 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 2
8: TypePointer Function 7(ivec2)
10: TypePointer Input 7(ivec2)
11(gl_LaunchIDNVX): 10(ptr) Variable Input
14(gl_LaunchSizeNVX): 10(ptr) Variable Input
16: TypeInt 32 1
17: TypePointer Function 16(int)
19: TypePointer Input 16(int)
20(gl_PrimitiveID): 19(ptr) Variable Input
23(gl_InstanceID): 19(ptr) Variable Input
26(gl_InstanceCustomIndexNVX): 19(ptr) Variable Input
28: TypeFloat 32
29: TypeVector 28(float) 3
30: TypePointer Function 29(fvec3)
32: TypePointer Input 29(fvec3)
33(gl_WorldRayOriginNVX): 32(ptr) Variable Input
36(gl_WorldRayDirectionNVX): 32(ptr) Variable Input
39(gl_ObjectRayOriginNVX): 32(ptr) Variable Input
42(gl_ObjectRayDirectionNVX): 32(ptr) Variable Input
44: TypePointer Function 28(float)
46: TypePointer Input 28(float)
47(gl_RayTminNVX): 46(ptr) Variable Input
50(gl_RayTmaxNVX): 46(ptr) Variable Input
53(gl_HitTNVX): 46(ptr) Variable Input
55: TypePointer Function 6(int)
57: TypePointer Input 6(int)
58(gl_HitKindNVX): 57(ptr) Variable Input
60: TypeMatrix 29(fvec3) 4
61: TypePointer Function 60
63: TypePointer Input 60
64(gl_ObjectToWorldNVX): 63(ptr) Variable Input
67(gl_WorldToObjectNVX): 63(ptr) Variable Input
69: TypeVector 28(float) 4
70: TypePointer IncomingRayPayloadNVX 69(fvec4)
71(incomingPayload): 70(ptr) Variable IncomingRayPayloadNVX
72: 28(float) Constant 1056964608
73: 69(fvec4) ConstantComposite 72 72 72 72
75: 16(int) Constant 1
76: TypeBool
4(main): 2 Function None 3
5: Label
9(v0): 8(ptr) Variable Function
13(v1): 8(ptr) Variable Function
18(v2): 17(ptr) Variable Function
22(v3): 17(ptr) Variable Function
25(v4): 17(ptr) Variable Function
31(v5): 30(ptr) Variable Function
35(v6): 30(ptr) Variable Function
38(v7): 30(ptr) Variable Function
41(v8): 30(ptr) Variable Function
45(v9): 44(ptr) Variable Function
49(v10): 44(ptr) Variable Function
52(v11): 44(ptr) Variable Function
56(v12): 55(ptr) Variable Function
62(v13): 61(ptr) Variable Function
66(v14): 61(ptr) Variable Function
12: 7(ivec2) Load 11(gl_LaunchIDNVX)
Store 9(v0) 12
15: 7(ivec2) Load 14(gl_LaunchSizeNVX)
Store 13(v1) 15
21: 16(int) Load 20(gl_PrimitiveID)
Store 18(v2) 21
24: 16(int) Load 23(gl_InstanceID)
Store 22(v3) 24
27: 16(int) Load 26(gl_InstanceCustomIndexNVX)
Store 25(v4) 27
34: 29(fvec3) Load 33(gl_WorldRayOriginNVX)
Store 31(v5) 34
37: 29(fvec3) Load 36(gl_WorldRayDirectionNVX)
Store 35(v6) 37
40: 29(fvec3) Load 39(gl_ObjectRayOriginNVX)
Store 38(v7) 40
43: 29(fvec3) Load 42(gl_ObjectRayDirectionNVX)
Store 41(v8) 43
48: 28(float) Load 47(gl_RayTminNVX)
Store 45(v9) 48
51: 28(float) Load 50(gl_RayTmaxNVX)
Store 49(v10) 51
54: 28(float) Load 53(gl_HitTNVX)
Store 52(v11) 54
59: 6(int) Load 58(gl_HitKindNVX)
Store 56(v12) 59
65: 60 Load 64(gl_ObjectToWorldNVX)
Store 62(v13) 65
68: 60 Load 67(gl_WorldToObjectNVX)
Store 66(v14) 68
Store 71(incomingPayload) 73
74: 16(int) Load 18(v2)
77: 76(bool) IEqual 74 75
SelectionMerge 79 None
BranchConditional 77 78 80
78: Label
IgnoreIntersectionNVX
Branch 79
80: Label
TerminateRayNVX
Branch 79
79: Label
Return
FunctionEnd

View File

@ -0,0 +1,8 @@
spv.AnyHitShader_Errors.rahit
ERROR: 0:8: 'assign' : l-value required "payload" (cannot modify hitAttributeNVX in this stage)
ERROR: 0:9: 'reportIntersectionNVX' : no matching overloaded function found
ERROR: 0:10: 'traceNVX' : no matching overloaded function found
ERROR: 3 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,169 @@
spv.ClosestHitShader.rchit
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 88
Capability RaytracingNVX
Extension "SPV_NVX_raytracing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint ClosestHitNVX 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67
Source GLSL 460
SourceExtension "GL_NVX_raytracing"
Name 4 "main"
Name 9 "v0"
Name 11 "gl_LaunchIDNVX"
Name 13 "v1"
Name 14 "gl_LaunchSizeNVX"
Name 18 "v2"
Name 20 "gl_PrimitiveID"
Name 22 "v3"
Name 23 "gl_InstanceID"
Name 25 "v4"
Name 26 "gl_InstanceCustomIndexNVX"
Name 31 "v5"
Name 33 "gl_WorldRayOriginNVX"
Name 35 "v6"
Name 36 "gl_WorldRayDirectionNVX"
Name 38 "v7"
Name 39 "gl_ObjectRayOriginNVX"
Name 41 "v8"
Name 42 "gl_ObjectRayDirectionNVX"
Name 45 "v9"
Name 47 "gl_RayTminNVX"
Name 49 "v10"
Name 50 "gl_RayTmaxNVX"
Name 52 "v11"
Name 53 "gl_HitTNVX"
Name 56 "v12"
Name 58 "gl_HitKindNVX"
Name 62 "v13"
Name 64 "gl_ObjectToWorldNVX"
Name 66 "v14"
Name 67 "gl_WorldToObjectNVX"
Name 71 "accNV"
Name 85 "localPayload"
Name 87 "incomingPayload"
Decorate 11(gl_LaunchIDNVX) BuiltIn LaunchIdNVX
Decorate 14(gl_LaunchSizeNVX) BuiltIn LaunchSizeNVX
Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId
Decorate 23(gl_InstanceID) BuiltIn InstanceId
Decorate 26(gl_InstanceCustomIndexNVX) BuiltIn InstanceCustomIndexNVX
Decorate 33(gl_WorldRayOriginNVX) BuiltIn WorldRayOriginNVX
Decorate 36(gl_WorldRayDirectionNVX) BuiltIn WorldRayDirectionNVX
Decorate 39(gl_ObjectRayOriginNVX) BuiltIn ObjectRayOriginNVX
Decorate 42(gl_ObjectRayDirectionNVX) BuiltIn ObjectRayDirectionNVX
Decorate 47(gl_RayTminNVX) BuiltIn RayTminNVX
Decorate 50(gl_RayTmaxNVX) BuiltIn RayTmaxNVX
Decorate 53(gl_HitTNVX) BuiltIn HitTNVX
Decorate 58(gl_HitKindNVX) BuiltIn HitKindNVX
Decorate 64(gl_ObjectToWorldNVX) BuiltIn ObjectToWorldNVX
Decorate 67(gl_WorldToObjectNVX) BuiltIn WorldToObjectNVX
Decorate 71(accNV) DescriptorSet 0
Decorate 71(accNV) Binding 0
Decorate 85(localPayload) Location 0
Decorate 87(incomingPayload) Location 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 2
8: TypePointer Function 7(ivec2)
10: TypePointer Input 7(ivec2)
11(gl_LaunchIDNVX): 10(ptr) Variable Input
14(gl_LaunchSizeNVX): 10(ptr) Variable Input
16: TypeInt 32 1
17: TypePointer Function 16(int)
19: TypePointer Input 16(int)
20(gl_PrimitiveID): 19(ptr) Variable Input
23(gl_InstanceID): 19(ptr) Variable Input
26(gl_InstanceCustomIndexNVX): 19(ptr) Variable Input
28: TypeFloat 32
29: TypeVector 28(float) 3
30: TypePointer Function 29(fvec3)
32: TypePointer Input 29(fvec3)
33(gl_WorldRayOriginNVX): 32(ptr) Variable Input
36(gl_WorldRayDirectionNVX): 32(ptr) Variable Input
39(gl_ObjectRayOriginNVX): 32(ptr) Variable Input
42(gl_ObjectRayDirectionNVX): 32(ptr) Variable Input
44: TypePointer Function 28(float)
46: TypePointer Input 28(float)
47(gl_RayTminNVX): 46(ptr) Variable Input
50(gl_RayTmaxNVX): 46(ptr) Variable Input
53(gl_HitTNVX): 46(ptr) Variable Input
55: TypePointer Function 6(int)
57: TypePointer Input 6(int)
58(gl_HitKindNVX): 57(ptr) Variable Input
60: TypeMatrix 29(fvec3) 4
61: TypePointer Function 60
63: TypePointer Input 60
64(gl_ObjectToWorldNVX): 63(ptr) Variable Input
67(gl_WorldToObjectNVX): 63(ptr) Variable Input
69: TypeAccelerationStructureNVX
70: TypePointer UniformConstant 69
71(accNV): 70(ptr) Variable UniformConstant
73: 6(int) Constant 0
74: 6(int) Constant 1
75: 6(int) Constant 2
76: 6(int) Constant 3
77: 28(float) Constant 1056964608
78: 29(fvec3) ConstantComposite 77 77 77
79: 28(float) Constant 1065353216
80: 29(fvec3) ConstantComposite 79 79 79
81: 28(float) Constant 1061158912
82: 16(int) Constant 1
83: TypeVector 28(float) 4
84: TypePointer RayPayloadNVX 83(fvec4)
85(localPayload): 84(ptr) Variable RayPayloadNVX
86: TypePointer IncomingRayPayloadNVX 83(fvec4)
87(incomingPayload): 86(ptr) Variable IncomingRayPayloadNVX
4(main): 2 Function None 3
5: Label
9(v0): 8(ptr) Variable Function
13(v1): 8(ptr) Variable Function
18(v2): 17(ptr) Variable Function
22(v3): 17(ptr) Variable Function
25(v4): 17(ptr) Variable Function
31(v5): 30(ptr) Variable Function
35(v6): 30(ptr) Variable Function
38(v7): 30(ptr) Variable Function
41(v8): 30(ptr) Variable Function
45(v9): 44(ptr) Variable Function
49(v10): 44(ptr) Variable Function
52(v11): 44(ptr) Variable Function
56(v12): 55(ptr) Variable Function
62(v13): 61(ptr) Variable Function
66(v14): 61(ptr) Variable Function
12: 7(ivec2) Load 11(gl_LaunchIDNVX)
Store 9(v0) 12
15: 7(ivec2) Load 14(gl_LaunchSizeNVX)
Store 13(v1) 15
21: 16(int) Load 20(gl_PrimitiveID)
Store 18(v2) 21
24: 16(int) Load 23(gl_InstanceID)
Store 22(v3) 24
27: 16(int) Load 26(gl_InstanceCustomIndexNVX)
Store 25(v4) 27
34: 29(fvec3) Load 33(gl_WorldRayOriginNVX)
Store 31(v5) 34
37: 29(fvec3) Load 36(gl_WorldRayDirectionNVX)
Store 35(v6) 37
40: 29(fvec3) Load 39(gl_ObjectRayOriginNVX)
Store 38(v7) 40
43: 29(fvec3) Load 42(gl_ObjectRayDirectionNVX)
Store 41(v8) 43
48: 28(float) Load 47(gl_RayTminNVX)
Store 45(v9) 48
51: 28(float) Load 50(gl_RayTmaxNVX)
Store 49(v10) 51
54: 28(float) Load 53(gl_HitTNVX)
Store 52(v11) 54
59: 6(int) Load 58(gl_HitKindNVX)
Store 56(v12) 59
65: 60 Load 64(gl_ObjectToWorldNVX)
Store 62(v13) 65
68: 60 Load 67(gl_WorldToObjectNVX)
Store 66(v14) 68
72: 69 Load 71(accNV)
TraceNVX 72 73 74 75 76 73 78 77 80 81 82
Return
FunctionEnd

View File

@ -0,0 +1,9 @@
spv.ClosestHitShader_Errors.rchit
ERROR: 0:8: 'assign' : l-value required "payload" (cannot modify hitAttributeNVX in this stage)
ERROR: 0:9: 'reportIntersectionNVX' : no matching overloaded function found
ERROR: 0:10: 'terminateRayNVX' : no matching overloaded function found
ERROR: 0:11: 'ignoreIntersectionNVX' : no matching overloaded function found
ERROR: 4 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,138 @@
spv.IntersectShader.rint
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 71
Capability RaytracingNVX
Extension "SPV_NVX_raytracing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint IntersectionNVX 4 "main" 11 14 20 23 26 33 36 39 42 47 50 56 59
Source GLSL 460
SourceExtension "GL_NVX_raytracing"
Name 4 "main"
Name 9 "v0"
Name 11 "gl_LaunchIDNVX"
Name 13 "v1"
Name 14 "gl_LaunchSizeNVX"
Name 18 "v2"
Name 20 "gl_PrimitiveID"
Name 22 "v3"
Name 23 "gl_InstanceID"
Name 25 "v4"
Name 26 "gl_InstanceCustomIndexNVX"
Name 31 "v5"
Name 33 "gl_WorldRayOriginNVX"
Name 35 "v6"
Name 36 "gl_WorldRayDirectionNVX"
Name 38 "v7"
Name 39 "gl_ObjectRayOriginNVX"
Name 41 "v8"
Name 42 "gl_ObjectRayDirectionNVX"
Name 45 "v9"
Name 47 "gl_RayTminNVX"
Name 49 "v10"
Name 50 "gl_RayTmaxNVX"
Name 54 "v11"
Name 56 "gl_ObjectToWorldNVX"
Name 58 "v12"
Name 59 "gl_WorldToObjectNVX"
Name 63 "iAttr"
Decorate 11(gl_LaunchIDNVX) BuiltIn LaunchIdNVX
Decorate 14(gl_LaunchSizeNVX) BuiltIn LaunchSizeNVX
Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId
Decorate 23(gl_InstanceID) BuiltIn InstanceId
Decorate 26(gl_InstanceCustomIndexNVX) BuiltIn InstanceCustomIndexNVX
Decorate 33(gl_WorldRayOriginNVX) BuiltIn WorldRayOriginNVX
Decorate 36(gl_WorldRayDirectionNVX) BuiltIn WorldRayDirectionNVX
Decorate 39(gl_ObjectRayOriginNVX) BuiltIn ObjectRayOriginNVX
Decorate 42(gl_ObjectRayDirectionNVX) BuiltIn ObjectRayDirectionNVX
Decorate 47(gl_RayTminNVX) BuiltIn RayTminNVX
Decorate 50(gl_RayTmaxNVX) BuiltIn RayTmaxNVX
Decorate 56(gl_ObjectToWorldNVX) BuiltIn ObjectToWorldNVX
Decorate 59(gl_WorldToObjectNVX) BuiltIn WorldToObjectNVX
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 2
8: TypePointer Function 7(ivec2)
10: TypePointer Input 7(ivec2)
11(gl_LaunchIDNVX): 10(ptr) Variable Input
14(gl_LaunchSizeNVX): 10(ptr) Variable Input
16: TypeInt 32 1
17: TypePointer Function 16(int)
19: TypePointer Input 16(int)
20(gl_PrimitiveID): 19(ptr) Variable Input
23(gl_InstanceID): 19(ptr) Variable Input
26(gl_InstanceCustomIndexNVX): 19(ptr) Variable Input
28: TypeFloat 32
29: TypeVector 28(float) 3
30: TypePointer Function 29(fvec3)
32: TypePointer Input 29(fvec3)
33(gl_WorldRayOriginNVX): 32(ptr) Variable Input
36(gl_WorldRayDirectionNVX): 32(ptr) Variable Input
39(gl_ObjectRayOriginNVX): 32(ptr) Variable Input
42(gl_ObjectRayDirectionNVX): 32(ptr) Variable Input
44: TypePointer Function 28(float)
46: TypePointer Input 28(float)
47(gl_RayTminNVX): 46(ptr) Variable Input
50(gl_RayTmaxNVX): 46(ptr) Variable Input
52: TypeMatrix 29(fvec3) 4
53: TypePointer Function 52
55: TypePointer Input 52
56(gl_ObjectToWorldNVX): 55(ptr) Variable Input
59(gl_WorldToObjectNVX): 55(ptr) Variable Input
61: TypeVector 28(float) 4
62: TypePointer HitAttributeNVX 61(fvec4)
63(iAttr): 62(ptr) Variable HitAttributeNVX
64: 28(float) Constant 1056964608
65: 28(float) Constant 0
66: 28(float) Constant 1065353216
67: 61(fvec4) ConstantComposite 64 64 65 66
68: 6(int) Constant 1
69: TypeBool
4(main): 2 Function None 3
5: Label
9(v0): 8(ptr) Variable Function
13(v1): 8(ptr) Variable Function
18(v2): 17(ptr) Variable Function
22(v3): 17(ptr) Variable Function
25(v4): 17(ptr) Variable Function
31(v5): 30(ptr) Variable Function
35(v6): 30(ptr) Variable Function
38(v7): 30(ptr) Variable Function
41(v8): 30(ptr) Variable Function
45(v9): 44(ptr) Variable Function
49(v10): 44(ptr) Variable Function
54(v11): 53(ptr) Variable Function
58(v12): 53(ptr) Variable Function
12: 7(ivec2) Load 11(gl_LaunchIDNVX)
Store 9(v0) 12
15: 7(ivec2) Load 14(gl_LaunchSizeNVX)
Store 13(v1) 15
21: 16(int) Load 20(gl_PrimitiveID)
Store 18(v2) 21
24: 16(int) Load 23(gl_InstanceID)
Store 22(v3) 24
27: 16(int) Load 26(gl_InstanceCustomIndexNVX)
Store 25(v4) 27
34: 29(fvec3) Load 33(gl_WorldRayOriginNVX)
Store 31(v5) 34
37: 29(fvec3) Load 36(gl_WorldRayDirectionNVX)
Store 35(v6) 37
40: 29(fvec3) Load 39(gl_ObjectRayOriginNVX)
Store 38(v7) 40
43: 29(fvec3) Load 42(gl_ObjectRayDirectionNVX)
Store 41(v8) 43
48: 28(float) Load 47(gl_RayTminNVX)
Store 45(v9) 48
51: 28(float) Load 50(gl_RayTmaxNVX)
Store 49(v10) 51
57: 52 Load 56(gl_ObjectToWorldNVX)
Store 54(v11) 57
60: 52 Load 59(gl_WorldToObjectNVX)
Store 58(v12) 60
Store 63(iAttr) 67
70: 69(bool) ReportIntersectionNVX 64 68
Return
FunctionEnd

View File

@ -0,0 +1,10 @@
spv.IntersectShader_Errors.rint
ERROR: 0:3: 'rayPayloadInNVX' : not supported in this stage: intersection
ERROR: 0:4: 'rayPayloadNVX' : not supported in this stage: intersection
ERROR: 0:8: 'gl_HitTNVX' : undeclared identifier
ERROR: 0:9: 'gl_HitKindNVX' : undeclared identifier
ERROR: 0:10: 'traceNVX' : no matching overloaded function found
ERROR: 5 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,113 @@
spv.MissShader.rmiss
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 60
Capability RaytracingNVX
Extension "SPV_NVX_raytracing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint MissNVX 4 "main" 11 14 21 24 27 30 35 38
Source GLSL 460
SourceExtension "GL_NVX_raytracing"
Name 4 "main"
Name 9 "v0"
Name 11 "gl_LaunchIDNVX"
Name 13 "v1"
Name 14 "gl_LaunchSizeNVX"
Name 19 "v2"
Name 21 "gl_WorldRayOriginNVX"
Name 23 "v3"
Name 24 "gl_WorldRayDirectionNVX"
Name 26 "v4"
Name 27 "gl_ObjectRayOriginNVX"
Name 29 "v5"
Name 30 "gl_ObjectRayDirectionNVX"
Name 33 "v6"
Name 35 "gl_RayTminNVX"
Name 37 "v7"
Name 38 "gl_RayTmaxNVX"
Name 42 "accNV"
Name 57 "localPayload"
Name 59 "incomingPayload"
Decorate 11(gl_LaunchIDNVX) BuiltIn LaunchIdNVX
Decorate 14(gl_LaunchSizeNVX) BuiltIn LaunchSizeNVX
Decorate 21(gl_WorldRayOriginNVX) BuiltIn WorldRayOriginNVX
Decorate 24(gl_WorldRayDirectionNVX) BuiltIn WorldRayDirectionNVX
Decorate 27(gl_ObjectRayOriginNVX) BuiltIn ObjectRayOriginNVX
Decorate 30(gl_ObjectRayDirectionNVX) BuiltIn ObjectRayDirectionNVX
Decorate 35(gl_RayTminNVX) BuiltIn RayTminNVX
Decorate 38(gl_RayTmaxNVX) BuiltIn RayTmaxNVX
Decorate 42(accNV) DescriptorSet 0
Decorate 42(accNV) Binding 0
Decorate 57(localPayload) Location 0
Decorate 59(incomingPayload) Location 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 2
8: TypePointer Function 7(ivec2)
10: TypePointer Input 7(ivec2)
11(gl_LaunchIDNVX): 10(ptr) Variable Input
14(gl_LaunchSizeNVX): 10(ptr) Variable Input
16: TypeFloat 32
17: TypeVector 16(float) 3
18: TypePointer Function 17(fvec3)
20: TypePointer Input 17(fvec3)
21(gl_WorldRayOriginNVX): 20(ptr) Variable Input
24(gl_WorldRayDirectionNVX): 20(ptr) Variable Input
27(gl_ObjectRayOriginNVX): 20(ptr) Variable Input
30(gl_ObjectRayDirectionNVX): 20(ptr) Variable Input
32: TypePointer Function 16(float)
34: TypePointer Input 16(float)
35(gl_RayTminNVX): 34(ptr) Variable Input
38(gl_RayTmaxNVX): 34(ptr) Variable Input
40: TypeAccelerationStructureNVX
41: TypePointer UniformConstant 40
42(accNV): 41(ptr) Variable UniformConstant
44: 6(int) Constant 0
45: 6(int) Constant 1
46: 6(int) Constant 2
47: 6(int) Constant 3
48: 16(float) Constant 1056964608
49: 17(fvec3) ConstantComposite 48 48 48
50: 16(float) Constant 1065353216
51: 17(fvec3) ConstantComposite 50 50 50
52: 16(float) Constant 1061158912
53: TypeInt 32 1
54: 53(int) Constant 1
55: TypeVector 16(float) 4
56: TypePointer RayPayloadNVX 55(fvec4)
57(localPayload): 56(ptr) Variable RayPayloadNVX
58: TypePointer IncomingRayPayloadNVX 55(fvec4)
59(incomingPayload): 58(ptr) Variable IncomingRayPayloadNVX
4(main): 2 Function None 3
5: Label
9(v0): 8(ptr) Variable Function
13(v1): 8(ptr) Variable Function
19(v2): 18(ptr) Variable Function
23(v3): 18(ptr) Variable Function
26(v4): 18(ptr) Variable Function
29(v5): 18(ptr) Variable Function
33(v6): 32(ptr) Variable Function
37(v7): 32(ptr) Variable Function
12: 7(ivec2) Load 11(gl_LaunchIDNVX)
Store 9(v0) 12
15: 7(ivec2) Load 14(gl_LaunchSizeNVX)
Store 13(v1) 15
22: 17(fvec3) Load 21(gl_WorldRayOriginNVX)
Store 19(v2) 22
25: 17(fvec3) Load 24(gl_WorldRayDirectionNVX)
Store 23(v3) 25
28: 17(fvec3) Load 27(gl_ObjectRayOriginNVX)
Store 26(v4) 28
31: 17(fvec3) Load 30(gl_ObjectRayDirectionNVX)
Store 29(v5) 31
36: 16(float) Load 35(gl_RayTminNVX)
Store 33(v6) 36
39: 16(float) Load 38(gl_RayTmaxNVX)
Store 37(v7) 39
43: 40 Load 42(accNV)
TraceNVX 43 44 45 46 47 44 49 48 51 52 54
Return
FunctionEnd

View File

@ -0,0 +1,21 @@
spv.MissShader_Errors.rmiss
ERROR: 0:3: 'hitAttributeNVX' : not supported in this stage: miss
ERROR: 0:6: 'gl_PrimitiveID' : undeclared identifier
ERROR: 0:6: '=' : cannot convert from ' temp float' to ' temp highp int'
ERROR: 0:7: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?)
ERROR: 0:7: '=' : cannot convert from ' temp float' to ' temp highp int'
ERROR: 0:8: 'gl_InstanceCustomIndexNVX' : undeclared identifier
ERROR: 0:8: '=' : cannot convert from ' temp float' to ' temp highp int'
ERROR: 0:9: 'gl_ObjectToWorldNVX' : undeclared identifier
ERROR: 0:9: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float'
ERROR: 0:10: 'gl_WorldToObjectNVX' : undeclared identifier
ERROR: 0:10: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float'
ERROR: 0:11: 'gl_HitTNVX' : undeclared identifier
ERROR: 0:12: 'gl_HitKindNVX' : undeclared identifier
ERROR: 0:13: 'reportIntersectionNVX' : no matching overloaded function found
ERROR: 0:14: 'ignoreIntersectionNVX' : no matching overloaded function found
ERROR: 0:15: 'terminateRayNVX' : no matching overloaded function found
ERROR: 16 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,46 @@
spv.RayConstants.rgen
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 27
Capability RaytracingNVX
Extension "SPV_NVX_raytracing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint RayGenerationNVX 4 "main"
Source GLSL 460
SourceExtension "GL_NVX_raytracing"
Name 4 "main"
Name 8 "accNV"
Name 26 "payload"
Decorate 8(accNV) DescriptorSet 0
Decorate 8(accNV) Binding 0
Decorate 26(payload) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeAccelerationStructureNVX
7: TypePointer UniformConstant 6
8(accNV): 7(ptr) Variable UniformConstant
10: TypeInt 32 0
11: 10(int) Constant 255
12: 10(int) Constant 0
13: 10(int) Constant 1
14: TypeFloat 32
15: TypeVector 14(float) 3
16: 14(float) Constant 0
17: 15(fvec3) ConstantComposite 16 16 16
18: 14(float) Constant 1056964608
19: 14(float) Constant 1065353216
20: 15(fvec3) ConstantComposite 19 19 19
21: 14(float) Constant 1061158912
22: TypeInt 32 1
23: 22(int) Constant 1
24: TypeVector 14(float) 4
25: TypePointer RayPayloadNVX 24(fvec4)
26(payload): 25(ptr) Variable RayPayloadNVX
4(main): 2 Function None 3
5: Label
9: 6 Load 8(accNV)
TraceNVX 9 11 12 13 13 12 17 18 20 21 23
Return
FunctionEnd

View File

@ -0,0 +1,101 @@
spv.RayGenShader.rgen
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 60
Capability RaytracingNVX
Extension "SPV_NVX_raytracing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint RayGenerationNVX 4 "main" 11 21
Source GLSL 460
SourceExtension "GL_NVX_raytracing"
Name 4 "main"
Name 8 "lx"
Name 11 "gl_LaunchIDNVX"
Name 16 "ly"
Name 20 "sx"
Name 21 "gl_LaunchSizeNVX"
Name 24 "sy"
Name 29 "accNV"
Name 48 "block"
MemberName 48(block) 0 "arr"
MemberName 48(block) 1 "pad"
Name 50 ""
Name 56 "payload"
Decorate 11(gl_LaunchIDNVX) BuiltIn LaunchIdNVX
Decorate 21(gl_LaunchSizeNVX) BuiltIn LaunchSizeNVX
Decorate 29(accNV) DescriptorSet 0
Decorate 29(accNV) Binding 0
Decorate 46 ArrayStride 4
MemberDecorate 48(block) 0 Offset 0
MemberDecorate 48(block) 1 Offset 16
Decorate 48(block) BufferBlock
Decorate 56(payload) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypePointer Function 6(int)
9: TypeVector 6(int) 2
10: TypePointer Input 9(ivec2)
11(gl_LaunchIDNVX): 10(ptr) Variable Input
12: 6(int) Constant 0
13: TypePointer Input 6(int)
17: 6(int) Constant 1
21(gl_LaunchSizeNVX): 10(ptr) Variable Input
27: TypeAccelerationStructureNVX
28: TypePointer UniformConstant 27
29(accNV): 28(ptr) Variable UniformConstant
35: TypeFloat 32
36: TypeVector 35(float) 3
37: 35(float) Constant 0
38: 36(fvec3) ConstantComposite 37 37 37
39: 35(float) Constant 1056964608
40: 35(float) Constant 1065353216
41: 36(fvec3) ConstantComposite 40 40 40
42: 35(float) Constant 1061158912
43: TypeInt 32 1
44: 43(int) Constant 1
45: 6(int) Constant 4
46: TypeArray 35(float) 45
47: TypeVector 35(float) 4
48(block): TypeStruct 46 47(fvec4)
49: TypePointer ShaderRecordBufferNVX 48(block)
50: 49(ptr) Variable ShaderRecordBufferNVX
51: 43(int) Constant 0
52: 43(int) Constant 3
53: TypePointer ShaderRecordBufferNVX 35(float)
55: TypePointer RayPayloadNVX 47(fvec4)
56(payload): 55(ptr) Variable RayPayloadNVX
58: TypePointer ShaderRecordBufferNVX 47(fvec4)
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_LaunchIDNVX) 12
15: 6(int) Load 14
Store 8(lx) 15
18: 13(ptr) AccessChain 11(gl_LaunchIDNVX) 17
19: 6(int) Load 18
Store 16(ly) 19
22: 13(ptr) AccessChain 21(gl_LaunchSizeNVX) 12
23: 6(int) Load 22
Store 20(sx) 23
25: 13(ptr) AccessChain 21(gl_LaunchSizeNVX) 17
26: 6(int) Load 25
Store 24(sy) 26
30: 27 Load 29(accNV)
31: 6(int) Load 8(lx)
32: 6(int) Load 16(ly)
33: 6(int) Load 20(sx)
34: 6(int) Load 24(sy)
TraceNVX 30 31 32 33 34 12 38 39 41 42 44
54: 53(ptr) AccessChain 50 51 52
Store 54 40
57: 47(fvec4) Load 56(payload)
59: 58(ptr) AccessChain 50 44
Store 59 57
Return
FunctionEnd

View File

@ -0,0 +1,39 @@
spv.RayGenShader_Errors.rgen
ERROR: 0:3: 'hitAttributeNVX' : not supported in this stage: ray-generation
ERROR: 0:4: 'rayPayloadInNVX' : not supported in this stage: ray-generation
ERROR: 0:5: 'shaderRecordNVX' : can only be used with a buffer
ERROR: 0:9: 'binding' : cannot be used with shaderRecordNVX
ERROR: 0:12: 'set' : cannot be used with shaderRecordNVX
ERROR: 0:23: 'accelerationStructureNVX' : accelerationStructureNVX can only be used in uniform variables or function parameters: a
ERROR: 0:23: '=' : cannot convert from ' const int' to ' temp accelerationStructureNVX'
ERROR: 0:24: 'gl_PrimitiveID' : undeclared identifier
ERROR: 0:24: '=' : cannot convert from ' temp float' to ' temp highp int'
ERROR: 0:25: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?)
ERROR: 0:25: '=' : cannot convert from ' temp float' to ' temp highp int'
ERROR: 0:26: 'gl_InstanceCustomIndexNVX' : undeclared identifier
ERROR: 0:26: '=' : cannot convert from ' temp float' to ' temp highp int'
ERROR: 0:27: 'gl_WorldRayOriginNVX' : undeclared identifier
ERROR: 0:27: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float'
ERROR: 0:28: 'gl_WorldRayDirectionNVX' : undeclared identifier
ERROR: 0:28: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float'
ERROR: 0:29: 'gl_ObjectRayOriginNVX' : undeclared identifier
ERROR: 0:29: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float'
ERROR: 0:30: 'gl_ObjectRayDirectionNVX' : undeclared identifier
ERROR: 0:30: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float'
ERROR: 0:31: 'gl_RayTminNVX' : undeclared identifier
ERROR: 0:32: 'gl_RayTmaxNVX' : undeclared identifier
ERROR: 0:33: 'gl_ObjectToWorldNVX' : undeclared identifier
ERROR: 0:33: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float'
ERROR: 0:34: 'gl_WorldToObjectNVX' : undeclared identifier
ERROR: 0:34: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float'
ERROR: 0:35: 'gl_HitTNVX' : undeclared identifier
ERROR: 0:36: 'gl_HitKindNVX' : undeclared identifier
ERROR: 0:37: 'reportIntersectionNVX' : no matching overloaded function found
ERROR: 0:38: 'ignoreIntersectionNVX' : no matching overloaded function found
ERROR: 0:39: 'terminateRayNVX' : no matching overloaded function found
ERROR: 32 compilation errors. No code generated.
ERROR: Linking ray-generation stage: Only one shaderRecordNVX buffer block is allowed per stage
SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,26 @@
#version 460
#extension GL_NVX_raytracing : enable
layout(location = 1) rayPayloadInNVX vec4 incomingPayload;
void main()
{
uvec2 v0 = gl_LaunchIDNVX;
uvec2 v1 = gl_LaunchSizeNVX;
int v2 = gl_PrimitiveID;
int v3 = gl_InstanceID;
int v4 = gl_InstanceCustomIndexNVX;
vec3 v5 = gl_WorldRayOriginNVX;
vec3 v6 = gl_WorldRayDirectionNVX;
vec3 v7 = gl_ObjectRayOriginNVX;
vec3 v8 = gl_ObjectRayDirectionNVX;
float v9 = gl_RayTminNVX;
float v10 = gl_RayTmaxNVX;
float v11 = gl_HitTNVX;
uint v12 = gl_HitKindNVX;
mat4x3 v13 = gl_ObjectToWorldNVX;
mat4x3 v14 = gl_WorldToObjectNVX;
incomingPayload = vec4(0.5f);
if (v2 == 1)
ignoreIntersectionNVX();
else
terminateRayNVX();
}

View File

@ -0,0 +1,11 @@
#version 460
#extension GL_NVX_raytracing : enable
hitAttributeNVX vec4 payload;
layout(binding = 0, set = 0) uniform accelerationStructureNVX accNV;
void main()
{
payload.x = 1.0f; // ERROR, cannot write to hitattributeNVX in stage
reportIntersectionNVX(1.0, 1U); // ERROR, unsupported builtin in stage
traceNVX(accNV, 0, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 0); // ERROR, unsupported builtin in stage
}

View File

@ -0,0 +1,24 @@
#version 460
#extension GL_NVX_raytracing : enable
layout(binding = 0, set = 0) uniform accelerationStructureNVX accNV;
layout(location = 0) rayPayloadNVX vec4 localPayload;
layout(location = 1) rayPayloadInNVX vec4 incomingPayload;
void main()
{
uvec2 v0 = gl_LaunchIDNVX;
uvec2 v1 = gl_LaunchSizeNVX;
int v2 = gl_PrimitiveID;
int v3 = gl_InstanceID;
int v4 = gl_InstanceCustomIndexNVX;
vec3 v5 = gl_WorldRayOriginNVX;
vec3 v6 = gl_WorldRayDirectionNVX;
vec3 v7 = gl_ObjectRayOriginNVX;
vec3 v8 = gl_ObjectRayDirectionNVX;
float v9 = gl_RayTminNVX;
float v10 = gl_RayTmaxNVX;
float v11 = gl_HitTNVX;
uint v12 = gl_HitKindNVX;
mat4x3 v13 = gl_ObjectToWorldNVX;
mat4x3 v14 = gl_WorldToObjectNVX;
traceNVX(accNV, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1);
}

View File

@ -0,0 +1,12 @@
#version 460
#extension GL_NVX_raytracing : enable
hitAttributeNVX vec4 payload;
layout(binding = 0, set = 0) uniform accelerationStructureNVX accNV;
void main()
{
payload.x = 1.0f; // ERROR, cannot write to hitattributeNVX in stage
reportIntersectionNVX(1.0, 1U); // ERROR, unsupported builtin in stage
terminateRayNVX();
ignoreIntersectionNVX();
}

View File

@ -0,0 +1,21 @@
#version 460
#extension GL_NVX_raytracing : enable
hitAttributeNVX vec4 iAttr;
void main()
{
uvec2 v0 = gl_LaunchIDNVX;
uvec2 v1 = gl_LaunchSizeNVX;
int v2 = gl_PrimitiveID;
int v3 = gl_InstanceID;
int v4 = gl_InstanceCustomIndexNVX;
vec3 v5 = gl_WorldRayOriginNVX;
vec3 v6 = gl_WorldRayDirectionNVX;
vec3 v7 = gl_ObjectRayOriginNVX;
vec3 v8 = gl_ObjectRayDirectionNVX;
float v9 = gl_RayTminNVX;
float v10 = gl_RayTmaxNVX;
mat4x3 v11 = gl_ObjectToWorldNVX;
mat4x3 v12 = gl_WorldToObjectNVX;
iAttr = vec4(0.5f,0.5f,0.0f,1.0f);
reportIntersectionNVX(0.5, 1U);
}

View File

@ -0,0 +1,11 @@
#version 460
#extension GL_NVX_raytracing : enable
rayPayloadInNVX vec4 payloadIn; // ERROR, rayPayloadIn unsupported in this stage
rayPayloadNVX vec4 payload; // ERROR, rayPayload unsuppoted in this stage
uniform accelerationStructureNVX accNV;
void main()
{
float e12 = gl_HitTNVX; // ERROR, unsupported builtin in stage
float e13 = gl_HitKindNVX; // ERROR, unsupported builtin in stage
traceNVX(accNV, 0, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 0); // ERROR, unsupported
}

17
Test/spv.MissShader.rmiss Normal file
View File

@ -0,0 +1,17 @@
#version 460
#extension GL_NVX_raytracing : enable
layout(binding = 0, set = 0) uniform accelerationStructureNVX accNV;
layout(location = 0) rayPayloadNVX vec4 localPayload;
layout(location = 1) rayPayloadInNVX vec4 incomingPayload;
void main()
{
uvec2 v0 = gl_LaunchIDNVX;
uvec2 v1 = gl_LaunchSizeNVX;
vec3 v2 = gl_WorldRayOriginNVX;
vec3 v3 = gl_WorldRayDirectionNVX;
vec3 v4 = gl_ObjectRayOriginNVX;
vec3 v5 = gl_ObjectRayDirectionNVX;
float v6 = gl_RayTminNVX;
float v7 = gl_RayTmaxNVX;
traceNVX(accNV, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1);
}

View File

@ -0,0 +1,16 @@
#version 460
#extension GL_NVX_raytracing : enable
hitAttributeNVX vec4 payload; // ERROR, hitattributeNVX unsupported in this stage
void main()
{
int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage
int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage
int e3 = gl_InstanceCustomIndexNVX; // ERROR, unsupported builtin in stage
mat4x3 e10 = gl_ObjectToWorldNVX; // ERROR, unsupported builtin in stage
mat4x3 e11 = gl_WorldToObjectNVX; // ERROR, unsupported builtin in stage
float e12 = gl_HitTNVX; // ERROR, unsupported builtin in stage
float e13 = gl_HitKindNVX; // ERROR, unsupported builtin in stage
reportIntersectionNVX(1.0, 1U); // ERROR, unsupported builtin in stage
ignoreIntersectionNVX(); // ERROR, unsupported builtin in stage
terminateRayNVX(); // ERROR, unsupported builtin in stage
}

View File

@ -0,0 +1,15 @@
#version 460
#extension GL_NVX_raytracing : enable
layout(binding = 0, set = 0) uniform accelerationStructureNVX accNV;
layout(location = 0) rayPayloadNVX vec4 payload;
void main()
{
const uint rayFlags = gl_RayFlagsNoneNVX | gl_RayFlagsOpaqueNVX |
gl_RayFlagsNoOpaqueNVX | gl_RayFlagsTerminateOnFirstHitNVX |
gl_RayFlagsSkipClosestHitShaderNVX | gl_RayFlagsCullBackFacingTrianglesNVX |
gl_RayFlagsCullFrontFacingTrianglesNVX | gl_RayFlagsCullOpaqueNVX |
gl_RayFlagsCullNoOpaqueNVX;
const int payloadId = 1;
traceNVX(accNV, rayFlags, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, payloadId);
}

View File

@ -0,0 +1,19 @@
#version 460
#extension GL_NVX_raytracing : enable
layout(binding = 0, set = 0) uniform accelerationStructureNVX accNV;
layout(location = 0) rayPayloadNVX vec4 payload;
layout(shaderRecordNVX) buffer block
{
float arr[4];
vec4 pad;
};
void main()
{
uint lx = gl_LaunchIDNVX.x;
uint ly = gl_LaunchIDNVX.y;
uint sx = gl_LaunchSizeNVX.x;
uint sy = gl_LaunchSizeNVX.y;
traceNVX(accNV, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1);
arr[3] = 1.0f;
pad = payload;
}

View File

@ -0,0 +1,40 @@
#version 460
#extension GL_NVX_raytracing : enable
hitAttributeNVX vec4 payload; // ERROR, hitattributeNVX unsupported in this stage
rayPayloadInNVX vec4 payloadIn; // ERROR, rayPayloadIn unsupported in this stage
layout(shaderRecordNVX) uniform ublock // ERROR, shaderRecordNVX unsupported on uniform blocks
{
float a;
};
layout(binding = 0, shaderRecordNVX) buffer bblock { // ERROR, binding unsupported on shaderRecordNVX blocks
float b;
};
layout(set = 0, shaderRecordNVX) buffer bblock2 { // ERROR, set unsupported on shaderRecordNVX blocks
float c;
};
layout(shaderRecordNVX) buffer bblock3 {
float d;
};
layout(shaderRecordNVX) buffer bblock4 { // ERROR, cannot have more than one shaderRecordNVX block
float e;
};
void main()
{
accelerationStructureNVX a = 0;
int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage
int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage
int e3 = gl_InstanceCustomIndexNVX; // ERROR, unsupported builtin in stage
vec3 e4 = gl_WorldRayOriginNVX; // ERROR, unsupported builtin in stage
vec3 e5 = gl_WorldRayDirectionNVX; // ERROR, unsupported builtin in stage
vec3 e6 = gl_ObjectRayOriginNVX; // ERROR, unsupported builtin in stage
vec3 e7 = gl_ObjectRayDirectionNVX; // ERROR, unsupported builtin in stage
float e8 = gl_RayTminNVX; // ERROR, unsupported builtin in stage
float e9 = gl_RayTmaxNVX; // ERROR, unsupported builtin in stage
mat4x3 e10 = gl_ObjectToWorldNVX; // ERROR, unsupported builtin in stage
mat4x3 e11 = gl_WorldToObjectNVX; // ERROR, unsupported builtin in stage
float e12 = gl_HitTNVX; // ERROR, unsupported builtin in stage
float e13 = gl_HitKindNVX; // ERROR, unsupported builtin in stage
reportIntersectionNVX(1.0, 1U); // ERROR, unsupported builtin in stage
ignoreIntersectionNVX(); // ERROR, unsupported builtin in stage
terminateRayNVX(); // ERROR, unsupported builtin in stage
}

View File

@ -62,6 +62,10 @@ enum TBasicType {
EbtStruct,
EbtBlock,
#ifdef NV_EXTENSIONS
EbtAccStructNV,
#endif
// HLSL types that live only temporarily.
EbtString,
@ -88,6 +92,12 @@ enum TStorageQualifier {
EvqBuffer, // read/write, shared with app
EvqShared, // compute shader's read/write 'shared' qualifier
#ifdef NV_EXTENSIONS
EvqPayloadNV,
EvqPayloadInNV,
EvqHitAttrNV,
#endif
// parameters
EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter
EvqOut, // also, for 'out' in the grammar before we know if it's a pipeline output or an 'out' parameter
@ -227,6 +237,20 @@ enum TBuiltInVariable {
EbvPositionPerViewNV,
EbvViewportMaskPerViewNV,
EbvFragFullyCoveredNV,
// raytracing
EbvLaunchIdNV,
EbvLaunchSizeNV,
EbvInstanceCustomIndexNV,
EbvWorldRayOriginNV,
EbvWorldRayDirectionNV,
EbvObjectRayOriginNV,
EbvObjectRayDirectionNV,
EbvRayTminNV,
EbvRayTmaxNV,
EbvHitTNV,
EbvHitKindNV,
EbvObjectToWorldNV,
EbvWorldToObjectNV,
EbvBaryCoordNV,
EbvBaryCoordNoPerspNV,
EbvTaskCountNV,
@ -283,6 +307,11 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q)
case EvqPointCoord: return "gl_PointCoord"; break;
case EvqFragColor: return "fragColor"; break;
case EvqFragDepth: return "gl_FragDepth"; break;
#ifdef NV_EXTENSIONS
case EvqPayloadNV: return "rayPayloadNVX"; break;
case EvqPayloadInNV: return "rayPayloadInNVX"; break;
case EvqHitAttrNV: return "hitAttributeNVX"; break;
#endif
default: return "unknown qualifier";
}
}
@ -375,6 +404,19 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvPositionPerViewNV: return "PositionPerViewNV";
case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
case EbvFragFullyCoveredNV: return "FragFullyCoveredNV";
case EbvLaunchIdNV: return "LaunchIdNVX";
case EbvLaunchSizeNV: return "LaunchSizeNVX";
case EbvInstanceCustomIndexNV: return "InstanceCustomIndexNVX";
case EbvWorldRayOriginNV: return "WorldRayOriginNVX";
case EbvWorldRayDirectionNV: return "WorldRayDirectionNVX";
case EbvObjectRayOriginNV: return "ObjectRayOriginNVX";
case EbvObjectRayDirectionNV: return "ObjectRayDirectionNVX";
case EbvRayTminNV: return "ObjectRayTminNVX";
case EbvRayTmaxNV: return "ObjectRayTmaxNVX";
case EbvHitTNV: return "HitTNVX";
case EbvHitKindNV: return "HitKindNVX";
case EbvObjectToWorldNV: return "ObjectToWorldNVX";
case EbvWorldToObjectNV: return "WorldToObjectNVX";
case EbvBaryCoordNV: return "BaryCoordNV";
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
case EbvTaskCountNV: return "TaskCountNV";

View File

@ -725,6 +725,7 @@ public:
layoutViewportRelative = false;
// -2048 as the default value indicating layoutSecondaryViewportRelative is not set
layoutSecondaryViewportRelativeOffset = -2048;
layoutShaderRecordNV = false;
#endif
clearInterstageLayout();
@ -758,6 +759,9 @@ public:
hasAnyLocation() ||
hasStream() ||
hasFormat() ||
#ifdef NV_EXTENSIONS
layoutShaderRecordNV ||
#endif
layoutPushConstant;
}
bool hasLayout() const
@ -811,6 +815,7 @@ public:
bool layoutPassthrough;
bool layoutViewportRelative;
int layoutSecondaryViewportRelativeOffset;
bool layoutShaderRecordNV;
#endif
bool hasUniformLayout() const
@ -1481,7 +1486,11 @@ public:
}
return false;
}
virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint; }
virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint
#ifdef NV_EXTENSIONS
|| basicType == EbtAccStructNV
#endif
; }
virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
// "Image" is a superset of "Subpass"
@ -1669,6 +1678,9 @@ public:
case EbtSampler: return "sampler/image";
case EbtStruct: return "structure";
case EbtBlock: return "block";
#ifdef NV_EXTENSIONS
case EbtAccStructNV: return "accelerationStructureNVX";
#endif
default: return "unknown type";
}
}
@ -1764,6 +1776,8 @@ public:
appendStr(" layoutSecondaryViewportRelativeOffset=");
appendInt(qualifier.layoutSecondaryViewportRelativeOffset);
}
if (qualifier.layoutShaderRecordNV)
appendStr(" shaderRecordNVX");
#endif
appendStr(")");

View File

@ -894,6 +894,10 @@ enum TOperator {
EOpFindMSB,
#ifdef NV_EXTENSIONS
EOpTraceNV,
EOpReportIntersectionNV,
EOpIgnoreIntersectionNV,
EOpTerminateRayNV,
EOpWritePackedPrimitiveIndices4x8NV,
#endif
//

View File

@ -5058,6 +5058,27 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
#endif
#ifdef NV_EXTENSIONS
// Builtins for GL_NV_raytracing
if (profile != EEsProfile && version >= 460) {
stageBuiltins[EShLangRayGenNV].append(
"void traceNVX(accelerationStructureNVX,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
"\n");
stageBuiltins[EShLangIntersectNV].append(
"bool reportIntersectionNVX(float, uint);"
"\n");
stageBuiltins[EShLangAnyHitNV].append(
"void ignoreIntersectionNVX();"
"void terminateRayNVX();"
"\n");
stageBuiltins[EShLangClosestHitNV].append(
"void traceNVX(accelerationStructureNVX,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
"\n");
stageBuiltins[EShLangMissNV].append(
"void traceNVX(accelerationStructureNVX,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
"\n");
}
//E_SPV_NV_compute_shader_derivatives
stageBuiltins[EShLangCompute].append(derivatives);
@ -5930,7 +5951,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangFragment].append(
"in vec3 gl_BaryCoordNV;"
"in vec3 gl_BaryCoordNoPerspNV;"
);
);
#endif
} else {
// ES profile
@ -5973,12 +5995,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"highp float gl_FragDepthEXT;" // GL_EXT_frag_depth
);
#ifdef NV_EXTENSIONS
if (version >= 320)
if (version >= 320)
stageBuiltins[EShLangFragment].append(
"in vec3 gl_BaryCoordNV;"
"in vec3 gl_BaryCoordNoPerspNV;"
);
);
#endif
}
stageBuiltins[EShLangFragment].append("\n");
@ -6072,6 +6095,94 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
#endif
}
#ifdef NV_EXTENSIONS
// GL_NV_raytracing
if (profile != EEsProfile && version >= 460) {
const char *constRayFlags =
"const uint gl_RayFlagsNoneNVX = 0U;"
"const uint gl_RayFlagsOpaqueNVX = 1U;"
"const uint gl_RayFlagsNoOpaqueNVX = 2U;"
"const uint gl_RayFlagsTerminateOnFirstHitNVX = 4U;"
"const uint gl_RayFlagsSkipClosestHitShaderNVX = 8U;"
"const uint gl_RayFlagsCullBackFacingTrianglesNVX = 16U;"
"const uint gl_RayFlagsCullFrontFacingTrianglesNVX = 32U;"
"const uint gl_RayFlagsCullOpaqueNVX = 64U;"
"const uint gl_RayFlagsCullNoOpaqueNVX = 128U;"
"\n";
const char *rayGenDecls =
"in uvec2 gl_LaunchIDNVX;"
"in uvec2 gl_LaunchSizeNVX;"
"\n";
const char *intersectDecls =
"in uvec2 gl_LaunchIDNVX;"
"in uvec2 gl_LaunchSizeNVX;"
"in int gl_PrimitiveID;"
"in int gl_InstanceID;"
"in int gl_InstanceCustomIndexNVX;"
"in vec3 gl_WorldRayOriginNVX;"
"in vec3 gl_WorldRayDirectionNVX;"
"in vec3 gl_ObjectRayOriginNVX;"
"in vec3 gl_ObjectRayDirectionNVX;"
"in float gl_RayTminNVX;"
"in float gl_RayTmaxNVX;"
"in mat4x3 gl_ObjectToWorldNVX;"
"in mat4x3 gl_WorldToObjectNVX;"
"\n";
const char *hitDecls =
"in uvec2 gl_LaunchIDNVX;"
"in uvec2 gl_LaunchSizeNVX;"
"in int gl_PrimitiveID;"
"in int gl_InstanceID;"
"in int gl_InstanceCustomIndexNVX;"
"in vec3 gl_WorldRayOriginNVX;"
"in vec3 gl_WorldRayDirectionNVX;"
"in vec3 gl_ObjectRayOriginNVX;"
"in vec3 gl_ObjectRayDirectionNVX;"
"in float gl_RayTminNVX;"
"in float gl_RayTmaxNVX;"
"in float gl_HitTNVX;"
"in uint gl_HitKindNVX;"
"in mat4x3 gl_ObjectToWorldNVX;"
"in mat4x3 gl_WorldToObjectNVX;"
"\n";
const char *missDecls =
"in uvec2 gl_LaunchIDNVX;"
"in uvec2 gl_LaunchSizeNVX;"
"in vec3 gl_WorldRayOriginNVX;"
"in vec3 gl_WorldRayDirectionNVX;"
"in vec3 gl_ObjectRayOriginNVX;"
"in vec3 gl_ObjectRayDirectionNVX;"
"in float gl_RayTminNVX;"
"in float gl_RayTmaxNVX;"
"\n";
stageBuiltins[EShLangRayGenNV].append(rayGenDecls);
stageBuiltins[EShLangRayGenNV].append(constRayFlags);
stageBuiltins[EShLangIntersectNV].append(intersectDecls);
stageBuiltins[EShLangAnyHitNV].append(hitDecls);
stageBuiltins[EShLangClosestHitNV].append(hitDecls);
stageBuiltins[EShLangClosestHitNV].append(constRayFlags);
stageBuiltins[EShLangMissNV].append(missDecls);
stageBuiltins[EShLangMissNV].append(constRayFlags);
}
if ((profile != EEsProfile && version >= 140)) {
const char *deviceIndex =
"in highp int gl_DeviceIndex;" // GL_EXT_device_group
"\n";
stageBuiltins[EShLangRayGenNV].append(deviceIndex);
stageBuiltins[EShLangIntersectNV].append(deviceIndex);
stageBuiltins[EShLangAnyHitNV].append(deviceIndex);
stageBuiltins[EShLangClosestHitNV].append(deviceIndex);
stageBuiltins[EShLangMissNV].append(deviceIndex);
}
#endif
if (version >= 300 /* both ES and non-ES */) {
stageBuiltins[EShLangFragment].append(
"flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2
@ -8468,8 +8579,48 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic);
}
break;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV:
case EShLangIntersectNV:
case EShLangAnyHitNV:
case EShLangClosestHitNV:
case EShLangMissNV:
if (profile != EEsProfile && version >= 460) {
symbolTable.setVariableExtensions("gl_LaunchIDNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_LaunchSizeNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_PrimitiveID", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_InstanceID", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_InstanceCustomIndexNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_WorldRayOriginNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_WorldRayDirectionNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_ObjectRayOriginNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_ObjectRayDirectionNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_RayTminNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_RayTmaxNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_HitTNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_HitKindNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_ObjectToWorldNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_WorldToObjectNVX", 1, &E_GL_NVX_raytracing);
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
BuiltInVariable("gl_LaunchIDNVX", EbvLaunchIdNV, symbolTable);
BuiltInVariable("gl_LaunchSizeNVX", EbvLaunchSizeNV, symbolTable);
BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable);
BuiltInVariable("gl_InstanceID", EbvInstanceId, symbolTable);
BuiltInVariable("gl_InstanceCustomIndexNVX",EbvInstanceCustomIndexNV,symbolTable);
BuiltInVariable("gl_WorldRayOriginNVX", EbvWorldRayOriginNV, symbolTable);
BuiltInVariable("gl_WorldRayDirectionNVX", EbvWorldRayDirectionNV, symbolTable);
BuiltInVariable("gl_ObjectRayOriginNVX", EbvObjectRayOriginNV, symbolTable);
BuiltInVariable("gl_ObjectRayDirectionNVX", EbvObjectRayDirectionNV, symbolTable);
BuiltInVariable("gl_RayTminNVX", EbvRayTminNV, symbolTable);
BuiltInVariable("gl_RayTmaxNVX", EbvRayTmaxNV, symbolTable);
BuiltInVariable("gl_HitTNVX", EbvHitTNV, symbolTable);
BuiltInVariable("gl_HitKindNVX", EbvHitKindNV, symbolTable);
BuiltInVariable("gl_ObjectToWorldNVX", EbvObjectToWorldNV, symbolTable);
BuiltInVariable("gl_WorldToObjectNVX", EbvWorldToObjectNV, symbolTable);
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
}
break;
case EShLangMeshNV:
if (profile != EEsProfile && version >= 450) {
// Per-vertex builtins
@ -9200,6 +9351,22 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
break;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV:
case EShLangClosestHitNV:
case EShLangMissNV:
if (profile != EEsProfile && version >= 460)
symbolTable.relateToOperator("traceNVX", EOpTraceNV);
break;
case EShLangIntersectNV:
if (profile != EEsProfile && version >= 460)
symbolTable.relateToOperator("reportIntersectionNVX", EOpReportIntersectionNV);
break;
case EShLangAnyHitNV:
if (profile != EEsProfile && version >= 460) {
symbolTable.relateToOperator("ignoreIntersectionNVX", EOpIgnoreIntersectionNV);
symbolTable.relateToOperator("terminateRayNVX", EOpTerminateRayNV);
}
break;
case EShLangMeshNV:
if (profile != EEsProfile && version >= 450) {
symbolTable.relateToOperator("writePackedPrimitiveIndices4x8NV", EOpWritePackedPrimitiveIndices4x8NV);

View File

@ -460,6 +460,9 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
return false;
case EbtAtomicUint:
case EbtSampler:
#ifdef NV_EXTENSIONS
case EbtAccStructNV:
#endif
// opaque types can be passed to functions
if (op == EOpFunction)
break;

View File

@ -153,6 +153,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
if (node->getQualifier().readonly)
message = "can't modify a readonly buffer";
break;
#ifdef NV_EXTENSIONS
case EvqHitAttrNV:
if (language != EShLangIntersectNV)
message = "cannot modify hitAttributeNVX in this stage";
break;
#endif
default:
//
@ -168,6 +174,11 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
case EbtVoid:
message = "can't modify void";
break;
#ifdef NV_EXTENSIONS
case EbtAccStructNV:
message = "can't modify accelerationStructureNVX";
break;
#endif
default:
break;
}

View File

@ -2962,6 +2962,20 @@ void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, co
else if (type.getBasicType() == EbtAtomicUint && type.getQualifier().storage != EvqUniform)
error(loc, "atomic_uints can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
}
#ifdef NV_EXTENSIONS
void TParseContext::accStructNVCheck(const TSourceLoc& loc, const TType& type, const TString& identifier)
{
if (type.getQualifier().storage == EvqUniform)
return;
if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtAccStructNV))
error(loc, "non-uniform struct contains an accelerationStructureNVX:", type.getBasicTypeString().c_str(), identifier.c_str());
else if (type.getBasicType() == EbtAccStructNV && type.getQualifier().storage != EvqUniform)
error(loc, "accelerationStructureNVX can only be used in uniform variables or function parameters:",
type.getBasicTypeString().c_str(), identifier.c_str());
}
#endif
void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& type, const TString& identifier)
{
@ -4696,6 +4710,15 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
publicType.qualifier.layoutViewportRelative = true;
return;
}
} else {
if (language == EShLangRayGenNV || language == EShLangIntersectNV ||
language == EShLangAnyHitNV || language == EShLangClosestHitNV ||
language == EShLangMissNV || language == EShLangCallableNV) {
if (id == "shaderrecordnvx") {
publicType.qualifier.layoutShaderRecordNV = true;
return;
}
}
}
if (language == EShLangCompute) {
if (id.compare(0, 17, "derivative_group_") == 0) {
@ -5076,6 +5099,8 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie
dst.layoutViewportRelative = true;
if (src.layoutSecondaryViewportRelativeOffset != -2048)
dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset;
if (src.layoutShaderRecordNV)
dst.layoutShaderRecordNV = true;
if (src.pervertexNV)
dst.pervertexNV = true;
#endif
@ -5143,6 +5168,10 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
error(loc, "cannot specify on a variable declaration", "align", "");
if (qualifier.layoutPushConstant)
error(loc, "can only specify on a uniform block", "push_constant", "");
#ifdef NV_EXTENSIONS
if (qualifier.layoutShaderRecordNV)
error(loc, "can only specify on a buffer block", "shaderRecordNVX", "");
#endif
}
break;
default:
@ -5216,6 +5245,12 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
if (type.getBasicType() == EbtBlock)
error(loc, "cannot apply to uniform or buffer block", "location", "");
break;
#ifdef NV_EXTENSIONS
case EvqPayloadNV:
case EvqPayloadInNV:
case EvqHitAttrNV:
break;
#endif
default:
error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", "");
break;
@ -5299,7 +5334,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
if (spvVersion.spv > 0) {
if (qualifier.isUniformOrBuffer()) {
if (type.getBasicType() == EbtBlock && !qualifier.layoutPushConstant &&
!qualifier.layoutAttachment)
#ifdef NV_EXTENSIONS
!qualifier.layoutShaderRecordNV &&
#endif
!qualifier.layoutAttachment)
error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", "");
else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler)
error(loc, "sampler/texture/image requires layout(binding=X)", "binding", "");
@ -5351,6 +5389,11 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
if (qualifier.layoutPushConstant && type.getBasicType() != EbtBlock)
error(loc, "can only be used with a block", "push_constant", "");
#ifdef NV_EXTENSIONS
if (qualifier.layoutShaderRecordNV && type.getBasicType() != EbtBlock)
error(loc, "can only be used with a block", "shaderRecordNVX", "");
#endif
// input attachment
if (type.isSubpass()) {
if (! qualifier.hasAttachment())
@ -5486,6 +5529,16 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
if (qualifier.hasSet())
error(loc, "cannot be used with push_constant", "set", "");
}
#ifdef NV_EXTENSIONS
if (qualifier.layoutShaderRecordNV) {
if (qualifier.storage != EvqBuffer)
error(loc, "can only be used with a buffer", "shaderRecordNVX", "");
if (qualifier.hasBinding())
error(loc, "cannot be used with shaderRecordNVX", "binding", "");
if (qualifier.hasSet())
error(loc, "cannot be used with shaderRecordNVX", "set", "");
}
#endif
}
// For places that can't have shader-level layout qualifiers
@ -5915,6 +5968,9 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
samplerCheck(loc, type, identifier, initializer);
atomicUintCheck(loc, type, identifier);
transparentOpaqueCheck(loc, type, identifier);
#ifdef NV_EXTENSIONS
accStructNVCheck(loc, type, identifier);
#endif
if (type.getQualifier().storage != EvqUniform && type.getQualifier().storage != EvqBuffer) {
if (type.containsBasicType(EbtFloat16))
@ -6613,7 +6669,11 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
// Special case for "push_constant uniform", which has a default of std430,
// contrary to normal uniform defaults, and can't have a default tracked for it.
if (currentBlockQualifier.layoutPushConstant && !currentBlockQualifier.hasPacking())
if ((currentBlockQualifier.layoutPushConstant && !currentBlockQualifier.hasPacking())
#ifdef NV_EXTENSIONS
|| (currentBlockQualifier.layoutShaderRecordNV && !currentBlockQualifier.hasPacking())
#endif
)
currentBlockQualifier.layoutPacking = ElpStd430;
#ifdef NV_EXTENSIONS
@ -6835,6 +6895,22 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q
}
#endif
break;
#ifdef NV_EXTENSIONS
case EvqPayloadNV:
profileRequires(loc, ~EEsProfile, 450, E_GL_NVX_raytracing, "rayPayloadNVX block");
requireStage(loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangAnyHitNVMask | EShLangClosestHitNVMask | EShLangMissNVMask),
"rayPayloadNVX block");
break;
case EvqPayloadInNV:
profileRequires(loc, ~EEsProfile, 450, E_GL_NVX_raytracing, "rayPayloadInNVX block");
requireStage(loc, (EShLanguageMask)(EShLangAnyHitNVMask | EShLangClosestHitNVMask | EShLangMissNVMask),
"rayPayloadInNVX block");
break;
case EvqHitAttrNV:
profileRequires(loc, ~EEsProfile, 450, E_GL_NVX_raytracing, "hitAttributeNVX block");
requireStage(loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangAnyHitNVMask | EShLangClosestHitNVMask), "hitAttributeNVX block");
break;
#endif
default:
error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), "");
break;
@ -6872,6 +6948,8 @@ void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier&
if (qualifier.layoutPushConstant)
intermediate.addPushConstantCount();
#ifdef NV_EXTENSIONS
if (qualifier.layoutShaderRecordNV)
intermediate.addShaderRecordNVCount();
if (qualifier.perTaskNV)
intermediate.addTaskNVCount();
#endif
@ -7357,6 +7435,10 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
error(loc, "cannot declare a default, can only be used on a block", "push_constant", "");
if (qualifier.hasSpecConstantId())
error(loc, "cannot declare a default, can only be used on a scalar", "constant_id", "");
#ifdef NV_EXTENSIONS
if (qualifier.layoutShaderRecordNV)
error(loc, "cannot declare a default, can only be used on a block", "shaderRecordNVX", "");
#endif
}
//

View File

@ -348,6 +348,9 @@ public:
void boolCheck(const TSourceLoc&, const TPublicType&);
void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer);
void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier);
#ifdef NV_EXTENSIONS
void accStructNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier);
#endif
void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier);
void memberQualifierCheck(glslang::TPublicType&);
void globalQualifierFixCheck(const TSourceLoc&, TQualifier&);

View File

@ -701,6 +701,10 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["superp"] = SUPERP;
#ifdef NV_EXTENSIONS
(*KeywordMap)["rayPayloadNVX"] = PAYLOADNV;
(*KeywordMap)["rayPayloadInNVX"] = PAYLOADINNV;
(*KeywordMap)["hitAttributeNVX"] = HITATTRNV;
(*KeywordMap)["accelerationStructureNVX"] = ACCSTRUCTNV;
(*KeywordMap)["perprimitiveNV"] = PERPRIMITIVENV;
(*KeywordMap)["perviewNV"] = PERVIEWNV;
(*KeywordMap)["taskNV"] = PERTASKNV;
@ -944,6 +948,18 @@ int TScanContext::tokenizeIdentifier()
return identifierOrType();
return keyword;
#ifdef NV_EXTENSIONS
case PAYLOADNV:
case PAYLOADINNV:
case HITATTRNV:
case ACCSTRUCTNV:
if (parseContext.symbolTable.atBuiltInLevel() ||
(parseContext.profile != EEsProfile && parseContext.version >= 460
&& parseContext.extensionTurnedOn(E_GL_NVX_raytracing)))
return keyword;
return identifierOrType();
#endif
case ATOMIC_UINT:
if ((parseContext.profile == EEsProfile && parseContext.version >= 310) ||
parseContext.extensionTurnedOn(E_GL_ARB_shader_atomic_counters))

View File

@ -348,6 +348,19 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
infoSink, commonTable, symbolTables);
#ifdef NV_EXTENSIONS
// check for ray tracing stages
if (profile != EEsProfile && version >= 450) {
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGenNV, source,
infoSink, commonTable, symbolTables);
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangIntersectNV, source,
infoSink, commonTable, symbolTables);
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangAnyHitNV, source,
infoSink, commonTable, symbolTables);
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangClosestHitNV, source,
infoSink, commonTable, symbolTables);
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMissNV, source,
infoSink, commonTable, symbolTables);
}
// check for mesh
if (profile != EEsProfile && version >= 450)
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMeshNV, source,
@ -583,6 +596,17 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
}
break;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV:
case EShLangIntersectNV:
case EShLangAnyHitNV:
case EShLangClosestHitNV:
case EShLangCallableNV:
if (profile == EEsProfile || version < 460) {
correct = false;
infoSink.info.message(EPrefixError, "#version: raytracing shaders require non-es profile with version 460 or above");
version = 460;
}
break;
case EShLangMeshNV:
case EShLangTaskNV:
if ((profile == EEsProfile) ||

View File

@ -72,6 +72,9 @@ void TType::buildMangledName(TString& mangledName) const
case EbtUint64: mangledName += "u64"; break;
case EbtBool: mangledName += 'b'; break;
case EbtAtomicUint: mangledName += "au"; break;
#ifdef NV_EXTENSIONS
case EbtAccStructNV: mangledName += "asnv"; break;
#endif
case EbtSampler:
switch (sampler.type) {
#ifdef AMD_EXTENSIONS

View File

@ -235,6 +235,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable;
extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable;
extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable;
extensionBehavior[E_GL_NVX_raytracing] = 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;
@ -409,6 +410,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_NV_shader_atomic_int64 1\n"
"#define GL_NV_conservative_raster_underestimation 1\n"
"#define GL_NV_shader_subgroup_partitioned 1\n"
"#define GL_NVX_raytracing 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"
@ -501,6 +503,12 @@ const char* StageName(EShLanguage stage)
case EShLangFragment: return "fragment";
case EShLangCompute: return "compute";
#ifdef NV_EXTENSIONS
case EShLangRayGenNV: return "ray-generation";
case EShLangIntersectNV: return "intersection";
case EShLangAnyHitNV: return "any-hit";
case EShLangClosestHitNV: return "closest-hit";
case EShLangMissNV: return "miss";
case EShLangCallableNV: return "callable";
case EShLangMeshNV: return "mesh";
case EShLangTaskNV: return "task";
#endif

View File

@ -207,6 +207,7 @@ const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_
const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation";
const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation";
const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned";
const char* const E_GL_NVX_raytracing = "GL_NVX_raytracing";
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";

View File

@ -140,7 +140,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> U8VEC2 U8VEC3 U8VEC4
%token <lex> VEC2 VEC3 VEC4
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED NONUNIFORM
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED NONUNIFORM PAYLOADNV PAYLOADINNV HITATTRNV
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT SUBGROUPCOHERENT NONPRIVATE
%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
@ -164,6 +164,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> F64MAT3X2 F64MAT3X3 F64MAT3X4
%token <lex> F64MAT4X2 F64MAT4X3 F64MAT4X4
%token <lex> ATOMIC_UINT
%token <lex> ACCSTRUCTNV
// combined image/sampler
%token <lex> SAMPLER1D SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER1DSHADOW SAMPLER2DSHADOW
@ -1339,6 +1340,36 @@ storage_qualifier
$$.init($1.loc);
$$.qualifier.storage = EvqBuffer;
}
| HITATTRNV {
#ifdef NV_EXTENSIONS
parseContext.globalCheck($1.loc, "hitAttributeNVX");
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangClosestHitNVMask
| EShLangAnyHitNVMask), "hitAttributeNVX");
parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_NVX_raytracing, "hitAttributeNVX");
$$.init($1.loc);
$$.qualifier.storage = EvqHitAttrNV;
#endif
}
| PAYLOADNV {
#ifdef NV_EXTENSIONS
parseContext.globalCheck($1.loc, "rayPayloadNVX");
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask |
EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadNVX");
parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_NVX_raytracing, "rayPayloadNVX");
$$.init($1.loc);
$$.qualifier.storage = EvqPayloadNV;
#endif
}
| PAYLOADINNV {
#ifdef NV_EXTENSIONS
parseContext.globalCheck($1.loc, "rayPayloadInNVX");
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitNVMask |
EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadInNVX");
parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_NVX_raytracing, "rayPayloadInNVX");
$$.init($1.loc);
$$.qualifier.storage = EvqPayloadInNV;
#endif
}
| SHARED {
parseContext.globalCheck($1.loc, "shared");
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
@ -2177,6 +2208,12 @@ type_specifier_nonarray
$$.basicType = EbtDouble;
$$.setMatrix(4, 4);
}
| ACCSTRUCTNV {
#ifdef NV_EXTENSIONS
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtAccStructNV;
#endif
}
| ATOMIC_UINT {
parseContext.vulkanRemoved($1.loc, "atomic counter types");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());

File diff suppressed because it is too large Load Diff

View File

@ -125,323 +125,327 @@ extern int yydebug;
BUFFER = 335,
SHARED = 336,
NONUNIFORM = 337,
COHERENT = 338,
VOLATILE = 339,
RESTRICT = 340,
READONLY = 341,
WRITEONLY = 342,
DEVICECOHERENT = 343,
QUEUEFAMILYCOHERENT = 344,
WORKGROUPCOHERENT = 345,
SUBGROUPCOHERENT = 346,
NONPRIVATE = 347,
DVEC2 = 348,
DVEC3 = 349,
DVEC4 = 350,
DMAT2 = 351,
DMAT3 = 352,
DMAT4 = 353,
F16VEC2 = 354,
F16VEC3 = 355,
F16VEC4 = 356,
F16MAT2 = 357,
F16MAT3 = 358,
F16MAT4 = 359,
F32VEC2 = 360,
F32VEC3 = 361,
F32VEC4 = 362,
F32MAT2 = 363,
F32MAT3 = 364,
F32MAT4 = 365,
F64VEC2 = 366,
F64VEC3 = 367,
F64VEC4 = 368,
F64MAT2 = 369,
F64MAT3 = 370,
F64MAT4 = 371,
NOPERSPECTIVE = 372,
FLAT = 373,
SMOOTH = 374,
LAYOUT = 375,
EXPLICITINTERPAMD = 376,
PERVERTEXNV = 377,
PERPRIMITIVENV = 378,
PERVIEWNV = 379,
PERTASKNV = 380,
MAT2X2 = 381,
MAT2X3 = 382,
MAT2X4 = 383,
MAT3X2 = 384,
MAT3X3 = 385,
MAT3X4 = 386,
MAT4X2 = 387,
MAT4X3 = 388,
MAT4X4 = 389,
DMAT2X2 = 390,
DMAT2X3 = 391,
DMAT2X4 = 392,
DMAT3X2 = 393,
DMAT3X3 = 394,
DMAT3X4 = 395,
DMAT4X2 = 396,
DMAT4X3 = 397,
DMAT4X4 = 398,
F16MAT2X2 = 399,
F16MAT2X3 = 400,
F16MAT2X4 = 401,
F16MAT3X2 = 402,
F16MAT3X3 = 403,
F16MAT3X4 = 404,
F16MAT4X2 = 405,
F16MAT4X3 = 406,
F16MAT4X4 = 407,
F32MAT2X2 = 408,
F32MAT2X3 = 409,
F32MAT2X4 = 410,
F32MAT3X2 = 411,
F32MAT3X3 = 412,
F32MAT3X4 = 413,
F32MAT4X2 = 414,
F32MAT4X3 = 415,
F32MAT4X4 = 416,
F64MAT2X2 = 417,
F64MAT2X3 = 418,
F64MAT2X4 = 419,
F64MAT3X2 = 420,
F64MAT3X3 = 421,
F64MAT3X4 = 422,
F64MAT4X2 = 423,
F64MAT4X3 = 424,
F64MAT4X4 = 425,
ATOMIC_UINT = 426,
SAMPLER1D = 427,
SAMPLER2D = 428,
SAMPLER3D = 429,
SAMPLERCUBE = 430,
SAMPLER1DSHADOW = 431,
SAMPLER2DSHADOW = 432,
SAMPLERCUBESHADOW = 433,
SAMPLER1DARRAY = 434,
SAMPLER2DARRAY = 435,
SAMPLER1DARRAYSHADOW = 436,
SAMPLER2DARRAYSHADOW = 437,
ISAMPLER1D = 438,
ISAMPLER2D = 439,
ISAMPLER3D = 440,
ISAMPLERCUBE = 441,
ISAMPLER1DARRAY = 442,
ISAMPLER2DARRAY = 443,
USAMPLER1D = 444,
USAMPLER2D = 445,
USAMPLER3D = 446,
USAMPLERCUBE = 447,
USAMPLER1DARRAY = 448,
USAMPLER2DARRAY = 449,
SAMPLER2DRECT = 450,
SAMPLER2DRECTSHADOW = 451,
ISAMPLER2DRECT = 452,
USAMPLER2DRECT = 453,
SAMPLERBUFFER = 454,
ISAMPLERBUFFER = 455,
USAMPLERBUFFER = 456,
SAMPLERCUBEARRAY = 457,
SAMPLERCUBEARRAYSHADOW = 458,
ISAMPLERCUBEARRAY = 459,
USAMPLERCUBEARRAY = 460,
SAMPLER2DMS = 461,
ISAMPLER2DMS = 462,
USAMPLER2DMS = 463,
SAMPLER2DMSARRAY = 464,
ISAMPLER2DMSARRAY = 465,
USAMPLER2DMSARRAY = 466,
SAMPLEREXTERNALOES = 467,
F16SAMPLER1D = 468,
F16SAMPLER2D = 469,
F16SAMPLER3D = 470,
F16SAMPLER2DRECT = 471,
F16SAMPLERCUBE = 472,
F16SAMPLER1DARRAY = 473,
F16SAMPLER2DARRAY = 474,
F16SAMPLERCUBEARRAY = 475,
F16SAMPLERBUFFER = 476,
F16SAMPLER2DMS = 477,
F16SAMPLER2DMSARRAY = 478,
F16SAMPLER1DSHADOW = 479,
F16SAMPLER2DSHADOW = 480,
F16SAMPLER1DARRAYSHADOW = 481,
F16SAMPLER2DARRAYSHADOW = 482,
F16SAMPLER2DRECTSHADOW = 483,
F16SAMPLERCUBESHADOW = 484,
F16SAMPLERCUBEARRAYSHADOW = 485,
SAMPLER = 486,
SAMPLERSHADOW = 487,
TEXTURE1D = 488,
TEXTURE2D = 489,
TEXTURE3D = 490,
TEXTURECUBE = 491,
TEXTURE1DARRAY = 492,
TEXTURE2DARRAY = 493,
ITEXTURE1D = 494,
ITEXTURE2D = 495,
ITEXTURE3D = 496,
ITEXTURECUBE = 497,
ITEXTURE1DARRAY = 498,
ITEXTURE2DARRAY = 499,
UTEXTURE1D = 500,
UTEXTURE2D = 501,
UTEXTURE3D = 502,
UTEXTURECUBE = 503,
UTEXTURE1DARRAY = 504,
UTEXTURE2DARRAY = 505,
TEXTURE2DRECT = 506,
ITEXTURE2DRECT = 507,
UTEXTURE2DRECT = 508,
TEXTUREBUFFER = 509,
ITEXTUREBUFFER = 510,
UTEXTUREBUFFER = 511,
TEXTURECUBEARRAY = 512,
ITEXTURECUBEARRAY = 513,
UTEXTURECUBEARRAY = 514,
TEXTURE2DMS = 515,
ITEXTURE2DMS = 516,
UTEXTURE2DMS = 517,
TEXTURE2DMSARRAY = 518,
ITEXTURE2DMSARRAY = 519,
UTEXTURE2DMSARRAY = 520,
F16TEXTURE1D = 521,
F16TEXTURE2D = 522,
F16TEXTURE3D = 523,
F16TEXTURE2DRECT = 524,
F16TEXTURECUBE = 525,
F16TEXTURE1DARRAY = 526,
F16TEXTURE2DARRAY = 527,
F16TEXTURECUBEARRAY = 528,
F16TEXTUREBUFFER = 529,
F16TEXTURE2DMS = 530,
F16TEXTURE2DMSARRAY = 531,
SUBPASSINPUT = 532,
SUBPASSINPUTMS = 533,
ISUBPASSINPUT = 534,
ISUBPASSINPUTMS = 535,
USUBPASSINPUT = 536,
USUBPASSINPUTMS = 537,
F16SUBPASSINPUT = 538,
F16SUBPASSINPUTMS = 539,
IMAGE1D = 540,
IIMAGE1D = 541,
UIMAGE1D = 542,
IMAGE2D = 543,
IIMAGE2D = 544,
UIMAGE2D = 545,
IMAGE3D = 546,
IIMAGE3D = 547,
UIMAGE3D = 548,
IMAGE2DRECT = 549,
IIMAGE2DRECT = 550,
UIMAGE2DRECT = 551,
IMAGECUBE = 552,
IIMAGECUBE = 553,
UIMAGECUBE = 554,
IMAGEBUFFER = 555,
IIMAGEBUFFER = 556,
UIMAGEBUFFER = 557,
IMAGE1DARRAY = 558,
IIMAGE1DARRAY = 559,
UIMAGE1DARRAY = 560,
IMAGE2DARRAY = 561,
IIMAGE2DARRAY = 562,
UIMAGE2DARRAY = 563,
IMAGECUBEARRAY = 564,
IIMAGECUBEARRAY = 565,
UIMAGECUBEARRAY = 566,
IMAGE2DMS = 567,
IIMAGE2DMS = 568,
UIMAGE2DMS = 569,
IMAGE2DMSARRAY = 570,
IIMAGE2DMSARRAY = 571,
UIMAGE2DMSARRAY = 572,
F16IMAGE1D = 573,
F16IMAGE2D = 574,
F16IMAGE3D = 575,
F16IMAGE2DRECT = 576,
F16IMAGECUBE = 577,
F16IMAGE1DARRAY = 578,
F16IMAGE2DARRAY = 579,
F16IMAGECUBEARRAY = 580,
F16IMAGEBUFFER = 581,
F16IMAGE2DMS = 582,
F16IMAGE2DMSARRAY = 583,
STRUCT = 584,
VOID = 585,
WHILE = 586,
IDENTIFIER = 587,
TYPE_NAME = 588,
FLOATCONSTANT = 589,
DOUBLECONSTANT = 590,
INT16CONSTANT = 591,
UINT16CONSTANT = 592,
INT32CONSTANT = 593,
UINT32CONSTANT = 594,
INTCONSTANT = 595,
UINTCONSTANT = 596,
INT64CONSTANT = 597,
UINT64CONSTANT = 598,
BOOLCONSTANT = 599,
FLOAT16CONSTANT = 600,
LEFT_OP = 601,
RIGHT_OP = 602,
INC_OP = 603,
DEC_OP = 604,
LE_OP = 605,
GE_OP = 606,
EQ_OP = 607,
NE_OP = 608,
AND_OP = 609,
OR_OP = 610,
XOR_OP = 611,
MUL_ASSIGN = 612,
DIV_ASSIGN = 613,
ADD_ASSIGN = 614,
MOD_ASSIGN = 615,
LEFT_ASSIGN = 616,
RIGHT_ASSIGN = 617,
AND_ASSIGN = 618,
XOR_ASSIGN = 619,
OR_ASSIGN = 620,
SUB_ASSIGN = 621,
LEFT_PAREN = 622,
RIGHT_PAREN = 623,
LEFT_BRACKET = 624,
RIGHT_BRACKET = 625,
LEFT_BRACE = 626,
RIGHT_BRACE = 627,
DOT = 628,
COMMA = 629,
COLON = 630,
EQUAL = 631,
SEMICOLON = 632,
BANG = 633,
DASH = 634,
TILDE = 635,
PLUS = 636,
STAR = 637,
SLASH = 638,
PERCENT = 639,
LEFT_ANGLE = 640,
RIGHT_ANGLE = 641,
VERTICAL_BAR = 642,
CARET = 643,
AMPERSAND = 644,
QUESTION = 645,
INVARIANT = 646,
PRECISE = 647,
HIGH_PRECISION = 648,
MEDIUM_PRECISION = 649,
LOW_PRECISION = 650,
PRECISION = 651,
PACKED = 652,
RESOURCE = 653,
SUPERP = 654
PAYLOADNV = 338,
PAYLOADINNV = 339,
HITATTRNV = 340,
COHERENT = 341,
VOLATILE = 342,
RESTRICT = 343,
READONLY = 344,
WRITEONLY = 345,
DEVICECOHERENT = 346,
QUEUEFAMILYCOHERENT = 347,
WORKGROUPCOHERENT = 348,
SUBGROUPCOHERENT = 349,
NONPRIVATE = 350,
DVEC2 = 351,
DVEC3 = 352,
DVEC4 = 353,
DMAT2 = 354,
DMAT3 = 355,
DMAT4 = 356,
F16VEC2 = 357,
F16VEC3 = 358,
F16VEC4 = 359,
F16MAT2 = 360,
F16MAT3 = 361,
F16MAT4 = 362,
F32VEC2 = 363,
F32VEC3 = 364,
F32VEC4 = 365,
F32MAT2 = 366,
F32MAT3 = 367,
F32MAT4 = 368,
F64VEC2 = 369,
F64VEC3 = 370,
F64VEC4 = 371,
F64MAT2 = 372,
F64MAT3 = 373,
F64MAT4 = 374,
NOPERSPECTIVE = 375,
FLAT = 376,
SMOOTH = 377,
LAYOUT = 378,
EXPLICITINTERPAMD = 379,
PERVERTEXNV = 380,
PERPRIMITIVENV = 381,
PERVIEWNV = 382,
PERTASKNV = 383,
MAT2X2 = 384,
MAT2X3 = 385,
MAT2X4 = 386,
MAT3X2 = 387,
MAT3X3 = 388,
MAT3X4 = 389,
MAT4X2 = 390,
MAT4X3 = 391,
MAT4X4 = 392,
DMAT2X2 = 393,
DMAT2X3 = 394,
DMAT2X4 = 395,
DMAT3X2 = 396,
DMAT3X3 = 397,
DMAT3X4 = 398,
DMAT4X2 = 399,
DMAT4X3 = 400,
DMAT4X4 = 401,
F16MAT2X2 = 402,
F16MAT2X3 = 403,
F16MAT2X4 = 404,
F16MAT3X2 = 405,
F16MAT3X3 = 406,
F16MAT3X4 = 407,
F16MAT4X2 = 408,
F16MAT4X3 = 409,
F16MAT4X4 = 410,
F32MAT2X2 = 411,
F32MAT2X3 = 412,
F32MAT2X4 = 413,
F32MAT3X2 = 414,
F32MAT3X3 = 415,
F32MAT3X4 = 416,
F32MAT4X2 = 417,
F32MAT4X3 = 418,
F32MAT4X4 = 419,
F64MAT2X2 = 420,
F64MAT2X3 = 421,
F64MAT2X4 = 422,
F64MAT3X2 = 423,
F64MAT3X3 = 424,
F64MAT3X4 = 425,
F64MAT4X2 = 426,
F64MAT4X3 = 427,
F64MAT4X4 = 428,
ATOMIC_UINT = 429,
ACCSTRUCTNV = 430,
SAMPLER1D = 431,
SAMPLER2D = 432,
SAMPLER3D = 433,
SAMPLERCUBE = 434,
SAMPLER1DSHADOW = 435,
SAMPLER2DSHADOW = 436,
SAMPLERCUBESHADOW = 437,
SAMPLER1DARRAY = 438,
SAMPLER2DARRAY = 439,
SAMPLER1DARRAYSHADOW = 440,
SAMPLER2DARRAYSHADOW = 441,
ISAMPLER1D = 442,
ISAMPLER2D = 443,
ISAMPLER3D = 444,
ISAMPLERCUBE = 445,
ISAMPLER1DARRAY = 446,
ISAMPLER2DARRAY = 447,
USAMPLER1D = 448,
USAMPLER2D = 449,
USAMPLER3D = 450,
USAMPLERCUBE = 451,
USAMPLER1DARRAY = 452,
USAMPLER2DARRAY = 453,
SAMPLER2DRECT = 454,
SAMPLER2DRECTSHADOW = 455,
ISAMPLER2DRECT = 456,
USAMPLER2DRECT = 457,
SAMPLERBUFFER = 458,
ISAMPLERBUFFER = 459,
USAMPLERBUFFER = 460,
SAMPLERCUBEARRAY = 461,
SAMPLERCUBEARRAYSHADOW = 462,
ISAMPLERCUBEARRAY = 463,
USAMPLERCUBEARRAY = 464,
SAMPLER2DMS = 465,
ISAMPLER2DMS = 466,
USAMPLER2DMS = 467,
SAMPLER2DMSARRAY = 468,
ISAMPLER2DMSARRAY = 469,
USAMPLER2DMSARRAY = 470,
SAMPLEREXTERNALOES = 471,
F16SAMPLER1D = 472,
F16SAMPLER2D = 473,
F16SAMPLER3D = 474,
F16SAMPLER2DRECT = 475,
F16SAMPLERCUBE = 476,
F16SAMPLER1DARRAY = 477,
F16SAMPLER2DARRAY = 478,
F16SAMPLERCUBEARRAY = 479,
F16SAMPLERBUFFER = 480,
F16SAMPLER2DMS = 481,
F16SAMPLER2DMSARRAY = 482,
F16SAMPLER1DSHADOW = 483,
F16SAMPLER2DSHADOW = 484,
F16SAMPLER1DARRAYSHADOW = 485,
F16SAMPLER2DARRAYSHADOW = 486,
F16SAMPLER2DRECTSHADOW = 487,
F16SAMPLERCUBESHADOW = 488,
F16SAMPLERCUBEARRAYSHADOW = 489,
SAMPLER = 490,
SAMPLERSHADOW = 491,
TEXTURE1D = 492,
TEXTURE2D = 493,
TEXTURE3D = 494,
TEXTURECUBE = 495,
TEXTURE1DARRAY = 496,
TEXTURE2DARRAY = 497,
ITEXTURE1D = 498,
ITEXTURE2D = 499,
ITEXTURE3D = 500,
ITEXTURECUBE = 501,
ITEXTURE1DARRAY = 502,
ITEXTURE2DARRAY = 503,
UTEXTURE1D = 504,
UTEXTURE2D = 505,
UTEXTURE3D = 506,
UTEXTURECUBE = 507,
UTEXTURE1DARRAY = 508,
UTEXTURE2DARRAY = 509,
TEXTURE2DRECT = 510,
ITEXTURE2DRECT = 511,
UTEXTURE2DRECT = 512,
TEXTUREBUFFER = 513,
ITEXTUREBUFFER = 514,
UTEXTUREBUFFER = 515,
TEXTURECUBEARRAY = 516,
ITEXTURECUBEARRAY = 517,
UTEXTURECUBEARRAY = 518,
TEXTURE2DMS = 519,
ITEXTURE2DMS = 520,
UTEXTURE2DMS = 521,
TEXTURE2DMSARRAY = 522,
ITEXTURE2DMSARRAY = 523,
UTEXTURE2DMSARRAY = 524,
F16TEXTURE1D = 525,
F16TEXTURE2D = 526,
F16TEXTURE3D = 527,
F16TEXTURE2DRECT = 528,
F16TEXTURECUBE = 529,
F16TEXTURE1DARRAY = 530,
F16TEXTURE2DARRAY = 531,
F16TEXTURECUBEARRAY = 532,
F16TEXTUREBUFFER = 533,
F16TEXTURE2DMS = 534,
F16TEXTURE2DMSARRAY = 535,
SUBPASSINPUT = 536,
SUBPASSINPUTMS = 537,
ISUBPASSINPUT = 538,
ISUBPASSINPUTMS = 539,
USUBPASSINPUT = 540,
USUBPASSINPUTMS = 541,
F16SUBPASSINPUT = 542,
F16SUBPASSINPUTMS = 543,
IMAGE1D = 544,
IIMAGE1D = 545,
UIMAGE1D = 546,
IMAGE2D = 547,
IIMAGE2D = 548,
UIMAGE2D = 549,
IMAGE3D = 550,
IIMAGE3D = 551,
UIMAGE3D = 552,
IMAGE2DRECT = 553,
IIMAGE2DRECT = 554,
UIMAGE2DRECT = 555,
IMAGECUBE = 556,
IIMAGECUBE = 557,
UIMAGECUBE = 558,
IMAGEBUFFER = 559,
IIMAGEBUFFER = 560,
UIMAGEBUFFER = 561,
IMAGE1DARRAY = 562,
IIMAGE1DARRAY = 563,
UIMAGE1DARRAY = 564,
IMAGE2DARRAY = 565,
IIMAGE2DARRAY = 566,
UIMAGE2DARRAY = 567,
IMAGECUBEARRAY = 568,
IIMAGECUBEARRAY = 569,
UIMAGECUBEARRAY = 570,
IMAGE2DMS = 571,
IIMAGE2DMS = 572,
UIMAGE2DMS = 573,
IMAGE2DMSARRAY = 574,
IIMAGE2DMSARRAY = 575,
UIMAGE2DMSARRAY = 576,
F16IMAGE1D = 577,
F16IMAGE2D = 578,
F16IMAGE3D = 579,
F16IMAGE2DRECT = 580,
F16IMAGECUBE = 581,
F16IMAGE1DARRAY = 582,
F16IMAGE2DARRAY = 583,
F16IMAGECUBEARRAY = 584,
F16IMAGEBUFFER = 585,
F16IMAGE2DMS = 586,
F16IMAGE2DMSARRAY = 587,
STRUCT = 588,
VOID = 589,
WHILE = 590,
IDENTIFIER = 591,
TYPE_NAME = 592,
FLOATCONSTANT = 593,
DOUBLECONSTANT = 594,
INT16CONSTANT = 595,
UINT16CONSTANT = 596,
INT32CONSTANT = 597,
UINT32CONSTANT = 598,
INTCONSTANT = 599,
UINTCONSTANT = 600,
INT64CONSTANT = 601,
UINT64CONSTANT = 602,
BOOLCONSTANT = 603,
FLOAT16CONSTANT = 604,
LEFT_OP = 605,
RIGHT_OP = 606,
INC_OP = 607,
DEC_OP = 608,
LE_OP = 609,
GE_OP = 610,
EQ_OP = 611,
NE_OP = 612,
AND_OP = 613,
OR_OP = 614,
XOR_OP = 615,
MUL_ASSIGN = 616,
DIV_ASSIGN = 617,
ADD_ASSIGN = 618,
MOD_ASSIGN = 619,
LEFT_ASSIGN = 620,
RIGHT_ASSIGN = 621,
AND_ASSIGN = 622,
XOR_ASSIGN = 623,
OR_ASSIGN = 624,
SUB_ASSIGN = 625,
LEFT_PAREN = 626,
RIGHT_PAREN = 627,
LEFT_BRACKET = 628,
RIGHT_BRACKET = 629,
LEFT_BRACE = 630,
RIGHT_BRACE = 631,
DOT = 632,
COMMA = 633,
COLON = 634,
EQUAL = 635,
SEMICOLON = 636,
BANG = 637,
DASH = 638,
TILDE = 639,
PLUS = 640,
STAR = 641,
SLASH = 642,
PERCENT = 643,
LEFT_ANGLE = 644,
RIGHT_ANGLE = 645,
VERTICAL_BAR = 646,
CARET = 647,
AMPERSAND = 648,
QUESTION = 649,
INVARIANT = 650,
PRECISE = 651,
HIGH_PRECISION = 652,
MEDIUM_PRECISION = 653,
LOW_PRECISION = 654,
PRECISION = 655,
PACKED = 656,
RESOURCE = 657,
SUPERP = 658
};
#endif
@ -485,7 +489,7 @@ union YYSTYPE
};
} interm;
#line 489 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
#line 493 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;

View File

@ -1049,6 +1049,10 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
#ifdef NV_EXTENSIONS
case EOpTraceNV: out.debug << "traceNVX"; break;
case EOpReportIntersectionNV: out.debug << "reportIntersectionNVX"; break;
case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNVX"; break;
case EOpTerminateRayNV: out.debug << "terminateRayNVX"; break;
case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break;
#endif

View File

@ -279,6 +279,9 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit)
}
// Getting this far means we have two existing trees to merge...
#ifdef NV_EXTENSIONS
numShaderRecordNVBlocks += unit.numShaderRecordNVBlocks;
#endif
#ifdef NV_EXTENSIONS
numTaskNVBlocks += unit.numTaskNVBlocks;
@ -710,6 +713,15 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
break;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV:
case EShLangIntersectNV:
case EShLangAnyHitNV:
case EShLangClosestHitNV:
case EShLangMissNV:
case EShLangCallableNV:
if (numShaderRecordNVBlocks > 1)
error(infoSink, "Only one shaderRecordNVX buffer block is allowed per stage");
break;
case EShLangMeshNV:
if (outputPrimitive == ElgNone)
error(infoSink, "At least one shader must specify an output layout primitive");

View File

@ -236,6 +236,7 @@ public:
#ifdef NV_EXTENSIONS
layoutOverrideCoverage(false),
geoPassthroughEXT(false),
numShaderRecordNVBlocks(0),
computeDerivativeMode(LayoutDerivativeNone),
primitives(TQualifier::layoutNotSet),
numTaskNVBlocks(0),
@ -430,6 +431,7 @@ public:
int getNumErrors() const { return numErrors; }
void addPushConstantCount() { ++numPushConstants; }
#ifdef NV_EXTENSIONS
void addShaderRecordNVCount() { ++numShaderRecordNVBlocks; }
void addTaskNVCount() { ++numTaskNVBlocks; }
#endif
@ -753,6 +755,7 @@ protected:
#ifdef NV_EXTENSIONS
bool layoutOverrideCoverage;
bool geoPassthroughEXT;
int numShaderRecordNVBlocks;
ComputeDerivativeMode computeDerivativeMode;
int primitives;
int numTaskNVBlocks;

View File

@ -95,6 +95,12 @@ typedef enum {
EShLangFragment,
EShLangCompute,
#ifdef NV_EXTENSIONS
EShLangRayGenNV,
EShLangIntersectNV,
EShLangAnyHitNV,
EShLangClosestHitNV,
EShLangMissNV,
EShLangCallableNV,
EShLangTaskNV,
EShLangMeshNV,
#endif
@ -109,6 +115,12 @@ typedef enum {
EShLangFragmentMask = (1 << EShLangFragment),
EShLangComputeMask = (1 << EShLangCompute),
#ifdef NV_EXTENSIONS
EShLangRayGenNVMask = (1 << EShLangRayGenNV),
EShLangIntersectNVMask = (1 << EShLangIntersectNV),
EShLangAnyHitNVMask = (1 << EShLangAnyHitNV),
EShLangClosestHitNVMask = (1 << EShLangClosestHitNV),
EShLangMissNVMask = (1 << EShLangMissNV),
EShLangCallableNVMask = (1 << EShLangCallableNV),
EShLangTaskNVMask = (1 << EShLangTaskNV),
EShLangMeshNVMask = (1 << EShLangMeshNV),
#endif

View File

@ -501,6 +501,17 @@ INSTANTIATE_TEST_CASE_P(
"spv.multiviewPerViewAttributes.vert",
"spv.multiviewPerViewAttributes.tesc",
"spv.atomicInt64.comp",
"spv.RayGenShader.rgen",
"spv.RayGenShader_Errors.rgen",
"spv.RayConstants.rgen",
"spv.IntersectShader.rint",
"spv.IntersectShader_Errors.rint",
"spv.AnyHitShader.rahit",
"spv.AnyHitShader_Errors.rahit",
"spv.ClosestHitShader.rchit",
"spv.ClosestHitShader_Errors.rchit",
"spv.MissShader.rmiss",
"spv.MissShader_Errors.rmiss",
"spv.fragmentShaderBarycentric.frag",
"spv.fragmentShaderBarycentric2.frag",
"spv.computeShaderDerivatives.comp",

View File

@ -61,6 +61,18 @@ EShLanguage GetShaderStage(const std::string& stage)
} else if (stage == "comp") {
return EShLangCompute;
#ifdef NV_EXTENSIONS
} else if (stage == "rgen") {
return EShLangRayGenNV;
} else if (stage == "rint") {
return EShLangIntersectNV;
} else if (stage == "rahit") {
return EShLangAnyHitNV;
} else if (stage == "rchit") {
return EShLangClosestHitNV;
} else if (stage == "rmiss") {
return EShLangMissNV;
} else if (stage == "rcall") {
return EShLangCallableNV;
} else if (stage == "task") {
return EShLangTaskNV;
} else if (stage == "mesh") {