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

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10163>
This commit is contained in:
Jesse Natalie 2021-04-11 14:11:43 -07:00
parent 6126dd29a4
commit 4c5f1ef3ca
1 changed files with 12 additions and 0 deletions

View File

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