Add renaming underlying GPU resource (eg. for pooled render targets)

This commit is contained in:
Wojtek Figat
2026-03-23 18:37:18 +01:00
parent 1e44bb1832
commit b756c16018
10 changed files with 70 additions and 1 deletions

View File

@@ -242,6 +242,19 @@ void GPUTextureWebGPU::OnReleaseGPU()
GPUTexture::OnReleaseGPU();
}
#if GPU_ENABLE_RESOURCE_NAMING
void GPUTextureWebGPU::OnRenamed()
{
if (Texture)
{
_name.Set(_namePtr, _nameSize);
wgpuTextureSetLabel(Texture, { _name.Get(), (size_t)_name.Length() });
}
}
#endif
void GPUTextureWebGPU::InitHandles()
{
WGPUTextureViewDescriptor viewDesc = WGPU_TEXTURE_VIEW_DESCRIPTOR_INIT;