TextureFormat
Generated from engine/render/texture_format.h at 0f4f503. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
Audience: renderer writer.
#include "engine/render/texture_format.h" · namespace labrador
enum class TextureFormat
Section titled “enum class TextureFormat”{ r8g8b8a8_unorm, b8g8r8a8_unorm, b4g4r4a4_unorm, bc1_unorm, bc2_unorm, bc3_unorm,};The pixel layouts this engine's content actually arrives in, named in the engine's own vocabulary rather than in any one API's.
WHY THIS EXISTS AT ALL. Both file kinds this engine loads carry a texture and say what format it is in, and both say it as a DXGI number - a .dds because that is the file format, a .spritefont because MakeSpriteFont wrote one down. A DXGI number is a thing the engine may not repeat outside engine/render/<backend>/. This enum is the translation, and the two readers that produce one and the backends that consume one are the whole of its traffic - every backend with a device consumes it, by a different route and with a different answer about what it will take, and the null backend never reads it, because it keeps a width and a height and throws the bytes away.
THE LIST IS WHAT THE CONTENT IS, AND NOTHING ELSE (T1). Art arrives block-compressed as DXT4 or DXT5, and so as bc3_unorm, or uncompressed as b8g8r8a8_unorm. A font atlas is a texture too and is bc2_unorm - the one this repository ships is pinned as such by sprite_font_file_tests.cpp. bc1_unorm and r8g8b8a8_unorm are here because they complete a switch over what a .dds and a .spritefont can say rather than because a file says them, and b4g4r4a4_unorm because MakeSpriteFont offers it. A file naming anything else is rejected by name (T6) rather than passed through to fail as a device error, and this list grows when a real file needs it to.
THE BLOCK-COMPRESSED ENTRIES ARE THE ONES TO WATCH ON A BACKEND, and they are not a corner of the content: compressed art is the common case and every font atlas is one, so a backend that can neither sample them nor decode them has no text and, for most content, no art. Each backend with a device answers one of two ways. engine/render/gl/ asks for S3TC - GL_EXT_texture_compression_s3tc on a desktop driver, where it is universal, and WEBGL_compressed_texture_s3tc in a browser, where desktops have it and most phones do not, GLES 3.0 itself having no S3TC - and on a context without it uploads the pixels block_decode.h decodes from the blocks. engine/render/vulkan/texture_factory.cpp refuses instead and names textureCompressionBC, which the device is asked for when it is selected, because the failure worth having is the one that says which feature is missing rather than the one that draws nothing.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
samples/components/animation_preview_content_tests.cpptests/assets/string_table_text_tests.cpptests/render/block_decode_tests.cpp,dds_file_tests.cpp,presentation_lifecycle_tests.cpp,renderer_seam_tests.cpp,resource_pixel_tests.cpp,sprite_font_file_tests.cpp,sprite_pixel_tests.cpptests/render/d3d12/submit_allocation_tests.cpp,texture_replacement_tests.cpptests/render/vulkan/submit_allocation_tests.cpp,submit_failure_tests.cpptests/scene/cull_tests.cpp,fanout_tests.cpptests/ui/text_widget_tests.cpp
Explained in
Section titled “Explained in”No guide or concept page links to this header yet.
Documentation for Labrador v0.3.0. Built from Labrador 0f4f503 of 2026-11-03.