mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Updated spirv-cross.
This commit is contained in:
24
3rdparty/spirv-cross/spirv_cross.cpp
vendored
24
3rdparty/spirv-cross/spirv_cross.cpp
vendored
@@ -1659,6 +1659,9 @@ bool Compiler::traverse_all_reachable_opcodes(const SPIRBlock &block, OpcodeHand
|
||||
}
|
||||
}
|
||||
|
||||
if (!handler.handle_terminator(block))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3055,6 +3058,27 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::id_is_potential_temporary(uint
|
||||
return compiler.ir.ids[id].empty() || (compiler.ir.ids[id].get_type() == TypeExpression);
|
||||
}
|
||||
|
||||
bool Compiler::AnalyzeVariableScopeAccessHandler::handle_terminator(const SPIRBlock &block)
|
||||
{
|
||||
switch (block.terminator)
|
||||
{
|
||||
case SPIRBlock::Return:
|
||||
if (block.return_value)
|
||||
notify_variable_access(block.return_value, block.self);
|
||||
break;
|
||||
|
||||
case SPIRBlock::Select:
|
||||
case SPIRBlock::MultiSelect:
|
||||
notify_variable_access(block.condition, block.self);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint32_t *args, uint32_t length)
|
||||
{
|
||||
// Keep track of the types of temporaries, so we can hoist them out as necessary.
|
||||
|
||||
5
3rdparty/spirv-cross/spirv_cross.hpp
vendored
5
3rdparty/spirv-cross/spirv_cross.hpp
vendored
@@ -765,6 +765,10 @@ protected:
|
||||
// Return true if traversal should continue.
|
||||
// If false, traversal will end immediately.
|
||||
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) = 0;
|
||||
virtual bool handle_terminator(const SPIRBlock &)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool follow_function_call(const SPIRFunction &)
|
||||
{
|
||||
@@ -979,6 +983,7 @@ protected:
|
||||
bool id_is_phi_variable(uint32_t id) const;
|
||||
bool id_is_potential_temporary(uint32_t id) const;
|
||||
bool handle(spv::Op op, const uint32_t *args, uint32_t length) override;
|
||||
bool handle_terminator(const SPIRBlock &block) override;
|
||||
|
||||
Compiler &compiler;
|
||||
SPIRFunction &entry;
|
||||
|
||||
Reference in New Issue
Block a user