Returns true if opcode is *ImageSparse*, false otherwise.
| 891 | |
| 892 | // Returns true if opcode is *ImageSparse*, false otherwise. |
| 893 | bool IsSparse(spv::Op opcode) { |
| 894 | switch (opcode) { |
| 895 | case spv::Op::OpImageSparseSampleImplicitLod: |
| 896 | case spv::Op::OpImageSparseSampleExplicitLod: |
| 897 | case spv::Op::OpImageSparseSampleDrefImplicitLod: |
| 898 | case spv::Op::OpImageSparseSampleDrefExplicitLod: |
| 899 | case spv::Op::OpImageSparseSampleProjImplicitLod: |
| 900 | case spv::Op::OpImageSparseSampleProjExplicitLod: |
| 901 | case spv::Op::OpImageSparseSampleProjDrefImplicitLod: |
| 902 | case spv::Op::OpImageSparseSampleProjDrefExplicitLod: |
| 903 | case spv::Op::OpImageSparseFetch: |
| 904 | case spv::Op::OpImageSparseGather: |
| 905 | case spv::Op::OpImageSparseDrefGather: |
| 906 | case spv::Op::OpImageSparseTexelsResident: |
| 907 | case spv::Op::OpImageSparseRead: { |
| 908 | return true; |
| 909 | } |
| 910 | |
| 911 | default: { return false; } |
| 912 | } |
| 913 | |
| 914 | return false; |
| 915 | } |
| 916 | |
| 917 | // Checks sparse image opcode result type and returns the second struct member. |
| 918 | // Returns inst.type_id for non-sparse image opcodes. |
no outgoing calls
no test coverage detected