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 <mavaldin@microsoft.com>
This commit is contained in:
Matteo Valdina
2026-03-23 09:05:18 -07:00
committed by GitHub
parent a7016487e5
commit fd8d480b28

View File

@@ -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);