Skip to content

Commit

Permalink
Add multiple extensions to Vk.Format/format_type
Browse files Browse the repository at this point in the history
  • Loading branch information
serenity4 committed Jul 28, 2024
1 parent bd152ba commit db8b495
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1.9', 'nightly']
julia-version: ['1.9', '1.10', 'nightly']
julia-arch: [x64, x86]
os: [ubuntu-latest]
steps:
Expand Down
12 changes: 9 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name = "Vulkan"
uuid = "9f14b124-c50e-4008-a7d4-969b3a6cd68a"
authors = ["Cédric Belmant"]
version = "0.6.17"
authors = ["Cédric Belmant"]

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
BitMasks = "a3e06817-fd65-4797-8291-16f435bc2529"
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"
Expand All @@ -20,10 +19,16 @@ 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"
XCB = "16167f82-ea26-5cba-b1de-ed6fd5e30a10"

[extensions]
VulkanColorTypesExt = "ColorTypes"
VulkanFixedPointNumbersExt = "FixedPointNumbers"
VulkanFixedPointNumbersColorTypesExt = ["ColorTypes", "FixedPointNumbers"]
VulkanFixedPointNumbersStaticArraysCoreExt = ["FixedPointNumbers", "StaticArraysCore"]
VulkanStaticArraysCoreExt = "StaticArraysCore"
VulkanXCBExt = "XCB"

[compat]
Expand All @@ -37,6 +42,7 @@ PrecompileTools = "1"
Preferences = "1.2"
Reexport = "1"
ResultTypes = "3"
StaticArraysCore = "1"
StructEquality = "2"
VulkanCore = "1.3.1"
XCB = "0.5, 0.6, 0.7"
Expand All @@ -51,4 +57,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
XCB = "16167f82-ea26-5cba-b1de-ed6fd5e30a10"

[targets]
test = ["Test", "Documenter", "Pkg", "SwiftShader_jll", "ColorTypes", "XCB"]
test = ["Test", "Documenter", "Pkg", "SwiftShader_jll", "ColorTypes", "XCB", "FixedPointNumbers", "StaticArraysCore"]
51 changes: 13 additions & 38 deletions ext/VulkanColorTypesExt.jl
Original file line number Diff line number Diff line change
@@ -1,47 +1,22 @@
module VulkanColorTypesExt

using Vulkan: Vk
using Vulkan
using ColorTypes
using FixedPointNumbers

# generated by `ext/generate_formats.jl`.

Vk.Format(::Type{RGB{N0f8}}) = Vk.FORMAT_R8G8B8_UNORM
Vk.Format(::Type{RGB{Q0f7}}) = Vk.FORMAT_R8G8B8_SNORM
Vk.Format(::Type{BGR{N0f8}}) = Vk.FORMAT_B8G8R8_UNORM
Vk.Format(::Type{BGR{Q0f7}}) = Vk.FORMAT_B8G8R8_SNORM
Vk.Format(::Type{RGBA{N0f8}}) = Vk.FORMAT_R8G8B8A8_UNORM
Vk.Format(::Type{RGBA{Q0f7}}) = Vk.FORMAT_R8G8B8A8_SNORM
Vk.Format(::Type{BGRA{N0f8}}) = Vk.FORMAT_B8G8R8A8_UNORM
Vk.Format(::Type{BGRA{Q0f7}}) = Vk.FORMAT_B8G8R8A8_SNORM
Vk.Format(::Type{RGB{N0f16}}) = Vk.FORMAT_R16G16B16_UNORM
Vk.Format(::Type{RGB{Q0f15}}) = Vk.FORMAT_R16G16B16_SNORM
Vk.Format(::Type{RGB{Float16}}) = Vk.FORMAT_R16G16B16_SFLOAT
Vk.Format(::Type{RGBA{N0f16}}) = Vk.FORMAT_R16G16B16A16_UNORM
Vk.Format(::Type{RGBA{Q0f15}}) = Vk.FORMAT_R16G16B16A16_SNORM
Vk.Format(::Type{RGBA{Float16}}) = Vk.FORMAT_R16G16B16A16_SFLOAT
Vk.Format(::Type{RGB{Float32}}) = Vk.FORMAT_R32G32B32_SFLOAT
Vk.Format(::Type{RGBA{Float32}}) = Vk.FORMAT_R32G32B32A32_SFLOAT
Vk.Format(::Type{RGB{Float64}}) = Vk.FORMAT_R64G64B64_SFLOAT
Vk.Format(::Type{RGBA{Float64}}) = Vk.FORMAT_R64G64B64A64_SFLOAT
Vk.Format(::Type{RGB{Float16}}) = FORMAT_R16G16B16_SFLOAT
Vk.Format(::Type{RGBA{Float16}}) = FORMAT_R16G16B16A16_SFLOAT
Vk.Format(::Type{RGB{Float32}}) = FORMAT_R32G32B32_SFLOAT
Vk.Format(::Type{RGBA{Float32}}) = FORMAT_R32G32B32A32_SFLOAT
Vk.Format(::Type{RGB{Float64}}) = FORMAT_R64G64B64_SFLOAT
Vk.Format(::Type{RGBA{Float64}}) = FORMAT_R64G64B64A64_SFLOAT

