Commit cebb5aa0 by Geoff Lang

Fix warnings about unreferenced local variables.

BUG=angleproject:602 Change-Id: I2eb04fe6eed60b3877b14628e81c0b1fe3b68647 Reviewed-on: https://chromium-review.googlesource.com/193431Tested-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 662b8481
...@@ -102,7 +102,6 @@ void Std140BlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize, ...@@ -102,7 +102,6 @@ void Std140BlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize,
// We assume we are only dealing with 4 byte components (no doubles or half-words currently) // We assume we are only dealing with 4 byte components (no doubles or half-words currently)
ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent); ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent);
int numComponents = gl::UniformComponentCount(type);
size_t baseAlignment = 0; size_t baseAlignment = 0;
int matrixStride = 0; int matrixStride = 0;
int arrayStride = 0; int arrayStride = 0;
......
...@@ -3534,10 +3534,7 @@ void OutputHLSL::addConstructor(const TType &type, const TString &name, const TI ...@@ -3534,10 +3534,7 @@ void OutputHLSL::addConstructor(const TType &type, const TString &name, const TI
structureString(*structure, true, false) + structureString(*structure, true, false) +
"#pragma pack_matrix(column_major)\n"; "#pragma pack_matrix(column_major)\n";
const TString &std140Prefix = "std";
TString std140String = structureString(*structure, false, true); TString std140String = structureString(*structure, false, true);
const TString &std140RowMajorPrefix = "std_rm";
TString std140RowMajorString = "#pragma pack_matrix(row_major)\n" + TString std140RowMajorString = "#pragma pack_matrix(row_major)\n" +
structureString(*structure, true, true) + structureString(*structure, true, true) +
"#pragma pack_matrix(column_major)\n"; "#pragma pack_matrix(column_major)\n";
...@@ -3889,7 +3886,6 @@ Uniform OutputHLSL::declareUniformToList(const TType &type, const TString &name, ...@@ -3889,7 +3886,6 @@ Uniform OutputHLSL::declareUniformToList(const TType &type, const TString &name,
if (!structure) if (!structure)
{ {
const bool isRowMajorMatrix = (type.isMatrix() && type.getLayoutQualifier().matrixPacking == EmpRowMajor);
Uniform uniform(glVariableType(type), glVariablePrecision(type), name.c_str(), Uniform uniform(glVariableType(type), glVariablePrecision(type), name.c_str(),
(unsigned int)type.getArraySize(), (unsigned int)registerIndex, 0); (unsigned int)type.getArraySize(), (unsigned int)registerIndex, 0);
output.push_back(uniform); output.push_back(uniform);
......
...@@ -215,6 +215,7 @@ void ShGetInfo(const ShHandle handle, ShShaderInfo pname, size_t* params) ...@@ -215,6 +215,7 @@ void ShGetInfo(const ShHandle handle, ShShaderInfo pname, size_t* params)
// 64 bits hashing output requires 16 bytes for hex // 64 bits hashing output requires 16 bytes for hex
// representation. // representation.
const char HashedNamePrefix[] = HASHED_NAME_PREFIX; const char HashedNamePrefix[] = HASHED_NAME_PREFIX;
(void)HashedNamePrefix;
*params = 16 + sizeof(HashedNamePrefix); *params = 16 + sizeof(HashedNamePrefix);
} }
break; break;
......
...@@ -2547,9 +2547,7 @@ void Context::generateSwizzles(ProgramBinary *programBinary) ...@@ -2547,9 +2547,7 @@ void Context::generateSwizzles(ProgramBinary *programBinary)
void Context::generateSwizzles(ProgramBinary *programBinary, SamplerType type) void Context::generateSwizzles(ProgramBinary *programBinary, SamplerType type)
{ {
// Range of Direct3D samplers of given sampler type // Range of Direct3D samplers of given sampler type
int samplerCount = (type == SAMPLER_PIXEL) ? MAX_TEXTURE_IMAGE_UNITS : mRenderer->getMaxVertexTextureImageUnits();
int samplerRange = programBinary->getUsedSamplerRange(type); int samplerRange = programBinary->getUsedSamplerRange(type);
for (int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++) for (int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++)
{ {
Texture *texture = NULL; Texture *texture = NULL;
......
...@@ -1416,8 +1416,6 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length) ...@@ -1416,8 +1416,6 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
stream.write(mVertexHLSL); stream.write(mVertexHLSL);
stream.write(mVertexWorkarounds); stream.write(mVertexWorkarounds);
UINT vertexShadersTotalSize = 0;
stream.write(mVertexExecutables.size()); stream.write(mVertexExecutables.size());
for (size_t vertexExecutableIndex = 0; vertexExecutableIndex < mVertexExecutables.size(); vertexExecutableIndex++) for (size_t vertexExecutableIndex = 0; vertexExecutableIndex < mVertexExecutables.size(); vertexExecutableIndex++)
{ {
......
...@@ -1363,8 +1363,6 @@ void TextureCubeMap::setCompleteTexStorage(rx::TextureStorageInterfaceCube *newC ...@@ -1363,8 +1363,6 @@ void TextureCubeMap::setCompleteTexStorage(rx::TextureStorageInterfaceCube *newC
if (mTexStorage && mTexStorage->isManaged()) if (mTexStorage && mTexStorage->isManaged())
{ {
int levels = mTexStorage->getLevelCount();
for (int faceIndex = 0; faceIndex < 6; faceIndex++) for (int faceIndex = 0; faceIndex < 6; faceIndex++)
{ {
for (int level = 0; level < mTexStorage->getLevelCount(); level++) for (int level = 0; level < mTexStorage->getLevelCount(); level++)
......
...@@ -280,6 +280,11 @@ void Image11::copy(GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y ...@@ -280,6 +280,11 @@ void Image11::copy(GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y
// This format requires conversion, so we must copy the texture to staging and manually convert via readPixels // This format requires conversion, so we must copy the texture to staging and manually convert via readPixels
D3D11_MAPPED_SUBRESOURCE mappedImage; D3D11_MAPPED_SUBRESOURCE mappedImage;
HRESULT result = map(D3D11_MAP_WRITE, &mappedImage); HRESULT result = map(D3D11_MAP_WRITE, &mappedImage);
if (FAILED(result))
{
ERR("Failed to map texture for Image11::copy, HRESULT: 0x%X.", result);
return;
}
// determine the offset coordinate into the destination buffer // determine the offset coordinate into the destination buffer
GLuint clientVersion = mRenderer->getCurrentClientVersion(); GLuint clientVersion = mRenderer->getCurrentClientVersion();
......
...@@ -688,10 +688,6 @@ void Renderer11::setTexture(gl::SamplerType type, int index, gl::Texture *textur ...@@ -688,10 +688,6 @@ void Renderer11::setTexture(gl::SamplerType type, int index, gl::Texture *textur
bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], const gl::Buffer *fragmentUniformBuffers[]) bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], const gl::Buffer *fragmentUniformBuffers[])
{ {
// convert buffers to ID3D11Buffer*
ID3D11Buffer *vertexConstantBuffers[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS] = { NULL };
ID3D11Buffer *pixelConstantBuffers[gl::IMPLEMENTATION_MAX_FRAGMENT_SHADER_UNIFORM_BUFFERS] = { NULL };
for (unsigned int uniformBufferIndex = 0; uniformBufferIndex < gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS; uniformBufferIndex++) for (unsigned int uniformBufferIndex = 0; uniformBufferIndex < gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS; uniformBufferIndex++)
{ {
const gl::Buffer *uniformBuffer = vertexUniformBuffers[uniformBufferIndex]; const gl::Buffer *uniformBuffer = vertexUniformBuffers[uniformBufferIndex];
...@@ -733,8 +729,6 @@ bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], con ...@@ -733,8 +729,6 @@ bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], con
1, &constantBuffer); 1, &constantBuffer);
mCurrentConstantBufferPS[uniformBufferIndex] = bufferStorage->getSerial(); mCurrentConstantBufferPS[uniformBufferIndex] = bufferStorage->getSerial();
} }
pixelConstantBuffers[uniformBufferIndex] = constantBuffer;
} }
} }
...@@ -2962,12 +2956,12 @@ ShaderExecutable *Renderer11::loadExecutable(const void *function, size_t length ...@@ -2962,12 +2956,12 @@ ShaderExecutable *Renderer11::loadExecutable(const void *function, size_t length
for (size_t i = 0; i < transformFeedbackVaryings.size(); i++) for (size_t i = 0; i < transformFeedbackVaryings.size(); i++)
{ {
const gl::LinkedVarying &varying = transformFeedbackVaryings[i]; const gl::LinkedVarying &varying = transformFeedbackVaryings[i];
for (size_t j = 0; j < transformFeedbackVaryings[i].semanticIndexCount; j++) for (size_t j = 0; j < varying.semanticIndexCount; j++)
{ {
D3D11_SO_DECLARATION_ENTRY entry = { 0 }; D3D11_SO_DECLARATION_ENTRY entry = { 0 };
entry.Stream = 0; entry.Stream = 0;
entry.SemanticName = transformFeedbackVaryings[i].semanticName.c_str(); entry.SemanticName = varying.semanticName.c_str();
entry.SemanticIndex = transformFeedbackVaryings[i].semanticIndex + j; entry.SemanticIndex = varying.semanticIndex + j;
entry.StartComponent = 0; entry.StartComponent = 0;
entry.ComponentCount = gl::VariableRowCount(type); entry.ComponentCount = gl::VariableRowCount(type);
entry.OutputSlot = (separatedOutputBuffers ? i : 0); entry.OutputSlot = (separatedOutputBuffers ? i : 0);
......
...@@ -585,6 +585,11 @@ ID3D11RenderTargetView *TextureStorage11_2D::getSwizzleRenderTarget(int mipLevel ...@@ -585,6 +585,11 @@ ID3D11RenderTargetView *TextureStorage11_2D::getSwizzleRenderTarget(int mipLevel
rtvDesc.Texture2D.MipSlice = mTopLevel + mipLevel; rtvDesc.Texture2D.MipSlice = mTopLevel + mipLevel;
HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]); HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]);
if (result == E_OUTOFMEMORY)
{
return gl::error(GL_OUT_OF_MEMORY, static_cast<ID3D11RenderTargetView*>(NULL));
}
ASSERT(SUCCEEDED(result));
} }
return mSwizzleRenderTargets[mipLevel]; return mSwizzleRenderTargets[mipLevel];
...@@ -937,6 +942,12 @@ ID3D11RenderTargetView *TextureStorage11_Cube::getSwizzleRenderTarget(int mipLev ...@@ -937,6 +942,12 @@ ID3D11RenderTargetView *TextureStorage11_Cube::getSwizzleRenderTarget(int mipLev
rtvDesc.Texture2DArray.ArraySize = 6; rtvDesc.Texture2DArray.ArraySize = 6;
HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]); HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]);
if (result == E_OUTOFMEMORY)
{
return gl::error(GL_OUT_OF_MEMORY, static_cast<ID3D11RenderTargetView*>(NULL));
}
ASSERT(SUCCEEDED(result));
} }
return mSwizzleRenderTargets[mipLevel]; return mSwizzleRenderTargets[mipLevel];
...@@ -1291,6 +1302,12 @@ ID3D11RenderTargetView *TextureStorage11_3D::getSwizzleRenderTarget(int mipLevel ...@@ -1291,6 +1302,12 @@ ID3D11RenderTargetView *TextureStorage11_3D::getSwizzleRenderTarget(int mipLevel
rtvDesc.Texture3D.WSize = -1; rtvDesc.Texture3D.WSize = -1;
HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]); HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]);
if (result == E_OUTOFMEMORY)
{
return gl::error(GL_OUT_OF_MEMORY, static_cast<ID3D11RenderTargetView*>(NULL));
}
ASSERT(SUCCEEDED(result));
} }
return mSwizzleRenderTargets[mipLevel]; return mSwizzleRenderTargets[mipLevel];
...@@ -1613,6 +1630,12 @@ ID3D11RenderTargetView *TextureStorage11_2DArray::getSwizzleRenderTarget(int mip ...@@ -1613,6 +1630,12 @@ ID3D11RenderTargetView *TextureStorage11_2DArray::getSwizzleRenderTarget(int mip
rtvDesc.Texture2DArray.ArraySize = mTextureDepth; rtvDesc.Texture2DArray.ArraySize = mTextureDepth;
HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]); HRESULT result = device->CreateRenderTargetView(mSwizzleTexture, &rtvDesc, &mSwizzleRenderTargets[mipLevel]);
if (result == E_OUTOFMEMORY)
{
return gl::error(GL_OUT_OF_MEMORY, static_cast<ID3D11RenderTargetView*>(NULL));
}
ASSERT(SUCCEEDED(result));
} }
return mSwizzleRenderTargets[mipLevel]; return mSwizzleRenderTargets[mipLevel];
......
...@@ -138,7 +138,6 @@ bool Image9::redefine(rx::Renderer *renderer, GLenum target, GLenum internalform ...@@ -138,7 +138,6 @@ bool Image9::redefine(rx::Renderer *renderer, GLenum target, GLenum internalform
forceRelease) forceRelease)
{ {
mRenderer = Renderer9::makeRenderer9(renderer); mRenderer = Renderer9::makeRenderer9(renderer);
GLuint clientVersion = mRenderer->getCurrentClientVersion();
mWidth = width; mWidth = width;
mHeight = height; mHeight = height;
...@@ -416,7 +415,6 @@ void Image9::loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLs ...@@ -416,7 +415,6 @@ void Image9::loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLs
GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, 1); GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, 1);
GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, height, 1); GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, height, 1);
GLuint outputPixelSize = d3d9::GetFormatPixelBytes(mD3DFormat);
GLuint outputBlockWidth = d3d9::GetBlockWidth(mD3DFormat); GLuint outputBlockWidth = d3d9::GetBlockWidth(mD3DFormat);
GLuint outputBlockHeight = d3d9::GetBlockHeight(mD3DFormat); GLuint outputBlockHeight = d3d9::GetBlockHeight(mD3DFormat);
......
...@@ -1896,9 +1896,6 @@ void Renderer9::clear(const gl::ClearParameters &clearParams, gl::Framebuffer *f ...@@ -1896,9 +1896,6 @@ void Renderer9::clear(const gl::ClearParameters &clearParams, gl::Framebuffer *f
stencilUnmasked = (0x1 << stencilSize) - 1; stencilUnmasked = (0x1 << stencilSize) - 1;
} }
bool alphaUnmasked = gl::GetAlphaBits(mRenderTargetDesc.format, getCurrentClientVersion()) == 0 ||
clearParams.colorMaskAlpha;
const bool needMaskedStencilClear = clearParams.clearStencil && const bool needMaskedStencilClear = clearParams.clearStencil &&
(clearParams.stencilWriteMask & stencilUnmasked) != stencilUnmasked; (clearParams.stencilWriteMask & stencilUnmasked) != stencilUnmasked;
......
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