Mesa (main): microsoft/clc: Add a test for compiling a kernel with a read-write image

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 29 22:13:58 UTC 2021


Module: Mesa
Branch: main
Commit: 4c5f1ef3cad5fe351bb8024d6733b22984d23a69
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c5f1ef3cad5fe351bb8024d6733b22984d23a69

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Sun Apr 11 14:11:43 2021 -0700

microsoft/clc: Add a test for compiling a kernel with a read-write image

Reviewed-by: Enrico Galli <enrico.galli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10163>

---

 src/microsoft/clc/clc_compiler_test.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/microsoft/clc/clc_compiler_test.cpp b/src/microsoft/clc/clc_compiler_test.cpp
index 2063e5e49ed..4d3182f17c3 100644
--- a/src/microsoft/clc/clc_compiler_test.cpp
+++ b/src/microsoft/clc/clc_compiler_test.cpp
@@ -1566,6 +1566,18 @@ TEST_F(ComputeTest, image_two_reads)
    validate(shader);
 }
 
+TEST_F(ComputeTest, image_read_write)
+{
+   const char *kernel_source =
+   R"(__kernel void main_test(read_write image2d_t image)
+   {
+      int2 coords = (int2)(get_global_id(0), get_global_id(1));
+      write_imagef(image, coords, read_imagef(image, coords) + (float4)(1.0f, 1.0f, 1.0f, 1.0f));
+   })";
+   Shader shader = compile(std::vector<const char*>({ kernel_source }), { "-cl-std=cl3.0" });
+   validate(shader);
+}
+
 TEST_F(ComputeTest, sampler)
 {
    const char* kernel_source =



More information about the mesa-commit mailing list