From 491d3b7054feddbd565ceb94cba6f49203ff2bd3 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 13 Aug 2018 09:07:17 +0200 Subject: [PATCH] shader: fix conversion for return type of various bit operations findLSB, findMSB, and countBits always return a signed integer Fixes: dEQP-GLES31.functional.shaders.builtin_functions.uniform.findLSBMinusOne.* dEQP-GLES31.functional.shaders.builtin_functions.integer.findmsb.* dEQP-GLES31.functional.shaders.builtin_functions.integer.bitcount.* Changes resulting from the discussion on mesa-dev with Roland Schneidegger: v2: Set values in infer_(src|dst)_type only v3: Set values in the common infer_type code path, and only add the source type for UMSB Signed-off-by: Gert Wollny gert.wollny@collabora.com Reviewed-by: Dave Airlie --- src/gallium/auxiliary/tgsi/tgsi_info.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c index e2e3875..b0c385b 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_info.c +++ b/src/gallium/auxiliary/tgsi/tgsi_info.c @@ -351,9 +351,6 @@ tgsi_opcode_infer_type( uint opcode ) case TGSI_OPCODE_UBFE: case TGSI_OPCODE_BFI: case TGSI_OPCODE_BREV: - case TGSI_OPCODE_POPC: - case TGSI_OPCODE_LSB: - case TGSI_OPCODE_UMSB: case TGSI_OPCODE_D2U: case TGSI_OPCODE_CLOCK: return TGSI_TYPE_UNSIGNED; @@ -384,6 +381,9 @@ tgsi_opcode_infer_type( uint opcode ) case TGSI_OPCODE_DSLT: case TGSI_OPCODE_DSNE: case TGSI_OPCODE_D2I: + case TGSI_OPCODE_LSB: + case TGSI_OPCODE_POPC: + case TGSI_OPCODE_UMSB: return TGSI_TYPE_SIGNED; case TGSI_OPCODE_DADD: case TGSI_OPCODE_DABS: @@ -432,6 +432,7 @@ tgsi_opcode_infer_src_type( uint opcode ) case TGSI_OPCODE_SAMPLE_I: case TGSI_OPCODE_SAMPLE_I_MS: case TGSI_OPCODE_UMUL_HI: + case TGSI_OPCODE_UMSB: return TGSI_TYPE_UNSIGNED; case TGSI_OPCODE_IMUL_HI: case TGSI_OPCODE_I2F: