Changeset 70661 in webkit


Ignore:
Timestamp:
Oct 27, 2010 10:10:14 AM (13 years ago)
Author:
zmo@google.com
Message:

2010-10-27 Zhenyao Mo <zmo@google.com>

Reviewed by Kenneth Russell.

If WebGL is running on top of a strict version of OpenGL ES it should make sure attribs have buffers assigned at all times
https://bugs.webkit.org/show_bug.cgi?id=47964

  • html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::validateRenderingState): Minimum checking: if input <= 0, only check if each enabled vertex attribute is bound to a buffer. (WebCore::WebGLRenderingContext::drawArrays): If underlying GL performs bounds checking, we still need to do the minimum checking using validateRenderingState. (WebCore::WebGLRenderingContext::drawElements): Ditto.
  • html/canvas/WebGLRenderingContext.h: Add a comment for input <= 0 in validateRenderingState.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r70657 r70661  
     12010-10-27  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        If WebGL is running on top of a strict version of OpenGL ES it should make sure attribs have buffers assigned at all times
     6        https://bugs.webkit.org/show_bug.cgi?id=47964
     7
     8        * html/canvas/WebGLRenderingContext.cpp:
     9        (WebCore::WebGLRenderingContext::validateRenderingState): Minimum checking: if input <= 0, only check if each enabled vertex attribute is bound to a buffer.
     10        (WebCore::WebGLRenderingContext::drawArrays): If underlying GL performs bounds checking, we still need to do the minimum checking using validateRenderingState.
     11        (WebCore::WebGLRenderingContext::drawElements): Ditto.
     12        * html/canvas/WebGLRenderingContext.h: Add a comment for input <= 0 in validateRenderingState.
     13
    1142010-10-27  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/WebCore/html/canvas/WebGLRenderingContext.cpp

    r69804 r70661  
    879879    }
    880880
     881    if (numElementsRequired <= 0)
     882        return true;
     883
    881884    // Look in each consumed vertex attrib (by the current program) and find the smallest buffer size
    882885    long smallestNumElements = LONG_MAX;
     
    940943            return;
    941944        }
     945    } else {
     946        if (!validateRenderingState(0)) {
     947            m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
     948            return;
     949        }
    942950    }
    943951
     
    990998                return;
    991999            }
     1000        }
     1001    } else {
     1002        if (!validateRenderingState(0)) {
     1003            m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
     1004            return;
    9921005        }
    9931006    }
  • trunk/WebCore/html/canvas/WebGLRenderingContext.h

    r69619 r70661  
    324324    // Precise but slow index validation -- only done if conservative checks fail
    325325    bool validateIndexArrayPrecise(unsigned long count, unsigned long type, long offset, long& numElementsRequired);
     326    // If numElements <= 0, we only check if each enabled vertex attribute is bound to a buffer.
    326327    bool validateRenderingState(long numElements);
    327328
Note: See TracChangeset for help on using the changeset viewer.