Commit 19209666 by Peter Kasting Committed by Angle LUCI CQ

Fix -Wc++11-narrowing in ANGLE.

This adds a few explicit casts where necessary and changes some double constants to floats to avoid truncation. Bug: chromium:1216696 Change-Id: Ie1a3ad94284185fb20a6feff75290cabb7ee09e8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950320Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 87b8d32a
......@@ -4415,8 +4415,9 @@ TEST_P(GLSLTest_ES31, ArraysOfArraysStructDifferentTypesSampler)
glActiveTexture(GL_TEXTURE0 + textureUnit);
glBindTexture(GL_TEXTURE_2D, textures[i][j][k]);
GLint texData[4] = {i + 1, j + 1, k + 1, 1};
GLubyte texDataFloat[4] = {(i + 1) * 64 - 1, (j + 1) * 64 - 1, (k + 1) * 64 - 1,
64};
GLubyte texDataFloat[4] = {static_cast<GLubyte>((i + 1) * 64 - 1),
static_cast<GLubyte>((j + 1) * 64 - 1),
static_cast<GLubyte>((k + 1) * 64 - 1), 64};
if (j == 0)
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32I, 1, 1, 0, GL_RGBA_INTEGER, GL_INT,
......
......@@ -2513,7 +2513,7 @@ void MemoryBarrierTestBase::textureUpdateBitImageWriteThenCopy(ShaderWritePipeli
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, kTextureSize, kTextureSize);
const std::array<float, 4> kExpectedData = {
0, 1.0, writePipeline == ShaderWritePipeline::Graphics ? 1.0 : 0, 1.0};
0, 1.0f, writePipeline == ShaderWritePipeline::Graphics ? 1.0f : 0, 1.0f};
verifyFramebufferAndImageContents(writePipeline, writeResource, texture, kExpectedData);
}
......
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