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

Function IsSparse

source/val/validate_image.cpp:893–915  ·  view source on GitHub ↗

Returns true if opcode is *ImageSparse*, false otherwise.

Source from the content-addressed store, hash-verified

891
892// Returns true if opcode is *ImageSparse*, false otherwise.
893bool 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.

Callers 2

GetActualResultTypeFunction · 0.85
GetActualResultTypeStrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected