| 186 | } |
| 187 | |
| 188 | spv_result_t GraphicsRobustAccessPass::IsCompatibleModule() { |
| 189 | auto* feature_mgr = context()->get_feature_mgr(); |
| 190 | if (!feature_mgr->HasCapability(spv::Capability::Shader)) |
| 191 | return Fail() << "Can only process Shader modules"; |
| 192 | if (feature_mgr->HasCapability(spv::Capability::VariablePointers)) |
| 193 | return Fail() << "Can't process modules with VariablePointers capability"; |
| 194 | if (feature_mgr->HasCapability( |
| 195 | spv::Capability::VariablePointersStorageBuffer)) |
| 196 | return Fail() << "Can't process modules with VariablePointersStorageBuffer " |
| 197 | "capability"; |
| 198 | if (feature_mgr->HasCapability(spv::Capability::RuntimeDescriptorArrayEXT)) { |
| 199 | // These have a RuntimeArray outside of Block-decorated struct. There |
| 200 | // is no way to compute the array length from within SPIR-V. |
| 201 | return Fail() << "Can't process modules with RuntimeDescriptorArrayEXT " |
| 202 | "capability"; |
| 203 | } |
| 204 | |
| 205 | { |
| 206 | auto* inst = context()->module()->GetMemoryModel(); |
| 207 | const auto addressing_model = |
| 208 | spv::AddressingModel(inst->GetSingleWordOperand(0)); |
| 209 | if (addressing_model != spv::AddressingModel::Logical) |
| 210 | return Fail() << "Addressing model must be Logical. Found " |
| 211 | << inst->PrettyPrint(); |
| 212 | } |
| 213 | return SPV_SUCCESS; |
| 214 | } |
| 215 | |
| 216 | spv_result_t GraphicsRobustAccessPass::ProcessCurrentModule() { |
| 217 | auto err = IsCompatibleModule(); |
nothing calls this directly
no test coverage detected