Commit 5fc3fa9a by Peter Kasting Committed by Angle LUCI CQ

Fix -Wimplicit-int-float-conversions.

Bug: chromium:989932 Change-Id: Id7a49a4bd925508ea0362d1e6b9d853bf860ddb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2987733Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 8b4f6e6d
...@@ -204,12 +204,12 @@ inline void CopyToFloatVertexData(const uint8_t *input, ...@@ -204,12 +204,12 @@ inline void CopyToFloatVertexData(const uint8_t *input,
{ {
if (NL::is_signed) if (NL::is_signed)
{ {
result = static_cast<float>(offsetInput[j]) / NL::max(); result = static_cast<float>(offsetInput[j]) / static_cast<float>(NL::max());
result = result >= -1.0f ? result : -1.0f; result = result >= -1.0f ? result : -1.0f;
} }
else else
{ {
result = static_cast<float>(offsetInput[j]) / NL::max(); result = static_cast<float>(offsetInput[j]) / static_cast<float>(NL::max());
} }
} }
else else
......
...@@ -102,7 +102,8 @@ struct TexFormat final ...@@ -102,7 +102,8 @@ struct TexFormat final
template <const uint8_t bits> template <const uint8_t bits>
constexpr uint32_t EncodeNormUint(const float val) constexpr uint32_t EncodeNormUint(const float val)
{ {
return static_cast<uint32_t>(val * (UINT32_MAX >> (32 - bits)) + 0.5); // round-half-up return static_cast<uint32_t>(val * static_cast<float>(UINT32_MAX >> (32 - bits)) +
0.5f); // round-half-up
} }
} // anonymous namespace } // anonymous namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment