diff --git a/spirv_cross.cpp b/spirv_cross.cpp index abffe386..b6529141 100644 --- a/spirv_cross.cpp +++ b/spirv_cross.cpp @@ -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; } } diff --git a/spirv_cross.hpp b/spirv_cross.hpp index 1736368f..ec2bfc30 100644 --- a/spirv_cross.hpp +++ b/spirv_cross.hpp @@ -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.