mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 06:50:11 +01:00
st/mesa: avoid aliasing violation in st_cb_perfmon.c
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
52f9ccefcb
commit
c33807463e
1 changed files with 3 additions and 3 deletions
|
|
@ -308,16 +308,16 @@ st_GetPerfMonitorResult(struct gl_context *ctx,
|
|||
data[offset++] = cid;
|
||||
switch (type) {
|
||||
case GL_UNSIGNED_INT64_AMD:
|
||||
*(uint64_t *)&data[offset] = result.u64;
|
||||
memcpy(&data[offset], &result.u64, sizeof(uint64_t));
|
||||
offset += sizeof(uint64_t) / sizeof(GLuint);
|
||||
break;
|
||||
case GL_UNSIGNED_INT:
|
||||
*(uint32_t *)&data[offset] = result.u32;
|
||||
memcpy(&data[offset], &result.u32, sizeof(uint32_t));
|
||||
offset += sizeof(uint32_t) / sizeof(GLuint);
|
||||
break;
|
||||
case GL_FLOAT:
|
||||
case GL_PERCENTAGE_AMD:
|
||||
*(GLfloat *)&data[offset] = result.f;
|
||||
memcpy(&data[offset], &result.f, sizeof(GLfloat));
|
||||
offset += sizeof(GLfloat) / sizeof(GLuint);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue