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

Function ValidateUndef

source/val/validate_misc.cpp:27–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace {
26
27spv_result_t ValidateUndef(ValidationState_t& _, const Instruction* inst) {
28 if (_.IsVoidType(inst->type_id())) {
29 return _.diag(SPV_ERROR_INVALID_ID, inst)
30 << "Cannot create undefined values with void type";
31 }
32 if (_.HasCapability(spv::Capability::Shader) &&
33 _.ContainsLimitedUseIntOrFloatType(inst->type_id()) &&
34 !_.IsPointerType(inst->type_id())) {
35 return _.diag(SPV_ERROR_INVALID_ID, inst)
36 << "Cannot create undefined values with 8- or 16-bit types";
37 }
38
39 return SPV_SUCCESS;
40}
41
42spv_result_t ValidateShaderClock(ValidationState_t& _,
43 const Instruction* inst) {

Callers 1

MiscPassFunction · 0.85

Calls 6

IsVoidTypeMethod · 0.80
diagMethod · 0.80
IsPointerTypeMethod · 0.80
type_idMethod · 0.45
HasCapabilityMethod · 0.45

Tested by

no test coverage detected