@@ -4884,24 +4884,25 @@ bool WrappedOpenGL::Serialise_glVertexAttrib(SerialiserType &ser, GLuint index,
4884
4884
4885
4885
if (ser.IsWriting ())
4886
4886
{
4887
- uint32_t byteCount = count;
4888
-
4889
- if (attr == Attrib_GLbyte)
4890
- byteCount *= sizeof (char );
4891
- else if (attr == Attrib_GLshort)
4892
- byteCount *= sizeof (int16_t );
4893
- else if (attr == Attrib_GLint)
4894
- byteCount *= sizeof (int32_t );
4895
- else if (attr == Attrib_GLubyte)
4896
- byteCount *= sizeof (unsigned char );
4897
- else if (attr == Attrib_GLushort)
4898
- byteCount *= sizeof (uint16_t );
4899
- else if (attr == Attrib_GLuint || attr == Attrib_packed)
4900
- byteCount *= sizeof (uint32_t );
4887
+ uint32_t byteCount = 0u ;
4888
+
4889
+ switch (attr)
4890
+ {
4891
+ case Attrib_GLdouble: byteCount = sizeof (double ) * count; break ;
4892
+ case Attrib_GLfloat: byteCount = sizeof (float ) * count; break ;
4893
+ case Attrib_GLshort:
4894
+ case Attrib_GLushort: byteCount = sizeof (int16_t ) * count; break ;
4895
+ default :
4896
+ case Attrib_GLbyte:
4897
+ case Attrib_GLubyte: byteCount = sizeof (int8_t ) * count; break ;
4898
+ case Attrib_GLint:
4899
+ case Attrib_GLuint: byteCount = sizeof (int32_t ) * count; break ;
4900
+ case Attrib_packed: byteCount = sizeof (uint32_t ); break ;
4901
+ }
4901
4902
4902
4903
RDCEraseEl (v);
4903
4904
4904
- memcpy (v. f , value, byteCount);
4905
+ memcpy (&v , value, byteCount);
4905
4906
}
4906
4907
4907
4908
// Serialise the array with the right type. We don't want to allocate new storage
0 commit comments