libretro / pcsx_rearmed

ARM optimized PCSX fork
GNU General Public License v2.0
166 stars 120 forks source link

Far polygons are broken when usng arm dynarec #103

Closed meepingsnesroms closed 1 year ago

meepingsnesroms commented 7 years ago

The polygon culling on the arm dynarec completely destroys long distance objects, I tested with pcsx-rearmed android, pcsx-rearmed mac and openemu mednafen. Only pcsx-rearmed android was effected. Here is an archive of all test screenshots plus 2 broken ones for easy viewing. neonremove.zip ctr - crash team racing usa -170218-122200 ctr - crash team racing usa -170218-122108

I originally thought it was the fault of the neon gpu plugin but after using unai gpu on android and testing it it still happened so all thats left is the dynarec.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/42186176-far-polygons-are-broken-when-usng-arm-dynarec?utm_campaign=plugin&utm_content=tracker%2F441984&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F441984&utm_medium=issues&utm_source=github).
inactive123 commented 7 years ago

Might be a bad bug but at the same time, the NEON renderer is a very, very good renderer and makes things much faster.

Just removing it altogether would be foolhardy.

meepingsnesroms commented 7 years ago

What about disabling it until it can be fixed?

inactive123 commented 7 years ago

What on earth are you talking about?

Without the NEON renderer, PCSX ReARMed is worthless.

Let me make it clear once more - disabling or even outright removing the NEON renderer is completely out of the question. Spend your energy instead trying to fix the bug instead.

meepingsnesroms commented 7 years ago

I have no knowledge in this area so I can't fix it, I will just use a custom build with it disabled instead.

meepingsnesroms commented 7 years ago

This happened even with my custom build, but not with dynarec turned off so it is not the neon gpus fault but dynarec inaccuracy.

meepingsnesroms commented 7 years ago

This may have to do with signed,unsigned casting since only far polygons are affected.

inactive123 commented 7 years ago

OK, try to see if you can get to the bottom of the issue. It's slightly messy code though and it's known that the ARM codepath is more complete than the C version, which has slightly broken graphics.

meepingsnesroms commented 7 years ago

What is wrong with the C graphics pipeline?(aside for lack of resolution multiplier)

inactive123 commented 7 years ago

Broken graphics here and there, and several times slower than the ARM codepath.

meepingsnesroms commented 7 years ago

I dont think I can fix it. But if it helps others it is somewhere in the dynarec and happens on armv6 and armv7.

Pcsx-reloaded with x86 dynarec does not have this problem. Most likely in the geometry transformation engine part. This is with the official bios. Disabling the dynarec fixes it but is too slow. Only affects far polygons, and even then only some of those. Moving your view point(car) to the left or right makes them appear even if you don't get closer, but they disappear again when centered. You can see them the best in the airship stage or by the spaceship in the overworld. They seem to only glitch if the tip of the triangle is pointed away from you.

dankcushions commented 7 years ago

I get this also with rpi3 (Cortex-A53) and CTR. it's quite subtle but i can see the triangle break-up on certain background objects.

if it's only certain arm processors, i wonder if more conservative compile options could resolve it?

i want to verify it happens in standalone - https://github.com/notaz/pcsx_rearmed - but having trouble getting it to recognise BIOS file and/or controller. it just locks up for me on rpi3. is there another game that shows it well?

meepingsnesroms commented 7 years ago

I don't know of any other games that do it, it may be a speedhack the game implements if it thinks it is running too slow that could be fixed with timing adjustment like the other 2 hacks.(since only far polygons are affected it could just be lowering the render distance)

I can try to mess with the timing.

meepingsnesroms commented 7 years ago

Still cant find whats wrong.

Gurk232 commented 7 years ago

This doesn't occur on other games that use far distance polygons (like Spyro the Dragon.) I'll go around and try all the games I know of that have them but so far CTR was the only one I had issues with.

meepingsnesroms commented 7 years ago

Well CTR is poorly coded so it is probably the games fault for using inconsistent timing.

If you google the "CTR language selector bug" you'll know what I mean.

meepingsnesroms commented 7 years ago

The ps2 ps1 mode has different timing, does this happen on a real ps2?

Gurk232 commented 7 years ago

I don't have my ps2 setup right now to test it but from this video it would appear not https://m.youtube.com/watch?v=aNYYMG4Oxds

The issue also doesn't appear in the official ps1 emulator on the ps3, however CTR does have issues on the psp/Vita official emulator if I remember correctly, but not sure if it's the same rendering issue.

notaz commented 1 year ago

I'm not seeing this, probably some dynarec bug fixed long ago.