Index: tools/gpu/vk/VkTestContext.cpp |
diff --git a/tools/gpu/vk/VkTestContext.cpp b/tools/gpu/vk/VkTestContext.cpp |
index 02bda2fa31dafa44fa325ad04efee83fee2b0df3..72d29639f3664efb7289599040b2f373b460e1fe 100644 |
--- a/tools/gpu/vk/VkTestContext.cpp |
+++ b/tools/gpu/vk/VkTestContext.cpp |
@@ -13,13 +13,13 @@ |
#include "vk/GrVkUtil.h" |
#include <vulkan/vulkan.h> |
-namespace { |
+namespace sk_gpu_test { |
bsalomon
2016/10/03 17:54:00
Ditto
csmartdalton
2016/10/03 19:05:40
Done.
|
/** |
- * 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 +58,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 +77,17 @@ public: |
submitInfo.pSignalSemaphores = nullptr; |
GR_VK_CALL_ERRCHECK(fVk, QueueSubmit(fQueue, 1, &submitInfo, fence)); |
egdaniel
2016/10/03 13:24:24
since we don't need a command buffer, we can pass
|
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; |
egdaniel
2016/10/03 13:24:24
Should this assert be result == VK_SUCCESS, this w
|
} |
- 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 +100,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 +139,9 @@ private: |
void onPlatformMakeCurrent() const override {} |
void onPlatformSwapBuffers() const override {} |
- typedef sk_gpu_test::VkTestContext INHERITED; |
+ typedef VkTestContext INHERITED; |
}; |
-} |
-namespace sk_gpu_test { |
VkTestContext* CreatePlatformVkTestContext() { return VkTestContextImpl::Create(); } |
} // namespace sk_gpu_test |