Add GPU profile events to WebGPU and use the by default in non-Release builds

This commit is contained in:
Wojtek Figat
2026-02-26 11:08:12 +01:00
parent d2a8ac54cf
commit ac4526744a
4 changed files with 32 additions and 2 deletions

View File

@@ -115,6 +115,27 @@ void GPUContextWebGPU::FrameEnd()
Flush();
}
#if GPU_ALLOW_PROFILE_EVENTS
#include "Engine/Utilities/StringConverter.h"
void GPUContextWebGPU::EventBegin(const Char* name)
{
StringAsANSI<> nameAnsi(name);
wgpuCommandEncoderPushDebugGroup(Encoder, { nameAnsi.Get(), (size_t)nameAnsi.Length() });
}
void GPUContextWebGPU::EventEnd()
{
// Cannot insert commands in encoder during render pass
if (_renderPass)
EndRenderPass();
wgpuCommandEncoderPopDebugGroup(Encoder);
}
#endif
void* GPUContextWebGPU::GetNativePtr() const
{
return Encoder;