tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Fence11.h (2570B)


      1 //
      2 // Copyright 2013 The ANGLE Project Authors. All rights reserved.
      3 // Use of this source code is governed by a BSD-style license that can be
      4 // found in the LICENSE file.
      5 //
      6 
      7 // Fence11.h: Defines the rx::FenceNV11 and rx::Sync11 classes which implement rx::FenceNVImpl
      8 // and rx::SyncImpl.
      9 
     10 #ifndef LIBANGLE_RENDERER_D3D_D3D11_FENCE11_H_
     11 #define LIBANGLE_RENDERER_D3D_D3D11_FENCE11_H_
     12 
     13 #include "libANGLE/renderer/FenceNVImpl.h"
     14 #include "libANGLE/renderer/SyncImpl.h"
     15 
     16 namespace rx
     17 {
     18 class Renderer11;
     19 
     20 class FenceNV11 : public FenceNVImpl
     21 {
     22  public:
     23    explicit FenceNV11(Renderer11 *renderer);
     24    ~FenceNV11() override;
     25 
     26    void onDestroy(const gl::Context *context) override {}
     27    angle::Result set(const gl::Context *context, GLenum condition) override;
     28    angle::Result test(const gl::Context *context, GLboolean *outFinished) override;
     29    angle::Result finish(const gl::Context *context) override;
     30 
     31  private:
     32    template <class T>
     33    friend angle::Result FenceSetHelper(const gl::Context *context, T *fence);
     34    template <class T>
     35    friend angle::Result FenceTestHelper(const gl::Context *context,
     36                                         T *fence,
     37                                         bool flushCommandBuffer,
     38                                         GLboolean *outFinished);
     39 
     40    Renderer11 *mRenderer;
     41    ID3D11Query *mQuery;
     42 };
     43 
     44 class Sync11 : public SyncImpl
     45 {
     46  public:
     47    explicit Sync11(Renderer11 *renderer);
     48    ~Sync11() override;
     49 
     50    angle::Result set(const gl::Context *context, GLenum condition, GLbitfield flags) override;
     51    angle::Result clientWait(const gl::Context *context,
     52                             GLbitfield flags,
     53                             GLuint64 timeout,
     54                             GLenum *outResult) override;
     55    angle::Result serverWait(const gl::Context *context,
     56                             GLbitfield flags,
     57                             GLuint64 timeout) override;
     58    angle::Result getStatus(const gl::Context *context, GLint *outResult) override;
     59 
     60  private:
     61    template <class T>
     62    friend angle::Result FenceSetHelper(const gl::Context *context, T *fence);
     63    template <class T>
     64    friend angle::Result FenceTestHelper(const gl::Context *context,
     65                                         T *fence,
     66                                         bool flushCommandBuffer,
     67                                         GLboolean *outFinished);
     68 
     69    Renderer11 *mRenderer;
     70    ID3D11Query *mQuery;
     71    LONGLONG mCounterFrequency;
     72 };
     73 
     74 }  // namespace rx
     75 
     76 #endif  // LIBANGLE_RENDERER_D3D_D3D11_FENCE11_H_