Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace bitmask enums with uint64_t + constants, and remove "Flags" suffix #336

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

kainino0x
Copy link
Collaborator

@kainino0x kainino0x commented Sep 17, 2024

Fixes #247
Fixes #273
(already done in Dawn)

@kainino0x kainino0x changed the title Replace bitmask enums with typedef+constants Replace bitmask enums with uint64_t + constants, and remove "Flags" suffix Sep 17, 2024
@kainino0x kainino0x merged commit 0edd217 into webgpu-native:main Sep 17, 2024
4 checks passed
@kainino0x kainino0x deleted the flags64 branch September 17, 2024 18:28
static const WGPUColorWriteMask WGPUColorWriteMask_Green = 0x0000000000000002;
static const WGPUColorWriteMask WGPUColorWriteMask_Blue = 0x0000000000000004;
static const WGPUColorWriteMask WGPUColorWriteMask_Alpha = 0x0000000000000008;
static const WGPUColorWriteMask WGPUColorWriteMask_All = WGPUColorWriteMask_None | WGPUColorWriteMask_Red | WGPUColorWriteMask_Green | WGPUColorWriteMask_Blue | WGPUColorWriteMask_Alpha;
Copy link

@PJB3005 PJB3005 Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to give me the following error when compiling with MSVC:

E:\Projects\wgpu-native\ffi\webgpu-headers\webgpu.h(931,33): error C2099: initializer is not a constant [E:\Projects\wgpu-native\examples\build\framework\framework.vcxproj]

Apparently const ints like this are not constants themselves in C... https://stackoverflow.com/questions/6131455/compile-error-c2099-initializer-is-not-a-constant

Actually I'll just file a proper issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Defining enums and bitmasks using enum vs. as constants Expand some bitmask enums to 64-bits?
3 participants