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

Use numeric constants to define wgpu_types::Features values. #2817

Merged

Commits on Jun 28, 2022

  1. Use numeric constants to define wgpu_types::Features values.

    As an incidental change, wgpu#2802 (de5fe90) changed the definitions
    of the bitflags in `wgpu_types::Features` from looking like this:
    
        const DEPTH24UNORM_STENCIL8 = 1 << 1;
    
    to this:
    
        const DEPTH24UNORM_STENCIL8 = Self::DEPTH_CLIP_CONTROL.bits << 1;
    
    The intention was to make it easier to insert new flags at a logical
    point in the list, and have the numbers automatically update
    themselves.
    
    Unfortunately, `cbindgen` can't cope with the new style of definition.
    It produces definitions for these flags that look like this:
    
        #define WGPUFeatures_DEPTH24UNORM_STENCIL8 (uint64_t)((WGPUFeatures_DEPTH_CLIP_CONTROL).bits << 1)
    
    These are integer values, so the `.bits` field access is bogus.
    
    This commit changes the definitions back to using direct numbering,
    which `cbindgen` doesn't choke on.
    jimblandy committed Jun 28, 2022
    Configuration menu
    Copy the full SHA
    7150fbb View commit details
    Browse the repository at this point in the history