xemu icon indicating copy to clipboard operation
xemu copied to clipboard

nv2a: Make multiplication by 0 match HW behavior.

Open abaire opened this issue 2 years ago • 7 comments

Fixes #1008 Fixes #1044

The nv2a returns 0 for anything multiplied by zero, including exceptional values such as Inf and NaN. Desktop GPUs do not enforce this, leading to conditions where NaNs wipe out calculations and lead to erroneous behavior.

Test HW Results

abaire avatar Jun 08 '22 22:06 abaire

@abaire Based on your comment in #55 about the broken floor texture in Halo 2 being related to depth buffer precision, I assumed this PR would not fix that issue. I did test it to be sure, to no avail, in case it matters at all.

Shoegzer avatar Jun 09 '22 17:06 Shoegzer

@abaire Based on your comment in #55 about the broken floor texture in Halo 2 being related to depth buffer precision, I assumed this PR would not fix that issue. I did test it to be sure, to no avail, in case it matters at all.

Thanks for checking, I would've been very surprised if this fixed the issue in Halo 2, it should really only affect calculations that end up dealing with multiplication of exceptional values (Inf/NaN/etc..) which did not appear to be the case when I briefly looked at #55.

abaire avatar Jun 09 '22 17:06 abaire

This fixes the menu issues in american chopper 1 and 2

Triticum0 avatar Jun 24 '22 12:06 Triticum0

American Chopper

Before Black screen xemu-2022-06-24-13-53-50 xemu-2022-06-24-13-53-54 xemu-2022-06-24-13-53-56 After xemu-2022-06-24-13-54-21 xemu-2022-06-24-13-54-23 xemu-2022-06-24-13-54-30 xemu-2022-06-24-13-54-32

Triticum0 avatar Jun 24 '22 12:06 Triticum0

American Chopper 2 Before xemu-2022-06-24-13-52-20 xemu-2022-06-24-13-52-30 After xemu-2022-06-24-13-52-03 xemu-2022-06-24-13-49-37

Triticum0 avatar Jun 24 '22 12:06 Triticum0

This pr fixes azurik - rise of perathia late game Before Screenshot_40

After Screenshot_42-1

Triticum0 avatar Jul 23 '22 17:07 Triticum0

This also affects #1044 using this pr fixes the issue

Triticum0 avatar Jul 25 '22 14:07 Triticum0

this PR seems to fix quite a handful of graphical issues

user18081972 avatar Mar 20 '23 00:03 user18081972

Also seems to fix Breakdown lighting issues https://www.youtube.com/watch?v=LQ5y4sdaA5s

Triticum0 avatar Mar 20 '23 01:03 Triticum0

Maybe we should merge it

user18081972 avatar Mar 22 '23 14:03 user18081972

Maybe we should merge it

this is still incomplete yet since it works only at 1x resolution scale, and we don't know if there might be edge cases where graphics might change behavior like it happened before with a previous "version" of this PR. There's no need to rush if we have to grant stability.

Fabxx avatar Mar 22 '23 14:03 Fabxx