{\r
depthStencil->release();\r
}\r
- \r
+\r
markAllStateDirty();\r
}\r
\r
GLuint Context::getActiveQuery(GLenum target) const\r
{\r
Query *queryObject = NULL;\r
- \r
+\r
switch(target)\r
{\r
case GL_ANY_SAMPLES_PASSED_EXT:\r
{\r
return queryObject->name;\r
}\r
- \r
+\r
return 0;\r
}\r
\r
{\r
GLuint handle = mVertexArrayNameSpace.allocate();\r
\r
- mVertexArrayMap[handle] = NULL;\r
+ mVertexArrayMap[handle] = nullptr;\r
\r
return handle;\r
}\r
{\r
detachBuffer(buffer);\r
}\r
- \r
+\r
mResourceManager->deleteBuffer(buffer);\r
}\r
\r
{\r
detachRenderbuffer(renderbuffer);\r
}\r
- \r
+\r
mResourceManager->deleteRenderbuffer(renderbuffer);\r
}\r
\r
void Context::deleteQuery(GLuint query)\r
{\r
QueryMap::iterator queryObject = mQueryMap.find(query);\r
- \r
+\r
if(queryObject != mQueryMap.end())\r
{\r
mQueryNameSpace.release(queryObject->first);\r
- \r
+\r
if(queryObject->second)\r
{\r
queryObject->second->release();\r
}\r
- \r
+\r
mQueryMap.erase(queryObject);\r
}\r
}\r
mResourceManager->checkBufferAllocation(buffer);\r
\r
TransformFeedback* transformFeedback = getTransformFeedback(mState.transformFeedback);\r
- \r
+\r
if(transformFeedback)\r
{\r
transformFeedback->setGenericBuffer(getBuffer(buffer));\r
mState.renderbuffer = getRenderbuffer(renderbuffer);\r
}\r
\r
-bool Context::bindVertexArray(GLuint array)\r
+void Context::bindVertexArray(GLuint array)\r
{\r
- VertexArray* vertexArray = getVertexArray(array);\r
+ VertexArray *vertexArray = getVertexArray(array);\r
\r
if(!vertexArray)\r
{\r
}\r
\r
mState.vertexArray = array;\r
-\r
- return !!vertexArray;\r
}\r
\r
void Context::bindGenericUniformBuffer(GLuint buffer)\r
{\r
newProgram->addRef();\r
}\r
- \r
+\r
if(oldProgram)\r
{\r
oldProgram->release();\r
\r
void Context::beginQuery(GLenum target, GLuint query)\r
{\r
- // From EXT_occlusion_query_boolean: If BeginQueryEXT is called with an <id> \r
- // of zero, if the active query object name for <target> is non-zero (for the \r
- // targets ANY_SAMPLES_PASSED_EXT and ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, if \r
- // the active query for either target is non-zero), if <id> is the name of an \r
+ // From EXT_occlusion_query_boolean: If BeginQueryEXT is called with an <id>\r
+ // of zero, if the active query object name for <target> is non-zero (for the\r
+ // targets ANY_SAMPLES_PASSED_EXT and ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, if\r
+ // the active query for either target is non-zero), if <id> is the name of an\r
// existing query object whose type does not match <target>, or if <id> is the\r
// active query object name for any query type, the error INVALID_OPERATION is\r
// generated.\r
QueryType qType;\r
switch(target)\r
{\r
- case GL_ANY_SAMPLES_PASSED_EXT: \r
- qType = QUERY_ANY_SAMPLES_PASSED; \r
+ case GL_ANY_SAMPLES_PASSED_EXT:\r
+ qType = QUERY_ANY_SAMPLES_PASSED;\r
break;\r
- case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT: \r
- qType = QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE; \r
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT:\r
+ qType = QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE;\r
break;\r
case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:\r
qType = QUERY_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN;\r
break;\r
- default: \r
+ default:\r
ASSERT(false);\r
}\r
\r
{\r
VertexArrayMap::const_iterator vertexArray = mVertexArrayMap.find(array);\r
\r
- return (vertexArray == mVertexArrayMap.end()) ? NULL : vertexArray->second;\r
+ return (vertexArray == mVertexArrayMap.end()) ? nullptr : vertexArray->second;\r
}\r
\r
VertexArray *Context::getCurrentVertexArray() const\r
// Please note: DEPTH_CLEAR_VALUE is not included in our internal getIntegerv implementation\r
// because it is stored as a float, despite the fact that the GL ES 2.0 spec names\r
// GetIntegerv as its native query function. As it would require conversion in any\r
- // case, this should make no difference to the calling application. You may find it in \r
+ // case, this should make no difference to the calling application. You may find it in\r
// Context::getFloatv.\r
switch(pname)\r
{\r
case GL_MAX_CUBE_MAP_TEXTURE_SIZE: *params = IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE; break;\r
case GL_NUM_COMPRESSED_TEXTURE_FORMATS: *params = NUM_COMPRESSED_TEXTURE_FORMATS; break;\r
case GL_MAX_SAMPLES_ANGLE: *params = IMPLEMENTATION_MAX_SAMPLES; break;\r
- case GL_SAMPLE_BUFFERS: \r
+ case GL_SAMPLE_BUFFERS:\r
case GL_SAMPLES:\r
{\r
Framebuffer *framebuffer = getDrawFramebuffer();\r
// Please note: the query type returned for DEPTH_CLEAR_VALUE in this implementation\r
// is FLOAT rather than INT, as would be suggested by the GL ES 2.0 spec. This is due\r
// to the fact that it is stored internally as a float, and so would require conversion\r
- // if returned from Context::getIntegerv. Since this conversion is already implemented \r
+ // if returned from Context::getIntegerv. Since this conversion is already implemented\r
// in the case that one calls glGetIntegerv to retrieve a float-typed state variable, we\r
// place DEPTH_CLEAR_VALUE with the floats. This should make no difference to the calling\r
// application.\r
}\r
}\r
}\r
- \r
+\r
if(mState.sampleCoverageInvert)\r
{\r
mask = ~mask;\r
\r
sw::Resource *resource = attributes[i].vertexBuffer;\r
const void *buffer = (char*)resource->data() + attributes[i].offset;\r
- \r
+\r
int stride = attributes[i].stride;\r
\r
buffer = (char*)buffer + stride * base;\r
}\r
\r
device->setTextureResource(sampler, resource);\r
- \r
+\r
if(baseTexture && textureUsed)\r
{\r
int levelCount = baseTexture->getLevelCount();\r
GLsizei outputHeight = (mState.packImageHeight == 0) ? height : mState.packImageHeight;\r
pixels = getPixelPackBuffer() ? (unsigned char*)getPixelPackBuffer()->data() + (ptrdiff_t)pixels : (unsigned char*)pixels;\r
pixels = ((char*)pixels) + (mState.packSkipImages * outputHeight + mState.packSkipRows) * outputPitch + mState.packSkipPixels;\r
- \r
+\r
// Sized query sanity check\r
if(bufSize)\r
{\r
{\r
return;\r
}\r
- \r
+\r
if(mask & GL_COLOR_BUFFER_BIT)\r
{\r
unsigned int rgbaMask = getColorMask();\r
mVertexDataManager->dirtyCurrentValue(index);\r
}\r
\r
-void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, \r
+void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,\r
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,\r
GLbitfield mask)\r
{\r
destRect.x0 = dstX1;\r
destRect.x1 = dstX0;\r
}\r
- \r
+\r
if(srcY0 < srcY1)\r
{\r
sourceRect.y0 = srcY0;\r
sw::Rect sourceTrimmedRect = sourceScissoredRect;\r
sw::Rect destTrimmedRect = destScissoredRect;\r
\r
- // The source & destination rectangles also may need to be trimmed if they fall out of the bounds of \r
+ // The source & destination rectangles also may need to be trimmed if they fall out of the bounds of\r
// the actual draw and read surfaces.\r
if(sourceTrimmedRect.x0 < 0)\r
{\r
bool partialBufferCopy = false;\r
\r
if(sourceTrimmedRect.y1 - sourceTrimmedRect.y0 < readBufferHeight ||\r
- sourceTrimmedRect.x1 - sourceTrimmedRect.x0 < readBufferWidth || \r
+ sourceTrimmedRect.x1 - sourceTrimmedRect.x0 < readBufferWidth ||\r
destTrimmedRect.y1 - destTrimmedRect.y0 < drawBufferHeight ||\r
destTrimmedRect.x1 - destTrimmedRect.x0 < drawBufferWidth ||\r
sourceTrimmedRect.y0 != 0 || destTrimmedRect.y0 != 0 || sourceTrimmedRect.x0 != 0 || destTrimmedRect.x0 != 0)\r
{\r
return error(GL_INVALID_OPERATION);\r
}\r
- \r
+\r
if(partialBufferCopy && readBufferSamples > 1)\r
{\r
return error(GL_INVALID_OPERATION);\r
return error(GL_INVALID_OPERATION); // Only whole-buffer copies are permitted\r
}\r
\r
- if((drawDSBuffer && drawDSBuffer->getSamples() > 1) || \r
+ if((drawDSBuffer && drawDSBuffer->getSamples() > 1) ||\r
(readDSBuffer && readDSBuffer->getSamples() > 1))\r
{\r
return error(GL_INVALID_OPERATION);\r
{\r
egl::Image *readRenderTarget = readFramebuffer->getReadRenderTarget();\r
egl::Image *drawRenderTarget = drawFramebuffer->getRenderTarget(0);\r
- \r
+\r
if(flipX)\r
{\r
swap(destRect.x0, destRect.x1);\r
default:\r
return EGL_BAD_PARAMETER;\r
}\r
- \r
+\r
if(textureLevel >= es2::IMPLEMENTATION_MAX_TEXTURE_LEVELS)\r
{\r
return EGL_BAD_MATCH;\r
bool isDepthTestEnabled() const;\r
void setDepthFunc(GLenum depthFunc);\r
void setDepthRange(float zNear, float zFar);\r
- \r
+\r
void setBlendEnabled(bool enabled);\r
bool isBlendEnabled() const;\r
void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha);\r
void setPackSkipRows(GLint skipRows);\r
void setPackSkipImages(GLint skipImages);\r
\r
- // These create and destroy methods are merely pass-throughs to \r
+ // These create and destroy methods are merely pass-throughs to\r
// ResourceManager, which owns these object types\r
GLuint createBuffer();\r
GLuint createShader(GLenum type);\r
void bindReadFramebuffer(GLuint framebuffer);\r
void bindDrawFramebuffer(GLuint framebuffer);\r
void bindRenderbuffer(GLuint renderbuffer);\r
- bool bindVertexArray(GLuint array);\r
+ void bindVertexArray(GLuint array);\r
void bindGenericUniformBuffer(GLuint buffer);\r
void bindIndexedUniformBuffer(GLuint buffer, GLuint index, GLintptr offset, GLsizeiptr size);\r
void bindGenericTransformFeedbackBuffer(GLuint buffer);\r
GLenum getError();\r
\r
static int getSupportedMultisampleCount(int requested);\r
- \r
- void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, \r
+\r
+ void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,\r
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,\r
GLbitfield mask);\r
\r
bool mHasBeenCurrent;\r
\r
unsigned int mAppliedProgramSerial;\r
- \r
+\r
// state caching flags\r
bool mDepthStateDirty;\r
bool mMaskStateDirty;\r