2#include <vulkan/vulkan_core.h>
53 return VK_FORMAT_R8_SRGB;
57 return VK_FORMAT_R8_UNORM;
66 return VK_FORMAT_R8G8_SRGB;
70 return VK_FORMAT_R8G8_UNORM;
79 return VK_FORMAT_R8G8B8_SRGB;
83 return VK_FORMAT_R8G8B8_UNORM;
93 return VK_FORMAT_R8G8B8A8_SRGB;
97 return VK_FORMAT_R8G8B8A8_UNORM;
105 switch (components) {
106 case 1:
return VK_FORMAT_R16_SFLOAT;
107 case 2:
return VK_FORMAT_R16G16_SFLOAT;
108 case 3:
return VK_FORMAT_R16G16B16_SFLOAT;
110 default:
return VK_FORMAT_R16G16B16A16_SFLOAT;
116 switch (components) {
117 case 1:
return VK_FORMAT_R32_SFLOAT;
118 case 2:
return VK_FORMAT_R32G32_SFLOAT;
119 case 3:
return VK_FORMAT_R32G32B32_SFLOAT;
121 default:
return VK_FORMAT_R32G32B32A32_SFLOAT;
126 return VK_FORMAT_R8G8B8A8_SRGB;
Log category system implementation.
constexpr VkFormat getVkFormat(TextureType type, int bits, int components)
Get the correct VkFormat based on texture type and image properties.
constexpr bool requiresLinearFormat(TextureType type)
Check if a texture type requires linear (non-SRGB) format.
TextureType
Represents the semantic type of a texture, determining its Vulkan format.
@ Lightmap
HDR baked lighting data (SFLOAT format)
@ Emissive
Color data with gamma (SRGB format for 8-bit)
@ BaseColor
Color data with gamma (SRGB format for 8-bit)
@ Unknown
Fallback type, uses SRGB as default.
@ Normal
Linear data for normal maps (UNORM format for 8-bit)
@ MetallicRoughness
Linear data for PBR parameters (UNORM format for 8-bit)