mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-23 04:00:05 +00:00
Added NVIDIA ray tracing storage classes in ValidateVariable. (#2254)
* Added additional changes for the new AccelerationStructureNV type. * Added NVIDIA ray tracing storage classes for checking in ValidateVariable. * For NVIDIA ray tracing storage classes added test to load bool type (allowed) in new storage class.
This commit is contained in:
parent
f70e9e2a1f
commit
980ae1d1cd
@ -372,7 +372,12 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
|
||||
if (storage_class != SpvStorageClassWorkgroup &&
|
||||
storage_class != SpvStorageClassCrossWorkgroup &&
|
||||
storage_class != SpvStorageClassPrivate &&
|
||||
storage_class != SpvStorageClassFunction) {
|
||||
storage_class != SpvStorageClassFunction &&
|
||||
storage_class != SpvStorageClassRayPayloadNV &&
|
||||
storage_class != SpvStorageClassIncomingRayPayloadNV &&
|
||||
storage_class != SpvStorageClassHitAttributeNV &&
|
||||
storage_class != SpvStorageClassCallableDataNV &&
|
||||
storage_class != SpvStorageClassIncomingCallableDataNV) {
|
||||
const auto storage_index = 2;
|
||||
const auto storage_id = result_type->GetOperandAs<uint32_t>(storage_index);
|
||||
const auto storage = _.FindDef(storage_id);
|
||||
|
@ -2104,6 +2104,29 @@ OpFunctionEnd
|
||||
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
|
||||
}
|
||||
|
||||
TEST_F(ValidateIdWithMessage, OpVariableContainsRayPayloadBoolGood) {
|
||||
std::string spirv = R"(
|
||||
OpCapability RayTracingNV
|
||||
OpCapability Shader
|
||||
OpCapability Linkage
|
||||
OpExtension "SPV_NV_ray_tracing"
|
||||
OpMemoryModel Logical GLSL450
|
||||
%bool = OpTypeBool
|
||||
%PerRayData = OpTypeStruct %bool
|
||||
%_ptr_PerRayData = OpTypePointer RayPayloadNV %PerRayData
|
||||
%var = OpVariable %_ptr_PerRayData RayPayloadNV
|
||||
%void = OpTypeVoid
|
||||
%fnty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %fnty
|
||||
%entry = OpLabel
|
||||
%load = OpLoad %PerRayData %var
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
)";
|
||||
CompileSuccessfully(spirv.c_str());
|
||||
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
|
||||
}
|
||||
|
||||
TEST_F(ValidateIdWithMessage, OpVariablePointerNoVariablePointersBad) {
|
||||
const std::string spirv = R"(
|
||||
OpCapability Shader
|
||||
|
Loading…
Reference in New Issue
Block a user