[Bf-blender-cvs] [b7e178cb7d6] master: GPU: Cross test OpenGL tests to Vulkan.

Jeroen Bakker noreply at git.blender.org
Tue Jan 31 08:49:09 CET 2023


Commit: b7e178cb7d6a4ccb40f11e09a04f41441ad42568
Author: Jeroen Bakker
Date:   Tue Jan 31 08:48:52 2023 +0100
Branches: master
https://developer.blender.org/rBb7e178cb7d6a4ccb40f11e09a04f41441ad42568

GPU: Cross test OpenGL tests to Vulkan.

Enhanced the GPU_TEST macro to also handle Vulkan backend
when WITH_VULKAN_BACKEND compilation option has been
enabled.

===================================================================

M	source/blender/gpu/tests/gpu_testing.hh

===================================================================

diff --git a/source/blender/gpu/tests/gpu_testing.hh b/source/blender/gpu/tests/gpu_testing.hh
index 058eabcc7ad..dfab3529134 100644
--- a/source/blender/gpu/tests/gpu_testing.hh
+++ b/source/blender/gpu/tests/gpu_testing.hh
@@ -63,8 +63,25 @@ class GPUMetalTest : public GPUTest {
 #  define GPU_METAL_TEST(test_name)
 #endif
 
+#ifdef WITH_VULKAN_BACKEND
+class GPUVulkanTest : public GPUTest {
+ public:
+  GPUVulkanTest() : GPUTest(GHOST_kDrawingContextTypeVulkan, GPU_BACKEND_VULKAN)
+  {
+  }
+};
+#  define GPU_VULKAN_TEST(test_name) \
+    TEST_F(GPUVulkanTest, test_name) \
+    { \
+      test_##test_name(); \
+    }
+#else
+#  define GPU_VULKAN_TEST(test_name)
+#endif
+
 #define GPU_TEST(test_name) \
   GPU_OPENGL_TEST(test_name) \
-  GPU_METAL_TEST(test_name)
+  GPU_METAL_TEST(test_name) \
+  GPU_VULKAN_TEST(test_name)
 
 }  // namespace blender::gpu



More information about the Bf-blender-cvs mailing list