Unravel Engine C++ Reference
Loading...
Searching...
No Matches
trace_resolution.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
base/basetypes.hpp
>
4
#include <algorithm>
5
#include <cstdint>
6
7
namespace
unravel
8
{
9
18
enum class
trace_resolution
: uint8_t
19
{
20
full
= 1,
21
half
= 2,
22
quarter
= 4,
23
eighth
= 8,
24
};
25
27
inline
auto
get_divisor
(
trace_resolution
res) -> uint32_t
28
{
29
return
static_cast<
uint32_t
>
(res);
30
}
31
33
inline
auto
compute_trace_size
(
const
usize32_t
& ref,
trace_resolution
res) ->
usize32_t
34
{
35
const
uint32_t d =
get_divisor
(res);
36
return
{std::max(1u, ref.width / d), std::max(1u, ref.height / d)};
37
}
38
39
40
}
// namespace unravel
basetypes.hpp
unravel
Definition
crash.cpp:21
unravel::get_divisor
auto get_divisor(trace_resolution res) -> uint32_t
Returns the integer divisor backing the enum value (never zero).
Definition
trace_resolution.h:27
unravel::trace_resolution
trace_resolution
Definition
trace_resolution.h:19
unravel::trace_resolution::half
@ half
unravel::trace_resolution::eighth
@ eighth
unravel::trace_resolution::quarter
@ quarter
unravel::trace_resolution::full
@ full
unravel::compute_trace_size
auto compute_trace_size(const usize32_t &ref, trace_resolution res) -> usize32_t
Computes the trace-target size from a full-resolution reference, clamped to 1x1 min.
Definition
trace_resolution.h:33
size< std::uint32_t >
engine
engine
rendering
pipeline
passes
trace_resolution.h
Generated by
1.12.0