Commit 3ae6465f by Austin Kinross Committed by Geoff Lang

Fix lots of variable shadowing in ANGLE

BUG=angle:877 Change-Id: I3df0fffb19f5ecbe439fbc2a8d6d239a5dc6b638 Reviewed-on: https://chromium-review.googlesource.com/243334Tested-by: 's avatarAustin Kinross <aukinros@microsoft.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 1be8870b
...@@ -423,25 +423,25 @@ void TCompiler::clearResults() ...@@ -423,25 +423,25 @@ void TCompiler::clearResults()
nameMap.clear(); nameMap.clear();
} }
bool TCompiler::detectCallDepth(TIntermNode* root, TInfoSink& infoSink, bool limitCallStackDepth) bool TCompiler::detectCallDepth(TIntermNode* inputRoot, TInfoSink& inputInfoSink, bool limitCallStackDepth)
{ {
DetectCallDepth detect(infoSink, limitCallStackDepth, maxCallStackDepth); DetectCallDepth detect(inputInfoSink, limitCallStackDepth, maxCallStackDepth);
root->traverse(&detect); inputRoot->traverse(&detect);
switch (detect.detectCallDepth()) switch (detect.detectCallDepth())
{ {
case DetectCallDepth::kErrorNone: case DetectCallDepth::kErrorNone:
return true; return true;
case DetectCallDepth::kErrorMissingMain: case DetectCallDepth::kErrorMissingMain:
infoSink.info.prefix(EPrefixError); inputInfoSink.info.prefix(EPrefixError);
infoSink.info << "Missing main()"; inputInfoSink.info << "Missing main()";
return false; return false;
case DetectCallDepth::kErrorRecursion: case DetectCallDepth::kErrorRecursion:
infoSink.info.prefix(EPrefixError); inputInfoSink.info.prefix(EPrefixError);
infoSink.info << "Function recursion detected"; inputInfoSink.info << "Function recursion detected";
return false; return false;
case DetectCallDepth::kErrorMaxDepthExceeded: case DetectCallDepth::kErrorMaxDepthExceeded:
infoSink.info.prefix(EPrefixError); inputInfoSink.info.prefix(EPrefixError);
infoSink.info << "Function call stack too deep"; inputInfoSink.info << "Function call stack too deep";
return false; return false;
default: default:
UNREACHABLE(); UNREACHABLE();
......
...@@ -33,7 +33,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe ...@@ -33,7 +33,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe
ASSERT(visit == PreVisit); ASSERT(visit == PreVisit);
ASSERT(detectCallDepth); ASSERT(detectCallDepth);
int maxDepth = depth; int retMaxDepth = depth;
visit = InVisit; visit = InVisit;
for (size_t i = 0; i < callees.size(); ++i) { for (size_t i = 0; i < callees.size(); ++i) {
switch (callees[i]->visit) { switch (callees[i]->visit) {
...@@ -52,7 +52,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe ...@@ -52,7 +52,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe
detectCallDepth->getInfoSink().info << "<-" << callees[i]->getName(); detectCallDepth->getInfoSink().info << "<-" << callees[i]->getName();
return callDepth; return callDepth;
} }
maxDepth = std::max(callDepth, maxDepth); retMaxDepth = std::max(callDepth, retMaxDepth);
break; break;
} }
default: default:
...@@ -61,7 +61,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe ...@@ -61,7 +61,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe
} }
} }
visit = PostVisit; visit = PostVisit;
return maxDepth; return retMaxDepth;
} }
void DetectCallDepth::FunctionNode::reset() void DetectCallDepth::FunctionNode::reset()
......
...@@ -651,11 +651,11 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -651,11 +651,11 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate *node)
for (TIntermSequence::const_iterator iter = node->getSequence()->begin(); for (TIntermSequence::const_iterator iter = node->getSequence()->begin();
iter != node->getSequence()->end(); ++iter) iter != node->getSequence()->end(); ++iter)
{ {
TIntermNode *node = *iter; TIntermNode *curNode = *iter;
ASSERT(node != NULL); ASSERT(curNode != NULL);
node->traverse(this); curNode->traverse(this);
if (isSingleStatement(node)) if (isSingleStatement(curNode))
out << ";\n"; out << ";\n";
} }
decrementDepth(); decrementDepth();
......
...@@ -1077,14 +1077,14 @@ const TVariable *TParseContext::getNamedVariable(const TSourceLoc &location, ...@@ -1077,14 +1077,14 @@ const TVariable *TParseContext::getNamedVariable(const TSourceLoc &location,
// //
// Return the function symbol if found, otherwise 0. // Return the function symbol if found, otherwise 0.
// //
const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction* call, int shaderVersion, bool *builtIn) const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction* call, int inputShaderVersion, bool *builtIn)
{ {
// First find by unmangled name to check whether the function name has been // First find by unmangled name to check whether the function name has been
// hidden by a variable name or struct typename. // hidden by a variable name or struct typename.
// If a function is found, check for one with a matching argument list. // If a function is found, check for one with a matching argument list.
const TSymbol* symbol = symbolTable.find(call->getName(), shaderVersion, builtIn); const TSymbol* symbol = symbolTable.find(call->getName(), inputShaderVersion, builtIn);
if (symbol == 0 || symbol->isFunction()) { if (symbol == 0 || symbol->isFunction()) {
symbol = symbolTable.find(call->getMangledName(), shaderVersion, builtIn); symbol = symbolTable.find(call->getMangledName(), inputShaderVersion, builtIn);
} }
if (symbol == 0) { if (symbol == 0) {
......
...@@ -120,7 +120,7 @@ struct TParseContext { ...@@ -120,7 +120,7 @@ struct TParseContext {
bool containsSampler(TType& type); bool containsSampler(TType& type);
bool areAllChildConst(TIntermAggregate* aggrNode); bool areAllChildConst(TIntermAggregate* aggrNode);
const TFunction* findFunction(const TSourceLoc& line, TFunction* pfnCall, int shaderVersion, bool *builtIn = 0); const TFunction* findFunction(const TSourceLoc& line, TFunction* pfnCall, int inputShaderVersion, bool *builtIn = 0);
bool executeInitializer(const TSourceLoc& line, const TString& identifier, TPublicType& pType, bool executeInitializer(const TSourceLoc& line, const TString& identifier, TPublicType& pType,
TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0); TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0);
......
...@@ -49,7 +49,7 @@ void TAliveTraverser::visitSymbol(TIntermSymbol* node) ...@@ -49,7 +49,7 @@ void TAliveTraverser::visitSymbol(TIntermSymbol* node)
found = true; found = true;
} }
bool TAliveTraverser::visitSelection(Visit preVisit, TIntermSelection* node) bool TAliveTraverser::visitSelection(Visit, TIntermSelection*)
{ {
if (wasFound()) if (wasFound())
return false; return false;
......
...@@ -86,7 +86,6 @@ bool ShaderVariable::findInfoByMappedName( ...@@ -86,7 +86,6 @@ bool ShaderVariable::findInfoByMappedName(
// 2) the top variable is an array; // 2) the top variable is an array;
// 3) otherwise. // 3) otherwise.
size_t pos = mappedFullName.find_first_of(".["); size_t pos = mappedFullName.find_first_of(".[");
std::string topName;
if (pos == std::string::npos) if (pos == std::string::npos)
{ {
......
...@@ -274,9 +274,9 @@ void StructureHLSL::addConstructor(const TType &type, const TString &name, const ...@@ -274,9 +274,9 @@ void StructureHLSL::addConstructor(const TType &type, const TString &name, const
for (unsigned int parameter = 0; parameter < ctorParameters.size(); parameter++) for (unsigned int parameter = 0; parameter < ctorParameters.size(); parameter++)
{ {
const TType &type = ctorParameters[parameter]; const TType &paramType = ctorParameters[parameter];
constructor += TypeString(type) + " x" + str(parameter) + ArrayString(type); constructor += TypeString(paramType) + " x" + str(parameter) + ArrayString(paramType);
if (parameter < ctorParameters.size() - 1) if (parameter < ctorParameters.size() - 1)
{ {
......
...@@ -46,9 +46,9 @@ void TranslatorESSL::translate(TIntermNode* root) { ...@@ -46,9 +46,9 @@ void TranslatorESSL::translate(TIntermNode* root) {
void TranslatorESSL::writeExtensionBehavior() { void TranslatorESSL::writeExtensionBehavior() {
TInfoSinkBase& sink = getInfoSink().obj; TInfoSinkBase& sink = getInfoSink().obj;
const TExtensionBehavior& extensionBehavior = getExtensionBehavior(); const TExtensionBehavior& extBehavior = getExtensionBehavior();
for (TExtensionBehavior::const_iterator iter = extensionBehavior.begin(); for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
iter != extensionBehavior.end(); ++iter) { iter != extBehavior.end(); ++iter) {
if (iter->second != EBhUndefined) { if (iter->second != EBhUndefined) {
if (getResources().NV_shader_framebuffer_fetch && iter->first == "GL_EXT_shader_framebuffer_fetch") { if (getResources().NV_shader_framebuffer_fetch && iter->first == "GL_EXT_shader_framebuffer_fetch") {
sink << "#extension GL_NV_shader_framebuffer_fetch : " sink << "#extension GL_NV_shader_framebuffer_fetch : "
......
...@@ -64,9 +64,9 @@ void TranslatorGLSL::writeVersion(TIntermNode *root) ...@@ -64,9 +64,9 @@ void TranslatorGLSL::writeVersion(TIntermNode *root)
void TranslatorGLSL::writeExtensionBehavior() { void TranslatorGLSL::writeExtensionBehavior() {
TInfoSinkBase& sink = getInfoSink().obj; TInfoSinkBase& sink = getInfoSink().obj;
const TExtensionBehavior& extensionBehavior = getExtensionBehavior(); const TExtensionBehavior& extBehavior = getExtensionBehavior();
for (TExtensionBehavior::const_iterator iter = extensionBehavior.begin(); for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
iter != extensionBehavior.end(); ++iter) { iter != extBehavior.end(); ++iter) {
if (iter->second == EBhUndefined) if (iter->second == EBhUndefined)
continue; continue;
......
...@@ -178,11 +178,12 @@ size_t TType::getObjectSize() const ...@@ -178,11 +178,12 @@ size_t TType::getObjectSize() const
if (isArray()) if (isArray())
{ {
size_t arraySize = getArraySize(); // TODO: getArraySize() returns an int, not a size_t
if (arraySize > INT_MAX / totalSize) size_t currentArraySize = getArraySize();
if (currentArraySize > INT_MAX / totalSize)
totalSize = INT_MAX; totalSize = INT_MAX;
else else
totalSize *= arraySize; totalSize *= currentArraySize;
} }
return totalSize; return totalSize;
......
...@@ -560,18 +560,18 @@ const InternalFormat &GetInternalFormatInfo(GLenum internalFormat) ...@@ -560,18 +560,18 @@ const InternalFormat &GetInternalFormatInfo(GLenum internalFormat)
} }
} }
GLuint InternalFormat::computeRowPitch(GLenum type, GLsizei width, GLint alignment) const GLuint InternalFormat::computeRowPitch(GLenum formatType, GLsizei width, GLint alignment) const
{ {
ASSERT(alignment > 0 && isPow2(alignment)); ASSERT(alignment > 0 && isPow2(alignment));
return rx::roundUp(computeBlockSize(type, width, 1), static_cast<GLuint>(alignment)); return rx::roundUp(computeBlockSize(formatType, width, 1), static_cast<GLuint>(alignment));
} }
GLuint InternalFormat::computeDepthPitch(GLenum type, GLsizei width, GLsizei height, GLint alignment) const GLuint InternalFormat::computeDepthPitch(GLenum formatType, GLsizei width, GLsizei height, GLint alignment) const
{ {
return computeRowPitch(type, width, alignment) * height; return computeRowPitch(formatType, width, alignment) * height;
} }
GLuint InternalFormat::computeBlockSize(GLenum type, GLsizei width, GLsizei height) const GLuint InternalFormat::computeBlockSize(GLenum formatType, GLsizei width, GLsizei height) const
{ {
if (compressed) if (compressed)
{ {
...@@ -581,7 +581,7 @@ GLuint InternalFormat::computeBlockSize(GLenum type, GLsizei width, GLsizei heig ...@@ -581,7 +581,7 @@ GLuint InternalFormat::computeBlockSize(GLenum type, GLsizei width, GLsizei heig
} }
else else
{ {
const Type &typeInfo = GetTypeInfo(type); const Type &typeInfo = GetTypeInfo(formatType);
if (typeInfo.specialInterpretation) if (typeInfo.specialInterpretation)
{ {
return typeInfo.bytes * width * height; return typeInfo.bytes * width * height;
......
...@@ -64,9 +64,9 @@ struct InternalFormat ...@@ -64,9 +64,9 @@ struct InternalFormat
SupportCheckFunction renderSupport; SupportCheckFunction renderSupport;
SupportCheckFunction filterSupport; SupportCheckFunction filterSupport;
GLuint computeRowPitch(GLenum type, GLsizei width, GLint alignment) const; GLuint computeRowPitch(GLenum formatType, GLsizei width, GLint alignment) const;
GLuint computeDepthPitch(GLenum type, GLsizei width, GLsizei height, GLint alignment) const; GLuint computeDepthPitch(GLenum formatType, GLsizei width, GLsizei height, GLint alignment) const;
GLuint computeBlockSize(GLenum type, GLsizei width, GLsizei height) const; GLuint computeBlockSize(GLenum formatType, GLsizei width, GLsizei height) const;
}; };
const InternalFormat &GetInternalFormatInfo(GLenum internalFormat); const InternalFormat &GetInternalFormatInfo(GLenum internalFormat);
......
...@@ -229,9 +229,9 @@ void ShaderD3D::compileToHLSL(ShHandle compiler, const std::string &source) ...@@ -229,9 +229,9 @@ void ShaderD3D::compileToHLSL(ShHandle compiler, const std::string &source)
if (uniform.staticUse) if (uniform.staticUse)
{ {
unsigned int index = -1; unsigned int index = -1;
bool result = ShGetUniformRegister(compiler, uniform.name, &index); bool getUniformRegisterResult = ShGetUniformRegister(compiler, uniform.name, &index);
UNUSED_ASSERTION_VARIABLE(result); UNUSED_ASSERTION_VARIABLE(getUniformRegisterResult);
ASSERT(result); ASSERT(getUniformRegisterResult);
mUniformRegisterMap[uniform.name] = index; mUniformRegisterMap[uniform.name] = index;
} }
...@@ -246,9 +246,9 @@ void ShaderD3D::compileToHLSL(ShHandle compiler, const std::string &source) ...@@ -246,9 +246,9 @@ void ShaderD3D::compileToHLSL(ShHandle compiler, const std::string &source)
if (interfaceBlock.staticUse) if (interfaceBlock.staticUse)
{ {
unsigned int index = -1; unsigned int index = -1;
bool result = ShGetInterfaceBlockRegister(compiler, interfaceBlock.name, &index); bool blockRegisterResult = ShGetInterfaceBlockRegister(compiler, interfaceBlock.name, &index);
UNUSED_ASSERTION_VARIABLE(result); UNUSED_ASSERTION_VARIABLE(blockRegisterResult);
ASSERT(result); ASSERT(blockRegisterResult);
mInterfaceBlockRegisterMap[interfaceBlock.name] = index; mInterfaceBlockRegisterMap[interfaceBlock.name] = index;
} }
......
...@@ -166,8 +166,6 @@ gl::Error TextureD3D::setImage(const gl::ImageIndex &index, GLenum type, const g ...@@ -166,8 +166,6 @@ gl::Error TextureD3D::setImage(const gl::ImageIndex &index, GLenum type, const g
if (pixelData != NULL) if (pixelData != NULL)
{ {
gl::Error error(GL_NO_ERROR);
if (shouldUseSetData(image)) if (shouldUseSetData(image))
{ {
error = mTexStorage->setData(index, image, NULL, type, unpack, pixelData); error = mTexStorage->setData(index, image, NULL, type, unpack, pixelData);
...@@ -210,7 +208,7 @@ gl::Error TextureD3D::subImage(const gl::ImageIndex &index, const gl::Box &area, ...@@ -210,7 +208,7 @@ gl::Error TextureD3D::subImage(const gl::ImageIndex &index, const gl::Box &area,
return mTexStorage->setData(index, image, &area, type, unpack, pixelData); return mTexStorage->setData(index, image, &area, type, unpack, pixelData);
} }
gl::Error error = image->loadData(area, unpack.alignment, type, pixelData); error = image->loadData(area, unpack.alignment, type, pixelData);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -245,7 +243,7 @@ gl::Error TextureD3D::setCompressedImage(const gl::ImageIndex &index, const gl:: ...@@ -245,7 +243,7 @@ gl::Error TextureD3D::setCompressedImage(const gl::ImageIndex &index, const gl::
ASSERT(image); ASSERT(image);
gl::Box fullImageArea(0, 0, 0, image->getWidth(), image->getHeight(), image->getDepth()); gl::Box fullImageArea(0, 0, 0, image->getWidth(), image->getHeight(), image->getDepth());
gl::Error error = image->loadCompressedData(fullImageArea, pixelData); error = image->loadCompressedData(fullImageArea, pixelData);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -272,7 +270,7 @@ gl::Error TextureD3D::subImageCompressed(const gl::ImageIndex &index, const gl:: ...@@ -272,7 +270,7 @@ gl::Error TextureD3D::subImageCompressed(const gl::ImageIndex &index, const gl::
ImageD3D *image = getImage(index); ImageD3D *image = getImage(index);
ASSERT(image); ASSERT(image);
gl::Error error = image->loadCompressedData(area, pixelData); error = image->loadCompressedData(area, pixelData);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -752,7 +750,7 @@ gl::Error TextureD3D_2D::copyImage(GLenum target, size_t level, const gl::Rectan ...@@ -752,7 +750,7 @@ gl::Error TextureD3D_2D::copyImage(GLenum target, size_t level, const gl::Rectan
if (sourceArea.width != 0 && sourceArea.height != 0 && isValidLevel(level)) if (sourceArea.width != 0 && sourceArea.height != 0 && isValidLevel(level))
{ {
gl::Error error = mRenderer->copyImage2D(source, sourceArea, internalFormat, destOffset, mTexStorage, level); error = mRenderer->copyImage2D(source, sourceArea, internalFormat, destOffset, mTexStorage, level);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -1682,11 +1680,11 @@ void TextureD3D_Cube::redefineImage(int faceIndex, GLint level, GLenum internalf ...@@ -1682,11 +1680,11 @@ void TextureD3D_Cube::redefineImage(int faceIndex, GLint level, GLenum internalf
size.height != storageHeight || size.height != storageHeight ||
internalformat != storageFormat) // Discard mismatched storage internalformat != storageFormat) // Discard mismatched storage
{ {
for (int level = 0; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++) for (int dirtyLevel = 0; dirtyLevel < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; dirtyLevel++)
{ {
for (int faceIndex = 0; faceIndex < 6; faceIndex++) for (int dirtyFace = 0; dirtyFace < 6; dirtyFace++)
{ {
mImageArray[faceIndex][level]->markDirty(); mImageArray[dirtyFace][dirtyLevel]->markDirty();
} }
} }
...@@ -2811,11 +2809,11 @@ void TextureD3D_2DArray::redefineImage(GLint level, GLenum internalformat, const ...@@ -2811,11 +2809,11 @@ void TextureD3D_2DArray::redefineImage(GLint level, GLenum internalformat, const
size.depth != storageDepth || size.depth != storageDepth ||
internalformat != storageFormat) // Discard mismatched storage internalformat != storageFormat) // Discard mismatched storage
{ {
for (int level = 0; level < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++) for (int dirtyLevel = 0; dirtyLevel < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; dirtyLevel++)
{ {
for (int layer = 0; layer < mLayerCounts[level]; layer++) for (int dirtyLayer = 0; dirtyLayer < mLayerCounts[dirtyLevel]; dirtyLayer++)
{ {
mImageArray[level][layer]->markDirty(); mImageArray[dirtyLevel][dirtyLayer]->markDirty();
} }
} }
......
...@@ -305,8 +305,8 @@ gl::Error VertexDataManager::storeAttribute(const gl::VertexAttribute &attrib, ...@@ -305,8 +305,8 @@ gl::Error VertexDataManager::storeAttribute(const gl::VertexAttribute &attrib,
int totalCount = ElementsInBuffer(attrib, storage->getSize()); int totalCount = ElementsInBuffer(attrib, storage->getSize());
int startIndex = attrib.offset / ComputeVertexAttributeStride(attrib); int startIndex = attrib.offset / ComputeVertexAttributeStride(attrib);
gl::Error error = staticBuffer->storeVertexAttributes(attrib, currentValue, -startIndex, totalCount, error = staticBuffer->storeVertexAttributes(attrib, currentValue, -startIndex, totalCount,
0, &streamOffset); 0, &streamOffset);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -534,13 +534,13 @@ ID3D11BlendState *Clear11::getBlendState(const std::vector<MaskedRenderTarget>& ...@@ -534,13 +534,13 @@ ID3D11BlendState *Clear11::getBlendState(const std::vector<MaskedRenderTarget>&
blendDesc.AlphaToCoverageEnable = FALSE; blendDesc.AlphaToCoverageEnable = FALSE;
blendDesc.IndependentBlendEnable = (rts.size() > 1) ? TRUE : FALSE; blendDesc.IndependentBlendEnable = (rts.size() > 1) ? TRUE : FALSE;
for (unsigned int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++) for (unsigned int j = 0; j < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; j++)
{ {
blendDesc.RenderTarget[i].BlendEnable = FALSE; blendDesc.RenderTarget[j].BlendEnable = FALSE;
blendDesc.RenderTarget[i].RenderTargetWriteMask = gl_d3d11::ConvertColorMask(blendKey.maskChannels[i][0], blendDesc.RenderTarget[j].RenderTargetWriteMask = gl_d3d11::ConvertColorMask(blendKey.maskChannels[j][0],
blendKey.maskChannels[i][1], blendKey.maskChannels[j][1],
blendKey.maskChannels[i][2], blendKey.maskChannels[j][2],
blendKey.maskChannels[i][3]); blendKey.maskChannels[j][3]);
} }
ID3D11Device *device = mRenderer->getDevice(); ID3D11Device *device = mRenderer->getDevice();
......
...@@ -179,7 +179,7 @@ gl::Error FenceSync11::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *ou ...@@ -179,7 +179,7 @@ gl::Error FenceSync11::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *ou
while (currentCounter.QuadPart < endCounter && !result) while (currentCounter.QuadPart < endCounter && !result)
{ {
ScheduleYield(); ScheduleYield();
BOOL success = QueryPerformanceCounter(&currentCounter); success = QueryPerformanceCounter(&currentCounter);
UNUSED_ASSERTION_VARIABLE(success); UNUSED_ASSERTION_VARIABLE(success);
ASSERT(success); ASSERT(success);
......
...@@ -216,7 +216,6 @@ gl::Error InputLayoutCache::applyVertexBuffers(TranslatedAttribute attributes[gl ...@@ -216,7 +216,6 @@ gl::Error InputLayoutCache::applyVertexBuffers(TranslatedAttribute attributes[gl
{ {
gl::VertexFormat shaderInputLayout[gl::MAX_VERTEX_ATTRIBS]; gl::VertexFormat shaderInputLayout[gl::MAX_VERTEX_ATTRIBS];
GetInputLayout(attributes, shaderInputLayout); GetInputLayout(attributes, shaderInputLayout);
ProgramD3D *programD3D = ProgramD3D::makeProgramD3D(program->getImplementation());
ShaderExecutableD3D *shader = NULL; ShaderExecutableD3D *shader = NULL;
gl::Error error = programD3D->getVertexExecutableForInputLayout(shaderInputLayout, &shader, nullptr); gl::Error error = programD3D->getVertexExecutableForInputLayout(shaderInputLayout, &shader, nullptr);
......
...@@ -379,8 +379,6 @@ gl::Error TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture, u ...@@ -379,8 +379,6 @@ gl::Error TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture, u
} }
else else
{ {
const d3d11::DXGIFormat &dxgiFormatInfo = d3d11::GetDXGIFormatInfo(mTextureFormat);
D3D11_BOX srcBox; D3D11_BOX srcBox;
srcBox.left = copyArea.x; srcBox.left = copyArea.x;
srcBox.top = copyArea.y; srcBox.top = copyArea.y;
...@@ -788,7 +786,6 @@ gl::Error TextureStorage11_2D::copyToStorage(TextureStorage *destStorage) ...@@ -788,7 +786,6 @@ gl::Error TextureStorage11_2D::copyToStorage(TextureStorage *destStorage)
return error; return error;
} }
TextureStorage11 *dest11 = TextureStorage11::makeTextureStorage11(destStorage);
ID3D11Resource *destResource = NULL; ID3D11Resource *destResource = NULL;
error = dest11->getResource(&destResource); error = dest11->getResource(&destResource);
if (error.isError()) if (error.isError())
......
...@@ -124,7 +124,7 @@ gl::Error VertexBuffer11::storeVertexAttributes(const gl::VertexAttribute &attri ...@@ -124,7 +124,7 @@ gl::Error VertexBuffer11::storeVertexAttributes(const gl::VertexAttribute &attri
if (buffer) if (buffer)
{ {
BufferD3D *storage = BufferD3D::makeFromBuffer(buffer); BufferD3D *storage = BufferD3D::makeFromBuffer(buffer);
gl::Error error = storage->getData(&input); error = storage->getData(&input);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -237,8 +237,8 @@ static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, ID3D11De ...@@ -237,8 +237,8 @@ static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, ID3D11De
UINT formatSupport; UINT formatSupport;
if (SUCCEEDED(device->CheckFormatSupport(formatInfo.texFormat, &formatSupport))) if (SUCCEEDED(device->CheckFormatSupport(formatInfo.texFormat, &formatSupport)))
{ {
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalFormat); const gl::InternalFormat &internalFormatInfo = gl::GetInternalFormatInfo(internalFormat);
if (formatInfo.depthBits > 0 || formatInfo.stencilBits > 0) if (internalFormatInfo.depthBits > 0 || internalFormatInfo.stencilBits > 0)
{ {
textureCaps.texturable = ((formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0); textureCaps.texturable = ((formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0);
} }
......
...@@ -395,7 +395,7 @@ gl::Error Image9::copyToStorage(TextureStorage *storage, const gl::ImageIndex &i ...@@ -395,7 +395,7 @@ gl::Error Image9::copyToStorage(TextureStorage *storage, const gl::ImageIndex &i
if (index.type == GL_TEXTURE_2D) if (index.type == GL_TEXTURE_2D)
{ {
TextureStorage9_2D *storage9 = TextureStorage9_2D::makeTextureStorage9_2D(storage); TextureStorage9_2D *storage9 = TextureStorage9_2D::makeTextureStorage9_2D(storage);
gl::Error error = storage9->getSurfaceLevel(index.mipIndex, true, &destSurface); error = storage9->getSurfaceLevel(index.mipIndex, true, &destSurface);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -405,7 +405,7 @@ gl::Error Image9::copyToStorage(TextureStorage *storage, const gl::ImageIndex &i ...@@ -405,7 +405,7 @@ gl::Error Image9::copyToStorage(TextureStorage *storage, const gl::ImageIndex &i
{ {
ASSERT(gl::IsCubeMapTextureTarget(index.type)); ASSERT(gl::IsCubeMapTextureTarget(index.type));
TextureStorage9_Cube *storage9 = TextureStorage9_Cube::makeTextureStorage9_Cube(storage); TextureStorage9_Cube *storage9 = TextureStorage9_Cube::makeTextureStorage9_Cube(storage);
gl::Error error = storage9->getCubeMapSurface(index.type, index.mipIndex, true, &destSurface); error = storage9->getCubeMapSurface(index.type, index.mipIndex, true, &destSurface);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -99,7 +99,7 @@ gl::Error VertexBuffer9::storeVertexAttributes(const gl::VertexAttribute &attrib ...@@ -99,7 +99,7 @@ gl::Error VertexBuffer9::storeVertexAttributes(const gl::VertexAttribute &attrib
{ {
BufferD3D *storage = BufferD3D::makeFromBuffer(buffer); BufferD3D *storage = BufferD3D::makeFromBuffer(buffer);
ASSERT(storage); ASSERT(storage);
gl::Error error = storage->getData(&input); error = storage->getData(&input);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
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