ir_constant_visitor: Use 'union ir_constant_data' instead of open-coded version
This commit is contained in:
@@ -558,11 +558,7 @@ ir_constant_visitor::visit(ir_swizzle *ir)
|
|||||||
this->value = NULL;
|
this->value = NULL;
|
||||||
|
|
||||||
if (v != NULL) {
|
if (v != NULL) {
|
||||||
union {
|
ir_constant_data data;
|
||||||
float f[4];
|
|
||||||
unsigned u[4];
|
|
||||||
bool b[4];
|
|
||||||
} data;
|
|
||||||
|
|
||||||
const unsigned swiz_idx[4] = {
|
const unsigned swiz_idx[4] = {
|
||||||
ir->mask.x, ir->mask.y, ir->mask.z, ir->mask.w
|
ir->mask.x, ir->mask.y, ir->mask.z, ir->mask.w
|
||||||
@@ -615,10 +611,7 @@ ir_constant_visitor::visit(ir_dereference_array *ir)
|
|||||||
*/
|
*/
|
||||||
const unsigned mat_idx = column * column_type->vector_elements;
|
const unsigned mat_idx = column * column_type->vector_elements;
|
||||||
|
|
||||||
union {
|
ir_constant_data data;
|
||||||
unsigned u[4];
|
|
||||||
float f[4];
|
|
||||||
} data;
|
|
||||||
|
|
||||||
switch (column_type->base_type) {
|
switch (column_type->base_type) {
|
||||||
case GLSL_TYPE_UINT:
|
case GLSL_TYPE_UINT:
|
||||||
|
Reference in New Issue
Block a user