Changeset 264807 in webkit
- Timestamp:
- Jul 23, 2020 5:50:29 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r264802 r264807 1 2020-07-23 James Darpinian <jdarpinian@chromium.org> 2 3 [WebGL2] Query Objects 4 https://bugs.webkit.org/show_bug.cgi?id=126940 5 6 Reviewed by Dean Jackson. 7 8 * webgl/2.0.0/conformance2/query/query-expected.txt: 9 * webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt: 10 1 11 2020-07-23 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/LayoutTests/webgl/2.0.0/conformance2/misc/expando-loss-2-expected.txt
r263281 r264807 1 CONSOLE MESSAGE: TypeError: null is not an object (evaluating 'instance.expando1')2 1 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. 3 2 … … 328 327 [ 324: PASS ] getIndexedParameter(UNIFORM_BUFFER_BINDING, 47): Expect extra expando to survive despite GC. 329 328 [ 325: PASS ] [object WebGLBuffer] is an instance of WebGLBuffer 330 [ 326: FAIL ] CURRENT_QUERY returns instance that was bound. 331 [ 327: FAIL ] CURRENT_QUERY returns instance that was bound. 332 [ 328: FAIL ] successfullyParsed should be true (of type boolean). Was undefined (of type undefined). 333 [ FAIL ] 179 failures reported 329 [ 326: PASS ] CURRENT_QUERY returns instance that was bound. 330 [ 327: PASS ] CURRENT_QUERY returns instance that was bound. 331 [ 328: FAIL ] Query: Expect basic expando to survive despite GC. 332 [ 329: FAIL ] Query: Expect subobject expando to survive despite GC. 333 [ 330: PASS ] Query: Expect extra expando to survive despite GC. 334 [ 331: PASS ] [object WebGLQuery] is an instance of WebGLQuery 335 [ 332: FAIL ] Query: Expect basic expando to survive despite GC. 336 [ 333: FAIL ] Query: Expect subobject expando to survive despite GC. 337 [ 334: PASS ] Query: Expect extra expando to survive despite GC. 338 [ 335: PASS ] [object WebGLQuery] is an instance of WebGLQuery 339 [ 336: PASS ] successfullyParsed is true 340 [ FAIL ] 180 failures reported 334 341 -
trunk/LayoutTests/webgl/2.0.0/conformance2/query/query-expected.txt
r256836 r264807 2 2 3 3 Test: ../../resources/webgl_test_files/conformance2/query/query.html 4 [ 1: PASS ] WebGL context exists 5 [ 2: PASS ] gl.ANY_SAMPLES_PASSED is 0x8C2F 6 [ 3: PASS ] gl.ANY_SAMPLES_PASSED_CONSERVATIVE is 0x8D6A 7 [ 4: PASS ] gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN is 0x8C88 8 [ 5: PASS ] getError was expected value: NO_ERROR : ANY_SAMPLES_PASSED query should succeed 9 [ 6: PASS ] getError was expected value: NO_ERROR : ANY_SAMPLES_PASSED query should succeed 10 [ 7: PASS ] getError was expected value: NO_ERROR : ANY_SAMPLES_PASSED query should succeed 11 [ 8: PASS ] gl.getQuery(gl.ANY_SAMPLES_PASSED, gl.CURRENT_QUERY) is null 12 [ 9: PASS ] gl.getQuery(gl.ANY_SAMPLES_PASSED_CONSERVATIVE, gl.CURRENT_QUERY) is null 13 [ 10: PASS ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) is null 14 [ 11: PASS ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) is null 15 [ 12: FAIL ] gl.isQuery(q1) should be true. Was false. 16 [ 13: FAIL ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) should be [object WebGLQuery]. Was null. 17 [ 14: PASS ] getError was expected value: INVALID_OPERATION : Can't begin a query while one is already active 18 [ 15: FAIL ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) should be [object WebGLQuery]. Was null. 19 [ 16: PASS ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) is null 20 [ 17: PASS ] getError was expected value: INVALID_OPERATION : Can't end a query if one is not active 21 [ 18: PASS ] getError was expected value: INVALID_OPERATION : Can't re-use query objects for incompatible targets 22 [ 19: PASS ] gl.getQuery(gl.ANY_SAMPLES_PASSED, gl.CURRENT_QUERY) is null 23 [ 20: FAIL ] gl.getQuery(gl.ANY_SAMPLES_PASSED, gl.CURRENT_QUERY) should be [object WebGLQuery]. Was null. 24 [ 21: PASS ] getError was expected value: INVALID_OPERATION : Can't call beginQuery on an already active query object 25 [ 22: PASS ] gl.getQuery(gl.ANY_SAMPLES_PASSED_CONSERVATIVE, gl.CURRENT_QUERY) is null 26 [ 23: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Should be able to have multiple unrelated query types active at once 27 [ 24: FAIL ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) should be [object WebGLQuery]. Was null. 28 [ 25: PASS ] getError was expected value: NO_ERROR : deleting queries should not produce errors 29 [ 26: PASS ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) is null 30 [ 27: PASS ] gl.getQuery(gl.ANY_SAMPLES_PASSED_CONSERVATIVE, gl.CURRENT_QUERY) is null 31 [ 28: PASS ] getError was expected value: INVALID_OPERATION : beginning a deleted query object 32 [ 29: PASS ] gl.getQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, gl.CURRENT_QUERY) is null 33 [ 30: PASS ] getError was expected value: NO_ERROR : should have no previous errors 34 [ 31: PASS ] getError was expected value: NO_ERROR : createQuery should not set an error 35 [ 32: PASS ] q1 is non-null. 36 [ 33: PASS ] gl.isQuery(q1) is false 37 [ 34: FAIL ] gl.isQuery(q1) should be true. Was false. 38 [ 35: FAIL ] gl.isQuery(q1) should be true. Was false. 39 [ 36: PASS ] gl.isQuery(q1) is false 40 [ 37: PASS ] gl.isQuery(null) is false 41 [ 38: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : there should be no errors 42 [ 39: PASS ] successfullyParsed is true 43 [ FAIL ] 9 failures reported 4 [ PASS ] All tests passed 44 5 -
trunk/LayoutTests/webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt
r264662 r264807 314 314 [ 311: PASS ] gl.getSyncParameter(sync, gl.SYNC_FLAGS) is 0 315 315 [ 312: PASS ] getSyncParameter correctly handled invalid pname enums 316 [ 313: FAIL ] gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE) should be false (of type boolean). Was 0 (of type number).316 [ 313: PASS ] gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE) is false 317 317 [ 314: PASS ] getQueryParameter correctly handled invalid pname enums 318 318 [ 315: PASS ] gl.getShaderParameter(vertShader, gl.COMPILE_STATUS) is true … … 365 365 [ 362: PASS ] getError was expected value: NO_ERROR : 366 366 [ 363: PASS ] successfullyParsed is true 367 [ FAIL ] 3 8failures reported367 [ FAIL ] 37 failures reported 368 368 -
trunk/Source/WebCore/ChangeLog
r264805 r264807 1 2020-07-23 James Darpinian <jdarpinian@chromium.org> 2 3 [WebGL2] Query Objects 4 https://bugs.webkit.org/show_bug.cgi?id=126940 5 6 Reviewed by Dean Jackson. 7 8 Passes conformance tests webgl/2.0.0/conformance2/query/* 9 10 * html/canvas/WebGL2RenderingContext.cpp: 11 (WebCore::WebGL2RenderingContext::deleteQuery): 12 (WebCore::WebGL2RenderingContext::isQuery): 13 (WebCore::WebGL2RenderingContext::validateQueryTarget): 14 (WebCore::WebGL2RenderingContext::beginQuery): 15 (WebCore::WebGL2RenderingContext::endQuery): 16 (WebCore::WebGL2RenderingContext::getQuery): 17 (WebCore::WebGL2RenderingContext::getQueryParameter): 18 * html/canvas/WebGL2RenderingContext.h: 19 * html/canvas/WebGLQuery.cpp: 20 (WebCore::WebGLQuery::deleteObjectImpl): 21 * html/canvas/WebGLQuery.h: 22 * html/canvas/WebGLRenderingContextBase.cpp: 23 (WebCore::WebGLRenderingContextBase::validateWebGLObject): 24 * platform/graphics/angle/GraphicsContextGLANGLE.cpp: 25 (WebCore::GraphicsContextGLOpenGL::deleteQuery): 26 (WebCore::GraphicsContextGLOpenGL::isQuery): 27 (WebCore::GraphicsContextGLOpenGL::getQuery): 28 1 29 2020-07-23 Guowei Yang <guowei_yang@apple.com> 2 30 -
trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
r264733 r264807 1831 1831 } 1832 1832 1833 void WebGL2RenderingContext::deleteQuery(WebGLQuery*) 1834 { 1835 LOG(WebGL, "[[ NOT IMPLEMENTED ]] deleteQuery()"); 1836 } 1837 1838 GCGLboolean WebGL2RenderingContext::isQuery(WebGLQuery*) 1839 { 1840 LOG(WebGL, "[[ NOT IMPLEMENTED ]] isQuery()"); 1841 return false; 1833 void WebGL2RenderingContext::deleteQuery(WebGLQuery* query) 1834 { 1835 if (isContextLostOrPending() || !query || !query->object() || !validateWebGLObject("deleteQuery", query)) 1836 return; 1837 if (query->target() && query == m_activeQueries.get(query->target())) { 1838 m_context->endQuery(query->target()); 1839 m_activeQueries.remove(query->target()); 1840 } 1841 deleteObject(query); 1842 } 1843 1844 GCGLboolean WebGL2RenderingContext::isQuery(WebGLQuery* query) 1845 { 1846 if (isContextLostOrPending() || !query || !query->object() || !validateWebGLObject("isQuery", query)) 1847 return false; 1848 return m_context->isQuery(query->object()); 1849 } 1850 1851 bool WebGL2RenderingContext::validateQueryTarget(const char* functionName, GCGLenum target, GCGLenum* targetKey) 1852 { 1853 if (target != GraphicsContextGL::ANY_SAMPLES_PASSED && target != GraphicsContextGL::ANY_SAMPLES_PASSED_CONSERVATIVE && target != GraphicsContextGL::TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN) { 1854 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, functionName, "invalid target"); 1855 return false; 1856 } 1857 if (targetKey) 1858 *targetKey = (target == GraphicsContextGL::ANY_SAMPLES_PASSED_CONSERVATIVE) ? GraphicsContextGL::ANY_SAMPLES_PASSED : target; 1859 return true; 1842 1860 } 1843 1861 1844 1862 void WebGL2RenderingContext::beginQuery(GCGLenum target, WebGLQuery& query) 1845 1863 { 1846 if (isContextLostOrPending()) 1847 return; 1848 1849 // FIXME: Add validation to prevent bad caching. 1864 GCGLenum targetKey; 1865 if (isContextLostOrPending() || !validateWebGLObject("beginQuery", &query) || !validateQueryTarget("beginQuery", target, &targetKey)) 1866 return; 1867 1868 if (query.target() && query.target() != target) { 1869 synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "beginQuery", "query type does not match target"); 1870 return; 1871 } 1872 1873 auto addResult = m_activeQueries.add(targetKey, makeRefPtr(&query)); 1850 1874 1851 1875 // Only one query object can be active per target. 1852 auto targetKey = (target == GraphicsContextGL::ANY_SAMPLES_PASSED_CONSERVATIVE) ? GraphicsContextGL::ANY_SAMPLES_PASSED : target;1853 1854 auto addResult = m_activeQueries.add(targetKey, makeRefPtr(&query));1855 1856 1876 if (!addResult.isNewEntry) { 1857 1877 synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "beginQuery", "Query object of target is already active"); … … 1860 1880 1861 1881 m_context->beginQuery(target, query.object()); 1882 query.setTarget(target); 1862 1883 } 1863 1884 1864 1885 void WebGL2RenderingContext::endQuery(GCGLenum target) 1865 1886 { 1866 if (isContextLostOrPending() || !scriptExecutionContext()) 1867 return; 1868 1869 auto targetKey = (target == GraphicsContextGL::ANY_SAMPLES_PASSED_CONSERVATIVE) ? GraphicsContextGL::ANY_SAMPLES_PASSED : target; 1887 GCGLenum targetKey; 1888 if (isContextLostOrPending() || !scriptExecutionContext() || !validateQueryTarget("beginQuery", target, &targetKey)) 1889 return; 1870 1890 1871 1891 auto query = m_activeQueries.take(targetKey); … … 1883 1903 } 1884 1904 1885 RefPtr<WebGLQuery> WebGL2RenderingContext::getQuery(GCGLenum, GCGLenum) 1886 { 1887 LOG(WebGL, "[[ NOT IMPLEMENTED ]] getquery()"); 1888 return nullptr; 1905 RefPtr<WebGLQuery> WebGL2RenderingContext::getQuery(GCGLenum target, GCGLenum pname) 1906 { 1907 GCGLenum targetKey; 1908 if (isContextLostOrPending() || !scriptExecutionContext() || !validateQueryTarget("beginQuery", target, &targetKey)) 1909 return nullptr; 1910 1911 if (pname != GraphicsContextGL::CURRENT_QUERY) { 1912 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getQuery", "invalid parameter name"); 1913 return nullptr; 1914 } 1915 1916 auto query = m_activeQueries.get(targetKey); 1917 if (!query || query->target() != target) 1918 return nullptr; 1919 return query; 1889 1920 } 1890 1921 1891 1922 WebGLAny WebGL2RenderingContext::getQueryParameter(WebGLQuery& query, GCGLenum pname) 1892 1923 { 1893 if (isContextLostOrPending() )1924 if (isContextLostOrPending() || !validateWebGLObject("getQueryParameter", &query)) 1894 1925 return nullptr; 1895 1926 1896 1927 switch (pname) { 1897 1928 case GraphicsContextGL::QUERY_RESULT: 1929 if (!query.isResultAvailable()) 1930 return false; 1931 break; 1898 1932 case GraphicsContextGL::QUERY_RESULT_AVAILABLE: 1899 1933 if (!query.isResultAvailable()) 1900 return 0;1934 return false; 1901 1935 break; 1902 1936 default: -
trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h
r264733 r264807 298 298 void restoreCurrentFramebuffer() final; 299 299 bool validateNonDefaultFramebufferAttachment(const char* functionName, GCGLenum attachment); 300 bool validateQueryTarget(const char* functionName, GCGLenum target, GCGLenum* targetKey); 300 301 301 302 GCGLenum baseInternalFormatFromInternalFormat(GCGLenum internalformat); -
trunk/Source/WebCore/html/canvas/WebGLQuery.cpp
r254481 r264807 52 52 void WebGLQuery::deleteObjectImpl(GraphicsContextGLOpenGL* context3d, PlatformGLObject object) 53 53 { 54 UNUSED_PARAM(context3d); 55 UNUSED_PARAM(object); 56 // FIXME: Call deleteQuery from GraphicsContextGLOpenGL. 54 context3d->deleteQuery(object); 57 55 } 58 56 -
trunk/Source/WebCore/html/canvas/WebGLQuery.h
r260415 r264807 41 41 void makeResultAvailable() { m_isResultAvailable = true; } 42 42 43 void setTarget(GCGLenum target) { m_target = target; } 44 GCGLenum target() const { return m_target; } 45 43 46 private: 44 47 explicit WebGLQuery(WebGLRenderingContextBase&); … … 46 49 47 50 bool m_isResultAvailable { false }; 51 GCGLenum m_target { 0 }; 48 52 }; 49 53 -
trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
r264733 r264807 2336 2336 void GraphicsContextGLOpenGL::deleteQuery(PlatformGLObject query) 2337 2337 { 2338 UNUSED_PARAM(query); 2338 makeContextCurrent(); 2339 gl::DeleteQueries(1, &query); 2339 2340 } 2340 2341 2341 2342 GCGLboolean GraphicsContextGLOpenGL::isQuery(PlatformGLObject query) 2342 2343 { 2343 UNUSED_PARAM(query); 2344 2345 return false; 2344 makeContextCurrent(); 2345 return gl::IsQuery(query); 2346 2346 } 2347 2347 2348 2348 PlatformGLObject GraphicsContextGLOpenGL::getQuery(GCGLenum target, GCGLenum pname) 2349 2349 { 2350 UNUSED_PARAM(target);2351 UNUSED_PARAM(pname);2352 2353 return 0;2350 makeContextCurrent(); 2351 GLint value; 2352 gl::GetQueryiv(target, pname, &value); 2353 return static_cast<PlatformGLObject>(value); 2354 2354 } 2355 2355
Note: See TracChangeset
for help on using the changeset viewer.