Removed deprecated Span<T> constructors

master
Marc Gilleron 2022-08-24 22:18:17 +01:00
parent b1869f390a
commit 8facdce3af
3 changed files with 7 additions and 23 deletions

View File

@ -1850,10 +1850,10 @@ float VoxelGeneratorGraph::debug_measure_microseconds_per_voxel(
src_y.resize(cube_volume);
src_z.resize(cube_volume);
src_sdf.resize(cube_volume);
Span<float> sx(src_x, 0, src_x.size());
Span<float> sy(src_y, 0, src_y.size());
Span<float> sz(src_z, 0, src_z.size());
Span<float> ssdf(src_sdf, 0, src_sdf.size());
Span<float> sx = to_span(src_x);
Span<float> sy = to_span(src_y);
Span<float> sz = to_span(src_z);
Span<float> ssdf = to_span(src_sdf);
const bool per_node_profiling = node_profiling_info != nullptr;
runtime.prepare_state(cache.state, sx.size(), per_node_profiling);

View File

@ -432,7 +432,7 @@ void VoxelGraphRuntime::generate_set(State &state, Span<float> in_x, Span<float>
#endif
#endif
Span<Buffer> buffers(state.buffers, 0, state.buffers.size());
Span<Buffer> buffers = to_span(state.buffers);
// Bind inputs
if (_program.x_input_address != -1) {
@ -518,8 +518,8 @@ void VoxelGraphRuntime::analyze_range(
ERR_FAIL_COND(state.ranges.size() != _program.buffer_count);
#endif
Span<math::Interval> ranges(state.ranges, 0, state.ranges.size());
Span<Buffer> buffers(state.buffers, 0, state.buffers.size());
Span<math::Interval> ranges = to_span(state.ranges);
Span<Buffer> buffers = to_span(state.buffers);
// Reset users count, as they might be decreased during the analysis
for (auto it = _program.buffer_specs.cbegin(); it != _program.buffer_specs.cend(); ++it) {

View File

@ -37,22 +37,6 @@ public:
_size = p_other.size();
}
// TODO Remove this one, prefer to_span() specializations
inline Span(std::vector<T> &vec, size_t p_begin, size_t p_end) {
ZN_ASSERT(p_end >= p_begin);
ZN_ASSERT(p_begin < vec.size());
ZN_ASSERT(p_end <= vec.size()); // `<=` because p_end is typically `p_begin + size`
_ptr = &vec[p_begin];
_size = p_end - p_begin;
}
// TODO Remove this one, prefer to_span() specializations
template <unsigned int N>
inline Span(FixedArray<T, N> &a) {
_ptr = a.data();
_size = a.size();
}
inline Span<T> sub(size_t from, size_t len) const {
ZN_ASSERT(from + len <= _size);
return Span<T>(_ptr + from, len);