From: Connor Abbott Date: Mon, 10 Aug 2015 18:35:34 +0000 (-0700) Subject: i965/vec4/nir: simplify glsl_type_for_nir_alu_type() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54913850aa379f57fcbf7a2dec5ea236cf997646;p=mesa.git i965/vec4/nir: simplify glsl_type_for_nir_alu_type() Less duplication, one one less case to handle for doubles and support for sized NIR types. v2: Fix call to get_instance by swapping rows and columns params (Iago) Signed-off-by: Iago Toral Quiroga Reviewed-by: Francisco Jerez Reviewed-by: Matt Turner --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index 9a851a82108..7128ca71720 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp @@ -1779,20 +1779,8 @@ const glsl_type * glsl_type_for_nir_alu_type(nir_alu_type alu_type, unsigned components) { - switch (alu_type) { - case nir_type_float: - return glsl_type::vec(components); - case nir_type_int: - return glsl_type::ivec(components); - case nir_type_uint: - return glsl_type::uvec(components); - case nir_type_bool: - return glsl_type::bvec(components); - default: - return glsl_type::error_type; - } - - return glsl_type::error_type; + return glsl_type::get_instance(brw_glsl_base_type_for_nir_type(alu_type), + components, 1); } void