glsl: ir_function_param_visitor::visit_enter always true condition
authorPiotr Kocia <peter.kocia@gmail.com>
Mon, 28 Aug 2023 20:39:59 +0000 (22:39 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 7 Sep 2023 05:00:26 +0000 (15:00 +1000)
commit8019a1b9292e6cf26f17126c50a7329820817e3d
tree562c67ee38cdac0e554978c5aa4a496a26144187
parent5d203c4ae03a4954bfa4f045862b3bf6312a532c
glsl: ir_function_param_visitor::visit_enter always true condition

The condition

!param->type->is_vector() || !param->type->is_scalar()

alawys evaluates to true:

* type is not scalar or vector -> true
* type is vector, i.e. num_components > 1 -> num_components == 1 is
  false and !is_scalar() == true
* type is scalar, i.e. num_components == 1 -> num_components > 1 is
  false and !is_vector() == true

There is no comment explaining why such code has been written, therefore
this seems to be a mistake.

To maintain consistency with the surrounding code,
glsl_type_is_scalar_or_vector has been used instead of
replacing || with &&.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24914>
src/broadcom/ci/traces-broadcom.yml
src/compiler/glsl/glsl_to_nir.cpp
src/freedreno/ci/freedreno-a618-fails.txt
src/freedreno/ci/freedreno-a630-fails.txt
src/freedreno/ci/traces-freedreno.yml
src/gallium/drivers/zink/ci/traces-zink.yml