Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
- };
- struct hlsl_ir_node *arg = params->args[0];
- const struct hlsl_type *type = arg->data_type;
- struct hlsl_ir_function_decl *func;
- unsigned int dim;
- if (type->class != HLSL_CLASS_SCALAR && type->class != HLSL_CLASS_MATRIX)
- {
hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, "Invalid argument type.");
return false;
- }
- dim = min(type->dimx, type->dimy);
- if (dim == 1)
- {
Not a big deal, but the condition could have just been `if (type->dimx == 1 || type->dimy == 1)`. You don't really need `dim`, apparently.