mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-23 10:09:22 +01:00
vk_texture_runtime: Fix debug scope label lambda-capture (#7102)
`DebugScope` was capturing a `string_view` in a lambda which is only valid during the scope of this ctor. When the lambda gets invoked at a later time, it will read undefined garbage. The lambda needs to make a deep copy of this `string_view` into a `string` so that it is valid by the time the scheduler invokes this lambda.
This commit is contained in:
parent
d3ce43782d
commit
ac9d72a95c
@ -1562,7 +1562,7 @@ DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f color, std::string
|
||||
if (!has_debug_tool) {
|
||||
return;
|
||||
}
|
||||
scheduler.Record([color, label](vk::CommandBuffer cmdbuf) {
|
||||
scheduler.Record([color, label = std::string(label)](vk::CommandBuffer cmdbuf) {
|
||||
const vk::DebugUtilsLabelEXT debug_label = {
|
||||
.pLabelName = label.data(),
|
||||
.color = std::array{color[0], color[1], color[2], color[3]},
|
||||
|
Loading…
Reference in New Issue
Block a user