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 <airlied@redhat.com>
macos/master
Gert Wollny 6 years ago committed by Dave Airlie
parent 51536444a1
commit 491d3b7054
  1. 7
      src/gallium/auxiliary/tgsi/tgsi_info.c

@ -351,9 +351,6 @@ tgsi_opcode_infer_type( uint opcode )
case TGSI_OPCODE_UBFE: case TGSI_OPCODE_UBFE:
case TGSI_OPCODE_BFI: case TGSI_OPCODE_BFI:
case TGSI_OPCODE_BREV: case TGSI_OPCODE_BREV:
case TGSI_OPCODE_POPC:
case TGSI_OPCODE_LSB:
case TGSI_OPCODE_UMSB:
case TGSI_OPCODE_D2U: case TGSI_OPCODE_D2U:
case TGSI_OPCODE_CLOCK: case TGSI_OPCODE_CLOCK:
return TGSI_TYPE_UNSIGNED; return TGSI_TYPE_UNSIGNED;
@ -384,6 +381,9 @@ tgsi_opcode_infer_type( uint opcode )
case TGSI_OPCODE_DSLT: case TGSI_OPCODE_DSLT:
case TGSI_OPCODE_DSNE: case TGSI_OPCODE_DSNE:
case TGSI_OPCODE_D2I: case TGSI_OPCODE_D2I:
case TGSI_OPCODE_LSB:
case TGSI_OPCODE_POPC:
case TGSI_OPCODE_UMSB:
return TGSI_TYPE_SIGNED; return TGSI_TYPE_SIGNED;
case TGSI_OPCODE_DADD: case TGSI_OPCODE_DADD:
case TGSI_OPCODE_DABS: 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:
case TGSI_OPCODE_SAMPLE_I_MS: case TGSI_OPCODE_SAMPLE_I_MS:
case TGSI_OPCODE_UMUL_HI: case TGSI_OPCODE_UMUL_HI:
case TGSI_OPCODE_UMSB:
return TGSI_TYPE_UNSIGNED; return TGSI_TYPE_UNSIGNED;
case TGSI_OPCODE_IMUL_HI: case TGSI_OPCODE_IMUL_HI:
case TGSI_OPCODE_I2F: case TGSI_OPCODE_I2F:

Loading…
Cancel
Save