mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
rsx: Fix surface metadata life-cycle
- Beware of clone operations. Blindly inheriting the parent's metadata is wrong. - It is possible, especially when reusing a pre-existing slice, that the parent and child info has diverged
This commit is contained in:
parent
90cf47cdce
commit
04fb86556a
5 changed files with 49 additions and 14 deletions
|
@ -4,17 +4,43 @@
|
|||
|
||||
namespace utils
|
||||
{
|
||||
namespace stack_trace
|
||||
{
|
||||
// Printing utilities
|
||||
|
||||
template <typename T>
|
||||
concept Logger = requires (T& t, const std::string& msg)
|
||||
{
|
||||
{ t.print(msg) };
|
||||
};
|
||||
|
||||
struct print_to_log
|
||||
{
|
||||
logs::channel& log;
|
||||
|
||||
public:
|
||||
print_to_log(logs::channel& chan)
|
||||
: log(chan)
|
||||
{}
|
||||
|
||||
void print(const std::string& s)
|
||||
{
|
||||
log.error("%s", s);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<void*> get_backtrace(int max_depth = 255);
|
||||
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack);
|
||||
|
||||
FORCE_INLINE void print_trace(logs::channel& logger, int max_depth = 255)
|
||||
FORCE_INLINE void print_trace(stack_trace::Logger auto& logger, int max_depth = 255)
|
||||
{
|
||||
const auto trace = get_backtrace(max_depth);
|
||||
const auto lines = get_backtrace_symbols(trace);
|
||||
|
||||
for (const auto& line : lines)
|
||||
{
|
||||
logger.error("%s", line);
|
||||
logger.print(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue