| Index: Source/core/html/canvas/WebGLRenderingContext.cpp
|
| diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
|
| index 447cbb56c1076a1e00f5f3523516a84088e46dd1..20fa595b39da22a5e0ff80a590017e3dd1b03291 100644
|
| --- a/Source/core/html/canvas/WebGLRenderingContext.cpp
|
| +++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
|
| @@ -1793,17 +1793,21 @@ void WebGLRenderingContext::disableVertexAttribArray(GLuint index)
|
| m_context->disableVertexAttribArray(index);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateRenderingState()
|
| +bool WebGLRenderingContext::validateRenderingState(const char* functionName)
|
| {
|
| - if (!m_currentProgram)
|
| + if (!m_currentProgram) {
|
| + synthesizeGLError(GL_INVALID_OPERATION, functionName, "no valid shader program in use");
|
| return false;
|
| + }
|
|
|
| // Look in each enabled vertex attrib and check if they've been bound to a buffer.
|
| for (unsigned i = 0; i < m_onePlusMaxEnabledAttribIndex; ++i) {
|
| const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(i);
|
| if (state.enabled
|
| - && (!state.bufferBinding || !state.bufferBinding->object()))
|
| + && (!state.bufferBinding || !state.bufferBinding->object())) {
|
| + synthesizeGLError(GL_INVALID_OPERATION, functionName, String::format("attribute %d is enabled but has no buffer bound", i).utf8().data());
|
| return false;
|
| + }
|
| }
|
|
|
| return true;
|
| @@ -5219,8 +5223,7 @@ bool WebGLRenderingContext::validateDrawArrays(const char* functionName, GLenum
|
| return false;
|
| }
|
|
|
| - if (!validateRenderingState()) {
|
| - synthesizeGLError(GL_INVALID_OPERATION, functionName, "attribs not setup correctly");
|
| + if (!validateRenderingState(functionName)) {
|
| return false;
|
| }
|
|
|
| @@ -5270,8 +5273,7 @@ bool WebGLRenderingContext::validateDrawElements(const char* functionName, GLenu
|
| return false;
|
| }
|
|
|
| - if (!validateRenderingState()) {
|
| - synthesizeGLError(GL_INVALID_OPERATION, functionName, "attribs not setup correctly");
|
| + if (!validateRenderingState(functionName)) {
|
| return false;
|
| }
|
|
|
|
|