Vk.format_type(::Val{Vk.FORMAT_R8G8B8_UNORM}) = RGB{N0f8}
Vk.format_type(::Val{Vk.FORMAT_R8G8B8_SNORM}) = RGB{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8_UNORM}) = BGR{N0f8}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8_SNORM}) = BGR{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_R8G8B8A8_UNORM}) = RGBA{N0f8}
Vk.format_type(::Val{Vk.FORMAT_R8G8B8A8_SNORM}) = RGBA{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8A8_UNORM}) = BGRA{N0f8}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8A8_SNORM}) = BGRA{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16_UNORM}) = RGB{N0f16}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16_SNORM}) = RGB{Q0f15}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16_SFLOAT}) = RGB{Float16}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16A16_UNORM}) = RGBA{N0f16}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16A16_SNORM}) = RGBA{Q0f15}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16A16_SFLOAT}) = RGBA{Float16}
Vk.format_type(::Val{Vk.FORMAT_R32G32B32_SFLOAT}) = RGB{Float32}
Vk.format_type(::Val{Vk.FORMAT_R32G32B32A32_SFLOAT}) = RGBA{Float32}
Vk.format_type(::Val{Vk.FORMAT_R64G64B64_SFLOAT}) = RGB{Float64}
Vk.format_type(::Val{Vk.FORMAT_R64G64B64A64_SFLOAT}) = RGBA{Float64}
Vk.format_type(::Val{FORMAT_R16G16B16_SFLOAT}) = RGB{Float16}
Vk.format_type(::Val{FORMAT_R16G16B16A16_SFLOAT}) = RGBA{Float16}
Vk.format_type(::Val{FORMAT_R32G32B32_SFLOAT}) = RGB{Float32}
Vk.format_type(::Val{FORMAT_R32G32B32A32_SFLOAT}) = RGBA{Float32}
Vk.format_type(::Val{FORMAT_R64G64B64_SFLOAT}) = RGB{Float64}
Vk.format_type(::Val{FORMAT_R64G64B64A64_SFLOAT}) = RGBA{Float64}

end
35 changes: 35 additions & 0 deletions ext/VulkanFixedPointNumbersColorTypesExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module VulkanFixedPointNumbersColorTypesExt

using Vulkan
using FixedPointNumbers
using ColorTypes

# generated by `ext/generate_formats.jl`.

Vk.Format(::Type{RGB{N0f8}}) = Vk.FORMAT_R8G8B8_UNORM
Vk.Format(::Type{RGB{Q0f7}}) = Vk.FORMAT_R8G8B8_SNORM
Vk.Format(::Type{BGR{N0f8}}) = Vk.FORMAT_B8G8R8_UNORM
Vk.Format(::Type{BGR{Q0f7}}) = Vk.FORMAT_B8G8R8_SNORM
Vk.Format(::Type{RGBA{N0f8}}) = Vk.FORMAT_R8G8B8A8_UNORM
Vk.Format(::Type{RGBA{Q0f7}}) = Vk.FORMAT_R8G8B8A8_SNORM
Vk.Format(::Type{BGRA{N0f8}}) = Vk.FORMAT_B8G8R8A8_UNORM
Vk.Format(::Type{BGRA{Q0f7}}) = Vk.FORMAT_B8G8R8A8_SNORM
Vk.Format(::Type{RGB{N0f16}}) = Vk.FORMAT_R16G16B16_UNORM
Vk.Format(::Type{RGB{Q0f15}}) = Vk.FORMAT_R16G16B16_SNORM
Vk.Format(::Type{RGBA{N0f16}}) = Vk.FORMAT_R16G16B16A16_UNORM
Vk.Format(::Type{RGBA{Q0f15}}) = Vk.FORMAT_R16G16B16A16_SNORM

Vk.format_type(::Val{Vk.FORMAT_R8G8B8_UNORM}) = RGB{N0f8}
Vk.format_type(::Val{Vk.FORMAT_R8G8B8_SNORM}) = RGB{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8_UNORM}) = BGR{N0f8}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8_SNORM}) = BGR{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_R8G8B8A8_UNORM}) = RGBA{N0f8}
Vk.format_type(::Val{Vk.FORMAT_R8G8B8A8_SNORM}) = RGBA{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8A8_UNORM}) = BGRA{N0f8}
Vk.format_type(::Val{Vk.FORMAT_B8G8R8A8_SNORM}) = BGRA{Q0f7}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16_UNORM}) = RGB{N0f16}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16_SNORM}) = RGB{Q0f15}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16A16_UNORM}) = RGBA{N0f16}
Vk.format_type(::Val{Vk.FORMAT_R16G16B16A16_SNORM}) = RGBA{Q0f15}

end
18 changes: 18 additions & 0 deletions ext/VulkanFixedPointNumbersExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module VulkanFixedPointNumbersExt

using Vulkan
using FixedPointNumbers

# generated by `ext/generate_formats.jl`.

Vk.Format(::Type{N0f8}) = FORMAT_R8_UNORM
Vk.Format(::Type{Q0f7}) = FORMAT_R8_SNORM
Vk.Format(::Type{N0f16}) = FORMAT_R16_UNORM
Vk.Format(::Type{Q0f15}) = FORMAT_R16_SNORM

Vk.format_type(::Val{FORMAT_R8_UNORM}) = N0f8
Vk.format_type(::Val{FORMAT_R8_SNORM}) = Q0f7
Vk.format_type(::Val{FORMAT_R16_UNORM}) = N0f16
Vk.format_type(::Val{FORMAT_R16_SNORM}) = Q0f15

end
31 changes: 31 additions & 0 deletions ext/VulkanFixedPointNumbersStaticArraysCoreExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module VulkanFixedPointNumbersStaticArraysCoreExt

using Vulkan
using FixedPointNumbers
using StaticArraysCore: SVector

# generated by `ext/generate_formats.jl`.

Vk.Format(::Type{SVector{2, Q0f7}}) = FORMAT_R8G8_SNORM
Vk.Format(::Type{SVector{3, Q0f7}}) = FORMAT_R8G8B8_SNORM
Vk.Format(::Type{SVector{4, Q0f7}}) = FORMAT_R8G8B8A8_SNORM
Vk.Format(::Type{SVector{2, N0f8}}) = FORMAT_R8G8_UNORM
Vk.Format(::Type{SVector{3, N0f8}}) = FORMAT_R8G8B8_UNORM
Vk.Format(::Type{SVector{4, N0f8}}) = FORMAT_R8G8B8A8_UNORM
Vk.Format(::Type{SVector{2, Q0f15}}) = FORMAT_R16G16_SNORM
Vk.Format(::Type{SVector{3, Q0f15}}) = FORMAT_R16G16B16_SNORM
Vk.Format(::Type{SVector{4, Q0f15}}) = FORMAT_R16G16B16A16_SNORM
Vk.Format(::Type{SVector{2, N0f16}}) = FORMAT_R16G16_UNORM
Vk.Format(::Type{SVector{3, N0f16}}) = FORMAT_R16G16B16_UNORM
Vk.Format(::Type{SVector{4, N0f16}}) = FORMAT_R16G16B16A16_UNORM

Vk.format_type(::Val{FORMAT_R8G8_SNORM}) = SVector{2, Q0f7}
Vk.format_type(::Val{FORMAT_R8G8_UNORM}) = SVector{2, N0f8}
Vk.format_type(::Val{FORMAT_G8B8G8R8_422_UNORM}) = SVector{4, N0f8}
Vk.format_type(::Val{FORMAT_B8G8R8G8_422_UNORM}) = SVector{4, N0f8}
Vk.format_type(::Val{FORMAT_R16G16_SNORM}) = SVector{2, Q0f15}
Vk.format_type(::Val{FORMAT_R16G16_UNORM}) = SVector{2, N0f16}
Vk.format_type(::Val{FORMAT_G16B16G16R16_422_UNORM}) = SVector{4, N0f16}
Vk.format_type(::Val{FORMAT_B16G16R16G16_422_UNORM}) = SVector{4, N0f16}

end
22 changes: 22 additions & 0 deletions ext/VulkanStaticArraysCoreExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module VulkanStaticArraysCoreExt

using Vulkan
using StaticArraysCore: SVector

# generated by `ext/generate_formats.jl`.

Vk.Format(::Type{SVector{2, Float16}}) = FORMAT_R16G16_SFLOAT
Vk.Format(::Type{SVector{3, Float16}}) = FORMAT_R16G16B16_SFLOAT
Vk.Format(::Type{SVector{4, Float16}}) = FORMAT_R16G16B16A16_SFLOAT
Vk.Format(::Type{SVector{2, Float32}}) = FORMAT_R32G32_SFLOAT
Vk.Format(::Type{SVector{3, Float32}}) = FORMAT_R32G32B32_SFLOAT
Vk.Format(::Type{SVector{4, Float32}}) = FORMAT_R32G32B32A32_SFLOAT
Vk.Format(::Type{SVector{2, Float64}}) = FORMAT_R64G64_SFLOAT
Vk.Format(::Type{SVector{3, Float64}}) = FORMAT_R64G64B64_SFLOAT
Vk.Format(::Type{SVector{4, Float64}}) = FORMAT_R64G64B64A64_SFLOAT

Vk.format_type(::Val{FORMAT_R16G16_SFLOAT}) = SVector{2, Float16}
Vk.format_type(::Val{FORMAT_R32G32_SFLOAT}) = SVector{2, Float32}
Vk.format_type(::Val{FORMAT_R64G64_SFLOAT}) = SVector{2, Float64}

end
64 changes: 49 additions & 15 deletions ext/generate_formats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ end
using Vulkan: Vk
using ColorTypes
using FixedPointNumbers
using StaticArrays

NUMERIC_FORMATS = [:SNORM, :UNORM, :UFLOAT, :SFLOAT] #, :UINT, :SINT, :USCALED, :SSCALED]

Expand Down Expand Up @@ -60,35 +61,64 @@ function generate_packed_formats()
vk_formats, packed_types
end

function generate_other_formats()
vk_formats = Vk.Format[]
julia_types = Type[]
function generate_vector_formats()
vk_formats = Pair{Vk.Format,Type}[]
vector_types = Pair{Type,Vk.Format}[]
ispermuted(pattern) = pattern[1] :R
for color_width in (8, 16, 32, 64)
for numeric_format in NUMERIC_FORMATS
rgb_orders = [[:R, :G], [:R, :G, :B], [:G, :B, :G, :R], [:B, :G, :R, :G]]
rgb_orders_with_alpha = filter(order -> length(order) == 3, rgb_orders)
color_patterns = [rgb_orders; [[:A; order] for order in rgb_orders_with_alpha]; [[order; :A] for order in rgb_orders_with_alpha]]
T = component_type(color_width, numeric_format)
patterns = [[:R], [:R, :G], [:G, :B, :G, :R], [:B, :G, :R, :G]]
for pattern in patterns
component_format = join(join.(zip(pattern, fill(color_width, length(pattern)))))
format = Symbol(:FORMAT_, component_format, length(pattern) == 4 ? "_422" : "", '_', numeric_format)
for color_pattern in color_patterns
component_format = join(join.(zip(color_pattern, fill(color_width, 4))))
format = Symbol(:FORMAT_, component_format, !allunique(color_pattern) ? "_422" : "", '_', numeric_format)
if isdefined(Vk, format)
val = getproperty(Vk, format)
julia_type = length(pattern) == 1 ? T : NTuple{length(pattern), T}
push!(vk_formats, val)
push!(julia_types, julia_type)
N = length(color_pattern)
concrete_type = SVector{N,T}
allunique(color_pattern) && push!(vk_formats, val => concrete_type)
# These color patterns are already mapped to ColorTypes types.
!in(color_pattern, ([:R, :G, :B], [:R, :G, :B, :A])) && push!(vector_types, concrete_type => val)
end
end
end
end
vk_formats, vector_types
end

function generate_single_component_formats()
vk_formats = Vk.Format[]
julia_types = Type[]
for color_width in (8, 16, 32, 64)
for numeric_format in NUMERIC_FORMATS
T = component_type(color_width, numeric_format)
format = Symbol(:FORMAT_R, color_width, '_', numeric_format)
if isdefined(Vk, format)
val = getproperty(Vk, format)
push!(vk_formats, val)
push!(julia_types, T)
end
end
end
vk_formats, julia_types
end

function print_mapping(vk_formats, julia_types)
mapping = sort(collect(Dict(vk_formats .=> julia_types)); by = first)
for (format, T) in mapping
if !isa(vk_formats, Vector{Pair{Vk.Format, Type}}) && !isa(julia_types, Vector{Pair{Type, Vk.Format}})
mapping = sort(collect(Dict(vk_formats .=> julia_types)); by = first)
mapping_formats = mapping
mapping_types = reverse.(mapping)
else
mapping_formats = vk_formats
mapping_types = julia_types
end
for (format, T) in mapping_formats
println("Vk.Format(::Type{", T, "}) = ", replace(repr(format), "Vulkan" => "Vk"))
end
println()
for (format, T) in mapping
for (T, format) in mapping_types
println("Vk.format_type(::Val{", replace(repr(format), "Vulkan" => "Vk"), "}) = ", T)
end
end
Expand All @@ -102,8 +132,12 @@ function main()
vk_formats, packed_types = generate_packed_formats()
print_mapping(vk_formats, packed_types)

printstyled("\nOther formats:\n"; color = :yellow)
vk_formats, julia_types = generate_other_formats()
printstyled("\nVector formats:\n"; color = :yellow)
vk_formats, packed_types = generate_vector_formats()
print_mapping(vk_formats, packed_types)

printstyled("\nSingle-component formats:\n"; color = :yellow)
vk_formats, julia_types = generate_single_component_formats()
print_mapping(vk_formats, julia_types)
end

Expand Down
1 change: 0 additions & 1 deletion src/Vulkan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ using Accessors: @set, setproperties
using PrecompileTools
using Libdl: Libdl
using BitMasks
using FixedPointNumbers # for formats.jl

