-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiple extensions to Vk.Format/format_type
- Loading branch information
Showing
11 changed files
with
203 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.