Changeset 264535 in webkit


Ignore:
Timestamp:
Jul 17, 2020 2:51:16 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[WebGL2] Sync objects
https://bugs.webkit.org/show_bug.cgi?id=126942

Patch by James Darpinian <James Darpinian> on 2020-07-17
Reviewed by Dean Jackson.

Source/WebCore:

Passes WebGL conformance tests
webgl/2.0.0/conformance2/sync/sync-webgl-specific.html
and
webgl/2.0.0/deqp/functional/gles3/sync.html

although the latter times out in the layout test harness.

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGL2RenderingContext::fenceSync):
(WebCore::WebGL2RenderingContext::isSync):
(WebCore::WebGL2RenderingContext::deleteSync):
(WebCore::WebGL2RenderingContext::clientWaitSync):
(WebCore::WebGL2RenderingContext::waitSync):
(WebCore::WebGL2RenderingContext::getSyncParameter):

  • html/canvas/WebGLRenderingContextBase.h:
  • html/canvas/WebGLSync.cpp:

(WebCore::WebGLSync::WebGLSync):
(WebCore::WebGLSync::deleteObjectImpl):
(WebCore::WebGLSync::updateCache):
(WebCore::WebGLSync::getCachedResult const):
(WebCore::WebGLSync::isSignaled const):
(WebCore::WebGLSync::scheduleAllowCacheUpdate):

  • html/canvas/WebGLSync.h:
  • platform/graphics/GraphicsContextGL.h:
  • platform/graphics/GraphicsTypesGL.h:
  • platform/graphics/angle/GraphicsContextGLANGLE.cpp:

(WebCore::GraphicsContextGLOpenGL::fenceSync):
(WebCore::GraphicsContextGLOpenGL::isSync):
(WebCore::GraphicsContextGLOpenGL::deleteSync):
(WebCore::GraphicsContextGLOpenGL::clientWaitSync):
(WebCore::GraphicsContextGLOpenGL::waitSync):
(WebCore::GraphicsContextGLOpenGL::getSynciv):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.h:
  • platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:

(WebCore::GraphicsContextGLOpenGL::fenceSync):
(WebCore::GraphicsContextGLOpenGL::isSync):
(WebCore::GraphicsContextGLOpenGL::deleteSync):
(WebCore::GraphicsContextGLOpenGL::clientWaitSync):
(WebCore::GraphicsContextGLOpenGL::waitSync):
(WebCore::GraphicsContextGLOpenGL::getSynciv):

LayoutTests:

  • webgl/TestExpectations:

