mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
tgsi_exec: Fix inf/nan handling for divide by zero.
For RCP and for DDIV, we do division without any src1 != 0 checks, and we should do the same here so that we get infs or nans as appropriate instead of undefined. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>
This commit is contained in:
parent
0fbd1b1f4c
commit
594d3982f7
1 changed files with 4 additions and 12 deletions
|
|
@ -1288,18 +1288,10 @@ micro_div(
|
||||||
const union tgsi_exec_channel *src0,
|
const union tgsi_exec_channel *src0,
|
||||||
const union tgsi_exec_channel *src1 )
|
const union tgsi_exec_channel *src1 )
|
||||||
{
|
{
|
||||||
if (src1->f[0] != 0) {
|
dst->f[0] = src0->f[0] / src1->f[0];
|
||||||
dst->f[0] = src0->f[0] / src1->f[0];
|
dst->f[1] = src0->f[1] / src1->f[1];
|
||||||
}
|
dst->f[2] = src0->f[2] / src1->f[2];
|
||||||
if (src1->f[1] != 0) {
|
dst->f[3] = src0->f[3] / src1->f[3];
|
||||||
dst->f[1] = src0->f[1] / src1->f[1];
|
|
||||||
}
|
|
||||||
if (src1->f[2] != 0) {
|
|
||||||
dst->f[2] = src0->f[2] / src1->f[2];
|
|
||||||
}
|
|
||||||
if (src1->f[3] != 0) {
|
|
||||||
dst->f[3] = src0->f[3] / src1->f[3];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue