zink: clamp subgroup op return types to required int/uint types

required by spec

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37239>
(cherry picked from commit a11a02d6f6)
This commit is contained in:
Mike Blumenkrantz 2025-09-08 11:06:15 -04:00 committed by Eric Engestrom
parent 462f8c59e5
commit af7f3d1dbb
2 changed files with 11 additions and 1 deletions

View file

@ -7414,7 +7414,7 @@
"description": "zink: clamp subgroup op return types to required int/uint types",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -3329,6 +3329,16 @@ emit_subgroup(struct ntv_context *ctx, nir_intrinsic_instr *intr)
atype = nir_type_float;
src0 = emit_bitcast(ctx, get_def_type(ctx, intr->src[0].ssa, atype), src0);
break;
case SpvOpGroupNonUniformUMin:
case SpvOpGroupNonUniformUMax:
atype = nir_type_uint;
src0 = emit_bitcast(ctx, get_def_type(ctx, intr->src[0].ssa, atype), src0);
break;
case SpvOpGroupNonUniformSMin:
case SpvOpGroupNonUniformSMax:
atype = nir_type_int;
src0 = emit_bitcast(ctx, get_def_type(ctx, intr->src[0].ssa, atype), src0);
break;
default: break;
}
SpvId type = get_def_type(ctx, intr->src[0].ssa, atype);