@@ -112,8 +112,8 @@ struct StructureOfArrays : impl::StructureOfArraysBase<IndexType,ElementStride,S
112
112
BaseAccessor accessor;
113
113
114
114
// Question: shall we go back to requiring a `access_t get(index_t)` on the `BaseAccessor`, then we could `enable_if` check the return type (via `has_method_get`) matches and we won't get Nasty HLSL copy-in copy-out conversions
115
- template<typename T>
116
- enable_if_t<sizeof (T)%sizeof (access_t)==0 ,void > get (const index_t ix, NBL_REF_ARG (T) value)
115
+ template<typename T, typename I=index_t >
116
+ enable_if_t<sizeof (T)%sizeof (access_t)==0 ,void > get (const I ix, NBL_REF_ARG (T) value)
117
117
{
118
118
NBL_CONSTEXPR uint64_t SubElementCount = sizeof (T)/sizeof (access_t);
119
119
// `vector` for now, we'll use `array` later when `bit_cast` gets fixed
@@ -123,8 +123,8 @@ struct StructureOfArrays : impl::StructureOfArraysBase<IndexType,ElementStride,S
123
123
value = bit_cast<T,vector <access_t,SubElementCount> >(aux);
124
124
}
125
125
126
- template<typename T>
127
- enable_if_t<sizeof (T)%sizeof (access_t)==0 ,void > set (const index_t ix, NBL_CONST_REF_ARG (T) value)
126
+ template<typename T, typename I=index_t >
127
+ enable_if_t<sizeof (T)%sizeof (access_t)==0 ,void > set (const I ix, NBL_CONST_REF_ARG (T) value)
128
128
{
129
129
NBL_CONSTEXPR uint64_t SubElementCount = sizeof (T)/sizeof (access_t);
130
130
// `vector` for now, we'll use `array` later when `bit_cast` gets fixed
@@ -209,11 +209,11 @@ struct Offset : impl::OffsetBase<IndexType,_Offset>
209
209
210
210
BaseAccessor accessor;
211
211
212
- template <typename T>
213
- void set (index_t idx, T value) {accessor.set (idx+base_t::offset,value); }
212
+ template <typename T, typename I=index_t >
213
+ void set (I idx, T value) {accessor.set (idx+base_t::offset,value); }
214
214
215
- template <typename T>
216
- void get (index_t idx, NBL_REF_ARG (T) value) {accessor.get (idx+base_t::offset,value);}
215
+ template <typename T, typename I=index_t >
216
+ void get (I idx, NBL_REF_ARG (T) value) {accessor.get (idx+base_t::offset,value);}
217
217
218
218
template<typename S=BaseAccessor>
219
219
enable_if_t<
0 commit comments