mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
microsoft/clc: Fixes compiling errors with clang/mingw64 in clc/clc_compiler_test.cpp
clc_compiler_test.cpp:1322:67: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list
log(0.0f) / log(2), log(1.0f) / log(2), log(2.0f) / log(2), log(3.0f) / log(2)
clc_compiler_test.cpp:2306:25: error: non-constant-expression cannot be narrowed from type 'std::vector<unsigned int>::size_type' (aka 'unsigned long long') to 'unsigned int' in initializer list
CompileArgs args = { inout.size(), 1, 1 };
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
(cherry picked from commit ecfda9a0fa)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18030>
This commit is contained in:
parent
4e0637a182
commit
12f1cabeba
1 changed files with 2 additions and 2 deletions
|
|
@ -1319,7 +1319,7 @@ TEST_F(ComputeTest, log2)
|
||||||
}\n";
|
}\n";
|
||||||
auto inout = ShaderArg<float>({ 0.0f, 1.0f, 2.0f, 3.0f }, SHADER_ARG_INOUT);
|
auto inout = ShaderArg<float>({ 0.0f, 1.0f, 2.0f, 3.0f }, SHADER_ARG_INOUT);
|
||||||
const float expected[] = {
|
const float expected[] = {
|
||||||
log(0.0f) / log(2), log(1.0f) / log(2), log(2.0f) / log(2), log(3.0f) / log(2)
|
log(0.0f) / log(2.0f), log(1.0f) / log(2.0f), log(2.0f) / log(2.0f), log(3.0f) / log(2.0f)
|
||||||
};
|
};
|
||||||
run_shader(kernel_source, inout.size(), 1, 1, inout);
|
run_shader(kernel_source, inout.size(), 1, 1, inout);
|
||||||
for (int i = 0; i < inout.size(); ++i)
|
for (int i = 0; i < inout.size(); ++i)
|
||||||
|
|
@ -2303,7 +2303,7 @@ TEST_F(ComputeTest, spec_constant)
|
||||||
const uint32_t expected[] = {
|
const uint32_t expected[] = {
|
||||||
0x00000005, 0x60000006, 0x000e000e, 0x20081018
|
0x00000005, 0x60000006, 0x000e000e, 0x20081018
|
||||||
};
|
};
|
||||||
CompileArgs args = { inout.size(), 1, 1 };
|
CompileArgs args = { (unsigned)inout.size(), 1, 1 };
|
||||||
run_shader(spec_shader, args, inout);
|
run_shader(spec_shader, args, inout);
|
||||||
for (int i = 0; i < inout.size(); ++i)
|
for (int i = 0; i < inout.size(); ++i)
|
||||||
EXPECT_EQ(inout[i], expected[i]);
|
EXPECT_EQ(inout[i], expected[i]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue