Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'"
Seems to have quite a few warnings in 64-bit on my machine.
BUG=angleproject:1120
This reverts commit c5cf9bc47d0ee028adbbf9e9f94ca567eec601dc.
Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9
Reviewed-on: https://chromium-review.googlesource.com/293280
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/BufferD3D.cpp b/src/libANGLE/renderer/d3d/BufferD3D.cpp
index 20fc82a..93ccd1d 100644
--- a/src/libANGLE/renderer/d3d/BufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/BufferD3D.cpp
@@ -116,7 +116,7 @@
return error;
}
- *outRange = gl::ComputeIndexRange(type, data + offset, static_cast<GLsizei>(count));
+ *outRange = gl::ComputeIndexRange(type, data + offset, count);
return gl::Error(GL_NO_ERROR);
}
diff --git a/src/libANGLE/renderer/d3d/DynamicHLSL.cpp b/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
index 7a12d36..3717f35 100644
--- a/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
+++ b/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
@@ -517,9 +517,8 @@
// corresponding to unwritten variables are similarly undefined.
if (outputVariable)
{
- declarationHLSL += " " + HLSLTypeString(outputVariable->type) + " " +
- outputVariable->name + " : " + targetSemantic +
- Str(static_cast<int>(layoutIndex)) + ";\n";
+ declarationHLSL += " " + HLSLTypeString(outputVariable->type) + " " + outputVariable->name +
+ " : " + targetSemantic + Str(layoutIndex) + ";\n";
copyHLSL += " output." + outputVariable->name + " = " + outputVariable->source + ";\n";
}
diff --git a/src/libANGLE/renderer/d3d/IndexDataManager.cpp b/src/libANGLE/renderer/d3d/IndexDataManager.cpp
index 1605590..c7c865b 100644
--- a/src/libANGLE/renderer/d3d/IndexDataManager.cpp
+++ b/src/libANGLE/renderer/d3d/IndexDataManager.cpp
@@ -222,8 +222,7 @@
}
ASSERT(bufferData != nullptr);
- unsigned int convertCount =
- static_cast<unsigned int>(buffer->getSize()) >> srcTypeInfo.bytesShift;
+ unsigned int convertCount = buffer->getSize() >> srcTypeInfo.bytesShift;
error = StreamInIndexBuffer(staticBuffer, bufferData, convertCount,
srcType, dstType, nullptr);
if (error.isError())
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index 9290914..3532634 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -90,8 +90,7 @@
if (!shaderOutputVars.empty())
{
- defaultPixelOutput.push_back(GL_COLOR_ATTACHMENT0 +
- static_cast<unsigned int>(shaderOutputVars[0].outputIndex));
+ defaultPixelOutput.push_back(GL_COLOR_ATTACHMENT0 + shaderOutputVars[0].outputIndex);
}
return defaultPixelOutput;
@@ -949,7 +948,7 @@
else if (!infoLog)
{
std::vector<char> tempCharBuffer(tempInfoLog.getLength() + 3);
- tempInfoLog.getLog(static_cast<GLsizei>(tempInfoLog.getLength()), NULL, &tempCharBuffer[0]);
+ tempInfoLog.getLog(tempInfoLog.getLength(), NULL, &tempCharBuffer[0]);
ERR("Error compiling dynamic pixel executable:\n%s\n", &tempCharBuffer[0]);
}
@@ -997,7 +996,7 @@
else if (!infoLog)
{
std::vector<char> tempCharBuffer(tempInfoLog.getLength() + 3);
- tempInfoLog.getLog(static_cast<GLsizei>(tempInfoLog.getLength()), NULL, &tempCharBuffer[0]);
+ tempInfoLog.getLog(tempInfoLog.getLength(), NULL, &tempCharBuffer[0]);
ERR("Error compiling dynamic vertex executable:\n%s\n", &tempCharBuffer[0]);
}
@@ -1254,7 +1253,7 @@
void ProgramD3D::dirtyAllUniforms()
{
- unsigned int numUniforms = static_cast<unsigned int>(mUniforms.size());
+ unsigned int numUniforms = mUniforms.size();
for (unsigned int index = 0; index < numUniforms; index++)
{
mUniforms[index]->dirty = true;
@@ -1510,8 +1509,7 @@
ASSERT(linkedUniform);
if (encoder)
- linkedUniform->registerElement = static_cast<unsigned int>(
- sh::HLSLBlockEncoder::getBlockRegisterElement(blockInfo));
+ linkedUniform->registerElement = sh::HLSLBlockEncoder::getBlockRegisterElement(blockInfo);
mUniforms.push_back(linkedUniform);
}
@@ -1519,13 +1517,11 @@
{
if (shader->getShaderType() == GL_FRAGMENT_SHADER)
{
- linkedUniform->psRegisterIndex =
- static_cast<unsigned int>(sh::HLSLBlockEncoder::getBlockRegister(blockInfo));
+ linkedUniform->psRegisterIndex = sh::HLSLBlockEncoder::getBlockRegister(blockInfo);
}
else if (shader->getShaderType() == GL_VERTEX_SHADER)
{
- linkedUniform->vsRegisterIndex =
- static_cast<unsigned int>(sh::HLSLBlockEncoder::getBlockRegister(blockInfo));
+ linkedUniform->vsRegisterIndex = sh::HLSLBlockEncoder::getBlockRegister(blockInfo);
}
else UNREACHABLE();
}
@@ -1825,7 +1821,7 @@
blockIndex, memberInfo);
// add to uniform list, but not index, since uniform block uniforms have no location
- blockUniformIndexes->push_back(static_cast<GLenum>(mUniforms.size()));
+ blockUniformIndexes->push_back(mUniforms.size());
mUniforms.push_back(newUniform);
}
}
@@ -1842,7 +1838,7 @@
if (getUniformBlockIndex(interfaceBlock.name) == GL_INVALID_INDEX)
{
std::vector<unsigned int> blockUniformIndexes;
- const unsigned int blockIndex = static_cast<unsigned int>(mUniformBlocks.size());
+ const unsigned int blockIndex = mUniformBlocks.size();
// define member uniforms
sh::BlockLayoutEncoder *encoder = NULL;
@@ -1859,7 +1855,7 @@
defineUniformBlockMembers(interfaceBlock.fields, "", blockIndex, encoder, &blockUniformIndexes, interfaceBlock.isRowMajorLayout);
- unsigned int dataSize = static_cast<unsigned int>(encoder->getBlockSize());
+ size_t dataSize = encoder->getBlockSize();
// create all the uniform blocks
if (interfaceBlock.arraySize > 0)
@@ -1999,8 +1995,7 @@
if (!uniform.isBuiltIn())
{
// Assign in-order uniform locations
- mUniformIndex[static_cast<GLuint>(mUniformIndex.size())] = gl::VariableLocation(
- uniform.name, arrayIndex, static_cast<unsigned int>(uniformIndex));
+ mUniformIndex[mUniformIndex.size()] = gl::VariableLocation(uniform.name, arrayIndex, uniformIndex);
}
}
}
diff --git a/src/libANGLE/renderer/d3d/RenderbufferD3D.cpp b/src/libANGLE/renderer/d3d/RenderbufferD3D.cpp
index d8ec8ac..7c3c611 100644
--- a/src/libANGLE/renderer/d3d/RenderbufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/RenderbufferD3D.cpp
@@ -53,9 +53,7 @@
}
RenderTargetD3D *newRT = NULL;
- gl::Error error =
- mRenderer->createRenderTarget(static_cast<int>(width), static_cast<int>(height),
- creationFormat, static_cast<GLsizei>(samples), &newRT);
+ gl::Error error = mRenderer->createRenderTarget(width, height, creationFormat, samples, &newRT);
if (error.isError())
{
return error;
diff --git a/src/libANGLE/renderer/d3d/RendererD3D.cpp b/src/libANGLE/renderer/d3d/RendererD3D.cpp
index c64b1f8..4c7ebb4 100644
--- a/src/libANGLE/renderer/d3d/RendererD3D.cpp
+++ b/src/libANGLE/renderer/d3d/RendererD3D.cpp
@@ -239,9 +239,9 @@
{
gl::Program *program = data.state->getProgram();
- unsigned int samplerRange = static_cast<unsigned int>(program->getUsedSamplerRange(type));
+ size_t samplerRange = program->getUsedSamplerRange(type);
- for (unsigned int i = 0; i < samplerRange; i++)
+ for (size_t i = 0; i < samplerRange; i++)
{
GLenum textureType = program->getSamplerTextureType(type, i);
GLint textureUnit = program->getSamplerMapping(type, i, *data.caps);
@@ -390,8 +390,8 @@
{
gl::Program *program = data.state->getProgram();
- unsigned int samplerRange = program->getUsedSamplerRange(shaderType);
- for (unsigned int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++)
+ size_t samplerRange = program->getUsedSamplerRange(shaderType);
+ for (size_t samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++)
{
GLenum textureType = program->getSamplerTextureType(shaderType, samplerIndex);
GLint textureUnit = program->getSamplerMapping(shaderType, samplerIndex, *data.caps);
diff --git a/src/libANGLE/renderer/d3d/TextureD3D.cpp b/src/libANGLE/renderer/d3d/TextureD3D.cpp
index 3a10db6..1992af5 100644
--- a/src/libANGLE/renderer/d3d/TextureD3D.cpp
+++ b/src/libANGLE/renderer/d3d/TextureD3D.cpp
@@ -691,21 +691,14 @@
return gl::GetInternalFormatInfo(getInternalFormat(level)).depthBits > 0;
}
-gl::Error TextureD3D_2D::setImage(GLenum target,
- size_t imageLevel,
- GLenum internalFormat,
- const gl::Extents &size,
- GLenum format,
- GLenum type,
- const gl::PixelUnpackState &unpack,
- const uint8_t *pixels)
+gl::Error TextureD3D_2D::setImage(GLenum target, size_t level, GLenum internalFormat, const gl::Extents &size, GLenum format, GLenum type,
+ const gl::PixelUnpackState &unpack, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_2D && size.depth == 1);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, type);
bool fastUnpacked = false;
- GLint level = static_cast<GLint>(imageLevel);
redefineImage(level, sizedInternalFormat, size);
@@ -748,13 +741,8 @@
return gl::Error(GL_NO_ERROR);
}
-gl::Error TextureD3D_2D::setSubImage(GLenum target,
- size_t imageLevel,
- const gl::Box &area,
- GLenum format,
- GLenum type,
- const gl::PixelUnpackState &unpack,
- const uint8_t *pixels)
+gl::Error TextureD3D_2D::setSubImage(GLenum target, size_t level, const gl::Box &area, GLenum format, GLenum type,
+ const gl::PixelUnpackState &unpack, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_2D && area.depth == 1 && area.z == 0);
@@ -764,7 +752,6 @@
return gl::Error(GL_INVALID_OPERATION, "unimplemented pixel store state");
}
- GLint level = static_cast<GLint>(imageLevel);
gl::ImageIndex index = gl::ImageIndex::Make2D(level);
if (isFastUnpackable(unpack, getInternalFormat(level)) && isLevelComplete(level))
{
@@ -785,16 +772,11 @@
}
}
-gl::Error TextureD3D_2D::setCompressedImage(GLenum target,
- size_t imageLevel,
- GLenum internalFormat,
- const gl::Extents &size,
- const gl::PixelUnpackState &unpack,
- size_t imageSize,
- const uint8_t *pixels)
+
+gl::Error TextureD3D_2D::setCompressedImage(GLenum target, size_t level, GLenum internalFormat, const gl::Extents &size,
+ const gl::PixelUnpackState &unpack, size_t imageSize, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_2D && size.depth == 1);
- GLint level = static_cast<GLint>(imageLevel);
// compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
redefineImage(level, internalFormat, size);
@@ -807,7 +789,7 @@
{
ASSERT(target == GL_TEXTURE_2D && area.depth == 1 && area.z == 0);
- gl::ImageIndex index = gl::ImageIndex::Make2D(static_cast<GLint>(level));
+ gl::ImageIndex index = gl::ImageIndex::Make2D(level);
gl::Error error = TextureD3D::subImageCompressed(index, area, format, unpack, pixels, 0);
if (error.isError())
{
@@ -817,15 +799,11 @@
return commitRegion(index, area);
}
-gl::Error TextureD3D_2D::copyImage(GLenum target,
- size_t imageLevel,
- const gl::Rectangle &sourceArea,
- GLenum internalFormat,
+gl::Error TextureD3D_2D::copyImage(GLenum target, size_t level, const gl::Rectangle &sourceArea, GLenum internalFormat,
const gl::Framebuffer *source)
{
ASSERT(target == GL_TEXTURE_2D);
- GLint level = static_cast<GLint>(imageLevel);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, GL_UNSIGNED_BYTE);
redefineImage(level, sizedInternalFormat, gl::Extents(sourceArea.width, sourceArea.height, 1));
@@ -867,10 +845,7 @@
return gl::Error(GL_NO_ERROR);
}
-gl::Error TextureD3D_2D::copySubImage(GLenum target,
- size_t imageLevel,
- const gl::Offset &destOffset,
- const gl::Rectangle &sourceArea,
+gl::Error TextureD3D_2D::copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea,
const gl::Framebuffer *source)
{
ASSERT(target == GL_TEXTURE_2D && destOffset.z == 0);
@@ -878,7 +853,6 @@
// can only make our texture storage to a render target if level 0 is defined (with a width & height) and
// the current level we're copying to is defined (with appropriate format, width & height)
- GLint level = static_cast<GLint>(imageLevel);
gl::ImageIndex index = gl::ImageIndex::Make2D(level);
// If the zero max LOD workaround is active, then we can't sample from individual layers of the framebuffer in shaders,
@@ -934,15 +908,14 @@
mImageArray[level]->redefine(GL_TEXTURE_2D, internalFormat, levelSize, true);
}
- for (size_t level = levels; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
+ for (int level = levels; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
{
mImageArray[level]->redefine(GL_TEXTURE_2D, GL_NONE, gl::Extents(0, 0, 0), true);
}
// TODO(geofflang): Verify storage creation had no errors
bool renderTarget = IsRenderTargetUsage(mUsage);
- TextureStorage *storage = mRenderer->createTextureStorage2D(
- internalFormat, renderTarget, size.width, size.height, static_cast<int>(levels), false);
+ TextureStorage *storage = mRenderer->createTextureStorage2D(internalFormat, renderTarget, size.width, size.height, levels, false);
gl::Error error = setCompleteTexStorage(storage);
if (error.isError())
@@ -1343,9 +1316,9 @@
ASSERT(size.depth == 1);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, type);
- gl::ImageIndex index = gl::ImageIndex::MakeCube(target, static_cast<GLint>(level));
+ gl::ImageIndex index = gl::ImageIndex::MakeCube(target, level);
- redefineImage(index.layerIndex, static_cast<GLint>(level), sizedInternalFormat, size);
+ redefineImage(index.layerIndex, level, sizedInternalFormat, size);
return TextureD3D::setImage(index, type, unpack, pixels, 0);
}
@@ -1355,7 +1328,7 @@
{
ASSERT(area.depth == 1 && area.z == 0);
- gl::ImageIndex index = gl::ImageIndex::MakeCube(target, static_cast<GLint>(level));
+ gl::ImageIndex index = gl::ImageIndex::MakeCube(target, level);
return TextureD3D::subImage(index, area, format, type, unpack, pixels, 0);
}
@@ -1367,9 +1340,9 @@
// compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
size_t faceIndex = gl::CubeMapTextureTargetToLayerIndex(target);
- redefineImage(static_cast<int>(faceIndex), static_cast<GLint>(level), internalFormat, size);
+ redefineImage(faceIndex, level, internalFormat, size);
- gl::ImageIndex index = gl::ImageIndex::MakeCube(target, static_cast<GLint>(level));
+ gl::ImageIndex index = gl::ImageIndex::MakeCube(target, level);
return TextureD3D::setCompressedImage(index, unpack, pixels, 0);
}
@@ -1378,7 +1351,7 @@
{
ASSERT(area.depth == 1 && area.z == 0);
- gl::ImageIndex index = gl::ImageIndex::MakeCube(target, static_cast<GLint>(level));
+ gl::ImageIndex index = gl::ImageIndex::MakeCube(target, level);
gl::Error error = TextureD3D::subImageCompressed(index, area, format, unpack, pixels, 0);
if (error.isError())
@@ -1389,19 +1362,14 @@
return commitRegion(index, area);
}
-gl::Error TextureD3D_Cube::copyImage(GLenum target,
- size_t imageLevel,
- const gl::Rectangle &sourceArea,
- GLenum internalFormat,
+gl::Error TextureD3D_Cube::copyImage(GLenum target, size_t level, const gl::Rectangle &sourceArea, GLenum internalFormat,
const gl::Framebuffer *source)
{
- int faceIndex = static_cast<int>(gl::CubeMapTextureTargetToLayerIndex(target));
+ size_t faceIndex = gl::CubeMapTextureTargetToLayerIndex(target);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, GL_UNSIGNED_BYTE);
- GLint level = static_cast<GLint>(imageLevel);
-
gl::Extents size(sourceArea.width, sourceArea.height, 1);
- redefineImage(static_cast<int>(faceIndex), level, sizedInternalFormat, size);
+ redefineImage(faceIndex, level, sizedInternalFormat, size);
gl::ImageIndex index = gl::ImageIndex::MakeCube(target, level);
gl::Offset destOffset(0, 0, 0);
@@ -1443,15 +1411,11 @@
return gl::Error(GL_NO_ERROR);
}
-gl::Error TextureD3D_Cube::copySubImage(GLenum target,
- size_t imageLevel,
- const gl::Offset &destOffset,
- const gl::Rectangle &sourceArea,
+gl::Error TextureD3D_Cube::copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea,
const gl::Framebuffer *source)
{
- int faceIndex = static_cast<int>(gl::CubeMapTextureTargetToLayerIndex(target));
+ size_t faceIndex = gl::CubeMapTextureTargetToLayerIndex(target);
- GLint level = static_cast<GLint>(imageLevel);
gl::ImageIndex index = gl::ImageIndex::MakeCube(target, level);
// If the zero max LOD workaround is active, then we can't sample from individual layers of the framebuffer in shaders,
@@ -1508,7 +1472,7 @@
}
}
- for (size_t level = levels; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
+ for (int level = levels; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
{
for (int faceIndex = 0; faceIndex < 6; faceIndex++)
{
@@ -1519,8 +1483,7 @@
// TODO(geofflang): Verify storage creation had no errors
bool renderTarget = IsRenderTargetUsage(mUsage);
- TextureStorage *storage = mRenderer->createTextureStorageCube(
- internalFormat, renderTarget, size.width, static_cast<int>(levels), false);
+ TextureStorage *storage = mRenderer->createTextureStorageCube(internalFormat, renderTarget, size.width, levels, false);
gl::Error error = setCompleteTexStorage(storage);
if (error.isError())
@@ -1938,19 +1901,12 @@
return gl::Error(GL_INVALID_OPERATION);
}
-gl::Error TextureD3D_3D::setImage(GLenum target,
- size_t imageLevel,
- GLenum internalFormat,
- const gl::Extents &size,
- GLenum format,
- GLenum type,
- const gl::PixelUnpackState &unpack,
- const uint8_t *pixels)
+gl::Error TextureD3D_3D::setImage(GLenum target, size_t level, GLenum internalFormat, const gl::Extents &size, GLenum format, GLenum type,
+ const gl::PixelUnpackState &unpack, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_3D);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, type);
- GLint level = static_cast<GLint>(imageLevel);
redefineImage(level, sizedInternalFormat, size);
bool fastUnpacked = false;
@@ -1994,17 +1950,11 @@
return gl::Error(GL_NO_ERROR);
}
-gl::Error TextureD3D_3D::setSubImage(GLenum target,
- size_t imageLevel,
- const gl::Box &area,
- GLenum format,
- GLenum type,
- const gl::PixelUnpackState &unpack,
- const uint8_t *pixels)
+gl::Error TextureD3D_3D::setSubImage(GLenum target, size_t level, const gl::Box &area, GLenum format, GLenum type,
+ const gl::PixelUnpackState &unpack, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_3D);
- GLint level = static_cast<GLint>(imageLevel);
gl::ImageIndex index = gl::ImageIndex::Make3D(level);
// Attempt a fast gpu copy of the pixel data to the surface if the app bound an unpack buffer
@@ -2027,17 +1977,11 @@
}
}
-gl::Error TextureD3D_3D::setCompressedImage(GLenum target,
- size_t imageLevel,
- GLenum internalFormat,
- const gl::Extents &size,
- const gl::PixelUnpackState &unpack,
- size_t imageSize,
- const uint8_t *pixels)
+gl::Error TextureD3D_3D::setCompressedImage(GLenum target, size_t level, GLenum internalFormat, const gl::Extents &size,
+ const gl::PixelUnpackState &unpack, size_t imageSize, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_3D);
- GLint level = static_cast<GLint>(imageLevel);
// compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
redefineImage(level, internalFormat, size);
@@ -2050,7 +1994,7 @@
{
ASSERT(target == GL_TEXTURE_3D);
- gl::ImageIndex index = gl::ImageIndex::Make3D(static_cast<GLint>(level));
+ gl::ImageIndex index = gl::ImageIndex::Make3D(level);
gl::Error error = TextureD3D::subImageCompressed(index, area, format, unpack, pixels, 0);
if (error.isError())
{
@@ -2067,15 +2011,11 @@
return gl::Error(GL_INVALID_OPERATION, "Copying 3D textures is unimplemented.");
}
-gl::Error TextureD3D_3D::copySubImage(GLenum target,
- size_t imageLevel,
- const gl::Offset &destOffset,
- const gl::Rectangle &sourceArea,
+gl::Error TextureD3D_3D::copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea,
const gl::Framebuffer *source)
{
ASSERT(target == GL_TEXTURE_3D);
- GLint level = static_cast<GLint>(imageLevel);
gl::ImageIndex index = gl::ImageIndex::Make3D(level);
if (canCreateRenderTargetForImage(index))
@@ -2129,16 +2069,14 @@
mImageArray[level]->redefine(GL_TEXTURE_3D, internalFormat, levelSize, true);
}
- for (size_t level = levels; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
+ for (int level = levels; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
{
mImageArray[level]->redefine(GL_TEXTURE_3D, GL_NONE, gl::Extents(0, 0, 0), true);
}
// TODO(geofflang): Verify storage creation had no errors
bool renderTarget = IsRenderTargetUsage(mUsage);
- TextureStorage *storage =
- mRenderer->createTextureStorage3D(internalFormat, renderTarget, size.width, size.height,
- size.depth, static_cast<int>(levels));
+ TextureStorage *storage = mRenderer->createTextureStorage3D(internalFormat, renderTarget, size.width, size.height, size.depth, levels);
gl::Error error = setCompleteTexStorage(storage);
if (error.isError())
@@ -2497,20 +2435,13 @@
return gl::Error(GL_INVALID_OPERATION);
}
-gl::Error TextureD3D_2DArray::setImage(GLenum target,
- size_t imageLevel,
- GLenum internalFormat,
- const gl::Extents &size,
- GLenum format,
- GLenum type,
- const gl::PixelUnpackState &unpack,
- const uint8_t *pixels)
+gl::Error TextureD3D_2DArray::setImage(GLenum target, size_t level, GLenum internalFormat, const gl::Extents &size, GLenum format, GLenum type,
+ const gl::PixelUnpackState &unpack, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_2D_ARRAY);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, type);
- GLint level = static_cast<GLint>(imageLevel);
redefineImage(level, sizedInternalFormat, size);
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(sizedInternalFormat);
@@ -2530,16 +2461,11 @@
return gl::Error(GL_NO_ERROR);
}
-gl::Error TextureD3D_2DArray::setSubImage(GLenum target,
- size_t imageLevel,
- const gl::Box &area,
- GLenum format,
- GLenum type,
- const gl::PixelUnpackState &unpack,
- const uint8_t *pixels)
+gl::Error TextureD3D_2DArray::setSubImage(GLenum target, size_t level, const gl::Box &area, GLenum format, GLenum type,
+ const gl::PixelUnpackState &unpack, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_2D_ARRAY);
- GLint level = static_cast<GLint>(imageLevel);
+
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(getInternalFormat(level));
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(type, area.width, area.height, unpack.alignment, unpack.rowLength);
@@ -2561,17 +2487,11 @@
return gl::Error(GL_NO_ERROR);
}
-gl::Error TextureD3D_2DArray::setCompressedImage(GLenum target,
- size_t imageLevel,
- GLenum internalFormat,
- const gl::Extents &size,
- const gl::PixelUnpackState &unpack,
- size_t imageSize,
- const uint8_t *pixels)
+gl::Error TextureD3D_2DArray::setCompressedImage(GLenum target, size_t level, GLenum internalFormat, const gl::Extents &size,
+ const gl::PixelUnpackState &unpack, size_t imageSize, const uint8_t *pixels)
{
ASSERT(target == GL_TEXTURE_2D_ARRAY);
- GLint level = static_cast<GLint>(imageLevel);
// compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
redefineImage(level, internalFormat, size);
@@ -2608,7 +2528,7 @@
gl::Box layerArea(area.x, area.y, 0, area.width, area.height, 1);
- gl::ImageIndex index = gl::ImageIndex::Make2DArray(static_cast<GLint>(level), layer);
+ gl::ImageIndex index = gl::ImageIndex::Make2DArray(level, layer);
gl::Error error = TextureD3D::subImageCompressed(index, layerArea, format, unpack, pixels, layerOffset);
if (error.isError())
{
@@ -2632,15 +2552,11 @@
return gl::Error(GL_INVALID_OPERATION, "Copying 2D array textures is unimplemented.");
}
-gl::Error TextureD3D_2DArray::copySubImage(GLenum target,
- size_t imageLevel,
- const gl::Offset &destOffset,
- const gl::Rectangle &sourceArea,
+gl::Error TextureD3D_2DArray::copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea,
const gl::Framebuffer *source)
{
ASSERT(target == GL_TEXTURE_2D_ARRAY);
- GLint level = static_cast<GLint>(imageLevel);
gl::ImageIndex index = gl::ImageIndex::Make2DArray(level, destOffset.z);
if (canCreateRenderTargetForImage(index))
@@ -2710,9 +2626,7 @@
// TODO(geofflang): Verify storage creation had no errors
bool renderTarget = IsRenderTargetUsage(mUsage);
- TextureStorage *storage =
- mRenderer->createTextureStorage2DArray(internalFormat, renderTarget, size.width,
- size.height, size.depth, static_cast<int>(levels));
+ TextureStorage *storage = mRenderer->createTextureStorage2DArray(internalFormat, renderTarget, size.width, size.height, size.depth, levels);
gl::Error error = setCompleteTexStorage(storage);
if (error.isError())
diff --git a/src/libANGLE/renderer/d3d/VertexBuffer.cpp b/src/libANGLE/renderer/d3d/VertexBuffer.cpp
index 51ea6ef..3502f30 100644
--- a/src/libANGLE/renderer/d3d/VertexBuffer.cpp
+++ b/src/libANGLE/renderer/d3d/VertexBuffer.cpp
@@ -210,7 +210,7 @@
StreamingVertexBufferInterface::StreamingVertexBufferInterface(BufferFactoryD3D *factory, std::size_t initialSize)
: VertexBufferInterface(factory, true)
{
- setBufferSize(static_cast<unsigned int>(initialSize));
+ setBufferSize(initialSize);
}
StreamingVertexBufferInterface::~StreamingVertexBufferInterface()
diff --git a/src/libANGLE/renderer/d3d/VertexDataManager.cpp b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
index 4fd4351..00adfc1 100644
--- a/src/libANGLE/renderer/d3d/VertexDataManager.cpp
+++ b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
@@ -35,10 +35,8 @@
size = static_cast<unsigned int>(std::numeric_limits<int>::max());
}
- GLsizei stride = static_cast<GLsizei>(ComputeVertexAttributeStride(attrib));
- return (size - attrib.offset % stride +
- (stride - static_cast<GLsizei>(ComputeVertexAttributeTypeSize(attrib)))) /
- stride;
+ GLsizei stride = ComputeVertexAttributeStride(attrib);
+ return (size - attrib.offset % stride + (stride - ComputeVertexAttributeTypeSize(attrib))) / stride;
}
static int StreamingBufferElementCount(const gl::VertexAttribute &attrib, int vertexDrawCount, int instanceDrawCount)
@@ -154,8 +152,7 @@
// Record the attribute now
translated->active = true;
translated->attribute = &vertexAttributes[attribIndex];
- translated->currentValueType =
- state.getVertexAttribCurrentValue(static_cast<unsigned int>(attribIndex)).Type;
+ translated->currentValueType = state.getVertexAttribCurrentValue(attribIndex).Type;
translated->divisor = vertexAttributes[attribIndex].divisor;
if (vertexAttributes[attribIndex].enabled)
@@ -163,9 +160,8 @@
mActiveEnabledAttributes.push_back(translated);
// Also invalidate static buffers that don't contain matching attributes
- invalidateMatchingStaticData(
- vertexAttributes[attribIndex],
- state.getVertexAttribCurrentValue(static_cast<unsigned int>(attribIndex)));
+ invalidateMatchingStaticData(vertexAttributes[attribIndex],
+ state.getVertexAttribCurrentValue(attribIndex));
}
else
{
@@ -203,9 +199,9 @@
mCurrentValueCache[attribIndex].buffer = new StreamingVertexBufferInterface(mFactory, CONSTANT_VERTEX_BUFFER_SIZE);
}
- gl::Error error = storeCurrentValue(
- state.getVertexAttribCurrentValue(static_cast<unsigned int>(attribIndex)),
- &(*translatedAttribs)[attribIndex], &mCurrentValueCache[attribIndex]);
+ gl::Error error = storeCurrentValue(state.getVertexAttribCurrentValue(attribIndex),
+ &(*translatedAttribs)[attribIndex],
+ &mCurrentValueCache[attribIndex]);
if (error.isError())
{
hintUnmapAllResources(vertexAttributes);
@@ -224,7 +220,7 @@
{
BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer);
size_t typeSize = ComputeVertexAttributeTypeSize(*activeAttrib->attribute);
- bufferD3D->promoteStaticUsage(count * static_cast<int>(typeSize));
+ bufferD3D->promoteStaticUsage(count * typeSize);
}
}
@@ -267,8 +263,7 @@
{
if (staticBuffer->getBufferSize() == 0)
{
- int totalCount =
- ElementsInBuffer(attrib, static_cast<unsigned int>(bufferImpl->getSize()));
+ int totalCount = ElementsInBuffer(attrib, bufferImpl->getSize());
gl::Error error = staticBuffer->reserveVertexSpace(attrib, totalCount, 0);
if (error.isError())
{
@@ -279,9 +274,7 @@
else
{
int totalCount = StreamingBufferElementCount(attrib, count, instances);
- ASSERT(!bufferImpl ||
- ElementsInBuffer(attrib, static_cast<unsigned int>(bufferImpl->getSize())) >=
- totalCount);
+ ASSERT(!bufferImpl || ElementsInBuffer(attrib, bufferImpl->getSize()) >= totalCount);
gl::Error error = mStreamingBuffer->reserveVertexSpace(attrib, totalCount, instances);
if (error.isError())
@@ -319,7 +312,7 @@
{
translated->storage = storage;
translated->serial = storage->getSerial();
- translated->stride = static_cast<unsigned int>(ComputeVertexAttributeStride(attrib));
+ translated->stride = ComputeVertexAttributeStride(attrib);
translated->offset = static_cast<unsigned int>(attrib.offset + translated->stride * firstVertexIndex);
return gl::Error(GL_NO_ERROR);
@@ -356,10 +349,8 @@
if (!staticBuffer->lookupAttribute(attrib, &streamOffset))
{
// Convert the entire buffer
- int totalCount =
- ElementsInBuffer(attrib, static_cast<unsigned int>(storage->getSize()));
- int startIndex = static_cast<int>(attrib.offset) /
- static_cast<int>(ComputeVertexAttributeStride(attrib));
+ int totalCount = ElementsInBuffer(attrib, storage->getSize());
+ int startIndex = attrib.offset / ComputeVertexAttributeStride(attrib);
error = staticBuffer->storeVertexAttributes(attrib,
translated->currentValueType,
@@ -374,10 +365,7 @@
}
}
- unsigned int firstElementOffset =
- (static_cast<unsigned int>(attrib.offset) /
- static_cast<unsigned int>(ComputeVertexAttributeStride(attrib))) *
- outputElementSize;
+ unsigned int firstElementOffset = (attrib.offset / ComputeVertexAttributeStride(attrib)) * outputElementSize;
unsigned int startOffset = (instances == 0 || attrib.divisor == 0) ? firstVertexIndex * outputElementSize : 0;
if (streamOffset + firstElementOffset + startOffset < streamOffset)
{
@@ -448,7 +436,7 @@
translated->divisor = 0;
translated->stride = 0;
- translated->offset = static_cast<unsigned int>(cachedState->offset);
+ translated->offset = cachedState->offset;
return gl::Error(GL_NO_ERROR);
}
diff --git a/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp b/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp
index 3b42c98..402495f 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp
@@ -233,10 +233,8 @@
ID3D11Device *device = mRenderer->getDevice();
D3D11_BUFFER_DESC vbDesc;
- vbDesc.ByteWidth =
- static_cast<unsigned int>(std::max(sizeof(d3d11::PositionLayerTexCoord3DVertex),
- sizeof(d3d11::PositionTexCoordVertex)) *
- 6 * renderer->getRendererCaps().max3DTextureSize);
+ vbDesc.ByteWidth = std::max(sizeof(d3d11::PositionLayerTexCoord3DVertex), sizeof(d3d11::PositionTexCoordVertex)) *
+ 6 * renderer->getRendererCaps().max3DTextureSize;
vbDesc.Usage = D3D11_USAGE_DYNAMIC;
vbDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
vbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
diff --git a/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
index 670561a..b354100 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
@@ -610,8 +610,7 @@
D3D11_SHADER_RESOURCE_VIEW_DESC bufferSRVDesc;
bufferSRVDesc.Buffer.ElementOffset = 0;
- bufferSRVDesc.Buffer.ElementWidth =
- static_cast<unsigned int>(mSize) / dxgiFormatInfo.pixelBytes;
+ bufferSRVDesc.Buffer.ElementWidth = mSize / dxgiFormatInfo.pixelBytes;
bufferSRVDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
bufferSRVDesc.Format = srvFormat;
@@ -930,8 +929,8 @@
else
{
D3D11_BOX srcBox;
- srcBox.left = static_cast<unsigned int>(sourceOffset);
- srcBox.right = static_cast<unsigned int>(sourceOffset + size);
+ srcBox.left = sourceOffset;
+ srcBox.right = sourceOffset + size;
srcBox.top = 0;
srcBox.bottom = 1;
srcBox.front = 0;
@@ -939,8 +938,8 @@
ID3D11Buffer *sourceBuffer = GetAs<NativeStorage>(source)->getNativeStorage();
- context->CopySubresourceRegion(mNativeStorage, 0, static_cast<unsigned int>(destOffset), 0,
- 0, sourceBuffer, 0, &srcBox);
+ context->CopySubresourceRegion(mNativeStorage, 0, destOffset, 0, 0, sourceBuffer, 0,
+ &srcBox);
}
return createBuffer;
@@ -952,7 +951,7 @@
ID3D11DeviceContext *context = mRenderer->getDeviceContext();
D3D11_BUFFER_DESC bufferDesc;
- fillBufferDesc(&bufferDesc, mRenderer, mUsage, static_cast<unsigned int>(size));
+ fillBufferDesc(&bufferDesc, mRenderer, mUsage, size);
ID3D11Buffer *newBuffer;
HRESULT result = device->CreateBuffer(&bufferDesc, nullptr, &newBuffer);
@@ -972,7 +971,7 @@
D3D11_BOX srcBox;
srcBox.left = 0;
- srcBox.right = static_cast<unsigned int>(mBufferSize);
+ srcBox.right = mBufferSize;
srcBox.top = 0;
srcBox.bottom = 1;
srcBox.front = 0;
@@ -1089,8 +1088,7 @@
if (!mNativeStorage)
{
// Expand the memory storage upon request and cache the results.
- unsigned int expandedDataSize =
- static_cast<unsigned int>((mIndexInfo.srcCount * mAttributeStride) + mAttributeOffset);
+ unsigned int expandedDataSize = (mIndexInfo.srcCount * mAttributeStride) + mAttributeOffset;
MemoryBuffer expandedData;
if (!expandedData.resize(expandedDataSize))
{
diff --git a/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp b/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
index 9adef8a..e7433a2 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
@@ -525,8 +525,7 @@
deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
// Apply render targets
- deviceContext->OMSetRenderTargets(static_cast<unsigned int>(rtvs.size()),
- (rtvs.empty() ? nullptr : &rtvs[0]), dsv);
+ deviceContext->OMSetRenderTargets(rtvs.size(), (rtvs.empty() ? nullptr : &rtvs[0]), dsv);
// Draw the clear quad
deviceContext->Draw(4, 0);
diff --git a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
index 76bb15c..a35a3a9 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
@@ -195,10 +195,9 @@
colorAttachmentID = attachments[i] - GL_COLOR_ATTACHMENT0;
}
- if (mData.getColorAttachment(static_cast<unsigned int>(colorAttachmentID)))
+ if (mData.getColorAttachment(colorAttachmentID))
{
- error = mData.getColorAttachment(static_cast<unsigned int>(colorAttachmentID))
- ->getRenderTarget(&renderTarget);
+ error = mData.getColorAttachment(colorAttachmentID)->getRenderTarget(&renderTarget);
if (error.isError())
{
return error;
@@ -307,8 +306,7 @@
if (packBuffer != nullptr)
{
Buffer11 *packBufferStorage = GetImplAs<Buffer11>(packBuffer);
- PackPixelsParams packParams(area, format, type, static_cast<GLuint>(outputPitch), pack,
- reinterpret_cast<ptrdiff_t>(pixels));
+ PackPixelsParams packParams(area, format, type, outputPitch, pack, reinterpret_cast<ptrdiff_t>(pixels));
error = packBufferStorage->packPixels(colorBufferTexture, subresourceIndex, packParams);
if (error.isError())
@@ -319,8 +317,7 @@
}
else
{
- error = mRenderer->readTextureData(colorBufferTexture, subresourceIndex, area, format, type,
- static_cast<GLuint>(outputPitch), pack, pixels);
+ error = mRenderer->readTextureData(colorBufferTexture, subresourceIndex, area, format, type, outputPitch, pack, pixels);
if (error.isError())
{
SafeRelease(colorBufferTexture);
diff --git a/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp b/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
index 3b2d05d..fb3613c 100644
--- a/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
@@ -377,8 +377,8 @@
}
bool dirtyBuffers = false;
- unsigned int minDiff = gl::MAX_VERTEX_ATTRIBS;
- unsigned int maxDiff = 0;
+ size_t minDiff = gl::MAX_VERTEX_ATTRIBS;
+ size_t maxDiff = 0;
unsigned int nextAvailableIndex = 0;
for (unsigned int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++)
@@ -432,8 +432,8 @@
vertexOffset != mCurrentVertexOffsets[i])
{
dirtyBuffers = true;
- minDiff = std::min(minDiff, i);
- maxDiff = std::max(maxDiff, i);
+ minDiff = std::min(minDiff, static_cast<size_t>(i));
+ maxDiff = std::max(maxDiff, static_cast<size_t>(i));
mCurrentBuffers[i] = buffer;
mCurrentVertexStrides[i] = vertexStride;
diff --git a/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
index ec569a3..e466689 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
@@ -384,10 +384,16 @@
#ifdef _DEBUG
{
TRACE_EVENT0("gpu.angle", "D3D11CreateDevice (Debug)");
- result = D3D11CreateDevice(
- NULL, mDriverType, NULL, D3D11_CREATE_DEVICE_DEBUG, mAvailableFeatureLevels.data(),
- static_cast<unsigned int>(mAvailableFeatureLevels.size()), D3D11_SDK_VERSION, &mDevice,
- &(mRenderer11DeviceCaps.featureLevel), &mDeviceContext);
+ result = D3D11CreateDevice(NULL,
+ mDriverType,
+ NULL,
+ D3D11_CREATE_DEVICE_DEBUG,
+ mAvailableFeatureLevels.data(),
+ mAvailableFeatureLevels.size(),
+ D3D11_SDK_VERSION,
+ &mDevice,
+ &(mRenderer11DeviceCaps.featureLevel),
+ &mDeviceContext);
}
if (!mDevice || FAILED(result))
@@ -401,10 +407,16 @@
SCOPED_ANGLE_HISTOGRAM_TIMER("GPU.ANGLE.D3D11CreateDeviceMS");
TRACE_EVENT0("gpu.angle", "D3D11CreateDevice");
- result = D3D11CreateDevice(NULL, mDriverType, NULL, 0, mAvailableFeatureLevels.data(),
- static_cast<unsigned int>(mAvailableFeatureLevels.size()),
- D3D11_SDK_VERSION, &mDevice,
- &(mRenderer11DeviceCaps.featureLevel), &mDeviceContext);
+ result = D3D11CreateDevice(NULL,
+ mDriverType,
+ NULL,
+ 0,
+ mAvailableFeatureLevels.data(),
+ mAvailableFeatureLevels.size(),
+ D3D11_SDK_VERSION,
+ &mDevice,
+ &(mRenderer11DeviceCaps.featureLevel),
+ &mDeviceContext);
// Cleanup done by destructor
if (!mDevice || FAILED(result))
@@ -544,7 +556,7 @@
};
D3D11_INFO_QUEUE_FILTER filter = {};
- filter.DenyList.NumIDs = static_cast<unsigned int>(ArraySize(hideMessages));
+ filter.DenyList.NumIDs = ArraySize(hideMessages);
filter.DenyList.pIDList = hideMessages;
infoQueue->AddStorageFilterEntries(&filter);
@@ -1008,17 +1020,13 @@
{
UINT firstConstant = 0, numConstants = 0;
CalculateConstantBufferParams(uniformBufferOffset, uniformBufferSize, &firstConstant, &numConstants);
- mDeviceContext1->VSSetConstantBuffers1(
- getReservedVertexUniformBuffers() +
- static_cast<unsigned int>(uniformBufferIndex),
- 1, &constantBuffer, &firstConstant, &numConstants);
+ mDeviceContext1->VSSetConstantBuffers1(getReservedVertexUniformBuffers() + uniformBufferIndex,
+ 1, &constantBuffer, &firstConstant, &numConstants);
}
else
{
- mDeviceContext->VSSetConstantBuffers(
- getReservedVertexUniformBuffers() +
- static_cast<unsigned int>(uniformBufferIndex),
- 1, &constantBuffer);
+ mDeviceContext->VSSetConstantBuffers(getReservedVertexUniformBuffers() + uniformBufferIndex,
+ 1, &constantBuffer);
}
mCurrentConstantBufferVS[uniformBufferIndex] = bufferStorage->getSerial();
@@ -1068,17 +1076,13 @@
{
UINT firstConstant = 0, numConstants = 0;
CalculateConstantBufferParams(uniformBufferOffset, uniformBufferSize, &firstConstant, &numConstants);
- mDeviceContext1->PSSetConstantBuffers1(
- getReservedFragmentUniformBuffers() +
- static_cast<unsigned int>(uniformBufferIndex),
- 1, &constantBuffer, &firstConstant, &numConstants);
+ mDeviceContext1->PSSetConstantBuffers1(getReservedFragmentUniformBuffers() + uniformBufferIndex,
+ 1, &constantBuffer, &firstConstant, &numConstants);
}
else
{
- mDeviceContext->PSSetConstantBuffers(
- getReservedFragmentUniformBuffers() +
- static_cast<unsigned int>(uniformBufferIndex),
- 1, &constantBuffer);
+ mDeviceContext->PSSetConstantBuffers(getReservedFragmentUniformBuffers() + uniformBufferIndex,
+ 1, &constantBuffer);
}
mCurrentConstantBufferPS[uniformBufferIndex] = bufferStorage->getSerial();
@@ -1234,8 +1238,8 @@
{
actualViewport.x = 0;
actualViewport.y = 0;
- actualViewport.width = static_cast<int>(mRenderTargetDesc.width);
- actualViewport.height = static_cast<int>(mRenderTargetDesc.height);
+ actualViewport.width = mRenderTargetDesc.width;
+ actualViewport.height = mRenderTargetDesc.height;
actualZNear = 0.0f;
actualZFar = 1.0f;
}
@@ -1255,8 +1259,8 @@
if (mRenderer11DeviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3)
{
// Feature Level 9 viewports shouldn't exceed the dimensions of the rendertarget.
- dxMaxViewportBoundsX = static_cast<int>(mRenderTargetDesc.width);
- dxMaxViewportBoundsY = static_cast<int>(mRenderTargetDesc.height);
+ dxMaxViewportBoundsX = mRenderTargetDesc.width;
+ dxMaxViewportBoundsY = mRenderTargetDesc.height;
dxMinViewportBoundsX = 0;
dxMinViewportBoundsY = 0;
}
@@ -1615,8 +1619,7 @@
mAppliedNumXFBBindings = numXFBBindings;
- mDeviceContext->SOSetTargets(static_cast<unsigned int>(numXFBBindings), mAppliedTFBuffers,
- mCurrentD3DOffsets);
+ mDeviceContext->SOSetTargets(numXFBBindings, mAppliedTFBuffers, mCurrentD3DOffsets);
}
}
@@ -2373,15 +2376,20 @@
D3D_FEATURE_LEVEL dummyFeatureLevel;
ID3D11DeviceContext* dummyContext;
- HRESULT result = D3D11CreateDevice(
- NULL, mDriverType, NULL,
+ HRESULT result = D3D11CreateDevice(NULL,
+ mDriverType,
+ NULL,
#if defined(_DEBUG)
- D3D11_CREATE_DEVICE_DEBUG,
+ D3D11_CREATE_DEVICE_DEBUG,
#else
- 0,
+ 0,
#endif
- mAvailableFeatureLevels.data(), static_cast<unsigned int>(mAvailableFeatureLevels.size()),
- D3D11_SDK_VERSION, &dummyDevice, &dummyFeatureLevel, &dummyContext);
+ mAvailableFeatureLevels.data(),
+ mAvailableFeatureLevels.size(),
+ D3D11_SDK_VERSION,
+ &dummyDevice,
+ &dummyFeatureLevel,
+ &dummyContext);
if (!mDevice || FAILED(result))
{
@@ -3003,7 +3011,7 @@
const gl::LinkedVarying &varying = transformFeedbackVaryings[i];
GLenum transposedType = gl::TransposeMatrixType(varying.type);
- for (unsigned int j = 0; j < varying.semanticIndexCount; j++)
+ for (size_t j = 0; j < varying.semanticIndexCount; j++)
{
D3D11_SO_DECLARATION_ENTRY entry = { 0 };
entry.Stream = 0;
@@ -3016,10 +3024,8 @@
}
}
- result = mDevice->CreateGeometryShaderWithStreamOutput(
- function, static_cast<unsigned int>(length), soDeclaration.data(),
- static_cast<unsigned int>(soDeclaration.size()), NULL, 0, 0, NULL,
- &streamOutShader);
+ result = mDevice->CreateGeometryShaderWithStreamOutput(function, length, soDeclaration.data(), soDeclaration.size(),
+ NULL, 0, 0, NULL, &streamOutShader);
ASSERT(SUCCEEDED(result));
if (FAILED(result))
{
@@ -3708,8 +3714,7 @@
sizeSum += buffer->getTotalCPUBufferMemoryBytes();
}
const int kOneMegaByte = 1024 * 1024;
- ANGLE_HISTOGRAM_MEMORY_MB("GPU.ANGLE.Buffer11CPUMemoryMB",
- static_cast<int>(sizeSum) / kOneMegaByte);
+ ANGLE_HISTOGRAM_MEMORY_MB("GPU.ANGLE.Buffer11CPUMemoryMB", sizeSum / kOneMegaByte);
}
}
@@ -3853,15 +3858,11 @@
if (samplerType == gl::SAMPLER_VERTEX)
{
- mDeviceContext->VSSetShaderResources(static_cast<unsigned int>(rangeStart),
- static_cast<unsigned int>(rangeEnd - rangeStart),
- &mNullSRVs[0]);
+ mDeviceContext->VSSetShaderResources(rangeStart, rangeEnd - rangeStart, &mNullSRVs[0]);
}
else
{
- mDeviceContext->PSSetShaderResources(static_cast<unsigned int>(rangeStart),
- static_cast<unsigned int>(rangeEnd - rangeStart),
- &mNullSRVs[0]);
+ mDeviceContext->PSSetShaderResources(rangeStart, rangeEnd - rangeStart, &mNullSRVs[0]);
}
for (size_t samplerIndex = rangeStart; samplerIndex < rangeEnd; ++samplerIndex)
diff --git a/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp b/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
index 4da51af..9f1fcc6 100644
--- a/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
@@ -77,7 +77,7 @@
if (initialSize > 0)
{
D3D11_BUFFER_DESC constantBufferDescription = {0};
- constantBufferDescription.ByteWidth = static_cast<unsigned int>(initialSize);
+ constantBufferDescription.ByteWidth = initialSize;
constantBufferDescription.Usage = D3D11_USAGE_DYNAMIC;
constantBufferDescription.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
constantBufferDescription.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
diff --git a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
index 347fed5..1ab03f5 100644
--- a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
@@ -628,7 +628,7 @@
size_t outputPixelSize = dxgiFormatInfo.pixelBytes;
- UINT bufferRowPitch = static_cast<unsigned int>(outputPixelSize) * width;
+ UINT bufferRowPitch = outputPixelSize * width;
UINT bufferDepthPitch = bufferRowPitch * height;
size_t neededSize = bufferDepthPitch * depth;
diff --git a/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp b/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp
index 098cefc..57cf5af 100644
--- a/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp
@@ -117,7 +117,7 @@
return gl::Error(GL_OUT_OF_MEMORY, "Internal vertex buffer is not initialized.");
}
- int inputStride = static_cast<int>(ComputeVertexAttributeStride(attrib));
+ int inputStride = ComputeVertexAttributeStride(attrib);
// This will map the resource if it isn't already mapped.
gl::Error error = mapResource();
diff --git a/src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp b/src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp
index 5b97c0a..6e91a9c 100644
--- a/src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp
@@ -389,11 +389,11 @@
if (colorInfoIter != colorInfoMap.end())
{
const DXGIColorFormatInfo &colorInfo = colorInfoIter->second;
- info.redBits = static_cast<GLuint>(colorInfo.redBits);
- info.greenBits = static_cast<GLuint>(colorInfo.greenBits);
- info.blueBits = static_cast<GLuint>(colorInfo.blueBits);
- info.alphaBits = static_cast<GLuint>(colorInfo.alphaBits);
- info.sharedBits = static_cast<GLuint>(colorInfo.sharedBits);
+ info.redBits = colorInfo.redBits;
+ info.greenBits = colorInfo.greenBits;
+ info.blueBits = colorInfo.blueBits;
+ info.alphaBits = colorInfo.alphaBits;
+ info.sharedBits = colorInfo.sharedBits;
}
static const DepthStencilInfoMap dsInfoMap = BuildDepthStencilInfoMap();
diff --git a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
index fd1d6e2..79aae53 100644
--- a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
@@ -323,8 +323,7 @@
// Assume 1x
textureCaps.sampleCounts.insert(1);
- for (unsigned int sampleCount = 2; sampleCount <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT;
- sampleCount *= 2)
+ for (size_t sampleCount = 2; sampleCount <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; sampleCount *= 2)
{
UINT qualityCount = 0;
if (SUCCEEDED(device->CheckMultisampleQualityLevels(formatInfo.renderFormat, sampleCount, &qualityCount)))
@@ -1026,10 +1025,10 @@
// GL core feature limits
caps->maxElementIndex = static_cast<GLint64>(std::numeric_limits<unsigned int>::max());
- caps->max3DTextureSize = static_cast<GLuint>(GetMaximum3DTextureSize(featureLevel));
- caps->max2DTextureSize = static_cast<GLuint>(GetMaximum2DTextureSize(featureLevel));
- caps->maxCubeMapTextureSize = static_cast<GLuint>(GetMaximumCubeMapTextureSize(featureLevel));
- caps->maxArrayTextureLayers = static_cast<GLuint>(GetMaximum2DTextureArraySize(featureLevel));
+ caps->max3DTextureSize = GetMaximum3DTextureSize(featureLevel);
+ caps->max2DTextureSize = GetMaximum2DTextureSize(featureLevel);
+ caps->maxCubeMapTextureSize = GetMaximumCubeMapTextureSize(featureLevel);
+ caps->maxArrayTextureLayers = GetMaximum2DTextureArraySize(featureLevel);
// Unimplemented, set to minimum required
caps->maxLODBias = 2.0f;
@@ -1039,12 +1038,11 @@
// Maximum draw buffers and color attachments are the same, max color attachments could eventually be
// increased to 16
- caps->maxDrawBuffers = static_cast<GLuint>(GetMaximumSimultaneousRenderTargets(featureLevel));
- caps->maxColorAttachments =
- static_cast<GLuint>(GetMaximumSimultaneousRenderTargets(featureLevel));
+ caps->maxDrawBuffers = GetMaximumSimultaneousRenderTargets(featureLevel);
+ caps->maxColorAttachments = GetMaximumSimultaneousRenderTargets(featureLevel);
// D3D11 has the same limit for viewport width and height
- caps->maxViewportWidth = static_cast<GLuint>(GetMaximumViewportSize(featureLevel));
+ caps->maxViewportWidth = GetMaximumViewportSize(featureLevel);
caps->maxViewportHeight = caps->maxViewportWidth;
// Choose a reasonable maximum, enforced in the shader.
@@ -1056,8 +1054,8 @@
caps->maxAliasedLineWidth = 1.0f;
// Primitive count limits
- caps->maxElementsIndices = static_cast<GLuint>(GetMaximumDrawIndexedIndexCount(featureLevel));
- caps->maxElementsVertices = static_cast<GLuint>(GetMaximumDrawVertexCount(featureLevel));
+ caps->maxElementsIndices = GetMaximumDrawIndexedIndexCount(featureLevel);
+ caps->maxElementsVertices = GetMaximumDrawVertexCount(featureLevel);
// Program and shader binary formats (no supported shader binary formats)
caps->programBinaryFormats.push_back(GL_PROGRAM_BINARY_ANGLE);
@@ -1081,27 +1079,19 @@
caps->maxServerWaitTimeout = 0;
// Vertex shader limits
- caps->maxVertexAttributes = static_cast<GLuint>(GetMaximumVertexInputSlots(featureLevel));
- caps->maxVertexUniformComponents =
- static_cast<GLuint>(GetMaximumVertexUniformVectors(featureLevel)) * 4;
- caps->maxVertexUniformVectors =
- static_cast<GLuint>(GetMaximumVertexUniformVectors(featureLevel));
- caps->maxVertexUniformBlocks = static_cast<GLuint>(GetMaximumVertexUniformBlocks(featureLevel));
- caps->maxVertexOutputComponents =
- static_cast<GLuint>(GetMaximumVertexOutputVectors(featureLevel)) * 4;
- caps->maxVertexTextureImageUnits =
- static_cast<GLuint>(GetMaximumVertexTextureUnits(featureLevel));
+ caps->maxVertexAttributes = GetMaximumVertexInputSlots(featureLevel);
+ caps->maxVertexUniformComponents = GetMaximumVertexUniformVectors(featureLevel) * 4;
+ caps->maxVertexUniformVectors = GetMaximumVertexUniformVectors(featureLevel);
+ caps->maxVertexUniformBlocks = GetMaximumVertexUniformBlocks(featureLevel);
+ caps->maxVertexOutputComponents = GetMaximumVertexOutputVectors(featureLevel) * 4;
+ caps->maxVertexTextureImageUnits = GetMaximumVertexTextureUnits(featureLevel);
// Fragment shader limits
- caps->maxFragmentUniformComponents =
- static_cast<GLuint>(GetMaximumPixelUniformVectors(featureLevel)) * 4;
- caps->maxFragmentUniformVectors =
- static_cast<GLuint>(GetMaximumPixelUniformVectors(featureLevel));
- caps->maxFragmentUniformBlocks =
- static_cast<GLuint>(GetMaximumPixelUniformBlocks(featureLevel));
- caps->maxFragmentInputComponents =
- static_cast<GLuint>(GetMaximumPixelInputVectors(featureLevel)) * 4;
- caps->maxTextureImageUnits = static_cast<GLuint>(GetMaximumPixelTextureUnits(featureLevel));
+ caps->maxFragmentUniformComponents = GetMaximumPixelUniformVectors(featureLevel) * 4;
+ caps->maxFragmentUniformVectors = GetMaximumPixelUniformVectors(featureLevel);
+ caps->maxFragmentUniformBlocks = GetMaximumPixelUniformBlocks(featureLevel);
+ caps->maxFragmentInputComponents = GetMaximumPixelInputVectors(featureLevel) * 4;
+ caps->maxTextureImageUnits = GetMaximumPixelTextureUnits(featureLevel);
caps->minProgramTexelOffset = GetMinimumTexelOffset(featureLevel);
caps->maxProgramTexelOffset = GetMaximumTexelOffset(featureLevel);
@@ -1120,18 +1110,14 @@
static_cast<GLint64>(caps->maxVertexUniformComponents);
caps->maxCombinedFragmentUniformComponents = (static_cast<GLint64>(caps->maxFragmentUniformBlocks) * static_cast<GLint64>(caps->maxUniformBlockSize / 4)) +
static_cast<GLint64>(caps->maxFragmentUniformComponents);
- caps->maxVaryingComponents =
- static_cast<GLuint>(GetMaximumVertexOutputVectors(featureLevel)) * 4;
- caps->maxVaryingVectors = static_cast<GLuint>(GetMaximumVertexOutputVectors(featureLevel));
+ caps->maxVaryingComponents = GetMaximumVertexOutputVectors(featureLevel) * 4;
+ caps->maxVaryingVectors = GetMaximumVertexOutputVectors(featureLevel);
caps->maxCombinedTextureImageUnits = caps->maxVertexTextureImageUnits + caps->maxTextureImageUnits;
// Transform feedback limits
- caps->maxTransformFeedbackInterleavedComponents =
- static_cast<GLuint>(GetMaximumStreamOutputInterleavedComponents(featureLevel));
- caps->maxTransformFeedbackSeparateAttributes =
- static_cast<GLuint>(GetMaximumStreamOutputBuffers(featureLevel));
- caps->maxTransformFeedbackSeparateComponents =
- static_cast<GLuint>(GetMaximumStreamOutputSeparateComponents(featureLevel));
+ caps->maxTransformFeedbackInterleavedComponents = GetMaximumStreamOutputInterleavedComponents(featureLevel);
+ caps->maxTransformFeedbackSeparateAttributes = GetMaximumStreamOutputBuffers(featureLevel);
+ caps->maxTransformFeedbackSeparateComponents = GetMaximumStreamOutputSeparateComponents(featureLevel);
// Multisample limits
caps->maxSamples = maxSamples;
@@ -1259,8 +1245,7 @@
HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name)
{
#if defined(_DEBUG)
- return resource->SetPrivateData(WKPDID_D3DDebugObjectName,
- static_cast<unsigned int>(strlen(name)), name);
+ return resource->SetPrivateData(WKPDID_D3DDebugObjectName, strlen(name), name);
#else
return S_OK;
#endif
diff --git a/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
index 281622e..8d8f076 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
@@ -1139,8 +1139,8 @@
{
actualViewport.x = 0;
actualViewport.y = 0;
- actualViewport.width = static_cast<int>(mRenderTargetDesc.width);
- actualViewport.height = static_cast<int>(mRenderTargetDesc.height);
+ actualViewport.width = mRenderTargetDesc.width;
+ actualViewport.height = mRenderTargetDesc.height;
actualZNear = 0.0f;
actualZFar = 1.0f;
}
@@ -1761,7 +1761,7 @@
// Update the counting index buffer if it is not large enough or has not been created yet.
if (count <= 65536) // 16-bit indices
{
- const unsigned int spaceNeeded = static_cast<unsigned int>(count) * sizeof(unsigned short);
+ const unsigned int spaceNeeded = count * sizeof(unsigned short);
if (!mCountingIB || mCountingIB->getBufferSize() < spaceNeeded)
{
@@ -1791,7 +1791,7 @@
}
else if (getRendererExtensions().elementIndexUint)
{
- const unsigned int spaceNeeded = static_cast<unsigned int>(count) * sizeof(unsigned int);
+ const unsigned int spaceNeeded = count * sizeof(unsigned int);
if (!mCountingIB || mCountingIB->getBufferSize() < spaceNeeded)
{
@@ -1807,7 +1807,7 @@
}
unsigned int *data = reinterpret_cast<unsigned int*>(mappedMemory);
- for (unsigned int i = 0; i < count; i++)
+ for (size_t i = 0; i < count; i++)
{
data[i] = i;
}
@@ -2972,7 +2972,7 @@
// TODO(jmadill): faster way?
for (size_t samplerIndex = rangeStart; samplerIndex < rangeEnd; samplerIndex++)
{
- gl::Error error = setTexture(samplerType, static_cast<int>(samplerIndex), nullptr);
+ gl::Error error = setTexture(samplerType, samplerIndex, nullptr);
if (error.isError())
{
return error;
diff --git a/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp b/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp
index 89c8cce..ceddda1 100644
--- a/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp
@@ -88,7 +88,7 @@
int TextureStorage9::getLevelCount() const
{
- return static_cast<int>(mMipLevels) - mTopLevel;
+ return mMipLevels - mTopLevel;
}
gl::Error TextureStorage9::setData(const gl::ImageIndex &index, ImageD3D *image, const gl::Box *destBox, GLenum type,
@@ -180,9 +180,7 @@
return error;
}
- mRenderTarget =
- new TextureRenderTarget9(surface, mInternalFormat, static_cast<GLsizei>(mTextureWidth),
- static_cast<GLsizei>(mTextureHeight), 1, 0);
+ mRenderTarget = new TextureRenderTarget9(surface, mInternalFormat, mTextureWidth, mTextureHeight, 1, 0);
}
ASSERT(outRT);
@@ -225,10 +223,8 @@
ASSERT(mMipLevels > 0);
IDirect3DDevice9 *device = mRenderer->getDevice();
- HRESULT result = device->CreateTexture(static_cast<unsigned int>(mTextureWidth),
- static_cast<unsigned int>(mTextureHeight),
- static_cast<unsigned int>(mMipLevels), getUsage(),
- mTextureFormat, getPool(), &mTexture, NULL);
+ HRESULT result = device->CreateTexture(mTextureWidth, mTextureHeight, mMipLevels, getUsage(), mTextureFormat,
+ getPool(), &mTexture, NULL);
if (FAILED(result))
{
@@ -356,9 +352,7 @@
return error;
}
- mRenderTarget[index.layerIndex] =
- new TextureRenderTarget9(surface, mInternalFormat, static_cast<GLsizei>(mTextureWidth),
- static_cast<GLsizei>(mTextureHeight), 1, 0);
+ mRenderTarget[index.layerIndex] = new TextureRenderTarget9(surface, mInternalFormat, mTextureWidth, mTextureHeight, 1, 0);
}
*outRT = mRenderTarget[index.layerIndex];
@@ -401,9 +395,8 @@
ASSERT(mTextureWidth == mTextureHeight);
IDirect3DDevice9 *device = mRenderer->getDevice();
- HRESULT result = device->CreateCubeTexture(
- static_cast<unsigned int>(mTextureWidth), static_cast<unsigned int>(mMipLevels),
- getUsage(), mTextureFormat, getPool(), &mTexture, NULL);
+ HRESULT result = device->CreateCubeTexture(mTextureWidth, mMipLevels, getUsage(), mTextureFormat, getPool(),
+ &mTexture, NULL);
if (FAILED(result))
{
diff --git a/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.cpp b/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.cpp
index bfdf137..51cfbdd 100644
--- a/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.cpp
@@ -69,8 +69,8 @@
return gl::Error(GL_OUT_OF_MEMORY, "Internal vertex buffer is not initialized.");
}
- int inputStride = static_cast<int>(gl::ComputeVertexAttributeStride(attrib));
- int elementSize = static_cast<int>(gl::ComputeVertexAttributeTypeSize(attrib));
+ int inputStride = gl::ComputeVertexAttributeStride(attrib);
+ int elementSize = gl::ComputeVertexAttributeTypeSize(attrib);
DWORD lockFlags = mDynamicUsage ? D3DLOCK_NOOVERWRITE : 0;
@@ -179,7 +179,7 @@
unsigned int elementCount = 0;
if (instances == 0 || attrib.divisor == 0)
{
- elementCount = static_cast<unsigned int>(count);
+ elementCount = count;
}
else
{
@@ -191,8 +191,7 @@
{
if (outSpaceRequired)
{
- *outSpaceRequired =
- static_cast<unsigned int>(d3d9VertexInfo.outputElementSize) * elementCount;
+ *outSpaceRequired = d3d9VertexInfo.outputElementSize * elementCount;
}
return gl::Error(GL_NO_ERROR);
}
diff --git a/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp b/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp
index e162dfd..6a1181a 100644
--- a/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp
@@ -108,7 +108,7 @@
// Directly binding the storage buffer is not supported for d3d9
ASSERT(attributes[i].storage == NULL);
- int stream = static_cast<int>(i);
+ int stream = i;
if (instances > 0)
{
@@ -125,7 +125,7 @@
}
else if (i == 0)
{
- stream = static_cast<int>(indexedAttribute);
+ stream = indexedAttribute;
}
UINT frequency = 1;
@@ -164,7 +164,7 @@
element->Type = static_cast<BYTE>(d3d9VertexInfo.nativeFormat);
element->Method = D3DDECLMETHOD_DEFAULT;
element->Usage = D3DDECLUSAGE_TEXCOORD;
- element->UsageIndex = static_cast<BYTE>(program->getSemanticIndex(static_cast<int>(i)));
+ element->UsageIndex = static_cast<BYTE>(program->getSemanticIndex(i));
element++;
}
}
diff --git a/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp b/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp
index 3592cad..13df51f 100644
--- a/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp
@@ -319,7 +319,7 @@
}
textureCaps.sampleCounts.insert(1);
- for (unsigned int i = D3DMULTISAMPLE_2_SAMPLES; i <= D3DMULTISAMPLE_16_SAMPLES; i++)
+ for (size_t i = D3DMULTISAMPLE_2_SAMPLES; i <= D3DMULTISAMPLE_16_SAMPLES; i++)
{
D3DMULTISAMPLE_TYPE multisampleType = D3DMULTISAMPLE_TYPE(i);