2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2021-05-14 07:55:01 +02:00
|
|
|
|
|
|
|
|
#include "gpu_testing.hh"
|
|
|
|
|
|
|
|
|
|
namespace blender::draw {
|
|
|
|
|
|
|
|
|
|
/* Base class for draw test cases. It will setup and tear down the GPU part around each test. */
|
2023-07-21 14:03:27 +10:00
|
|
|
#ifdef WITH_OPENGL_BACKEND
|
2021-06-28 08:28:56 +02:00
|
|
|
class DrawOpenGLTest : public blender::gpu::GPUOpenGLTest {
|
2021-05-14 08:34:13 +02:00
|
|
|
public:
|
2021-05-14 07:55:01 +02:00
|
|
|
void SetUp() override;
|
|
|
|
|
};
|
2023-07-21 14:03:27 +10:00
|
|
|
|
|
|
|
|
# define DRAW_OPENGL_TEST(test_name) \
|
|
|
|
|
TEST_F(DrawOpenGLTest, test_name) \
|
|
|
|
|
{ \
|
|
|
|
|
test_##test_name(); \
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
# define DRAW_OPENGL_TEST(test_name)
|
|
|
|
|
#endif
|
2021-06-28 08:28:56 +02:00
|
|
|
|
2023-07-03 14:24:34 +02:00
|
|
|
#ifdef WITH_METAL_BACKEND
|
|
|
|
|
class DrawMetalTest : public blender::gpu::GPUMetalTest {
|
|
|
|
|
public:
|
|
|
|
|
void SetUp() override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# define DRAW_METAL_TEST(test_name) \
|
|
|
|
|
TEST_F(DrawMetalTest, test_name) \
|
|
|
|
|
{ \
|
|
|
|
|
test_##test_name(); \
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
# define DRAW_METAL_TEST(test_name)
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-08-10 21:41:52 +02:00
|
|
|
#ifdef WITH_VULKAN_BACKEND
|
|
|
|
|
class DrawVulkanTest : public blender::gpu::GPUVulkanTest {
|
|
|
|
|
public:
|
|
|
|
|
void SetUp() override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# define DRAW_VULKAN_TEST(test_name) \
|
|
|
|
|
TEST_F(DrawVulkanTest, test_name) \
|
|
|
|
|
{ \
|
|
|
|
|
test_##test_name(); \
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
# define DRAW_VULKAN_TEST(test_name)
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-07-03 14:24:34 +02:00
|
|
|
#define DRAW_TEST(test_name) \
|
|
|
|
|
DRAW_OPENGL_TEST(test_name) \
|
2023-08-10 21:41:52 +02:00
|
|
|
DRAW_METAL_TEST(test_name) \
|
|
|
|
|
DRAW_VULKAN_TEST(test_name)
|
2023-07-03 14:24:34 +02:00
|
|
|
|
2021-05-14 07:55:01 +02:00
|
|
|
} // namespace blender::draw
|