using VulkanCore: VulkanCore, vk
using .vk
Expand Down
23 changes: 0 additions & 23 deletions src/formats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,36 +157,13 @@ Vk.format_type(::Val{Vk.FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16}) = UIn
Vk.format_type(::Val{Vk.FORMAT_A4R4G4B4_UNORM_PACK16}) = UInt16
Vk.format_type(::Val{Vk.FORMAT_A4B4G4R4_UNORM_PACK16}) = UInt16

Vk.Format(::Type{N0f8}) = FORMAT_R8_UNORM
Vk.Format(::Type{Q0f7}) = FORMAT_R8_SNORM
Vk.Format(::Type{Tuple{N0f8, N0f8}}) = FORMAT_R8G8_UNORM
Vk.Format(::Type{Tuple{Q0f7, Q0f7}}) = FORMAT_R8G8_SNORM
Vk.Format(::Type{N0f16}) = FORMAT_R16_UNORM
Vk.Format(::Type{Q0f15}) = FORMAT_R16_SNORM
Vk.Format(::Type{Float16}) = FORMAT_R16_SFLOAT
Vk.Format(::Type{Tuple{N0f16, N0f16}}) = FORMAT_R16G16_UNORM
Vk.Format(::Type{Tuple{Q0f15, Q0f15}}) = FORMAT_R16G16_SNORM
Vk.Format(::Type{Tuple{Float16, Float16}}) = FORMAT_R16G16_SFLOAT
Vk.Format(::Type{Float32}) = FORMAT_R32_SFLOAT
Vk.Format(::Type{Tuple{Float32, Float32}}) = FORMAT_R32G32_SFLOAT
Vk.Format(::Type{Float64}) = FORMAT_R64_SFLOAT
Vk.Format(::Type{Tuple{Float64, Float64}}) = FORMAT_R64G64_SFLOAT

Vk.format_type(::Val{FORMAT_R8_UNORM}) = N0f8
Vk.format_type(::Val{FORMAT_R8_SNORM}) = Q0f7
Vk.format_type(::Val{FORMAT_R8G8_UNORM}) = Tuple{N0f8, N0f8}
Vk.format_type(::Val{FORMAT_R8G8_SNORM}) = Tuple{Q0f7, Q0f7}
Vk.format_type(::Val{FORMAT_R16_UNORM}) = N0f16
Vk.format_type(::Val{FORMAT_R16_SNORM}) = Q0f15
Vk.format_type(::Val{FORMAT_R16_SFLOAT}) = Float16
Vk.format_type(::Val{FORMAT_R16G16_UNORM}) = Tuple{N0f16, N0f16}
Vk.format_type(::Val{FORMAT_R16G16_SNORM}) = Tuple{Q0f15, Q0f15}
Vk.format_type(::Val{FORMAT_R16G16_SFLOAT}) = Tuple{Float16, Float16}
Vk.format_type(::Val{FORMAT_R32_SFLOAT}) = Float32
Vk.format_type(::Val{FORMAT_R32G32_SFLOAT}) = Tuple{Float32, Float32}
Vk.format_type(::Val{FORMAT_R64_SFLOAT}) = Float64
Vk.format_type(::Val{FORMAT_R64G64_SFLOAT}) = Tuple{Float64, Float64}
Vk.format_type(::Val{FORMAT_G8B8G8R8_422_UNORM}) = NTuple{4, N0f8}
Vk.format_type(::Val{FORMAT_B8G8R8G8_422_UNORM}) = NTuple{4, N0f8}
Vk.format_type(::Val{FORMAT_G16B16G16R16_422_UNORM}) = NTuple{4, N0f16}
Vk.format_type(::Val{FORMAT_B16G16R16G16_422_UNORM}) = NTuple{4, N0f16}
Loading

0 comments on commit db8b495

Please sign in to comment.