Skip to content

Commit 24d882c

Browse files
authored
Bump API version to v1.3.273 (#576)
* Bump to .272 and fix huawei var leak * Bump API version to v1.3.273
1 parent 7011431 commit 24d882c

74 files changed

Lines changed: 5300 additions & 2599 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## WIP
44

5+
## [3.26.4] - 2025-05-31
6+
7+
- Bump API version to v1.3.273
8+
59
## [3.26.3] - 2025-05-18
610

711
- Bump API version to v1.3.271

generate-new/Vulkan-Docs

Submodule Vulkan-Docs updated 79 files

generate-new/khronos-spec/Khronos/SPIRVElements.hs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Render.Element
3535
import Render.SpecInfo ( HasSpecInfo
3636
, SpecInfo(..)
3737
)
38-
import Render.Type ( cToHsType )
38+
import Render.Type ( cToHsTypeWithHoles )
3939
import Render.Type.Preserve ( Preserve(DoNotPreserve) )
4040
import Render.Names
4141
import Spec.Types
@@ -94,6 +94,7 @@ renderSPIRVThing
9494
, HasSpecInfo r
9595
, HasMarshalledStructs r
9696
, HasRenderedNames r
97+
, HasCallStack
9798
)
9899
=> Text
99100
-> (a -> Text)
@@ -129,6 +130,7 @@ renderReq
129130
, HasSpecInfo r
130131
, HasMarshalledStructs r
131132
, HasRenderedNames r
133+
, HasCallStack
132134
)
133135
=> SPIRVRequirement
134136
-> Sem r ([Doc ()], [Doc ()])
@@ -142,8 +144,12 @@ renderReq = \case
142144
tellImportWithAll (mkName "Vulkan.Requirement.DeviceRequirement")
143145
tellImportWithAll (mkName "Vulkan.Requirement.InstanceRequirement")
144146
tellLanguageExtension (LanguageExtension "OverloadedLists")
145-
sTy <- cToHsType DoNotPreserve (TypeName s)
146-
-- TODO: this is pretty lazy, import the accessors properly
147+
-- Use the "holes" style (wildcard for extensible suffix) to avoid
148+
-- introducing fresh type variables that violate runNoContext when the
149+
-- struct is further extended (e.g. the new
150+
-- VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI extending
151+
-- VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI).
152+
sTy <- cToHsTypeWithHoles DoNotPreserve (TypeName s)
147153
traverse_ tellImportWithAll (allTypeNames sTy)
148154
(otherInstReqs, otherDevReqs) <- minVersionAndExtensionsReqs rs
149155
getStruct <- input
@@ -200,8 +206,9 @@ renderReq = \case
200206
tellImportWithAll (mkName "Vulkan.Requirement.DeviceRequirement")
201207
tellImportWithAll (mkName "Vulkan.Requirement.InstanceRequirement")
202208
tellLanguageExtension (LanguageExtension "OverloadedLists")
203-
-- TODO: this is pretty lazy, import the accessors properly
204-
sTy <- cToHsType DoNotPreserve (TypeName p)
209+
-- Same reasoning as above: employ the wildcard-hole variation for
210+
-- extensible structs so that no additional type variables leak out.
211+
sTy <- cToHsTypeWithHoles DoNotPreserve (TypeName p)
205212
traverse_ tellImportWithAll (allTypeNames sTy)
206213
sTyDoc <- renderType sTy
207214
let propertyMemberName = mkMemberName p m

generate-new/src/Render/Element/Write.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ renderModule out boot getDoc findModule findLocalModule (Segment modName unsorte
285285
let t = layoutDoc (d <> line <> line)
286286
if getAll (reCanFormat e)
287287
then
288-
liftIO (try (Ormolu.ormolu ormoluConfig "<stdin>" (T.unpack t)))
288+
liftIO (try (Ormolu.ormolu ormoluConfig "<stdin>" $ T.unpack t))
289289
>>= \case
290290
Left ex ->
291291
error
@@ -456,7 +456,7 @@ readFileMaybe :: FilePath -> IO (Maybe Text)
456456
readFileMaybe f =
457457
(Just <$> T.readFile f) `catch` (\(_ :: IOException) -> pure Nothing)
458458

459-
-- If we don't put PatternSynonyms here the fourmolu eatst he comments on them
459+
-- If we don't put PatternSynonyms here the fourmolu eatst he comments on them
460460
ormoluConfig :: Ormolu.Config Ormolu.RegionIndices
461461
ormoluConfig = Ormolu.defaultConfig
462462
{ Ormolu.cfgDynOptions = [Ormolu.DynOption "-XPatternSynonyms"]

generate-new/src/Render/Type.hs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
{-# language TemplateHaskellQuotes #-}
1+
{-# language NamedFieldPuns #-}
22
{-# language NoStarIsType #-}
3+
{-# language TemplateHaskellQuotes #-}
4+
35
module Render.Type
46
( Preserve(..)
57
, ExtensibleStructStyle(..)
@@ -15,6 +17,7 @@ module Render.Type
1517
, ConstrainedVar(..)
1618
) where
1719

20+
import qualified Data.List as L
1821
import qualified Data.Text as T
1922
import qualified Data.Vector as V
2023
import Foreign.C.Types
@@ -48,7 +51,7 @@ import Spec.Types
4851
-- | The same as 'cToHsType' except type variables are written as @_@
4952
cToHsTypeWithHoles
5053
:: forall r
51-
. (HasErr r, HasRenderParams r, HasSpecInfo r)
54+
. (HasErr r, HasRenderParams r, HasSpecInfo r, HasCallStack)
5255
=> Preserve
5356
-> CType
5457
-> Sem r H.Type
@@ -57,7 +60,7 @@ cToHsTypeWithHoles = runNoContext .: cToHsType' UnwrappedHole
5760
-- | The same as 'cToHsType' except extensible structs are wrapped in @SomeStruct@
5861
cToHsTypeWrapped
5962
:: forall r
60-
. (HasErr r, HasRenderParams r, HasSpecInfo r)
63+
. (HasErr r, HasRenderParams r, HasSpecInfo r, HasCallStack)
6164
=> Preserve
6265
-> CType
6366
-> Sem r H.Type
@@ -85,7 +88,7 @@ cToHsTypeWithContext = cToHsType' Unwrapped
8588

8689
cToHsType
8790
:: forall r
88-
. (HasErr r, HasRenderParams r, HasSpecInfo r)
91+
. (HasErr r, HasRenderParams r, HasSpecInfo r, HasCallStack)
8992
=> Preserve
9093
-> CType
9194
-> Sem r H.Type
@@ -212,6 +215,7 @@ data ContextState = ContextState
212215
, csPositiveVars :: [ConstrainedVar]
213216
, csNextVars :: [Name]
214217
}
218+
deriving (Show)
215219

216220
type HasContextState r = Member (State ContextState) r
217221

@@ -251,13 +255,17 @@ runRenderTypeContext a = do
251255
(s, r) <- runState initialContextState a
252256
pure (reverse (csNegativeVars s), reverse (csPositiveVars s), r)
253257

254-
runNoContext :: HasErr r => Sem (State ContextState : r) a -> Sem r a
258+
runNoContext :: (HasErr r, HasCallStack) => Sem (State ContextState : r) a -> Sem r a
255259
runNoContext a = do
256-
(s, r) <- runState initialContextState a
257-
if null (csNegativeVars s <> csPositiveVars s)
258-
then pure ()
259-
else throw "Variables were inserted while getting the type with no context"
260-
pure r
260+
(ContextState{csNegativeVars, csPositiveVars}, r) <- runState initialContextState a
261+
if null (csNegativeVars <> csPositiveVars)
262+
then pure r
263+
else throw . fromString $ L.unlines
264+
[ "Variables were inserted while getting the type with no context:"
265+
, '-' : show csNegativeVars
266+
, '+' : show csPositiveVars
267+
, prettyCallStack callStack
268+
]
261269

262270
----------------------------------------------------------------
263271
-- Utils

generate-new/src/Render/Type/Preserve.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module Render.Type.Preserve where
33
import Language.Haskell.TH ( Name
44
, Type
55
)
6+
import Prelude (Show)
7+
68
data Preserve
79
= DoNotPreserve
810
-- ^ Use more idiomatic haskell types
@@ -27,3 +29,4 @@ data ConstrainedVar
2729
= Extends {cVarBase :: Type, cVarName :: Name}
2830
| Inherits {cVarBase :: Type, cVarName :: Name}
2931
| Unconstrained {cVarName :: Name}
32+
deriving (Show)

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: vulkan
2-
version: "3.26.3"
2+
version: "3.26.4"
33
synopsis: Bindings to the Vulkan graphics API.
44
description: Please see [the readme](https://github.com/expipiplus1/vulkan/#readme)
55
category: Graphics

0 commit comments

Comments
 (0)