| 2478 | } |
| 2479 | |
| 2480 | spv_result_t ValidateImageProcessingQCOM(ValidationState_t& _, |
| 2481 | const Instruction* inst) { |
| 2482 | spv_result_t res = SPV_SUCCESS; |
| 2483 | const spv::Op opcode = inst->opcode(); |
| 2484 | switch (opcode) { |
| 2485 | case spv::Op::OpImageSampleWeightedQCOM: { |
| 2486 | int wi_idx = inst->GetOperandAs<int>(4); // weight |
| 2487 | res = ValidateImageProcessingQCOMDecoration( |
| 2488 | _, wi_idx, spv::Decoration::WeightTextureQCOM); |
| 2489 | break; |
| 2490 | } |
| 2491 | case spv::Op::OpImageBlockMatchSSDQCOM: |
| 2492 | case spv::Op::OpImageBlockMatchSADQCOM: { |
| 2493 | int tgt_idx = inst->GetOperandAs<int>(2); // target |
| 2494 | res = ValidateImageProcessingQCOMDecoration( |
| 2495 | _, tgt_idx, spv::Decoration::BlockMatchTextureQCOM); |
| 2496 | if (res != SPV_SUCCESS) break; |
| 2497 | int ref_idx = inst->GetOperandAs<int>(4); // reference |
| 2498 | res = ValidateImageProcessingQCOMDecoration( |
| 2499 | _, ref_idx, spv::Decoration::BlockMatchTextureQCOM); |
| 2500 | break; |
| 2501 | } |
| 2502 | case spv::Op::OpImageBlockMatchWindowSSDQCOM: |
| 2503 | case spv::Op::OpImageBlockMatchWindowSADQCOM: { |
| 2504 | int tgt_idx = inst->GetOperandAs<int>(2); // target |
| 2505 | res = ValidateImageProcessing2QCOMWindowDecoration(_, tgt_idx); |
| 2506 | if (res != SPV_SUCCESS) break; |
| 2507 | int ref_idx = inst->GetOperandAs<int>(4); // reference |
| 2508 | res = ValidateImageProcessing2QCOMWindowDecoration(_, ref_idx); |
| 2509 | break; |
| 2510 | } |
| 2511 | case spv::Op::OpImageBlockMatchGatherSSDQCOM: |
| 2512 | case spv::Op::OpImageBlockMatchGatherSADQCOM: { |
| 2513 | int tgt_idx = inst->GetOperandAs<int>(2); // target |
| 2514 | res = ValidateImageProcessingQCOMDecoration( |
| 2515 | _, tgt_idx, spv::Decoration::BlockMatchTextureQCOM); |
| 2516 | if (res != SPV_SUCCESS) break; |
| 2517 | int ref_idx = inst->GetOperandAs<int>(4); // reference |
| 2518 | res = ValidateImageProcessingQCOMDecoration( |
| 2519 | _, ref_idx, spv::Decoration::BlockMatchTextureQCOM); |
| 2520 | break; |
| 2521 | } |
| 2522 | default: |
| 2523 | break; |
| 2524 | } |
| 2525 | |
| 2526 | return res; |
| 2527 | } |
| 2528 | |
| 2529 | spv_result_t ValidateTileImageEXT(ValidationState_t& _, |
| 2530 | const Instruction* inst) { |
no test coverage detected