Use a memcpy to avoid strict-aliasing warnings.
This commit is contained in:
parent
6d90e01858
commit
ac49ed0779
|
@ -128,8 +128,10 @@ namespace backend { namespace opengl {
|
|||
*reinterpret_cast<GLuint*>(&mValues[stage][constant]));
|
||||
break;
|
||||
case PushConstantType::Float:
|
||||
glUniform1f(location,
|
||||
*reinterpret_cast<GLfloat*>(&mValues[stage][constant]));
|
||||
float value;
|
||||
// Use a memcpy to avoid strict-aliasing warnings.
|
||||
memcpy(&value, &mValues[stage][constant], sizeof(value));
|
||||
glUniform1f(location, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue