Skip to content

Commit

Permalink
Turn a few extensions into direct dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
serenity4 committed Jul 29, 2024
1 parent 11c836d commit b3f3232
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Version `v0.6.18`

- ![Feature][badge-feature] Extensions were added related to StaticArraysCore, FixedPointNumbers and ColorTypes to define additional `Vk.Format`/`Vk.format_type` mappings.
- ![Enhancement][badge-enhancement] Vulkan.jl no longer depends on FixedPointNumbers.jl.
- ![Feature][badge-feature] Extensions were added related to StaticArraysCore, FixedPointNumbers and ColorTypes to define additional `Vk.Format`/`Vk.format_type` mappings. However, due to https://github.com/JuliaLang/julia/issues/52511, these are not yet defined as package extensions, and the core packages were made direct dependencies instead of weak dependencies.

## Version `v0.6.16`
- ![Feature][badge-feature] Dependencies between handles may be specified via `Vk.depends_on(x, handle)`, to ensure that a given handle is not destroyed before anything that depends on it. This leverages the reference counting system already implemented, which itself encodes such dependencies from a given parent handle and its children. See the docstring of `Vk.depends_on` for more details.
Expand Down
23 changes: 14 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,34 @@ authors = ["Cédric Belmant"]
[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
BitMasks = "a3e06817-fd65-4797-8291-16f435bc2529"
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MLStyle = "d8e11817-5142-5d16-987a-aa16d5891078"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
ResultTypes = "08a2b407-ddc3-586a-afd6-c784ad1fffe2"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
StructEquality = "6ec83bb0-ed9f-11e9-3b4c-2b04cb4e219c"
VulkanCore = "16167f82-ea26-5cba-b1de-ed6fd5e30a11"

[weakdeps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
# ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
# FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
# StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
XCB = "16167f82-ea26-5cba-b1de-ed6fd5e30a10"

[extensions]
VulkanColorTypesExt = "ColorTypes"
VulkanFixedPointNumbersExt = "FixedPointNumbers"
VulkanFixedPointNumbersColorTypesExt = ["ColorTypes", "FixedPointNumbers"]
VulkanFixedPointNumbersStaticArraysCoreExt = ["FixedPointNumbers", "StaticArraysCore"]
VulkanStaticArraysCoreExt = "StaticArraysCore"
# Don't make these extensions until precompilation issues raised
# in https://github.com/JuliaLang/julia/issues/52511 are addressed.
# VulkanColorTypesExt = "ColorTypes"
# VulkanFixedPointNumbersExt = "FixedPointNumbers"
# VulkanFixedPointNumbersColorTypesExt = ["ColorTypes", "FixedPointNumbers"]
# VulkanFixedPointNumbersStaticArraysCoreExt = ["FixedPointNumbers", "StaticArraysCore"]
# VulkanStaticArraysCoreExt = "StaticArraysCore"
VulkanXCBExt = "XCB"

[compat]
Expand Down Expand Up @@ -57,4 +62,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
XCB = "16167f82-ea26-5cba-b1de-ed6fd5e30a10"

[targets]
test = ["Test", "Documenter", "Pkg", "SwiftShader_jll", "ColorTypes", "XCB", "FixedPointNumbers", "StaticArraysCore"]
test = ["Test", "Documenter", "Pkg", "SwiftShader_jll", "XCB"]
9 changes: 9 additions & 0 deletions src/Vulkan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ function __init__()
fill_dispatch_table()
end

# Extensions.
# Turn these into extensions when precompilation issues raised in
# in https://github.com/JuliaLang/julia/issues/52511 are addressed.
include("../ext/VulkanFixedPointNumbersExt.jl")
include("../ext/VulkanColorTypesExt.jl")
include("../ext/VulkanFixedPointNumbersColorTypesExt.jl")
include("../ext/VulkanStaticArraysCoreExt.jl")
include("../ext/VulkanFixedPointNumbersStaticArraysCoreExt.jl")

export
# Wrapper
VulkanStruct,
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ using Accessors: @set
include("dispatch.jl")
include("formats.jl")
@test Vulkan.precompile_workload()
isdefined(Base, :get_extension) && include("extensions.jl")
include("extensions.jl")
VERSION v"1.12" && include("doctests.jl")
end;

2 comments on commit b3f3232

@serenity4
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Error while trying to register: Version 0.6.18 already exists

Please sign in to comment.