From fd8d480b2812d8391bb063e9f58bcd03dabe4030 Mon Sep 17 00:00:00 2001 From: Matteo Valdina Date: Mon, 23 Mar 2026 09:05:18 -0700 Subject: [PATCH] Fix x86 crash: CreateTexture command buffer read uses wrong type (#3643) The _external parameter is written to the command buffer as uint64_t (8 bytes) but read back as uintptr_t (4 bytes on 32-bit). This causes a 4-byte deserialization misalignment on x86, corrupting all subsequent command buffer reads and leading to EXCEPTION_ACCESS_VIOLATION (0xC0000005) during D3D11 initialization. Co-authored-by: Matteo Valdina --- src/bgfx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index bbc20a018..66f312269 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -3344,7 +3344,7 @@ namespace bgfx uint8_t skip; _cmdbuf.read(skip); - uintptr_t external; + uint64_t external; _cmdbuf.read(external); void* ptr = m_renderCtx->createTexture(handle, mem, flags, skip, external);