Closed laurelkeys closed 8 months ago
This is to be expected - you need to zero initialize the struct because of the presence of the pnext pointer. We need to walk the pnext chain to fill in extra limit structs that are in the chain. If you leave it uninitialized, and the pnext chain is not null, we try to walk it and fail.
Oh, definitely! I guess I saw the std::mem::transmute
and stopped there instead of reading 4 lines down to see it's actually dereferencing a .nextInChain
. Thanks for the quick reply.
Using
wgpu_native.dll
and.pdb
(v0.18.1.4) from C++, I stumbled upon an "Access violation reading location 0xFFFFFFFFFFFFFFFF." when I first tried to use thewgpuAdapterGetLimits
function.Here's a minimal example that showcases the issue (I crash on the last line, when running from within Visual Studio 2022):
From the call stack (see below), the problem seems to be in an
unsafe
block ofwrite_limits_struct
: https://github.com/gfx-rs/wgpu-native/blob/5b75378728c965e3be4d6d9c69b4516ebde4522d/src/conv.rs#L418-L434Click to show the call stack and disassembly...
I get a "Exception thrown at 0x00007FF8F08CF58E (wgpu_native.dll) in minimal.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.", with the call stack: ``` wgpu_native.dll!wgpu_native::conv::write_limits_struct(wgpu_types::Limits wgt_limits, wgpu_native::native::WGPUSupportedLimits * supported_limits) wgpu_native.dll!wgpu_native::wgpuAdapterGetLimits(wgpu_native::WGPUAdapterImpl * adapter, enum2$
Please let me know if there's more information I could provide.