mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
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]));
|
*reinterpret_cast<GLuint*>(&mValues[stage][constant]));
|
||||||
break;
|
break;
|
||||||
case PushConstantType::Float:
|
case PushConstantType::Float:
|
||||||
glUniform1f(location,
|
float value;
|
||||||
*reinterpret_cast<GLfloat*>(&mValues[stage][constant]));
|
// Use a memcpy to avoid strict-aliasing warnings.
|
||||||
|
memcpy(&value, &mValues[stage][constant], sizeof(value));
|
||||||
|
glUniform1f(location, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user