Improve fix for boolean decorations queried in get_decoration, added support to get_member_decoration, and updated comments to reflect the change in behavior.
This commit is contained in:
parent
acd98ac0d5
commit
9b1ee8f10a
@ -890,7 +890,7 @@ uint32_t Compiler::get_member_decoration(uint32_t id, uint32_t index, Decoration
|
||||
case DecorationSpecId:
|
||||
return dec.spec_id;
|
||||
default:
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1018,11 +1018,8 @@ uint32_t Compiler::get_decoration(uint32_t id, Decoration decoration) const
|
||||
return dec.input_attachment;
|
||||
case DecorationSpecId:
|
||||
return dec.spec_id;
|
||||
case DecorationNonWritable:
|
||||
case DecorationNonReadable:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,8 +138,10 @@ public:
|
||||
uint64_t get_decoration_mask(uint32_t id) const;
|
||||
|
||||
// Gets the value for decorations which take arguments.
|
||||
// If the decoration is a boolean (i.e. spv::DecorationNonWritable),
|
||||
// 1 will be returned.
|
||||
// If decoration doesn't exist or decoration is not recognized,
|
||||
// 0 will be returned.
|
||||
// 0 will be returned.
|
||||
uint32_t get_decoration(uint32_t id, spv::Decoration decoration) const;
|
||||
|
||||
// Removes the decoration for a an ID.
|
||||
|
Loading…
Reference in New Issue
Block a user