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

Is this overflowed-literals warning in vulkan needs to be fixed? #266

Closed
ukari opened this issue Feb 27, 2021 · 2 comments
Closed

Is this overflowed-literals warning in vulkan needs to be fixed? #266

ukari opened this issue Feb 27, 2021 · 2 comments

Comments

@ukari
Copy link
Contributor

ukari commented Feb 27, 2021

problem

I noticed a warning in github ci log

src/Vulkan/Extensions/VK_KHR_synchronization2.hs:5294:78: warning: [-Woverflowed-literals]
    Literal 4294967296 is out of the Word32 range 0..4294967295
     |
5294 | pattern ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR            = AccessFlagBits2KHR 0x100000000
     |                                                                              ^^^^^^^^^^^

src/Vulkan/Extensions/VK_KHR_synchronization2.hs:5302:78: warning: [-Woverflowed-literals]
    Literal 8589934592 is out of the Word32 range 0..4294967295
     |
5302 | pattern ACCESS_2_SHADER_STORAGE_READ_BIT_KHR            = AccessFlagBits2KHR 0x200000000
     |                                                                              ^^^^^^^^^^^

I check vulkan doc, and found that VkPipelineStageFlagBits2KHR has a ULL(unsigned long long) type which means Word64 instead of Word32 in haskell.

static const VkPipelineStageFlags2KHR VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR = 0x800000000ULL;

related code

PipelineStageFlagBits2KHR

newtype PipelineStageFlagBits2KHR = PipelineStageFlagBits2KHR Flags
  deriving newtype (Eq, Ord, Storable, Zero, Bits, FiniteBits)

PIPELINE_STAGE_2_CLEAR_BIT_KHR

pattern PIPELINE_STAGE_2_CLEAR_BIT_KHR                          = PipelineStageFlagBits2KHR 0x800000000

Flags

type Flags = Word32
@expipiplus1
Copy link
Owner

Yeah, this certainly should be fixed! I'll get to it asap I hope.

Basically these should use Flags64 instead.

@expipiplus1
Copy link
Owner

This is fixed and released on Hackage

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

No branches or pull requests

2 participants