|
ReXGlue SDK
|
Data, texture, vertex and render target formats and conversions. More...
#include <algorithm>#include <bit>#include <rex/assert.h>#include <rex/platform.h>#include <rex/types.h>Go to the source code of this file.
Namespaces | |
| namespace | rex |
Enumerations | |
| enum class | rex::xenos::Endian : u32 { kNone = 0 , k8in16 = 1 , k8in32 = 2 , k16in32 = 3 } |
| enum class | rex::xenos::Endian128 : u32 { kNone = 0 , k8in16 = 1 , k8in32 = 2 , k16in32 = 3 , k8in64 = 4 , k8in128 = 5 } |
| enum class | IndexFormat : u32 { kInt16 , kInt32 } |
| enum class | rex::xenos::SurfaceNumberFormat : u32 { kUnsignedRepeatingFraction = 0 , kSignedRepeatingFraction = 1 , kUnsignedInteger = 2 , kSignedInteger = 3 , kFloat = 7 } |
| enum class | rex::xenos::ColorRenderTargetFormat : u32 { k_8_8_8_8 = 0 , k_8_8_8_8_GAMMA = 1 , k_2_10_10_10 = 2 , k_2_10_10_10_FLOAT = 3 , k_16_16 = 4 , k_16_16_16_16 = 5 , k_16_16_FLOAT = 6 , k_16_16_16_16_FLOAT = 7 , k_2_10_10_10_AS_10_10_10_10 = 10 , k_2_10_10_10_FLOAT_AS_16_16_16_16 = 12 , k_32_FLOAT = 14 , k_32_32_FLOAT = 15 } |
| enum class | rex::xenos::DepthRenderTargetFormat : u32 { kD24S8 = 0 , kD24FS8 = 1 } |
| enum class | rex::xenos::TextureFormat : u32 { k_1_REVERSE = 0 , k_1 = 1 , k_8 = 2 , k_1_5_5_5 = 3 , k_5_6_5 = 4 , k_6_5_5 = 5 , k_8_8_8_8 = 6 , k_2_10_10_10 = 7 , k_8_A = 8 , k_8_B = 9 , k_8_8 = 10 , k_Cr_Y1_Cb_Y0_REP = 11 , k_Y1_Cr_Y0_Cb_REP = 12 , k_16_16_EDRAM = 13 , k_8_8_8_8_A = 14 , k_4_4_4_4 = 15 , k_10_11_11 = 16 , k_11_11_10 = 17 , k_DXT1 = 18 , k_DXT2_3 = 19 , k_DXT4_5 = 20 , k_16_16_16_16_EDRAM = 21 , k_24_8 = 22 , k_24_8_FLOAT = 23 , k_16 = 24 , k_16_16 = 25 , k_16_16_16_16 = 26 , k_16_EXPAND = 27 , k_16_16_EXPAND = 28 , k_16_16_16_16_EXPAND = 29 , k_16_FLOAT = 30 , k_16_16_FLOAT = 31 , k_16_16_16_16_FLOAT = 32 , k_32 = 33 , k_32_32 = 34 , k_32_32_32_32 = 35 , k_32_FLOAT = 36 , k_32_32_FLOAT = 37 , k_32_32_32_32_FLOAT = 38 , k_32_AS_8 = 39 , k_32_AS_8_8 = 40 , k_16_MPEG = 41 , k_16_16_MPEG = 42 , k_8_INTERLACED = 43 , k_32_AS_8_INTERLACED = 44 , k_32_AS_8_8_INTERLACED = 45 , k_16_INTERLACED = 46 , k_16_MPEG_INTERLACED = 47 , k_16_16_MPEG_INTERLACED = 48 , k_DXN = 49 , k_8_8_8_8_AS_16_16_16_16 = 50 , k_DXT1_AS_16_16_16_16 = 51 , k_DXT2_3_AS_16_16_16_16 = 52 , k_DXT4_5_AS_16_16_16_16 = 53 , k_2_10_10_10_AS_16_16_16_16 = 54 , k_10_11_11_AS_16_16_16_16 = 55 , k_11_11_10_AS_16_16_16_16 = 56 , k_32_32_32_FLOAT = 57 , k_DXT3A = 58 , k_DXT5A = 59 , k_CTX1 = 60 , k_DXT3A_AS_1_1_1_1 = 61 , k_8_8_8_8_GAMMA_EDRAM = 62 , k_2_10_10_10_FLOAT_EDRAM = 63 } |
| enum class | rex::xenos::ColorFormat : u32 { k_8 = 2 , k_1_5_5_5 = 3 , k_5_6_5 = 4 , k_6_5_5 = 5 , k_8_8_8_8 = 6 , k_2_10_10_10 = 7 , k_8_A = 8 , k_8_B = 9 , k_8_8 = 10 , k_8_8_8_8_A = 14 , k_4_4_4_4 = 15 , k_10_11_11 = 16 , k_11_11_10 = 17 , k_16 = 24 , k_16_16 = 25 , k_16_16_16_16 = 26 , k_16_FLOAT = 30 , k_16_16_FLOAT = 31 , k_16_16_16_16_FLOAT = 32 , k_32_FLOAT = 36 , k_32_32_FLOAT = 37 , k_32_32_32_32_FLOAT = 38 , k_8_8_8_8_AS_16_16_16_16 = 50 , k_2_10_10_10_AS_16_16_16_16 = 54 , k_10_11_11_AS_16_16_16_16 = 55 , k_11_11_10_AS_16_16_16_16 = 56 } |
| enum class | VertexFormat : u32 { kUndefined = 0 , k_8_8_8_8 = 6 , k_2_10_10_10 = 7 , k_10_11_11 = 16 , k_11_11_10 = 17 , k_16_16 = 25 , k_16_16_16_16 = 26 , k_16_16_FLOAT = 31 , k_16_16_16_16_FLOAT = 32 , k_32 = 33 , k_32_32 = 34 , k_32_32_32_32 = 35 , k_32_FLOAT = 36 , k_32_32_FLOAT = 37 , k_32_32_32_32_FLOAT = 38 , k_32_32_32_FLOAT = 57 } |
Variables | |
| constexpr u32 | rex::xenos::kColorRenderTargetFormatBits = 4 |
| constexpr u32 | rex::xenos::kDepthRenderTargetFormatBits = 1 |
| constexpr u32 | rex::xenos::kRenderTargetFormatBits |
| constexpr u32 | rex::xenos::kFormatBits = 6 |
Data, texture, vertex and render target formats and conversions.
|
strong |
Subset of TextureFormat that render targets can be resolved to.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
inline |
Converts a CPU address to a GPU physical address.
| p | CPU address. |
| f32 rex::xenos::Float20e4To32 | ( | u32 | f24 | ) |
Converts Xenos 20e4 depth to an IEEE 754 32 bit number without clamping.
| f24 | Value in bits 0:23. |
| u32 rex::xenos::Float32To20e4 | ( | f32 | value, |
| bool | round_to_nearest_even ) |
Converts an IEEE 754 32 bit number to Xenos 20e4 depth.
| value | Value to convert. Values not above 0 become 0. |
| round_to_nearest_even | Round to the nearest even value instead of toward 0. |
| f32 rex::xenos::Float7e3To32 | ( | u32 | f10 | ) |
Converts a Xenos 7e3 color value to an IEEE 754 32 bit number without clamping.
| f10 | Value in bits 0:9. |
|
inline |
Converts a 32 bit value to the Xenos 16 bit floating point encoding.
The encoding uses the extended range instead of infinity and NaN, and saturates.
| preserve_denormal | Keep denormalized results instead of flushing them to 0. |
| round_to_nearest_even | Round to the nearest even value instead of toward 0. |
|
inline |
| const char * rex::xenos::GetColorRenderTargetFormatName | ( | ColorRenderTargetFormat | format | ) |
| const char * rex::xenos::GetDepthRenderTargetFormatName | ( | DepthRenderTargetFormat | format | ) |
|
constexpr |
Strips the blending precision modifier from a color render target format.
|
inline |
|
inline |
Returns which 32 bit words of a vertex element hold the used components. The mask uses bits 0:3.
| used_components | Mask of used components in bits 0:3. |
|
inline |
Applies a GPU endian swap to the bits of a 32 bit floating point value.
|
inline |
Applies a GPU endian swap to a 16 bit value.
| endianness | Swap mode, kNone or k8in16. |
|
inline |
Converts a GPU address to a CPU address.
| p | GPU address. |
|
inline |
Converts a Xenos 16 bit floating point value to 32 bits.
| value | 16 bit encoded value. |
| preserve_denormal | Keep denormalized inputs instead of flushing them to 0. |
|
constexpr |
Reports whether a color render target format uses 64 bits per sample.
|
constexpr |
Reports whether resolving a render target format to a color format copies bits unchanged.
Resolves write unsigned data for fixed point formats, so the signed k_16_16 and k_16_16_16_16 render target formats never match.
| f32 rex::xenos::LinearToPWLGamma | ( | f32 | linear | ) |
Converts a linear value to piecewise linear gamma.
| linear | Linear value, saturated before conversion. |
| f32 rex::xenos::PWLGammaToLinear | ( | f32 | gamma | ) |
Converts a piecewise linear gamma value to linear.
| gamma | Gamma value, saturated before conversion. |
|
constexpr |
Converts 24 bit unorm depth to an IEEE 754 32 bit number without clamping.
|
constexpr |
Width of a field that holds either render target format.