Add direct copy when output and input vertex formats are matching.
This commit is contained in:
parent
a02d8e4d7d
commit
39c449a763
@ -71,6 +71,20 @@ struct alignas(4) rk_output_row {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename _output, unsigned _cols, bool _signed, bool _normalized>
|
||||||
|
struct alignas(4) rk_output_row<_output, _output, _cols, _signed, _normalized> {
|
||||||
|
rk_output<_output, _output, _signed, _normalized> output_col[_cols];
|
||||||
|
|
||||||
|
[[RK_FAST]]
|
||||||
|
inline void convert(
|
||||||
|
rk_input_row<_output, _cols> const & __restrict src) {
|
||||||
|
static_assert(sizeof(output_col) == sizeof(src.input_col));
|
||||||
|
rk_output<_output, _output, _signed, _normalized> const * const input_col =
|
||||||
|
reinterpret_cast<rk_output<_output, _output, _signed, _normalized> const *>(src.input_col);
|
||||||
|
*output_col = *input_col;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<typename _input, unsigned _cols, bool _signed, bool _normalized>
|
template<typename _input, unsigned _cols, bool _signed, bool _normalized>
|
||||||
struct alignas(4) rk_output_row<rk_packed<_signed, _cols>, _input, _cols, _signed, _normalized> {
|
struct alignas(4) rk_output_row<rk_packed<_signed, _cols>, _input, _cols, _signed, _normalized> {
|
||||||
rk_output<rk_packed<_signed, _cols>, _input, _signed, _normalized> output_cols;
|
rk_output<rk_packed<_signed, _cols>, _input, _signed, _normalized> output_cols;
|
||||||
@ -100,6 +114,20 @@ struct alignas(4) rk_output_format {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename _output, unsigned _cols, unsigned _rows, bool _signed, bool _normalized>
|
||||||
|
struct alignas(4) rk_output_format<_output, _output, _cols, _rows, _signed, _normalized> {
|
||||||
|
rk_output_row<_output, _output, _cols, _signed, _normalized> output_row[_rows];
|
||||||
|
|
||||||
|
[[RK_FAST]]
|
||||||
|
inline void convert(
|
||||||
|
rk_input_format<_output, _cols, _rows> const & __restrict src) {
|
||||||
|
static_assert(sizeof(output_row) == sizeof(src.input_row));
|
||||||
|
rk_output_row<_output, _output, _cols, _signed, _normalized> const * const input_row =
|
||||||
|
reinterpret_cast<rk_output_row<_output, _output, _cols, _signed, _normalized> const *>(src.input_row);
|
||||||
|
*output_row = *input_row;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<typename _input, bool _signed, bool _normalized>
|
template<typename _input, bool _signed, bool _normalized>
|
||||||
struct alignas(alignof(rk_packed<_signed, 3>)) rk_output<rk_packed<_signed, 3>, _input, _signed, _normalized> {
|
struct alignas(alignof(rk_packed<_signed, 3>)) rk_output<rk_packed<_signed, 3>, _input, _signed, _normalized> {
|
||||||
rk_packed<_signed, 3> output;
|
rk_packed<_signed, 3> output;
|
||||||
|
Loading…
Reference in New Issue
Block a user