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.
This commit is contained in:
Jeroen Bakker 2023-01-31 08:48:52 +01:00
parent 6b8fa899ca
commit b7e178cb7d
1 changed files with 18 additions and 1 deletions

View File

@ -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