diff --git a/tools/gpu/FenceSync.h b/tools/gpu/FenceSync.h index c3f1182621..8f2bbe2e86 100644 --- a/tools/gpu/FenceSync.h +++ b/tools/gpu/FenceSync.h @@ -12,7 +12,7 @@ namespace sk_gpu_test { -using PlatformFence = intptr_t; +using PlatformFence = uint64_t; static constexpr PlatformFence kInvalidPlatformFence = 0; /* diff --git a/tools/gpu/gl/GLTestContext.cpp b/tools/gpu/gl/GLTestContext.cpp index 1d53bbcd83..1b077d5a02 100644 --- a/tools/gpu/gl/GLTestContext.cpp +++ b/tools/gpu/gl/GLTestContext.cpp @@ -28,6 +28,7 @@ private: static constexpr GrGLbitfield GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001; typedef struct __GLsync *GLsync; + GR_STATIC_ASSERT(sizeof(GLsync) <= sizeof(sk_gpu_test::PlatformFence)); typedef GLsync (GR_GL_FUNCTION_TYPE* GLFenceSyncProc) (GrGLenum, GrGLbitfield); typedef GrGLenum (GR_GL_FUNCTION_TYPE* GLClientWaitSyncProc) (GLsync, GrGLbitfield, GrGLuint64); diff --git a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp index 8fdd3fea86..06bd70f852 100644 --- a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp +++ b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp @@ -320,6 +320,8 @@ void EGLFenceSync::deleteFence(sk_gpu_test::PlatformFence platformFence) const { eglDestroySyncKHR(fDisplay, eglsync); } +GR_STATIC_ASSERT(sizeof(EGLSyncKHR) <= sizeof(sk_gpu_test::PlatformFence)); + } // anonymous namespace namespace sk_gpu_test { @@ -337,4 +339,3 @@ GLTestContext *CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI, return ctx; } } // namespace sk_gpu_test - diff --git a/tools/gpu/vk/VkTestContext.cpp b/tools/gpu/vk/VkTestContext.cpp index c1a2f8ab56..a76a361a37 100644 --- a/tools/gpu/vk/VkTestContext.cpp +++ b/tools/gpu/vk/VkTestContext.cpp @@ -103,6 +103,8 @@ private: typedef sk_gpu_test::FenceSync INHERITED; }; +GR_STATIC_ASSERT(sizeof(VkFence) <= sizeof(sk_gpu_test::PlatformFence)); + // TODO: Implement swap buffers and finish class VkTestContextImpl : public sk_gpu_test::VkTestContext { public: