| Index: tools/gpu/vk/VkTestContext.cpp
|
| diff --git a/tools/gpu/vk/VkTestContext.cpp b/tools/gpu/vk/VkTestContext.cpp
|
| index 02bda2fa31dafa44fa325ad04efee83fee2b0df3..5481c043c67b6f02be6f23c93589cf042526ead2 100644
|
| --- a/tools/gpu/vk/VkTestContext.cpp
|
| +++ b/tools/gpu/vk/VkTestContext.cpp
|
| @@ -13,13 +13,15 @@
|
| #include "vk/GrVkUtil.h"
|
| #include <vulkan/vulkan.h>
|
|
|
| +namespace sk_gpu_test {
|
| +
|
| namespace {
|
| /**
|
| - * Implements SkGpuFenceSync for Vulkan. It creates a single command buffer with
|
| + * Implements FenceSync for Vulkan. It creates a single command buffer with
|
| * USAGE_SIMULTANEOUS with no content . On every insertFence request it submits
|
| * the command buffer with a new fence.
|
| */
|
| -class VkFenceSync : public SkGpuFenceSync {
|
| +class VkFenceSync : public FenceSync {
|
| public:
|
| VkFenceSync(sk_sp<const GrVkInterface> vk, VkDevice device, VkQueue queue,
|
| uint32_t queueFamilyIndex)
|
| @@ -58,7 +60,7 @@ public:
|
| GR_VK_CALL(fVk, DestroyCommandPool(fDevice, fCommandPool, nullptr));
|
| }
|
|
|
| - SkPlatformGpuFence SK_WARN_UNUSED_RESULT insertFence() const override {
|
| + PlatformFence SK_WARN_UNUSED_RESULT insertFence() const override {
|
| VkFence fence;
|
| VkFenceCreateInfo info;
|
| info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
|
| @@ -77,17 +79,17 @@ public:
|
| submitInfo.pSignalSemaphores = nullptr;
|
| GR_VK_CALL_ERRCHECK(fVk, QueueSubmit(fQueue, 1, &submitInfo, fence));
|
| SkDEBUGCODE(++fUnfinishedSyncs;)
|
| - return reinterpret_cast<SkPlatformGpuFence>(fence);
|
| + return reinterpret_cast<PlatformFence>(fence);
|
| }
|
|
|
| - bool waitFence(SkPlatformGpuFence opaqueFence) const override {
|
| + bool waitFence(PlatformFence opaqueFence) const override {
|
| VkFence fence = reinterpret_cast<VkFence>(opaqueFence);
|
| static constexpr uint64_t kForever = ~((uint64_t)0);
|
| auto result = GR_VK_CALL(fVk, WaitForFences(fDevice, 1, &fence, true, kForever));
|
| return result != VK_TIMEOUT;
|
| }
|
|
|
| - void deleteFence(SkPlatformGpuFence opaqueFence) const override {
|
| + void deleteFence(PlatformFence opaqueFence) const override {
|
| VkFence fence = reinterpret_cast<VkFence>(opaqueFence);
|
| GR_VK_CALL(fVk, DestroyFence(fDevice, fence, nullptr));
|
| SkDEBUGCODE(--fUnfinishedSyncs;)
|
| @@ -100,11 +102,11 @@ private:
|
| VkCommandPool fCommandPool;
|
| VkCommandBuffer fCommandBuffer;
|
| SkDEBUGCODE(mutable int fUnfinishedSyncs;)
|
| - typedef SkGpuFenceSync INHERITED;
|
| + typedef FenceSync INHERITED;
|
| };
|
|
|
| // TODO: Implement swap buffers and finish
|
| -class VkTestContextImpl : public sk_gpu_test::VkTestContext {
|
| +class VkTestContextImpl : public VkTestContext {
|
| public:
|
| static VkTestContext* Create() {
|
| sk_sp<const GrVkBackendContext> backendContext(GrVkBackendContext::Create());
|
| @@ -139,11 +141,10 @@ private:
|
| void onPlatformMakeCurrent() const override {}
|
| void onPlatformSwapBuffers() const override {}
|
|
|
| - typedef sk_gpu_test::VkTestContext INHERITED;
|
| + typedef VkTestContext INHERITED;
|
| };
|
| -}
|
| +} // anonymous namespace
|
|
|
| -namespace sk_gpu_test {
|
| VkTestContext* CreatePlatformVkTestContext() { return VkTestContextImpl::Create(); }
|
| } // namespace sk_gpu_test
|
|
|
|
|