mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 08:50:09 +01:00
microsoft/clc: Add test with inline function
Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9085>
This commit is contained in:
parent
c1b8629b2c
commit
37142847fa
1 changed files with 18 additions and 0 deletions
|
|
@ -2186,3 +2186,21 @@ TEST_F(ComputeTest, vstore_half)
|
|||
for (unsigned i = 0; i < 8; ++i)
|
||||
EXPECT_EQ(dest[i], expected[i]);
|
||||
}
|
||||
|
||||
TEST_F(ComputeTest, inline_function)
|
||||
{
|
||||
const char *kernel_source = R"(
|
||||
inline float helper(float foo)
|
||||
{
|
||||
return foo * 2;
|
||||
}
|
||||
|
||||
__kernel void main_test(__global float *dst, __global float *src)
|
||||
{
|
||||
*dst = helper(*src);
|
||||
})";
|
||||
auto dest = ShaderArg<float>({ NAN }, SHADER_ARG_OUTPUT);
|
||||
auto src = ShaderArg<float>({ 1.0f }, SHADER_ARG_INPUT);
|
||||
run_shader(kernel_source, 1, 1, 1, dest, src);
|
||||
EXPECT_EQ(dest[0], 2.0f);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue