77#include < memory>
88#include < sstream>
99
10+ #include " impeller/base/strings.h"
1011#include " impeller/entity/entity.h"
1112#include " impeller/renderer/command_buffer.h"
1213#include " impeller/renderer/formats.h"
@@ -308,6 +309,7 @@ bool ContentContext::IsValid() const {
308309}
309310
310311std::shared_ptr<Texture> ContentContext::MakeSubpass (
312+ const std::string& label,
311313 ISize texture_size,
312314 const SubpassCallback& subpass_callback,
313315 bool msaa_enabled) const {
@@ -317,11 +319,11 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
317319 if (context->GetDeviceCapabilities ().SupportsOffscreenMSAA () &&
318320 msaa_enabled) {
319321 subpass_target = RenderTarget::CreateOffscreenMSAA (
320- *context, texture_size, " Contents Offscreen MSAA " ,
322+ *context, texture_size, SPrintF ( " %s Offscreen" , label. c_str ()) ,
321323 RenderTarget::kDefaultColorAttachmentConfigMSAA , std::nullopt );
322324 } else {
323325 subpass_target = RenderTarget::CreateOffscreen (
324- *context, texture_size, " Contents Offscreen" ,
326+ *context, texture_size, SPrintF ( " %s Offscreen" , label. c_str ()) ,
325327 RenderTarget::kDefaultColorAttachmentConfig , std::nullopt );
326328 }
327329 auto subpass_texture = subpass_target.GetRenderTargetTexture ();
@@ -330,7 +332,7 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
330332 }
331333
332334 auto sub_command_buffer = context->CreateCommandBuffer ();
333- sub_command_buffer->SetLabel (" Offscreen Contents Command Buffer " );
335+ sub_command_buffer->SetLabel (SPrintF ( " %s CommandBuffer " , label. c_str ()) );
334336 if (!sub_command_buffer) {
335337 return nullptr ;
336338 }
@@ -339,7 +341,7 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
339341 if (!sub_renderpass) {
340342 return nullptr ;
341343 }
342- sub_renderpass->SetLabel (" OffscreenContentsPass " );
344+ sub_renderpass->SetLabel (SPrintF ( " %s RenderPass " , label. c_str ()) );
343345
344346 if (!subpass_callback (*this , *sub_renderpass)) {
345347 return nullptr ;
0 commit comments