From 16dace3d4813489c750587f2b55796305219ebc7 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 1 Oct 2019 12:54:34 +0100 Subject: [PATCH] Fix tests running on 32-bit --- util/test/demos/gl/gl_parameter_zoo.cpp | 4 ++-- util/test/demos/vk/vk_headers.h | 1 + util/test/demos/vk/vk_test.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/util/test/demos/gl/gl_parameter_zoo.cpp b/util/test/demos/gl/gl_parameter_zoo.cpp index 1168a8150..bd9d5deed 100644 --- a/util/test/demos/gl/gl_parameter_zoo.cpp +++ b/util/test/demos/gl/gl_parameter_zoo.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -#ifdef WIN32 +#ifdef WIN64 extern "C" __declspec(dllexport) GLenum APIENTRY InternalFunction() { return GL_QUERY_BUFFER; @@ -127,7 +127,7 @@ void main() if(GLAD_GL_ARB_query_buffer_object) glBindBuffer(GL_QUERY_BUFFER, trash); -#ifdef WIN32 +#if defined(WIN64) PFNGLGETERRORPROC internalFunc = (PFNGLGETERRORPROC)GetProcAddress(GetModuleHandleA(NULL), "InternalFunction"); diff --git a/util/test/demos/vk/vk_headers.h b/util/test/demos/vk/vk_headers.h index 6ce154ee4..3e75d816a 100644 --- a/util/test/demos/vk/vk_headers.h +++ b/util/test/demos/vk/vk_headers.h @@ -48,6 +48,7 @@ bool operator==(const int &other) const { return handle == other; } \ bool operator!=(const int &other) const { return handle != other; } \ operator bool() const { return handle != 0; } \ + operator uint64_t() const { return handle; } \ uint64_t handle; \ }; diff --git a/util/test/demos/vk/vk_test.cpp b/util/test/demos/vk/vk_test.cpp index 24ebca05e..01cec5499 100644 --- a/util/test/demos/vk/vk_test.cpp +++ b/util/test/demos/vk/vk_test.cpp @@ -668,25 +668,25 @@ VkCommandBuffer VulkanWindow::GetCommandBuffer(VkCommandBufferLevel level) template <> void VulkanGraphicsTest::setName(VkPipeline obj, const std::string &name) { - setName(VK_OBJECT_TYPE_PIPELINE, (uint64_t)(uintptr_t)obj, name); + setName(VK_OBJECT_TYPE_PIPELINE, (uint64_t)obj, name); } template <> void VulkanGraphicsTest::setName(VkFramebuffer obj, const std::string &name) { - setName(VK_OBJECT_TYPE_FRAMEBUFFER, (uint64_t)(uintptr_t)obj, name); + setName(VK_OBJECT_TYPE_FRAMEBUFFER, (uint64_t)obj, name); } template <> void VulkanGraphicsTest::setName(VkImage obj, const std::string &name) { - setName(VK_OBJECT_TYPE_IMAGE, (uint64_t)(uintptr_t)obj, name); + setName(VK_OBJECT_TYPE_IMAGE, (uint64_t)obj, name); } template <> void VulkanGraphicsTest::setName(VkSampler obj, const std::string &name) { - setName(VK_OBJECT_TYPE_SAMPLER, (uint64_t)(uintptr_t)obj, name); + setName(VK_OBJECT_TYPE_SAMPLER, (uint64_t)obj, name); } void VulkanGraphicsTest::setName(VkObjectType objType, uint64_t obj, const std::string &name)