MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk::anonymous_namespace{mxvk.cpp} Namespace Reference

Functions

float half_to_float (uint16_t value) noexcept
bool shouldLogMissingValidationLayer ()

Function Documentation

◆ half_to_float()

float mxvk::anonymous_namespace{mxvk.cpp}::half_to_float ( uint16_t value)
nodiscardnoexcept

Definition at line 46 of file mxvk.cpp.

46 {
47 const bool negative = (value & 0x8000U) != 0U;
48 const uint32_t exponent = (value >> 10U) & 0x1FU;
49 const uint32_t mantissa = value & 0x3FFU;
50 float result = 0.0F;
51 if (exponent == 0U) {
52 result = std::ldexp(static_cast<float>(mantissa), -24);
53 } else if (exponent == 31U) {
54 result = mantissa == 0U ? std::numeric_limits<float>::infinity() : std::numeric_limits<float>::quiet_NaN();
55 } else {
56 result = std::ldexp(1.0F + static_cast<float>(mantissa) / 1024.0F, static_cast<int>(exponent) - 15);
57 }
58 return negative ? -result : result;
59 }

◆ shouldLogMissingValidationLayer()

bool mxvk::anonymous_namespace{mxvk.cpp}::shouldLogMissingValidationLayer ( )

Definition at line 61 of file mxvk.cpp.

61 {
62 const char *quiet_missing_validation = std::getenv("MXVK_QUIET_MISSING_VALIDATION");
63 return quiet_missing_validation == nullptr || std::strcmp(quiet_missing_validation, "1") != 0;
64 }