st_src_reg src(PROGRAM_IMMEDIATE, -1, GLSL_TYPE_DOUBLE);
union gl_constant_value uval[2];
- uval[0].u = *(uint32_t *)&val;
- uval[1].u = *(((uint32_t *)&val) + 1);
+ memcpy(uval, &val, sizeof(uval));
src.index = add_constant(src.file, uval, 1, GL_DOUBLE, &src.swizzle);
return src;
case GLSL_TYPE_DOUBLE:
gl_type = GL_DOUBLE;
for (i = 0; i < ir->type->vector_elements; i++) {
- values[i * 2].i = *(uint32_t *)&ir->value.d[i];
- values[i * 2 + 1].i = *(((uint32_t *)&ir->value.d[i]) + 1);
+ memcpy(&values[i * 2], &ir->value.d[i], sizeof(double));
}
break;
case GLSL_TYPE_UINT: