From b5471d14f8bb844a966dfdb3bfa3f2333aa148f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 12 Jun 2023 20:10:07 -0700 Subject: [PATCH] Acquire resource API lock when calling bgfx::reset. --- src/bgfx_p.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index c2c8d4a95..a1993f749 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -3165,6 +3165,8 @@ namespace bgfx BGFX_API_FUNC(void reset(uint32_t _width, uint32_t _height, uint32_t _flags, TextureFormat::Enum _format) ) { + BGFX_MUTEX_SCOPE(m_resourceApiLock); + const TextureFormat::Enum format = TextureFormat::Count != _format ? _format : m_init.resolution.format; if (!g_platformDataChangedSinceReset