webgl/2.0.0/deqp/functional/gles3/sync.html times out in the layout test harness, though it passes in MiniBrowser.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r264532 r264535  
     12020-07-17  James Darpinian  <jdarpinian@chromium.org>
     2
     3        [WebGL2] Sync objects
     4        https://bugs.webkit.org/show_bug.cgi?id=126942
     5
     6        Reviewed by Dean Jackson.
     7
     8        * webgl/TestExpectations:
     9        webgl/2.0.0/deqp/functional/gles3/sync.html times out in the layout test harness, though it passes in MiniBrowser.
     10
    1112020-07-17  Truitt Savell  <tsavell@apple.com>
    212
  • trunk/LayoutTests/webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt

    r264371 r264535  
    1 CONSOLE MESSAGE: TypeError: Argument 1 ('sync') to WebGL2RenderingContext.getSyncParameter must be an instance of WebGLSync
    21This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
    32
     
    310309[ 306: PASS ] gl.getSamplerParameter(sampler, gl.TEXTURE_WRAP_T) is gl.CLAMP_TO_EDGE
    311310[ 307: PASS ] getSamplerParameter correctly handled invalid pname enums
    312 [ 308: FAIL ] gl.getSyncParameter(sync, gl.OBJECT_TYPE) should be 37142. Threw exception TypeError: Argument 1 ('sync') to WebGL2RenderingContext.getSyncParameter must be an instance of WebGLSync
    313 [ 309: FAIL ] successfullyParsed should be true (of type boolean). Was undefined (of type undefined).
    314 [ FAIL ] 39 failures reported
     311[ 308: PASS ] gl.getSyncParameter(sync, gl.OBJECT_TYPE) is gl.SYNC_FENCE
     312[ 309: PASS ] gl.getSyncParameter(sync, gl.SYNC_CONDITION) is gl.UNSIGNALED
     313[ 310: PASS ] gl.getSyncParameter(sync, gl.SYNC_CONDITION) is gl.SYNC_GPU_COMMANDS_COMPLETE
     314[ 311: PASS ] gl.getSyncParameter(sync, gl.SYNC_FLAGS) is 0
     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).
     317[ 314: PASS ] getQueryParameter correctly handled invalid pname enums
     318[ 315: PASS ] gl.getShaderParameter(vertShader, gl.COMPILE_STATUS) is true
     319[ 316: PASS ] gl.getShaderParameter(fragShader, gl.COMPILE_STATUS) is true
     320[ 317: PASS ] gl.getProgramParameter(program, gl.LINK_STATUS) is true
     321[ 318: PASS ] gl.getFragDataLocation(program, "vertexColor") is -1
     322[ 319: PASS ] gl.getFragDataLocation(program, "modelViewMatrix") is -1
     323[ 320: PASS ] gl.getFragDataLocation(program, "projectionMatrix") is -1
     324[ 321: PASS ] gl.getFragDataLocation(program, "position") is -1
     325[ 322: PASS ] gl.getFragDataLocation(program, "fragColor") is 0
     326[ 323: PASS ] gl.getProgramParameter(program, gl.LINK_STATUS) is true
     327[ 324: PASS ] gl.getError() is gl.NO_ERROR
     328[ 325: PASS ] typeof rowMajors[i] is "boolean"
     329[ 326: PASS ] typeof rowMajors[i] is "boolean"
     330[ 327: PASS ] typeof rowMajors[i] is "boolean"
     331[ 328: PASS ] getActiveUniforms correctly handled invalid pname enums
     332[ 329: PASS ] gl.getProgramParameter(program, gl.LINK_STATUS) is true
     333[ 330: PASS ] gl.getUniformBlockIndex(program, "Transform") is 0
     334[ 331: PASS ] gl.getUniformBlockIndex(program, "u_modelViewMatrix") is gl.INVALID_INDEX
     335[ 332: PASS ] gl.getUniformBlockIndex(program, "normal") is gl.INVALID_INDEX
     336[ 333: PASS ] gl.getUniformBlockIndex(program, "u_normal") is gl.INVALID_INDEX
     337[ 334: PASS ] gl.getProgramParameter(noUniformProgram, gl.LINK_STATUS) is true
     338[ 335: PASS ] gl.getUniformBlockIndex(noUniformProgram, "u_modelViewProjMatrix") is gl.INVALID_INDEX
     339[ 336: PASS ] gl.getUniformBlockIndex(noUniformProgram, "u_normal") is gl.INVALID_INDEX
     340[ 337: PASS ] gl.getProgramParameter(program, gl.LINK_STATUS) is true
     341[ 338: PASS ] gl.getActiveUniformBlockName(program, 0) is "Transform"
     342[ 339: FAIL ] gl.getActiveUniformBlockName(program, -1) should be null (of type object). Was (of type string).
     343[ 340: PASS ] getError was expected value: INVALID_VALUE :
     344[ 341: FAIL ] gl.getActiveUniformBlockName(program, 1) should be null (of type object). Was (of type string).
     345[ 342: PASS ] getError was expected value: INVALID_VALUE :
     346[ 343: FAIL ] gl.getActiveUniformBlockName(program, gl.INVALID_INDEX) should be null (of type object). Was (of type string).
     347[ 344: PASS ] getError was expected value: INVALID_VALUE :
     348[ 345: PASS ] gl.getProgramParameter(noLinkProgram, gl.LINK_STATUS) is false
     349[ 346: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : after evaluating: gl.getActiveUniformBlockName(noLinkProgram, 0)
     350[ 347: PASS ] gl.getProgramParameter(noUniformProgram, gl.LINK_STATUS) is true
     351[ 348: FAIL ] gl.getActiveUniformBlockName(noUniformProgram, -1) should be null (of type object). Was (of type string).
     352[ 349: PASS ] getError was expected value: INVALID_VALUE :
     353[ 350: FAIL ] gl.getActiveUniformBlockName(noUniformProgram, 0) should be null (of type object). Was (of type string).
     354[ 351: PASS ] getError was expected value: INVALID_VALUE :
     355[ 352: FAIL ] gl.getActiveUniformBlockName(noUniformProgram, gl.INVALID_INDEX) should be null (of type object). Was (of type string).
     356[ 353: PASS ] getError was expected value: INVALID_VALUE :
     357[ 354: PASS ] gl.getProgramParameter(program, gl.LINK_STATUS) is true
     358[ 355: PASS ] gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_BINDING) is 0
     359[ 356: PASS ] gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_BINDING) is 1
     360[ 357: PASS ] gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_DATA_SIZE) >= 164 is true
     361[ 358: PASS ] gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS) is 3
     362[ 359: PASS ] gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER) is true
     363[ 360: PASS ] gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER) is false
     364[ 361: PASS ] getActiveUniformBlockParameter correctly handled invalid pname enums
     365[ 362: PASS ] getError was expected value: NO_ERROR :
     366[ 363: PASS ] successfullyParsed is true
     367[ FAIL ] 45 failures reported
    315368
  • trunk/LayoutTests/webgl/TestExpectations

    r258299 r264535  
    5656webgl/2.0.0/deqp/functional/gles3/clipping.html [ Skip ]
    5757webgl/2.0.0/deqp/functional/gles3/defaultvertexattribute.html [ Skip ]
     58webgl/2.0.0/deqp/functional/gles3/sync.html [ Skip ]
    5859webgl/2.0.0/deqp/functional/gles3/draw/draw_arrays.html [ Skip ]
    5960webgl/2.0.0/deqp/functional/gles3/draw/draw_arrays_instanced.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r264534 r264535  
     12020-07-17  James Darpinian  <jdarpinian@chromium.org>
     2
     3        [WebGL2] Sync objects
     4        https://bugs.webkit.org/show_bug.cgi?id=126942
     5
     6        Reviewed by Dean Jackson.
     7
     8        Passes WebGL conformance tests
     9        webgl/2.0.0/conformance2/sync/sync-webgl-specific.html
     10        and
     11        webgl/2.0.0/deqp/functional/gles3/sync.html
     12
     13        although the latter times out in the layout test harness.
     14
     15
     16        * html/canvas/WebGL2RenderingContext.cpp:
     17        (WebCore::WebGL2RenderingContext::fenceSync):
     18        (WebCore::WebGL2RenderingContext::isSync):
     19        (WebCore::WebGL2RenderingContext::deleteSync):
     20        (WebCore::WebGL2RenderingContext::clientWaitSync):
     21        (WebCore::WebGL2RenderingContext::waitSync):
     22        (WebCore::WebGL2RenderingContext::getSyncParameter):
     23        * html/canvas/WebGLRenderingContextBase.h:
     24        * html/canvas/WebGLSync.cpp:
     25        (WebCore::WebGLSync::WebGLSync):
     26        (WebCore::WebGLSync::deleteObjectImpl):
     27        (WebCore::WebGLSync::updateCache):
     28        (WebCore::WebGLSync::getCachedResult const):
     29        (WebCore::WebGLSync::isSignaled const):
     30        (WebCore::WebGLSync::scheduleAllowCacheUpdate):
     31        * html/canvas/WebGLSync.h:
     32        * platform/graphics/GraphicsContextGL.h:
     33        * platform/graphics/GraphicsTypesGL.h:
     34        * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
     35        (WebCore::GraphicsContextGLOpenGL::fenceSync):
     36        (WebCore::GraphicsContextGLOpenGL::isSync):
     37        (WebCore::GraphicsContextGLOpenGL::deleteSync):
     38        (WebCore::GraphicsContextGLOpenGL::clientWaitSync):
     39        (WebCore::GraphicsContextGLOpenGL::waitSync):
     40        (WebCore::GraphicsContextGLOpenGL::getSynciv):
     41        * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
     42        * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
     43        (WebCore::GraphicsContextGLOpenGL::fenceSync):
     44        (WebCore::GraphicsContextGLOpenGL::isSync):
     45        (WebCore::GraphicsContextGLOpenGL::deleteSync):
     46        (WebCore::GraphicsContextGLOpenGL::clientWaitSync):
     47        (WebCore::GraphicsContextGLOpenGL::waitSync):
     48        (WebCore::GraphicsContextGLOpenGL::getSynciv):
     49
    1502020-07-17  Lauro Moura  <lmoura@igalia.com>
    251
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r264509 r264535  
    20332033}
    20342034
    2035 RefPtr<WebGLSync> WebGL2RenderingContext::fenceSync(GCGLenum, GCGLbitfield)
    2036 {
    2037     LOG(WebGL, "[[ NOT IMPLEMENTED ]] fenceSync()");
    2038     return nullptr;
    2039 }
    2040 
    2041 GCGLboolean WebGL2RenderingContext::isSync(WebGLSync*)
    2042 {
    2043     LOG(WebGL, "[[ NOT IMPLEMENTED ]] isSync()");
    2044     return false;
    2045 }
    2046 
    2047 void WebGL2RenderingContext::deleteSync(WebGLSync*)
    2048 {
    2049     LOG(WebGL, "[[ NOT IMPLEMENTED ]] deleteSync()");
    2050 }
    2051 
    2052 GCGLenum WebGL2RenderingContext::clientWaitSync(WebGLSync&, GCGLbitfield, GCGLuint64)
    2053 {
    2054     // Note: Do not implement this function without consulting webkit-dev and WebGL
    2055     // reviewers beforehand. Apple folks, see <rdar://problem/36666458>.
    2056     LOG(WebGL, "[[ NOT IMPLEMENTED ]] clientWaitSync()");
    2057     return 0;
    2058 }
    2059 
    2060 void WebGL2RenderingContext::waitSync(WebGLSync&, GCGLbitfield, GCGLint64)
    2061 {
    2062     LOG(WebGL, "[[ NOT IMPLEMENTED ]] waitSync()");
    2063 }
    2064 
    2065 WebGLAny WebGL2RenderingContext::getSyncParameter(WebGLSync&, GCGLenum)
    2066 {
    2067     // Note: Do not implement this function without consulting webkit-dev and WebGL
    2068     // reviewers beforehand. Apple folks, see <rdar://problem/36666458>.
    2069     LOG(WebGL, "[[ NOT IMPLEMENTED ]] getSyncParameter()");
    2070     return nullptr;
     2035RefPtr<WebGLSync> WebGL2RenderingContext::fenceSync(GCGLenum condition, GCGLbitfield flags)
     2036{
     2037    if (isContextLostOrPending())
     2038        return nullptr;
     2039
     2040    if (condition != GraphicsContextGL::SYNC_GPU_COMMANDS_COMPLETE) {
     2041        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "fenceSync", "condition must be SYNC_GPU_COMMANDS_COMPLETE");
     2042        return nullptr;
     2043    }
     2044    if (flags) {
     2045        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "fenceSync", "flags must be zero");
     2046        return nullptr;
     2047    }
     2048    auto sync = WebGLSync::create(*this);
     2049    sync->scheduleAllowCacheUpdate(*this);
     2050    addSharedObject(sync.get());
     2051    return sync;
     2052}
     2053
     2054GCGLboolean WebGL2RenderingContext::isSync(WebGLSync* sync)
     2055{
     2056    return !isContextLostOrPending() && sync && !sync->isDeleted() && validateWebGLObject("isSync", sync);
     2057}
     2058
     2059void WebGL2RenderingContext::deleteSync(WebGLSync* sync)
     2060{
     2061    if (isContextLostOrPending() || !sync || sync->isDeleted() || !validateWebGLObject("deleteSync", sync))
     2062        return;
     2063    deleteObject(sync);
     2064}
     2065
     2066GCGLenum WebGL2RenderingContext::clientWaitSync(WebGLSync& sync, GCGLbitfield flags, GCGLuint64 timeout)
     2067{
     2068    if (isContextLostOrPending() || !validateWebGLObject("clientWaitSync", &sync))
     2069        return GraphicsContextGL::WAIT_FAILED;
     2070
     2071    if (timeout > MaxClientWaitTimeout) {
     2072        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "clientWaitSync", "timeout > MAX_CLIENT_WAIT_TIMEOUT_WEBGL");
     2073        return GraphicsContextGL::WAIT_FAILED;
     2074    }
     2075   
     2076    if (flags && flags != GraphicsContextGL::SYNC_FLUSH_COMMANDS_BIT) {
     2077        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "clientWaitSync", "invalid flags");
     2078        return GraphicsContextGL::WAIT_FAILED;
     2079    }
     2080
     2081    if (sync.isSignaled())
     2082        return GraphicsContextGL::ALREADY_SIGNALED;
     2083    sync.updateCache(*this);
     2084    if (sync.isSignaled())
     2085        return GraphicsContextGL::CONDITION_SATISFIED;
     2086    return GraphicsContextGL::TIMEOUT_EXPIRED;
     2087}
     2088
     2089void WebGL2RenderingContext::waitSync(WebGLSync& sync, GCGLbitfield flags, GCGLint64 timeout)
     2090{
     2091    if (isContextLostOrPending() || !validateWebGLObject("waitSync", &sync))
     2092        return;
     2093
     2094    if (flags)
     2095        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "waitSync", "flags must be zero");
     2096    else if (timeout != -1)
     2097        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "waitSync", "invalid timeout");
     2098
     2099    // This function is a no-op in WebGL 2.
     2100}
     2101
     2102WebGLAny WebGL2RenderingContext::getSyncParameter(WebGLSync& sync, GCGLenum pname)
     2103{
     2104    if (isContextLostOrPending() || !validateWebGLObject("getSyncParameter", &sync))
     2105        return nullptr;
     2106
     2107    switch (pname) {
     2108    case GraphicsContextGL::OBJECT_TYPE:
     2109    case GraphicsContextGL::SYNC_STATUS:
     2110    case GraphicsContextGL::SYNC_CONDITION:
     2111    case GraphicsContextGL::SYNC_FLAGS:
     2112        sync.updateCache(*this);
     2113        return sync.getCachedResult(pname);
     2114    default:
     2115        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getSyncParameter", "invalid parameter name");
     2116        return nullptr;
     2117    }
    20712118}
    20722119
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h

    r264488 r264535  
    413413    friend class WebGLVertexArrayObject;
    414414    friend class WebGLVertexArrayObjectBase;
     415    friend class WebGLSync;
    415416
    416417    // Implementation helpers.
  • trunk/Source/WebCore/html/canvas/WebGLSync.cpp

    r254214 r264535  
    4646WebGLSync::WebGLSync(WebGLRenderingContextBase& ctx)
    4747    : WebGLSharedObject(ctx)
     48    , m_sync(ctx.graphicsContextGL()->fenceSync(GraphicsContextGL::SYNC_GPU_COMMANDS_COMPLETE, 0))
    4849{
    49     // FIXME: Call fenceSync from GraphicsContextGLOpenGL.
     50    // This value is unused because the sync object is a pointer type, but it needs to be non-zero
     51    // or other parts of the code will assume the object is invalid.
     52    setObject(-1);
    5053}
    5154
    5255void WebGLSync::deleteObjectImpl(GraphicsContextGLOpenGL* context3d, PlatformGLObject object)
    5356{
    54     UNUSED_PARAM(context3d);
    5557    UNUSED_PARAM(object);
    56     // FIXME: Call deleteSync from GraphicsContextGLOpenGL.
     58    context3d->deleteSync(m_sync);
     59    m_sync = nullptr;
     60}
     61
     62void WebGLSync::updateCache(WebGLRenderingContextBase& context)
     63{
     64    if (m_syncStatus == GraphicsContextGL::SIGNALED || !m_allowCacheUpdate)
     65        return;
     66
     67    m_allowCacheUpdate = false;
     68    context.graphicsContextGL()->getSynciv(m_sync, GraphicsContextGL::SYNC_STATUS, sizeof(m_syncStatus), &m_syncStatus);
     69    if (m_syncStatus == GraphicsContextGL::UNSIGNALED)
     70        scheduleAllowCacheUpdate(context);
     71}
     72
     73GCGLint WebGLSync::getCachedResult(GCGLenum pname) const
     74{
     75    switch (pname) {
     76    case GraphicsContextGL::OBJECT_TYPE:
     77        return GraphicsContextGL::SYNC_FENCE;
     78    case GraphicsContextGL::SYNC_STATUS:
     79        return m_syncStatus;
     80    case GraphicsContextGL::SYNC_CONDITION:
     81        return GraphicsContextGL::SYNC_GPU_COMMANDS_COMPLETE;
     82    case GraphicsContextGL::SYNC_FLAGS:
     83        return 0;
     84    }
     85    ASSERT_NOT_REACHED();
     86    return 0;
     87}
     88
     89bool WebGLSync::isSignaled() const
     90{
     91    return m_syncStatus == GraphicsContextGL::SIGNALED;
     92}
     93
     94void WebGLSync::scheduleAllowCacheUpdate(WebGLRenderingContextBase& context)
     95{
     96    auto* canvas = context.htmlCanvas();
     97    if (!canvas)
     98        return;
     99
     100    context.queueTaskKeepingObjectAlive(*canvas, TaskSource::WebGL, [protectedThis = makeRef(*this)]() {
     101        protectedThis->m_allowCacheUpdate = true;
     102    });
    57103}
    58104
  • trunk/Source/WebCore/html/canvas/WebGLSync.h

    r260415 r264535  
    3838    static Ref<WebGLSync> create(WebGLRenderingContextBase&);
    3939
     40    void updateCache(WebGLRenderingContextBase&);
     41    GCGLint getCachedResult(GCGLenum pname) const;
     42    bool isSignaled() const;
     43    void scheduleAllowCacheUpdate(WebGLRenderingContextBase&);
     44
    4045private:
    4146    WebGLSync(WebGLRenderingContextBase&);
     47
     48    bool m_allowCacheUpdate = { false };
     49    GCGLint m_syncStatus = { GraphicsContextGL::UNSIGNALED };
     50    GCGLsync m_sync;
    4251
    4352    void deleteObjectImpl(GraphicsContextGLOpenGL*, PlatformGLObject) override;
  • trunk/Source/WebCore/platform/graphics/GraphicsContextGL.h

    r264377 r264535  
    12171217    virtual void getSamplerParameteriv(PlatformGLObject sampler, GCGLenum pname, GCGLint* value) = 0;
    12181218
    1219     virtual PlatformGLObject fenceSync(GCGLenum condition, GCGLbitfield flags) = 0;
    1220     virtual GCGLboolean isSync(PlatformGLObject sync) = 0;
    1221     virtual void deleteSync(PlatformGLObject sync) = 0;
    1222     virtual GCGLenum clientWaitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLuint64 timeout) = 0;
    1223     virtual void waitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLint64 timeout) = 0;
     1219    virtual GCGLsync fenceSync(GCGLenum condition, GCGLbitfield flags) = 0;
     1220    virtual GCGLboolean isSync(GCGLsync) = 0;
     1221    virtual void deleteSync(GCGLsync) = 0;
     1222    virtual GCGLenum clientWaitSync(GCGLsync, GCGLbitfield flags, GCGLuint64 timeout) = 0;
     1223    virtual void waitSync(GCGLsync, GCGLbitfield flags, GCGLint64 timeout) = 0;
    12241224    // getSyncParameter
    1225     virtual void getSynciv(PlatformGLObject sync, GCGLenum pname, GCGLsizei bufSize, GCGLint* value) = 0;
     1225    virtual void getSynciv(GCGLsync, GCGLenum pname, GCGLsizei bufSize, GCGLint* value) = 0;
    12261226
    12271227    virtual PlatformGLObject createTransformFeedback() = 0;
  • trunk/Source/WebCore/platform/graphics/GraphicsTypesGL.h

    r254214 r264535  
    4848typedef long long GCGLint64;
    4949typedef unsigned long long GCGLuint64;
     50typedef struct __GLsync* GCGLsync;
    5051
    5152typedef GCGLuint PlatformGLObject;
  • trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp

    r264381 r264535  
    24612461}
    24622462
    2463 PlatformGLObject GraphicsContextGLOpenGL::fenceSync(GCGLenum condition, GCGLbitfield flags)
    2464 {
    2465     UNUSED_PARAM(condition);
    2466     UNUSED_PARAM(flags);
    2467 
    2468     return 0;
    2469 }
    2470 
    2471 GCGLboolean GraphicsContextGLOpenGL::isSync(PlatformGLObject sync)
    2472 {
    2473     UNUSED_PARAM(sync);
    2474 
    2475     return false;
    2476 }
    2477 
    2478 void GraphicsContextGLOpenGL::deleteSync(PlatformGLObject sync)
    2479 {
    2480     UNUSED_PARAM(sync);
    2481 }
    2482 
    2483 GCGLenum GraphicsContextGLOpenGL::clientWaitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLuint64 timeout)
    2484 {
    2485     UNUSED_PARAM(sync);
    2486     UNUSED_PARAM(flags);
    2487     UNUSED_PARAM(timeout);
    2488 
    2489     return 0;
    2490 }
    2491 
    2492 void GraphicsContextGLOpenGL::waitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLint64 timeout)
    2493 {
    2494     UNUSED_PARAM(sync);
    2495     UNUSED_PARAM(flags);
    2496     UNUSED_PARAM(timeout);
    2497 }
    2498 
    2499 void GraphicsContextGLOpenGL::getSynciv(PlatformGLObject sync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value)
    2500 {
    2501     UNUSED_PARAM(sync);
    2502     UNUSED_PARAM(pname);
    2503     UNUSED_PARAM(bufSize);
    2504     UNUSED_PARAM(value);
     2463GCGLsync GraphicsContextGLOpenGL::fenceSync(GCGLenum condition, GCGLbitfield flags)
     2464{
     2465    makeContextCurrent();
     2466    return gl::FenceSync(condition, flags);
     2467}
     2468
     2469GCGLboolean GraphicsContextGLOpenGL::isSync(GCGLsync sync)
     2470{
     2471    makeContextCurrent();
     2472    return gl::IsSync(sync);
     2473}
     2474
     2475void GraphicsContextGLOpenGL::deleteSync(GCGLsync sync)
     2476{
     2477    makeContextCurrent();
     2478    gl::DeleteSync(sync);
     2479}
     2480
     2481GCGLenum GraphicsContextGLOpenGL::clientWaitSync(GCGLsync sync, GCGLbitfield flags, GCGLuint64 timeout)
     2482{
     2483    makeContextCurrent();
     2484    return gl::ClientWaitSync(sync, flags, timeout);
     2485}
     2486
     2487void GraphicsContextGLOpenGL::waitSync(GCGLsync sync, GCGLbitfield flags, GCGLint64 timeout)
     2488{
     2489    makeContextCurrent();
     2490    gl::WaitSync(sync, flags, timeout);
     2491}
     2492
     2493void GraphicsContextGLOpenGL::getSynciv(GCGLsync sync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value)
     2494{
     2495    makeContextCurrent();
     2496    gl::GetSynciv(sync, pname, bufSize, nullptr, value);
    25052497}
    25062498
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h

    r264377 r264535  
    466466    void getSamplerParameteriv(PlatformGLObject sampler, GCGLenum pname, GCGLint* value) final;
    467467
    468     PlatformGLObject fenceSync(GCGLenum condition, GCGLbitfield flags) final;
    469     GCGLboolean isSync(PlatformGLObject sync) final;
    470     void deleteSync(PlatformGLObject sync) final;
    471     GCGLenum clientWaitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLuint64 timeout) final;
    472     void waitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLint64 timeout) final;
     468    GCGLsync fenceSync(GCGLenum condition, GCGLbitfield flags) final;
     469    GCGLboolean isSync(GCGLsync) final;
     470    void deleteSync(GCGLsync) final;
     471    GCGLenum clientWaitSync(GCGLsync, GCGLbitfield flags, GCGLuint64 timeout) final;
     472    void waitSync(GCGLsync, GCGLbitfield flags, GCGLint64 timeout) final;
    473473    // getSyncParameter
    474474    // FIXME - this can be implemented at the WebGL level if we signal the WebGLSync object.
    475     void getSynciv(PlatformGLObject sync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value) final;
     475    void getSynciv(GCGLsync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value) final;
    476476
    477477    PlatformGLObject createTransformFeedback() final;
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp

    r264377 r264535  
    26302630}
    26312631
    2632 PlatformGLObject GraphicsContextGLOpenGL::fenceSync(GCGLenum condition, GCGLbitfield flags)
     2632GCGLsync GraphicsContextGLOpenGL::fenceSync(GCGLenum condition, GCGLbitfield flags)
    26332633{
    26342634    UNUSED_PARAM(condition);
     
    26382638}
    26392639
    2640 GCGLboolean GraphicsContextGLOpenGL::isSync(PlatformGLObject sync)
     2640GCGLboolean GraphicsContextGLOpenGL::isSync(GCGLsync sync)
    26412641{
    26422642    UNUSED_PARAM(sync);
     
    26452645}
    26462646
    2647 void GraphicsContextGLOpenGL::deleteSync(PlatformGLObject sync)
     2647void GraphicsContextGLOpenGL::deleteSync(GCGLsync sync)
    26482648{
    26492649    UNUSED_PARAM(sync);
    26502650}
    26512651
    2652 GCGLenum GraphicsContextGLOpenGL::clientWaitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLuint64 timeout)
     2652GCGLenum GraphicsContextGLOpenGL::clientWaitSync(GCGLsync sync, GCGLbitfield flags, GCGLuint64 timeout)
    26532653{
    26542654    UNUSED_PARAM(sync);
     
    26592659}
    26602660
    2661 void GraphicsContextGLOpenGL::waitSync(PlatformGLObject sync, GCGLbitfield flags, GCGLint64 timeout)
     2661void GraphicsContextGLOpenGL::waitSync(GCGLsync sync, GCGLbitfield flags, GCGLint64 timeout)
    26622662{
    26632663    UNUSED_PARAM(sync);
     
    26662666}
    26672667
    2668 void GraphicsContextGLOpenGL::getSynciv(PlatformGLObject sync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value)
     2668void GraphicsContextGLOpenGL::getSynciv(GCGLsync sync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value)
    26692669{
    26702670    UNUSED_PARAM(sync);
Note: See TracChangeset for help on using the changeset viewer.