This can get called in some circumstances if both src type and dst type
have same width (seen with float32->unorm32). While this particular case
was bogus anyway let's just fix that as it can work trivially (due to the
way it was called it actually worked anyway apart from the assert).
Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
/* We must not loose or gain channels. Only precision */
assert(src_type.length * num_srcs == dst_type.length * num_dsts);
/* We must not loose or gain channels. Only precision */
assert(src_type.length * num_srcs == dst_type.length * num_dsts);
- /* We don't support M:N conversion, only 1:N, M:1, or 1:1 */
- assert(num_srcs == 1 || num_dsts == 1);
-
assert(src_type.length <= LP_MAX_VECTOR_LENGTH);
assert(dst_type.length <= LP_MAX_VECTOR_LENGTH);
assert(num_srcs <= LP_MAX_VECTOR_LENGTH);
assert(src_type.length <= LP_MAX_VECTOR_LENGTH);
assert(dst_type.length <= LP_MAX_VECTOR_LENGTH);
assert(num_srcs <= LP_MAX_VECTOR_LENGTH);
+ /* Conversion must be M:1 */
assert(num_dsts == 1);
if (src_type.width * src_type.length == dst_type.width * dst_type.length) {
assert(num_dsts == 1);
if (src_type.width * src_type.length == dst_type.width * dst_type.length) {
+ /* Conversion must be 1:N */
assert(num_srcs == 1);
if (src_type.width * src_type.length == dst_type.width * dst_type.length) {
assert(num_srcs == 1);
if (src_type.width * src_type.length == dst_type.width * dst_type.length) {
- assert(num_srcs == 1);
- assert(num_dsts == 1);
+ /* "Conversion" must be N:N */
+ assert(num_srcs == num_dsts);
+ for(i = 0; i < num_dsts; ++i)
+ tmp[i] = src[i];
}
for(i = 0; i < num_dsts; ++i)
}
for(i = 0; i < num_dsts; ++i)