Lines Matching refs:Stride
73 template <int Stride>
87 template <int Stride>
97 ConstStridedValueAccess component (int compNdx) const { return ConstStridedValueAccess(getType().getElementType(), m_value + Stride*compNdx); }
98 ConstStridedValueAccess arrayElement (int elementNdx) const { return ConstStridedValueAccess(getType().getElementType(), m_value + Stride*getType().getElementScalarOffset(elementNdx)); }
99 ConstStridedValueAccess member (int memberNdx) const { return ConstStridedValueAccess(getType().getMembers()[memberNdx].getType(), m_value + Stride*getType().getMemberScalarOffset(memberNdx)); }
101 float asFloat (void) const { DE_STATIC_ASSERT(Stride == 1); return m_value->floatVal; }
102 int asInt (void) const { DE_STATIC_ASSERT(Stride == 1); return m_value->intVal; }
103 bool asBool (void) const { DE_STATIC_ASSERT(Stride == 1); return m_value->boolVal; }
104 Scalar asScalar (void) const { DE_STATIC_ASSERT(Stride == 1); return *m_value; }
106 float asFloat (int ndx) const { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return m_value[ndx].floatVal; }
107 int asInt (int ndx) const { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return m_value[ndx].intVal; }
108 bool asBool (int ndx) const { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return m_value[ndx].boolVal; }
109 Scalar asScalar (int ndx) const { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return m_value[ndx]; }
112 T as (int ndx) const { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return this->m_value[ndx].template as<T>(); }
115 StridedValueRead<Stride> value (void) const { return StridedValueRead<Stride>(getType(), m_value); }
122 template <int Stride>
123 class StridedValueAccess : public ConstStridedValueAccess<Stride>
127 StridedValueAccess (const VariableType& type, Scalar* valuePtr) : ConstStridedValueAccess<Stride>(type, valuePtr) {}
130 StridedValueAccess component (int compNdx) { return StridedValueAccess(this->getType().getElementType(), this->m_value + Stride*compNdx); }
131 StridedValueAccess arrayElement (int elementNdx) { return StridedValueAccess(this->getType().getElementType(), this->m_value + Stride*this->getType().getElementScalarOffset(elementNdx)); }
132 StridedValueAccess member (int memberNdx) { return StridedValueAccess(this->getType().getMembers()[memberNdx].getType(), this->m_value + Stride*this->getType().getMemberScalarOffset(memberNdx)); }
134 float& asFloat (void) { DE_STATIC_ASSERT(Stride == 1); return this->m_value->floatVal; }
135 int& asInt (void) { DE_STATIC_ASSERT(Stride == 1); return this->m_value->intVal; }
136 bool& asBool (void) { DE_STATIC_ASSERT(Stride == 1); return this->m_value->boolVal; }
137 Scalar& asScalar (void) { DE_STATIC_ASSERT(Stride == 1); return *this->m_value; }
139 float& asFloat (int ndx) { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return this->m_value[ndx].floatVal; }
140 int& asInt (int ndx) { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return this->m_value[ndx].intVal; }
141 bool& asBool (int ndx) { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return this->m_value[ndx].boolVal; }
142 Scalar& asScalar (int ndx) { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return this->m_value[ndx]; }
145 T& as (int ndx) { DE_ASSERT(de::inBounds(ndx, 0, Stride)); return this->m_value[ndx].template as<T>(); }
150 // Helpers, work only in Stride == 1 case
159 template <int Stride>
161 StridedValueAccess<Stride>& StridedValueAccess<Stride>::operator= (const StridedValueRead<SrcStride>& valueRead)
163 DE_STATIC_ASSERT(SrcStride == Stride || SrcStride == 1);
171 if (Stride == SrcStride)
172 std::copy(valueRead.getValuePtr(), valueRead.getValuePtr() + scalarSize*Stride, this->m_value);
176 std::fill(this->m_value + scalarNdx*Stride, this->m_value + (scalarNdx+1)*Stride, valueRead.getValuePtr()[scalarNdx]);
182 template <int Stride>
184 StridedValueAccess<Stride>& StridedValueAccess<Stride>::operator= (const tcu::Vector<float, Size>& vec)
193 // Typedefs for stride == 1 case
309 template <int Stride>
318 StridedValueAccess<Stride> getValue (const VariableType& type) { return StridedValueAccess<Stride>(type, &m_value[0]); }
319 ConstStridedValueAccess<Stride> getValue (const VariableType& type) const { return ConstStridedValueAccess<Stride>(type, &m_value[0]); }
328 template <int Stride>
329 ValueStorage<Stride>::ValueStorage (void)
333 template <int Stride>
334 ValueStorage<Stride>::ValueStorage (const VariableType& type)
339 template <int Stride>
340 void ValueStorage<Stride>::setStorage (const VariableType& type)
342 m_value.resize(type.getScalarSize() * Stride);