From b6ac73ab21ada7535c286b7d9d8d8bbc6c16f3f6 Mon Sep 17 00:00:00 2001 From: Ari Suonpaa Date: Sat, 20 Jun 2020 10:27:41 +0300 Subject: [PATCH] Add test for writing to an SSBO array VK-GL-CTS Issue: 2285 New tests: dEQP-VK.compute.basic.write_ssbo_array Components: Vulkan Change-Id: I6650aa1e087a5fb3c2bdad5eb3788b944faf996e --- android/cts/master/vk-master-2020-03-01.txt | 1 + android/cts/master/vk-master.txt | 1 + external/fetch_sources.py | 2 +- .../vulkan/amber/compute/write_ssbo_array.amber | 53 ++++++++++++++++++++++ .../modules/vulkan/compute/CMakeLists.txt | 5 +- .../compute/vktComputeBasicComputeShaderTests.cpp | 3 ++ external/vulkancts/mustpass/master/vk-default.txt | 1 + 7 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 external/vulkancts/data/vulkan/amber/compute/write_ssbo_array.amber diff --git a/android/cts/master/vk-master-2020-03-01.txt b/android/cts/master/vk-master-2020-03-01.txt index 31dda9c..552b96e 100644 --- a/android/cts/master/vk-master-2020-03-01.txt +++ b/android/cts/master/vk-master-2020-03-01.txt @@ -119159,6 +119159,7 @@ dEQP-VK.draw.explicit_vertex_parameter.noperspective_sample_samples_64 dEQP-VK.draw.explicit_vertex_parameter.smooth_centroid_samples_64 dEQP-VK.draw.explicit_vertex_parameter.noperspective_centroid_samples_64 dEQP-VK.compute.basic.concurrent_compute +dEQP-VK.compute.basic.write_ssbo_array dEQP-VK.compute.cooperative_matrix.length.float32_float32.buffer.rowmajor dEQP-VK.compute.cooperative_matrix.length.float32_float32.buffer.colmajor dEQP-VK.compute.cooperative_matrix.length.float32_float32.workgroup.rowmajor diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index 6c8dcce..e3f02ff 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -422171,6 +422171,7 @@ dEQP-VK.compute.basic.image_atomic_op_local_size_1 dEQP-VK.compute.basic.image_atomic_op_local_size_8 dEQP-VK.compute.basic.image_barrier_single dEQP-VK.compute.basic.image_barrier_multiple +dEQP-VK.compute.basic.write_ssbo_array dEQP-VK.compute.device_group.dispatch_base dEQP-VK.compute.device_group.device_index dEQP-VK.compute.cooperative_matrix.length.float32_float32.buffer.rowmajor diff --git a/external/fetch_sources.py b/external/fetch_sources.py index c011ac6..87129c8 100644 --- a/external/fetch_sources.py +++ b/external/fetch_sources.py @@ -332,7 +332,7 @@ PACKAGES = [ GitRepo( "https://github.com/google/amber.git", None, - "2f42dc26a78fe0ff9afa73d698344fb2170658d9", + "9f59702d3ddcb08dbec261c598de2e82e8fb3936", "amber"), ] diff --git a/external/vulkancts/data/vulkan/amber/compute/write_ssbo_array.amber b/external/vulkancts/data/vulkan/amber/compute/write_ssbo_array.amber new file mode 100644 index 0000000..b7c6c8c --- /dev/null +++ b/external/vulkancts/data/vulkan/amber/compute/write_ssbo_array.amber @@ -0,0 +1,53 @@ +#!amber +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SHADER compute compute_shader GLSL +#version 450 +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(binding = 0) buffer block0 +{ + int data; +} ssbo_array[2]; + +void main() +{ + ssbo_array[0].data++; + ssbo_array[0].data++; + ssbo_array[0].data++; + + ssbo_array[1].data++; + ssbo_array[1].data++; +} +END + +BUFFER buf0 DATA_TYPE int32 DATA +0 +END + +BUFFER buf1 DATA_TYPE int32 DATA +0 +END + +PIPELINE compute pipeline + ATTACH compute_shader + + BIND BUFFER_ARRAY buf0 buf1 AS storage DESCRIPTOR_SET 0 BINDING 0 +END + +RUN pipeline 1 1 1 + +EXPECT buf0 IDX 0 EQ 3 +EXPECT buf1 IDX 0 EQ 2 diff --git a/external/vulkancts/modules/vulkan/compute/CMakeLists.txt b/external/vulkancts/modules/vulkan/compute/CMakeLists.txt index 9ef5100..a6783b0 100644 --- a/external/vulkancts/modules/vulkan/compute/CMakeLists.txt +++ b/external/vulkancts/modules/vulkan/compute/CMakeLists.txt @@ -1,4 +1,7 @@ -include_directories(..) +include_directories( + .. + ../amber + ) set(DEQP_VK_COMPUTE_SRCS vktComputeTests.cpp diff --git a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp index c3e4048..4c3c4a5 100644 --- a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp +++ b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp @@ -27,6 +27,7 @@ #include "vktTestCaseUtil.hpp" #include "vktComputeTestsUtil.hpp" #include "vktCustomInstancesDevices.hpp" +#include "vktAmberTestCase.hpp" #include "vkDefs.hpp" #include "vkRef.hpp" @@ -3401,6 +3402,8 @@ tcu::TestCaseGroup* createBasicComputeShaderTests (tcu::TestContext& testCtx) basicComputeTests->addChild(new ImageBarrierTest(testCtx, "image_barrier_single", "Image barrier", tcu::IVec2(1,1))); basicComputeTests->addChild(new ImageBarrierTest(testCtx, "image_barrier_multiple", "Image barrier", tcu::IVec2(64,64))); + basicComputeTests->addChild(cts_amber::createAmberTestCase(testCtx, "write_ssbo_array", "", "compute", "write_ssbo_array.amber")); + return basicComputeTests.release(); } diff --git a/external/vulkancts/mustpass/master/vk-default.txt b/external/vulkancts/mustpass/master/vk-default.txt index 6e01684..e321182 100644 --- a/external/vulkancts/mustpass/master/vk-default.txt +++ b/external/vulkancts/mustpass/master/vk-default.txt @@ -422084,6 +422084,7 @@ dEQP-VK.compute.basic.image_atomic_op_local_size_1 dEQP-VK.compute.basic.image_atomic_op_local_size_8 dEQP-VK.compute.basic.image_barrier_single dEQP-VK.compute.basic.image_barrier_multiple +dEQP-VK.compute.basic.write_ssbo_array dEQP-VK.compute.device_group.dispatch_base dEQP-VK.compute.device_group.device_index dEQP-VK.compute.cooperative_matrix.length.float32_float32.buffer.rowmajor -- 2.7.4