Commit 5201ce12 by Geoff Lang Committed by Commit Bot

Fix MSVC 2015 warnings.

BUG=angleproject:2258 Change-Id: I280eb0e461fd749b01594bb1bb9a417f2cbc23fa Reviewed-on: https://chromium-review.googlesource.com/793975Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent df68ca50
...@@ -1326,7 +1326,7 @@ void SetFramebufferParameteri(Framebuffer *framebuffer, GLenum pname, GLint para ...@@ -1326,7 +1326,7 @@ void SetFramebufferParameteri(Framebuffer *framebuffer, GLenum pname, GLint para
framebuffer->setDefaultSamples(param); framebuffer->setDefaultSamples(param);
break; break;
case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS: case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS:
framebuffer->setDefaultFixedSampleLocations(CastQueryValueTo<GLboolean>(pname, param)); framebuffer->setDefaultFixedSampleLocations(ConvertToBool(param));
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
......
...@@ -102,8 +102,7 @@ struct TexFormat final ...@@ -102,8 +102,7 @@ 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)
{ {
constexpr auto max = UINT32_MAX >> (32 - bits); return static_cast<uint32_t>(val * (UINT32_MAX >> (32 - bits)) + 0.5); // round-half-up
return static_cast<uint32_t>(val * max + 0.5); // round-half-up
} }
template <const int signBit, const int eBits, const int mBits> template <const int signBit, const int eBits, const int mBits>
...@@ -587,8 +586,10 @@ TEST_P(TextureUploadFormatTest, All) ...@@ -587,8 +586,10 @@ TEST_P(TextureUploadFormatTest, All)
// RGBA_INTEGER+UNSIGNED_INT_2_10_10_10_REV // RGBA_INTEGER+UNSIGNED_INT_2_10_10_10_REV
{ {
constexpr uint32_t src[] = {(srcIntVals[0] << 0) | (srcIntVals[1] << 10) | constexpr uint32_t src[] = {static_cast<uint32_t>(srcIntVals[0] << 0) |
(srcIntVals[2] << 20) | (srcIntVals[3] << 30)}; static_cast<uint32_t>(srcIntVals[1] << 10) |
static_cast<uint32_t>(srcIntVals[2] << 20) |
static_cast<uint32_t>(srcIntVals[3] << 30)};
ZeroAndCopy(srcBuffer, src); ZeroAndCopy(srcBuffer, src);
fnTest({GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV}, {1, 1, 1, 1}); fnTest({GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV}, {1, 1, 1, 1});
......
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