From: Nicolas Capens Date: Wed, 13 Jan 2016 05:22:02 +0000 (-0500) Subject: Remove unused return value. X-Git-Tag: android-x86-7.1-r1~692 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=29faf67efafa22b44609550234f72faf773548df;p=android-x86%2Fexternal-swiftshader.git Remove unused return value. Change-Id: I99731b6697a4ae92b1d04c8a8d895a0cf19d580c Reviewed-on: https://swiftshader-review.googlesource.com/4545 Tested-by: Nicolas Capens Reviewed-by: Alexis Hétu Reviewed-by: Nicolas Capens --- diff --git a/src/OpenGL/libGLESv2/Context.cpp b/src/OpenGL/libGLESv2/Context.cpp index f5b625682..7bce0a121 100644 --- a/src/OpenGL/libGLESv2/Context.cpp +++ b/src/OpenGL/libGLESv2/Context.cpp @@ -306,7 +306,7 @@ void Context::makeCurrent(egl::Surface *surface) { depthStencil->release(); } - + markAllStateDirty(); } @@ -767,7 +767,7 @@ GLuint Context::getElementArrayBufferName() const GLuint Context::getActiveQuery(GLenum target) const { Query *queryObject = NULL; - + switch(target) { case GL_ANY_SAMPLES_PASSED_EXT: @@ -787,7 +787,7 @@ GLuint Context::getActiveQuery(GLenum target) const { return queryObject->name; } - + return 0; } @@ -951,7 +951,7 @@ GLuint Context::createVertexArray() { GLuint handle = mVertexArrayNameSpace.allocate(); - mVertexArrayMap[handle] = NULL; + mVertexArrayMap[handle] = nullptr; return handle; } @@ -985,7 +985,7 @@ void Context::deleteBuffer(GLuint buffer) { detachBuffer(buffer); } - + mResourceManager->deleteBuffer(buffer); } @@ -1015,7 +1015,7 @@ void Context::deleteRenderbuffer(GLuint renderbuffer) { detachRenderbuffer(renderbuffer); } - + mResourceManager->deleteRenderbuffer(renderbuffer); } @@ -1048,16 +1048,16 @@ void Context::deleteFence(GLuint fence) void Context::deleteQuery(GLuint query) { QueryMap::iterator queryObject = mQueryMap.find(query); - + if(queryObject != mQueryMap.end()) { mQueryNameSpace.release(queryObject->first); - + if(queryObject->second) { queryObject->second->release(); } - + mQueryMap.erase(queryObject); } } @@ -1199,7 +1199,7 @@ void Context::bindTransformFeedbackBuffer(GLuint buffer) mResourceManager->checkBufferAllocation(buffer); TransformFeedback* transformFeedback = getTransformFeedback(mState.transformFeedback); - + if(transformFeedback) { transformFeedback->setGenericBuffer(getBuffer(buffer)); @@ -1268,9 +1268,9 @@ void Context::bindRenderbuffer(GLuint renderbuffer) mState.renderbuffer = getRenderbuffer(renderbuffer); } -bool Context::bindVertexArray(GLuint array) +void Context::bindVertexArray(GLuint array) { - VertexArray* vertexArray = getVertexArray(array); + VertexArray *vertexArray = getVertexArray(array); if(!vertexArray) { @@ -1279,8 +1279,6 @@ bool Context::bindVertexArray(GLuint array) } mState.vertexArray = array; - - return !!vertexArray; } void Context::bindGenericUniformBuffer(GLuint buffer) @@ -1363,7 +1361,7 @@ void Context::useProgram(GLuint program) { newProgram->addRef(); } - + if(oldProgram) { oldProgram->release(); @@ -1373,10 +1371,10 @@ void Context::useProgram(GLuint program) void Context::beginQuery(GLenum target, GLuint query) { - // From EXT_occlusion_query_boolean: If BeginQueryEXT is called with an - // of zero, if the active query object name for is non-zero (for the - // targets ANY_SAMPLES_PASSED_EXT and ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, if - // the active query for either target is non-zero), if is the name of an + // From EXT_occlusion_query_boolean: If BeginQueryEXT is called with an + // of zero, if the active query object name for is non-zero (for the + // targets ANY_SAMPLES_PASSED_EXT and ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, if + // the active query for either target is non-zero), if is the name of an // existing query object whose type does not match , or if is the // active query object name for any query type, the error INVALID_OPERATION is // generated. @@ -1399,16 +1397,16 @@ void Context::beginQuery(GLenum target, GLuint query) QueryType qType; switch(target) { - case GL_ANY_SAMPLES_PASSED_EXT: - qType = QUERY_ANY_SAMPLES_PASSED; + case GL_ANY_SAMPLES_PASSED_EXT: + qType = QUERY_ANY_SAMPLES_PASSED; break; - case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT: - qType = QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE; + case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT: + qType = QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE; break; case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: qType = QUERY_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN; break; - default: + default: ASSERT(false); } @@ -1540,7 +1538,7 @@ VertexArray *Context::getVertexArray(GLuint array) const { VertexArrayMap::const_iterator vertexArray = mVertexArrayMap.find(array); - return (vertexArray == mVertexArrayMap.end()) ? NULL : vertexArray->second; + return (vertexArray == mVertexArrayMap.end()) ? nullptr : vertexArray->second; } VertexArray *Context::getCurrentVertexArray() const @@ -1924,7 +1922,7 @@ template bool Context::getIntegerv(GLenum pname, T *params) const // Please note: DEPTH_CLEAR_VALUE is not included in our internal getIntegerv implementation // because it is stored as a float, despite the fact that the GL ES 2.0 spec names // GetIntegerv as its native query function. As it would require conversion in any - // case, this should make no difference to the calling application. You may find it in + // case, this should make no difference to the calling application. You may find it in // Context::getFloatv. switch(pname) { @@ -1977,7 +1975,7 @@ template bool Context::getIntegerv(GLenum pname, T *params) const case GL_MAX_CUBE_MAP_TEXTURE_SIZE: *params = IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE; break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS: *params = NUM_COMPRESSED_TEXTURE_FORMATS; break; case GL_MAX_SAMPLES_ANGLE: *params = IMPLEMENTATION_MAX_SAMPLES; break; - case GL_SAMPLE_BUFFERS: + case GL_SAMPLE_BUFFERS: case GL_SAMPLES: { Framebuffer *framebuffer = getDrawFramebuffer(); @@ -2454,7 +2452,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu // Please note: the query type returned for DEPTH_CLEAR_VALUE in this implementation // is FLOAT rather than INT, as would be suggested by the GL ES 2.0 spec. This is due // to the fact that it is stored internally as a float, and so would require conversion - // if returned from Context::getIntegerv. Since this conversion is already implemented + // if returned from Context::getIntegerv. Since this conversion is already implemented // in the case that one calls glGetIntegerv to retrieve a float-typed state variable, we // place DEPTH_CLEAR_VALUE with the floats. This should make no difference to the calling // application. @@ -2946,7 +2944,7 @@ void Context::applyState(GLenum drawMode) } } } - + if(mState.sampleCoverageInvert) { mask = ~mask; @@ -2993,7 +2991,7 @@ GLenum Context::applyVertexBuffer(GLint base, GLint first, GLsizei count, GLsize sw::Resource *resource = attributes[i].vertexBuffer; const void *buffer = (char*)resource->data() + attributes[i].offset; - + int stride = attributes[i].stride; buffer = (char*)buffer + stride * base; @@ -3144,7 +3142,7 @@ void Context::applyTexture(sw::SamplerType type, int index, Texture *baseTexture } device->setTextureResource(sampler, resource); - + if(baseTexture && textureUsed) { int levelCount = baseTexture->getLevelCount(); @@ -3272,7 +3270,7 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLsizei outputHeight = (mState.packImageHeight == 0) ? height : mState.packImageHeight; pixels = getPixelPackBuffer() ? (unsigned char*)getPixelPackBuffer()->data() + (ptrdiff_t)pixels : (unsigned char*)pixels; pixels = ((char*)pixels) + (mState.packSkipImages * outputHeight + mState.packSkipRows) * outputPitch + mState.packSkipPixels; - + // Sized query sanity check if(bufSize) { @@ -3317,7 +3315,7 @@ void Context::clear(GLbitfield mask) { return; } - + if(mask & GL_COLOR_BUFFER_BIT) { unsigned int rgbaMask = getColorMask(); @@ -3816,7 +3814,7 @@ void Context::setVertexAttrib(GLuint index, const GLuint *values) mVertexDataManager->dirtyCurrentValue(index); } -void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, +void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask) { @@ -3863,7 +3861,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 destRect.x0 = dstX1; destRect.x1 = dstX0; } - + if(srcY0 < srcY1) { sourceRect.y0 = srcY0; @@ -3923,7 +3921,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 sw::Rect sourceTrimmedRect = sourceScissoredRect; sw::Rect destTrimmedRect = destScissoredRect; - // The source & destination rectangles also may need to be trimmed if they fall out of the bounds of + // The source & destination rectangles also may need to be trimmed if they fall out of the bounds of // the actual draw and read surfaces. if(sourceTrimmedRect.x0 < 0) { @@ -3984,7 +3982,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 bool partialBufferCopy = false; if(sourceTrimmedRect.y1 - sourceTrimmedRect.y0 < readBufferHeight || - sourceTrimmedRect.x1 - sourceTrimmedRect.x0 < readBufferWidth || + sourceTrimmedRect.x1 - sourceTrimmedRect.x0 < readBufferWidth || destTrimmedRect.y1 - destTrimmedRect.y0 < drawBufferHeight || destTrimmedRect.x1 - destTrimmedRect.x0 < drawBufferWidth || sourceTrimmedRect.y0 != 0 || destTrimmedRect.y0 != 0 || sourceTrimmedRect.x0 != 0 || destTrimmedRect.x0 != 0) @@ -4005,7 +4003,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 { return error(GL_INVALID_OPERATION); } - + if(partialBufferCopy && readBufferSamples > 1) { return error(GL_INVALID_OPERATION); @@ -4058,7 +4056,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 return error(GL_INVALID_OPERATION); // Only whole-buffer copies are permitted } - if((drawDSBuffer && drawDSBuffer->getSamples() > 1) || + if((drawDSBuffer && drawDSBuffer->getSamples() > 1) || (readDSBuffer && readDSBuffer->getSamples() > 1)) { return error(GL_INVALID_OPERATION); @@ -4071,7 +4069,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 { egl::Image *readRenderTarget = readFramebuffer->getReadRenderTarget(); egl::Image *drawRenderTarget = drawFramebuffer->getRenderTarget(0); - + if(flipX) { swap(destRect.x0, destRect.x1); @@ -4138,7 +4136,7 @@ EGLenum Context::validateSharedImage(EGLenum target, GLuint name, GLuint texture default: return EGL_BAD_PARAMETER; } - + if(textureLevel >= es2::IMPLEMENTATION_MAX_TEXTURE_LEVELS) { return EGL_BAD_MATCH; diff --git a/src/OpenGL/libGLESv2/Context.h b/src/OpenGL/libGLESv2/Context.h index 9defd5065..eb4e810ed 100644 --- a/src/OpenGL/libGLESv2/Context.h +++ b/src/OpenGL/libGLESv2/Context.h @@ -427,7 +427,7 @@ public: bool isDepthTestEnabled() const; void setDepthFunc(GLenum depthFunc); void setDepthRange(float zNear, float zFar); - + void setBlendEnabled(bool enabled); bool isBlendEnabled() const; void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha); @@ -518,7 +518,7 @@ public: void setPackSkipRows(GLint skipRows); void setPackSkipImages(GLint skipImages); - // These create and destroy methods are merely pass-throughs to + // These create and destroy methods are merely pass-throughs to // ResourceManager, which owns these object types GLuint createBuffer(); GLuint createShader(GLenum type); @@ -571,7 +571,7 @@ public: void bindReadFramebuffer(GLuint framebuffer); void bindDrawFramebuffer(GLuint framebuffer); void bindRenderbuffer(GLuint renderbuffer); - bool bindVertexArray(GLuint array); + void bindVertexArray(GLuint array); void bindGenericUniformBuffer(GLuint buffer); void bindIndexedUniformBuffer(GLuint buffer, GLuint index, GLintptr offset, GLsizeiptr size); void bindGenericTransformFeedbackBuffer(GLuint buffer); @@ -660,8 +660,8 @@ public: GLenum getError(); static int getSupportedMultisampleCount(int requested); - - void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + + void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask); @@ -743,7 +743,7 @@ private: bool mHasBeenCurrent; unsigned int mAppliedProgramSerial; - + // state caching flags bool mDepthStateDirty; bool mMaskStateDirty;