diff options
author | dan sinclair <dj2@everburning.com> | 2019-02-13 15:07:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-13 15:07:56 -0500 |
commit | 50dbc8a0bceca63731f0ccb8c62c69751e67a5f8 (patch) | |
tree | d870e8ebd78b81ce3f5598cd60b2c6209486f3ea /src | |
parent | ce1b67da054ecb9909424f3ad82c482b0aeef1ff (diff) | |
download | amber-50dbc8a0bceca63731f0ccb8c62c69751e67a5f8.tar.gz |
More casts to make CTS happy. (#291)
Diffstat (limited to 'src')
-rw-r--r-- | src/vulkan/vertex_buffer.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/vulkan/vertex_buffer.cc b/src/vulkan/vertex_buffer.cc index de6c21b..a09d64e 100644 --- a/src/vulkan/vertex_buffer.cc +++ b/src/vulkan/vertex_buffer.cc @@ -47,25 +47,28 @@ uint32_t FloatMantissa(const uint32_t hex_float) { // Convert 32 bits float |value| to 16 bits float based on IEEE-754. uint16_t FloatToHexFloat16(const float value) { const uint32_t* hex = reinterpret_cast<const uint32_t*>(&value); - return static_cast<uint16_t>(FloatSign(*hex) << 15U) | - static_cast<uint16_t>(FloatExponent(*hex) << 10U) | - static_cast<uint16_t>(FloatMantissa(*hex) >> 13U); + return static_cast<uint16_t>( + static_cast<uint16_t>(FloatSign(*hex) << 15U) | + static_cast<uint16_t>(FloatExponent(*hex) << 10U) | + static_cast<uint16_t>(FloatMantissa(*hex) >> 13U)); } // Convert 32 bits float |value| to 11 bits float based on IEEE-754. uint16_t FloatToHexFloat11(const float value) { const uint32_t* hex = reinterpret_cast<const uint32_t*>(&value); assert(FloatSign(*hex) == 0); - return static_cast<uint16_t>(FloatExponent(*hex) << 6U) | - static_cast<uint16_t>(FloatMantissa(*hex) >> 17U); + return static_cast<uint16_t>( + static_cast<uint16_t>(FloatExponent(*hex) << 6U) | + static_cast<uint16_t>(FloatMantissa(*hex) >> 17U)); } // Convert 32 bits float |value| to 10 bits float based on IEEE-754. uint16_t FloatToHexFloat10(const float value) { const uint32_t* hex = reinterpret_cast<const uint32_t*>(&value); assert(FloatSign(*hex) == 0); - return static_cast<uint16_t>(FloatExponent(*hex) << 5U) | - static_cast<uint16_t>(FloatMantissa(*hex) >> 18U); + return static_cast<uint16_t>( + static_cast<uint16_t>(FloatExponent(*hex) << 5U) | + static_cast<uint16_t>(FloatMantissa(*hex) >> 18U)); } // Convert float to small float format. |