Attempt to deduce constant/thread storage.
This commit is contained in:
Родитель
1a9c960058
Коммит
b2c9487b0f
|
@ -28,8 +28,8 @@ struct main0_out
|
|||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, typename U, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], U (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ struct main0_out
|
|||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, typename U, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], U (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ struct main0_out
|
|||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, typename U, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], U (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ struct main0_out
|
|||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, typename U, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], U (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ struct main0_out
|
|||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, typename U, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], U (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ struct main0_out
|
|||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, typename U, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], U (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
|
|
@ -915,8 +915,8 @@ void CompilerMSL::emit_custom_functions()
|
|||
case SPVFuncImplArrayCopy:
|
||||
statement("// Implementation of an array copy function to cover GLSL's ability to copy an array via "
|
||||
"assignment.");
|
||||
statement("template<typename T, uint N>");
|
||||
statement("void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])");
|
||||
statement("template<typename T, typename U, uint N>");
|
||||
statement("void spvArrayCopy(thread T (&dst)[N], U (&src)[N])");
|
||||
begin_scope();
|
||||
statement("for (uint i = 0; i < N; dst[i] = src[i], i++);");
|
||||
end_scope();
|
||||
|
|
Загрузка…
Ссылка в новой задаче