Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
HdrFormat.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
14#pragma once
15
16#include "../../core/Types.hpp"
17#include "../rhi/GfxEnums.hpp"
18
19namespace esengine {
20
29
31inline const char* hdrRefusalName(HdrRefusal why) {
32 switch (why) {
33 case HdrRefusal::FloatTargetsUnsupported: return "float targets unsupported";
34 case HdrRefusal::None: break;
35 }
36 return "none";
37}
38
47inline const char* pixelFormatName(GfxPixelFormat format) {
48 switch (format) {
49 case GfxPixelFormat::RGB8: return "RGB8";
50 case GfxPixelFormat::RGBA8: return "RGBA8";
51 case GfxPixelFormat::SRGB8_ALPHA8: return "SRGB8_ALPHA8";
52 case GfxPixelFormat::RGBA16F: return "RGBA16F";
53 case GfxPixelFormat::RGBA32F: return "RGBA32F";
54 case GfxPixelFormat::DepthComponent24: return "DepthComponent24";
55 case GfxPixelFormat::Depth24Stencil8: return "Depth24Stencil8";
56 }
57 return "unknown";
58}
59
74
82inline HdrFormatDecision decideHdrFormat(bool linearOutput, bool supportsFloatTargets) {
83 if (!linearOutput) return {GfxPixelFormat::RGBA8, GfxPixelFormat::RGBA8, HdrRefusal::None, false};
84 if (supportsFloatTargets) {
86 }
89}
90
91} // namespace esengine
Backend-agnostic graphics enumerations.
Core type definitions and utilities for ESEngine.
const char * pixelFormatName(GfxPixelFormat format)
A pixel format as a word.
Definition HdrFormat.hpp:47
HdrRefusal
Why the effective format is not the requested one.
Definition HdrFormat.hpp:22
HdrFormatDecision decideHdrFormat(bool linearOutput, bool supportsFloatTargets)
What a linear project asks for, and what supportsFloatTargets grants.
Definition HdrFormat.hpp:82
std::uint8_t u8
Unsigned 8-bit integer.
Definition Types.hpp:41
const char * hdrRefusalName(HdrRefusal why)
The refusal as a word, for a log line and for a reader.
Definition HdrFormat.hpp:31
The format decision one frame committed to.
Definition HdrFormat.hpp:67
bool linear
Whether the project asked for a linear pipeline at all this frame.
Definition HdrFormat.hpp:72