FenceVk.h#

PVRVk Fence class.

Includes#

  • PVRVk/DeviceVk.h

Included By#

Namespaces#

Classes#

Source Code#

#pragma once
#include "PVRVk/DeviceVk.h"

namespace pvrvk {
namespace impl {
class Fence_ : public PVRVkDeviceObjectBase<VkFence, ObjectType::e_FENCE>, public DeviceObjectDebugUtils<Fence_>
{
private:
    friend class Device_;

    class make_shared_enabler
    {
    protected:
        make_shared_enabler() {}
        friend class Fence_;
    };

    static Fence constructShared(const DeviceWeakPtr& device, const FenceCreateInfo& createInfo) { return std::make_shared<Fence_>(make_shared_enabler{}, device, createInfo); }

    FenceCreateInfo _createInfo;

public:
    DECLARE_NO_COPY_SEMANTICS(Fence_)
    Fence_(make_shared_enabler, const DeviceWeakPtr& device, const FenceCreateInfo& createInfo);
    ~Fence_();

    bool wait(uint64_t timeoutNanos = static_cast<uint64_t>(-1));

    bool isSignalled();

    void reset();

    inline FenceCreateFlags getFlags() const { return _createInfo.getFlags(); }

    FenceCreateInfo getCreateInfo() const { return _createInfo; }
};
} // namespace impl
} // namespace pvrvk