|
7 | 7 | #include "flutter/testing/testing.h"
|
8 | 8 | #include "impeller/base/strings.h"
|
9 | 9 | #include "impeller/fixtures/sample.comp.h"
|
10 |
| -#include "impeller/playground/playground_test.h" |
| 10 | +#include "impeller/playground/compute_playground_test.h" |
11 | 11 | #include "impeller/renderer/command_buffer.h"
|
12 | 12 | #include "impeller/renderer/compute_command.h"
|
13 | 13 | #include "impeller/renderer/compute_pipeline_builder.h"
|
|
17 | 17 | namespace impeller {
|
18 | 18 | namespace testing {
|
19 | 19 |
|
20 |
| -using ComputeTest = PlaygroundTest; |
21 |
| -INSTANTIATE_PLAYGROUND_SUITE(ComputeTest); |
| 20 | +using ComputeTest = ComputePlaygroundTest; |
| 21 | +INSTANTIATE_COMPUTE_SUITE(ComputeTest); |
22 | 22 |
|
23 | 23 | TEST_P(ComputeTest, CanCreateComputePass) {
|
24 |
| - if (GetParam() == PlaygroundBackend::kOpenGLES) { |
25 |
| - GTEST_SKIP_("Compute is not supported on GL."); |
26 |
| - } |
27 |
| - if (GetParam() == PlaygroundBackend::kVulkan) { |
28 |
| - GTEST_SKIP_("Compute is not supported on Vulkan yet."); |
29 |
| - } |
30 |
| - |
31 | 24 | using CS = SampleComputeShader;
|
32 | 25 | auto context = GetContext();
|
33 | 26 | ASSERT_TRUE(context);
|
@@ -63,6 +56,7 @@ TEST_P(ComputeTest, CanCreateComputePass) {
|
63 | 56 | input_0.fixed_array[1] = IPoint32(2, 2);
|
64 | 57 | input_1.fixed_array[0] = UintPoint32(3, 3);
|
65 | 58 | input_0.some_int = 5;
|
| 59 | + input_1.some_struct = CS::SomeStruct{.vf = Point(3, 4), .i = 42}; |
66 | 60 |
|
67 | 61 | DeviceBufferDescriptor buffer_desc;
|
68 | 62 | buffer_desc.storage_mode = StorageMode::kHostVisible;
|
@@ -97,8 +91,10 @@ TEST_P(ComputeTest, CanCreateComputePass) {
|
97 | 91 | for (size_t i = 0; i < kCount; i++) {
|
98 | 92 | Vector4 vector = output->elements[i];
|
99 | 93 | Vector4 computed = input_0.elements[i] * input_1.elements[i];
|
100 |
| - EXPECT_EQ(vector, Vector4(computed.x + 2, computed.y + 3, |
101 |
| - computed.z + 5, computed.w)); |
| 94 | + EXPECT_EQ(vector, Vector4(computed.x + 2 + input_1.some_struct.i, |
| 95 | + computed.y + 3 + input_1.some_struct.vf.x, |
| 96 | + computed.z + 5 + input_1.some_struct.vf.y, |
| 97 | + computed.w)); |
102 | 98 | }
|
103 | 99 | latch.Signal();
|
104 | 100 | }));
|
|
0 commit comments