Commit 63aa0e5b by Will Harris Committed by Commit Bot

Fix 64-bit -> 32-bit implicit conversions in libangle.

../../third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp(910,63): warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long long') to 'GLuint' (aka 'unsigned int') [-Wshorten-64-to-32] const gl::ImageUnit &imageUnit = glState.getImageUnit(imageUnitIndex); ~~~~~~~~~~~~ ^~~~~~~~~~~~~~ ../../third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp(914,30): warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long long') to 'GLuint' (aka 'unsigned int') [-Wshorten-64-to-32] bindImageTexture(imageUnitIndex, textureGL->getTextureID(), imageUnit.level, ~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~ ../../third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp(920,30): warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long long') to 'GLuint' (aka 'unsigned int') [-Wshorten-64-to-32] bindImageTexture(imageUnitIndex, 0, imageUnit.level, imageUnit.layered, imageUnit.layer, ~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~ ../../third_party/angle/src/tests/gl_tests/VertexAttributeTest.cpp(1080,66): warning: implicit conversion loses integer precision: 'GLsizeiptr' (aka 'long long') to 'GLuint' (aka 'unsigned int') [-Wshorten-64-to-32] glVertexAttribFormat(mTestAttrib, 1, GL_FLOAT, GL_FALSE, inputRelativeOffset); ~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~ BUG=chromium:879657 Change-Id: Ic6e8e5ebc0dc5fd38c15a48a936ceafd5407bba8 Reviewed-on: https://chromium-review.googlesource.com/1208315 Commit-Queue: Will Harris <wfh@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 8e9d2340
......@@ -2864,7 +2864,7 @@ void State::onProgramExecutableChange(Program *program)
}
void State::setImageUnit(const Context *context,
GLuint unit,
size_t unit,
Texture *texture,
GLint level,
GLboolean layered,
......@@ -2880,7 +2880,7 @@ void State::setImageUnit(const Context *context,
mImageUnits[unit].format = format;
}
const ImageUnit &State::getImageUnit(GLuint unit) const
const ImageUnit &State::getImageUnit(size_t unit) const
{
return mImageUnits[unit];
}
......
......@@ -464,7 +464,7 @@ class State : angle::NonCopyable
AttributesMask getAndResetDirtyCurrentValues() const;
void setImageUnit(const Context *context,
GLuint unit,
size_t unit,
Texture *texture,
GLint level,
GLboolean layered,
......@@ -472,7 +472,7 @@ class State : angle::NonCopyable
GLenum access,
GLenum format);
const ImageUnit &getImageUnit(GLuint unit) const;
const ImageUnit &getImageUnit(size_t unit) const;
const ActiveTexturePointerArray &getActiveTexturesCache() const { return mActiveTexturesCache; }
ComponentTypeMask getCurrentValuesTypeMask() const { return mCurrentValuesTypeMask; }
......
......@@ -12,6 +12,7 @@
#include <algorithm>
#include <limits>
#include "anglebase/numerics/safe_conversions.h"
#include "common/bitset_utils.h"
#include "common/mathutil.h"
#include "common/matrix_utils.h"
......@@ -249,8 +250,7 @@ void StateManagerGL::deleteTexture(GLuint texture)
{
if (mImages[imageUnitIndex].texture == texture)
{
bindImageTexture(static_cast<GLuint>(imageUnitIndex), 0, 0, false, 0, GL_READ_ONLY,
GL_R32UI);
bindImageTexture(imageUnitIndex, 0, 0, false, 0, GL_READ_ONLY, GL_R32UI);
}
}
......@@ -450,7 +450,7 @@ void StateManagerGL::bindSampler(size_t unit, GLuint sampler)
}
}
void StateManagerGL::bindImageTexture(GLuint unit,
void StateManagerGL::bindImageTexture(size_t unit,
GLuint texture,
GLint level,
GLboolean layered,
......@@ -468,7 +468,8 @@ void StateManagerGL::bindImageTexture(GLuint unit,
binding.layer = layer;
binding.access = access;
binding.format = format;
mFunctions->bindImageTexture(unit, texture, level, layered, layer, access, format);
mFunctions->bindImageTexture(angle::base::checked_cast<GLuint>(unit), texture, level,
layered, layer, access, format);
}
}
......
......@@ -64,7 +64,7 @@ class StateManagerGL final : angle::NonCopyable
void activeTexture(size_t unit);
void bindTexture(gl::TextureType type, GLuint texture);
void bindSampler(size_t unit, GLuint sampler);
void bindImageTexture(GLuint unit,
void bindImageTexture(size_t unit,
GLuint texture,
GLint level,
GLboolean layered,
......
......@@ -4,6 +4,7 @@
// found in the LICENSE file.
//
#include "anglebase/numerics/safe_conversions.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
......@@ -1077,7 +1078,8 @@ class VertexAttributeTestES31 : public VertexAttributeTestES3
glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
glBufferData(GL_ARRAY_BUFFER, inputSize, nullptr, GL_STATIC_DRAW);
glBufferSubData(GL_ARRAY_BUFFER, 0, inputSize, inputData.data());
glVertexAttribFormat(mTestAttrib, 1, GL_FLOAT, GL_FALSE, inputRelativeOffset);
glVertexAttribFormat(mTestAttrib, 1, GL_FLOAT, GL_FALSE,
base::checked_cast<GLuint>(inputRelativeOffset));
glBindVertexBuffer(mTestAttrib, mBuffer, 0, inputStride);
glEnableVertexAttribArray(mTestAttrib);
......
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