Skip to content

Commit

Permalink
Merge pull request #2376 from chyyran/get_buffer_block_flags_no_assert
Browse files Browse the repository at this point in the history
Replace assert of buffer block SPIRType with exception in `get_buffer_block_flags`
  • Loading branch information
HansKristian-Work authored Sep 2, 2024
2 parents c29a7b2 + 28d8914 commit 6a1fb66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spirv_cross_parsed_ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,8 @@ Bitset ParsedIR::get_buffer_block_type_flags(const SPIRType &type) const
Bitset ParsedIR::get_buffer_block_flags(const SPIRVariable &var) const
{
auto &type = get<SPIRType>(var.basetype);
assert(type.basetype == SPIRType::Struct);
if (type.basetype != SPIRType::Struct)
SPIRV_CROSS_THROW("Cannot get buffer block flags for non-buffer variable.");

// Some flags like non-writable, non-readable are actually found
// as member decorations. If all members have a decoration set, propagate
Expand Down

0 comments on commit 6a1fb66

Please sign in to comment.