Nebula
Loading...
Searching...
No Matches
vktypes.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "core/types.h"
14#include "coregraphics/config.h"
15
16namespace Vulkan
17{
18
19static const VkComponentSwizzle VkSwizzle[] =
20{
21 VK_COMPONENT_SWIZZLE_IDENTITY,
22 VK_COMPONENT_SWIZZLE_R,
23 VK_COMPONENT_SWIZZLE_G,
24 VK_COMPONENT_SWIZZLE_B,
25 VK_COMPONENT_SWIZZLE_A,
26 VK_COMPONENT_SWIZZLE_ZERO,
27 VK_COMPONENT_SWIZZLE_ONE,
28};
29
31{
32public:
33
35 {
36 uint32_t width;
37 uint32_t height;
38 };
39
40
41
42#pragma region Pixel stuff
46 static bool IsCompressedFormat(VkFormat p);
50 static VkBlockDimensions AsVkBlockSize(VkFormat fmt);
52 static VkFormat AsVkMappableImageFormat(VkFormat fmt);
56 static VkSampleCountFlagBits AsVkSampleFlags(const SizeT samples);
58 static VkImageType AsVkImageType(CoreGraphics::TextureType type);
60 static VkImageViewType AsVkImageViewType(CoreGraphics::TextureType type);
64 static VkImageAspectFlags AsVkImageAspectFlags(const CoreGraphics::ImageBits bits);
66 static VkShaderStageFlags AsVkShaderVisibility(const CoreGraphics::ShaderVisibility vis);
68 static VkImageLayout AsVkImageLayout(const CoreGraphics::ImageLayout layout);
70 static VkPipelineStageFlags AsVkPipelineStage(const CoreGraphics::PipelineStage stage);
72 static VkAccessFlags AsVkAccessFlags(const CoreGraphics::PipelineStage stage);
74 static VkImageLayout AsVkImageLayout(const CoreGraphics::PipelineStage stage, bool depthStencil = false);
75
76#pragma endregion
77
79 static VkPrimitiveTopology AsVkPrimitiveType(CoreGraphics::PrimitiveTopology::Code t);
86};
87} // namespace Vulkan
Code
enums
Definition pixelformat.h:26
Code
enumeration
Definition primitivetopology.h:23
Format
component format
Definition vertexcomponent.h:25
Definition vktypes.h:31
static VkImageLayout AsVkImageLayout(const CoreGraphics::ImageLayout layout)
convert image layout to vulkan
Definition vktypes.cc:493
static VkFormat AsVkMappableImageFormat(VkFormat fmt)
convert Vulkan image compressed format to one which is mappable
Definition vktypes.cc:206
static VkAccessFlags AsVkAccessFlags(const CoreGraphics::PipelineStage stage)
Convert pipeline stage and pipeline access to Vk access flags.
Definition vktypes.cc:599
static VkShaderStageFlags AsVkShaderVisibility(const CoreGraphics::ShaderVisibility vis)
convert shader visibility to vulkan
Definition vktypes.cc:469
static VkImageType AsVkImageType(CoreGraphics::TextureType type)
convert texture type to vk image type
Definition vktypes.cc:316
static CoreGraphics::PixelFormat::Code AsNebulaPixelFormat(VkFormat f)
convert vulkan format back to nebula format
Definition vktypes.cc:372
static VkImageAspectFlags AsVkImageAspectFlags(const CoreGraphics::ImageBits bits)
convert image aspects to Vulkan
Definition vktypes.cc:430
static VkFormat AsVkVertexType(CoreGraphics::VertexComponent::Format f)
convert vertex component type to OGL4 symbolic type (single-element)
Definition vktypes.cc:858
static uint32_t AsVkNumComponents(CoreGraphics::VertexComponent::Format f)
convert vertex format to number of components
Definition vktypes.cc:814
static VkBlockDimensions AsVkBlockSize(CoreGraphics::PixelFormat::Code p)
convert pixel format to block size
Definition vktypes.cc:98
static VkPrimitiveTopology AsVkPrimitiveType(CoreGraphics::PrimitiveTopology::Code t)
convert primitive topology to vulkan
Definition vktypes.cc:753
static bool IsCompressedFormat(VkFormat p)
returns true if format is compressed
Definition vktypes.cc:76
static VkSampleCountFlagBits AsVkSampleFlags(const SizeT samples)
convert uint to vulkan sample count
Definition vktypes.cc:295
static uint32_t AsVkSize(CoreGraphics::VertexComponent::Format f)
convert vertex format to size
Definition vktypes.cc:777
static VkFormat AsVkFormat(CoreGraphics::PixelFormat::Code p)
convert Nebula pixel format to Vulkan pixel format
Definition vktypes.cc:17
static VkFormat AsVkDataFormat(CoreGraphics::PixelFormat::Code p)
convert Nebula pixel format to Vulkan data format
Definition vktypes.cc:259
static VkImageViewType AsVkImageViewType(CoreGraphics::TextureType type)
convert texture type to vk view type
Definition vktypes.cc:344
static VkPipelineStageFlags AsVkPipelineStage(const CoreGraphics::PipelineStage stage)
Convert pipeline stage to Vk pipeline stage.
Definition vktypes.cc:515
ImageLayout
Definition config.h:97
TextureType
texture types
Definition texture.h:30
ShaderVisibility
Definition config.h:60
ImageBits
Definition config.h:82
PipelineStage
Definition config.h:191
Vulkan implementation of GPU acceleration structure.
Definition vkaccelerationstructure.cc:15
static const VkComponentSwizzle VkSwizzle[]
Definition vktypes.h:19
Compile time configuration options for the CoreGraphics subsystem.
Definition vktypes.h:35
uint32_t height
Definition vktypes.h:37
uint32_t width
Definition vktypes.h:36
int SizeT
Definition types.h:49