Skip to content

Commit

Permalink
Add complete pragma to MAKE_VERSION
Browse files Browse the repository at this point in the history
Closes #256
  • Loading branch information
expipiplus1 committed Feb 6, 2021
1 parent d27a662 commit b9ac855
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## WIP
- Bump API version to v1.2.168
- Add `COMPLETE` pragma to `MAKE_VERSION` pattern
https://github.com/expipiplus1/vulkan/issues/256

## [3.10] - 2021-01-09
- Make zero instance for `TransformMatrixKHR` return identity matrix. See
Expand Down
2 changes: 2 additions & 0 deletions generate-new/khronos-spec/Khronos/Versions/OpenXR.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ versionConstruction = genRe "version construction" $ do
.|. fromIntegral minor `shiftL` 32
.|. fromIntegral patch

\{-# complete {p} #-}

{patMajor} :: Version -> Word16
{patMajor} (Version v) = fromIntegral $ (v `shiftR` 48) .&. 0xffff

Expand Down
2 changes: 2 additions & 0 deletions generate-new/src/Render/Spec/Versions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ versionConstruction = genRe "version construction" $ do
(\\v -> ({patMajor} v, {patMinor} v, {patPatch} v) -> (major, minor, patch))
where {mkPatternName "VK_MAKE_VERSION"} major minor patch = major `shiftL` 22 .|. minor `shiftL` 12 .|. patch

\{-# complete {mkPatternName "VK_MAKE_VERSION"} #-}

{patMajor} :: Word32 -> Word32
{patMajor} v = v `shiftR` 22

Expand Down
2 changes: 2 additions & 0 deletions src/Vulkan/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pattern MAKE_VERSION major minor patch <-
(\v -> (_VERSION_MAJOR v, _VERSION_MINOR v, _VERSION_PATCH v) -> (major, minor, patch))
where MAKE_VERSION major minor patch = major `shiftL` 22 .|. minor `shiftL` 12 .|. patch

{-# complete MAKE_VERSION #-}

_VERSION_MAJOR :: Word32 -> Word32
_VERSION_MAJOR v = v `shiftR` 22

Expand Down

0 comments on commit b9ac855

Please sign in to comment.