diff options
author | Marek Olšák <[email protected]> | 2020-05-11 02:56:47 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-02 20:01:18 +0000 |
commit | a6916d1ce823439d7de752b2f2013e9b3e434d82 (patch) | |
tree | 8c6bbe720efdbb045885edafe4cd196bf9e2fa43 /src/compiler/nir | |
parent | 92333c6d1a6e71215c82a49485ba27d1def85152 (diff) |
nir: fix lower_wpos for 16-bit fddy
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5002>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_lower_wpos_ytransform.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c b/src/compiler/nir/nir_lower_wpos_ytransform.c index d0a694f889b..2771f2afede 100644 --- a/src/compiler/nir/nir_lower_wpos_ytransform.c +++ b/src/compiler/nir/nir_lower_wpos_ytransform.c @@ -267,8 +267,11 @@ lower_fddy(lower_wpos_ytransform_state *state, nir_alu_instr *fddy) b->cursor = nir_before_instr(&fddy->instr); p = nir_ssa_for_alu_src(b, fddy, 0); - trans = get_transform(state); - pt = nir_fmul(b, p, nir_channel(b, trans, 0)); + trans = nir_channel(b, get_transform(state), 0); + if (p->bit_size == 16) + trans = nir_f2f16(b, trans); + + pt = nir_fmul(b, p, trans); nir_instr_rewrite_src(&fddy->instr, &fddy->src[0].src, |