MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / is_interface_variable

Function is_interface_variable

source/val/validate_interfaces.cpp:34–49  ·  view source on GitHub ↗

Returns true if \c inst is an input or output variable.

Source from the content-addressed store, hash-verified

32
33// Returns true if \c inst is an input or output variable.
34bool is_interface_variable(const Instruction* inst, bool is_spv_1_4) {
35 if (is_spv_1_4) {
36 // Starting in SPIR-V 1.4, all global variables are interface variables.
37 return (inst->opcode() == spv::Op::OpVariable ||
38 inst->opcode() == spv::Op::OpUntypedVariableKHR) &&
39 inst->GetOperandAs<spv::StorageClass>(2u) !=
40 spv::StorageClass::Function;
41 } else {
42 return (inst->opcode() == spv::Op::OpVariable ||
43 inst->opcode() == spv::Op::OpUntypedVariableKHR) &&
44 (inst->GetOperandAs<spv::StorageClass>(2u) ==
45 spv::StorageClass::Input ||
46 inst->GetOperandAs<spv::StorageClass>(2u) ==
47 spv::StorageClass::Output);
48 }
49}
50
51// Special validation for varibles that are between shader stages
52spv_result_t ValidateInputOutputInterfaceVariables(ValidationState_t& _,

Callers 1

ValidateInterfacesFunction · 0.85

Calls 1

opcodeMethod · 0.45

Tested by

no test coverage detected