From 28d8914022e23fa48ba4ea86b3bc1bf491a988af Mon Sep 17 00:00:00 2001 From: chyyran Date: Mon, 2 Sep 2024 10:12:52 -0400 Subject: [PATCH] Replace assert of buffer block SPIRType with exception --- spirv_cross_parsed_ir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spirv_cross_parsed_ir.cpp b/spirv_cross_parsed_ir.cpp index 3072cd8ab..188c0ae65 100644 --- a/spirv_cross_parsed_ir.cpp +++ b/spirv_cross_parsed_ir.cpp @@ -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(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