Thanks for the CC! Indeed there is a type difference, hence we have two
different macros and you're meant to use the other one here :)

#define WGPU_WHOLE_MAP_SIZE SIZE_MAX
#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL)

This is a bit fussy, but it _is_ a C API.... In C++, things are a bit
better, because they're typed:

    static constexpr size_t kWholeMapSize = WGPU_WHOLE_MAP_SIZE;
    static constexpr uint64_t kWholeSize = WGPU_WHOLE_SIZE;

We could do this in the C API but it's somewhat unidiomatic - we had
someone complain about our use of static const instead of #define before.

That said we should probably consider the ~0 solution, maybe this would let
us get rid of the two definitions entirely. Would you file an issue to
suggest it here?
https://github.com/webgpu-native/webgpu-headers/

-Kai (he/they)


On Wed, Jan 18, 2023 at 4:14 PM Sam Clegg <s...@google.com> wrote:

> It looks like WGPU_WHOLE_SIZE is designed to be used WGPUBindGroupEntry
> where size is 64-bit, but wgpuBufferMapAsync uses size_t for size (which is
> either 32-bit ot 64-bit depending on the architecture).
>
> I'm not sure if this is intended behaviour or not.  Perhaps its a bug?
>  cc'ing Kai who will know more.
>
> On Wed, Jan 18, 2023 at 2:57 PM Mark Sibly <marksi...@gmail.com> wrote:
>
>> This works and gets rid of the warning:
>>
>> #define WGPU_WHOLE_SIZE ~0
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to emscripten-discuss+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/adac8f05-fb52-4124-8b73-d1354fd67485n%40googlegroups.com
>> <https://groups.google.com/d/msgid/emscripten-discuss/adac8f05-fb52-4124-8b73-d1354fd67485n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CANxMeyBV%2BZSf14bRt--Wvr9cagVC8RA3ogAKzAxgznR9jLEW4A%40mail.gmail.com.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to