04 March 2012, 21:33 | #1 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Bug with AMOS 3D in newer WinUAE
I have noticed a bug in WinUAE when running AMOS 3D programs using Fastest Possible CPU + JIT (with Vsync disabled), which involves some graphical corruption.
From my testing, this bug was introduced in WinUAE 2.3.2 (2011.06.02). WinUAE 2.3.1 (2011.02.26) and earlier do not have this bug. I enclose a zipped ADF test which reproduces this bug, as well as WinUAE logs from version 2.3.3 and the configuration used, as well as a screenshot. I can confirm that this bug is still current in the latest WinUAE 2.4.0 beta 20 (2012.03.04). I am hoping it can be fixed in final 2.4.0 release. (I want to create an updated AMOS for Windows emulation pack.) Mequa P.S. Enabling the new Vsync fixes this problem, however performance decreases drastically with this example and other AMOS 3D programs. Perhaps performance with the new Vsync can also be investigated. Last edited by Mequa; 04 March 2012 at 21:45. |
05 March 2012, 08:19 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
JIT and fastest possible timing can and will change between versions. Not a bug, sorry. (Does immediate blitter fix it?)
To test 2.4 vsync: Use sysinfo (yes, it is quite useless normally but works fine in this test) or some other speed test program and compare speed results using 2 following setups: - fullscreen + low latency vsync vs no vsync, fastest possible (no JIT) - fullscreen + low latency vsync vs no vsync, and JIT. First make working copy of your configuration and before each test, restart winuae, load same configuration and change vsync/buffer option only. Do not touch anything else. Use standard 60Hz refresh rate (It is guaranteed to work, other refresh rates may do something unexpected..) Try all buffering options. Save logs (winuaelog.txt only) from all vsync tests. Thanks. In my tests I get about 10-15% speed loss in JIT modes when using vsync. It is not possible to have full speed in vsync modes. |
05 March 2012, 09:39 | #3 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Immediate/original blitter doesn't seem to make much difference. The above uses A4000/040 quickstart options with immediate blitter enabled.
The above glitches also occur with fastest possible CPU without JIT, but to a much lesser extent. Downgrading to WinUAE 2.3.2 or earlier completely removes the above glitches. Correction to above: New Vsync reduces this glitch, but it still occurs. P.S. Speed loss in the above program (and other AMOS 3D ones) is MUCH more than 15% with new Vsync. It seems to run around 30% of the non-vsync speed. Last edited by Mequa; 05 March 2012 at 10:06. |
05 March 2012, 12:44 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
In my opinion drastically is much much more than 30%. Hard facts and numbers only accepted
You can test which 2.3.3 beta introduced the JIT issue if you are interested.. But I am quite sure it is simply working as designed. |
05 March 2012, 19:24 | #5 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
I think the glitch was introduced in one of the 2.3.2 betas. Where can I download them to test, since I narrowed it to that?
|
05 March 2012, 19:30 | #6 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Check old beta threads. All betas since 2.1 are still available.
|
05 March 2012, 19:47 | #7 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Never mind, I found all 8 of them here: http://eab.abime.net/showthread.php?t=58121
The glitch was introduced in 2.3.2 beta 4. All betas after that have the glitch, 2.3.2 beta 3 and earlier work fine. I'm wondering if it's this modification in beta 4 which caused the issue: "Stop the cpu and wait until blitter has finished if any blitter register is accessed while blitter is busy and cpu mode is fastest possible". As stated, setting immediate blitter does not fix the glitch, so this appears to also affect immediate blitter. (I know AMOS 3D makes heavy use of both the CPU and blitter, it requires fastest possible CPU + JIT + immediate blitter + disabled Vsync for best performance.) If it is this which causes issues, could it possibly be moved to config options? (Perhaps a "CPU wait for blitter" checkbox, on by default?) Last edited by Mequa; 05 March 2012 at 20:05. |
05 March 2012, 19:55 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Create minimal archive that includes required AMOS stuff (no WB files) and I'll take a closer look.
|
05 March 2012, 20:25 | #9 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Test archive
What is required in the archive? I included an ADF which boots into a CPU-heavy AMOS 3D demo which demonstrates the glitch (in AMOS3Dbugtest.zip), would you like its files in an archive?
I added an archive below containing the same demo (recompiled to include amos.library), this one should work from the folder when extracted. Its AMOS source is also included. Other than the 3DOBJECTS directory and compiled demo binary itself, the only required file included is c3d.lib (for compiled AMOS 3D programs). Last edited by Mequa; 05 March 2012 at 20:39. |
06 March 2012, 08:16 | #10 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
I missed the included adf, I wasn't expected it to be included already
btw, does older versions work with immediate blitter? (It would be really bad if it requires disabled immediate blitter..) |
06 March 2012, 09:21 | #11 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Yes, immediate blitter has always worked well with AMOS including 3D extension.
|
06 March 2012, 18:48 | #12 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
It was a bug in that 2.3.2 fastest possible CPU blitter update and quite stupid bug as usual..
This bug was triggered by amos bug, it calls graphics.library OwnBlitter() and then writes to some blitter registers, without waiting for blitter. OwnBlitter() does not wait, it is very clearly said in documentation. btw, amos blitter line draw code is horribly ineffective and other code isn't much better.. (Unfortunately I had to disassemble it to find this problem...) |
06 March 2012, 21:21 | #13 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
Is this bug and inefficient line drawing in AMOS itself or AMOS 3D extension (c3d.lib)?
I knew the 3D engine was pretty crap. Thanks for investigating! |
07 March 2012, 16:46 | #14 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
btw, do the vsync test, please. I need to know if some simple test (like sysinfo, make sure to run each test at least 3 times and ignore possible strange results that only appear once) shows the same slowdown or if it only happens when something more complex is happening. |
|
07 March 2012, 18:16 | #15 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Does http://www.winuae.net/files/b/winuae.zip run any faster in fastest possible + low latency vsync modes?
|
07 March 2012, 20:56 | #16 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
I couldn't see much of a speed increase - it's still quite a bit slower than half the speed without the new vsync (my game Operation Gigabyte has its own FPS counter, the game's reported difference is 50FPS without vsync to 17FPS with vsync, still running at 50FPS internally according to WinUAE) - but the graphical glitches are gone!
|
07 March 2012, 21:01 | #17 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
It appears this requires some specific condition because I can't see any major JIT + vsync slowdowns and I have tested it on 3 different PCs, which includes one crappy laptop that can't even run cycle-exact A500 full speed.. |
|
07 March 2012, 21:31 | #18 |
Registered User
Join Date: Nov 2009
Location: UK
Posts: 497
|
AMOS 3D demo with FPS counter
I attach a file archive of the same demo with an FPS counter added.
I get around 17 FPS without new Vsync and 7 FPS with new Vsync (both fastest possible CPU + JIT + immediate blitter). New Vsync is even slower when using included AROS ROM (around 6 FPS). Source included (in both .AMOS and Ascii format, for anyone interested). Zipped ADF version also included (autobooting, also works with AROS ROM). Last edited by Mequa; 07 March 2012 at 21:44. |
08 March 2012, 19:29 | #19 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Thanks, I can finally confirm it.
JIT gets slow, fastest possible without JIT works normally. I am not sure what happens but it seems there is some strange JIT trick in custom emulation code which does not make sense. JIT slows down even in non-vsync mode (exact same slow speed!) if this weird code is disabled... EDIT: It finally makes sense, I think this slowdown can be fixed! Last edited by Toni Wilen; 08 March 2012 at 20:44. |
09 March 2012, 20:42 | #20 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
http://www.winuae.net/files/b/winuae.zip should finally fix low latency vsync + fastest possible (with or without JIT) slowdown.
Beta coming tomorrow if no new issues found. This update changed code that I haven't really touched (or even fully understood until now), it may cause surprises.. One nice side-effect is non-JIT fastest possible CPU being now faster (possibly much faster) than previously. EDIT: funnily enough both JIT and non-JIT fastest possible modes + immediate blitter are faster than previous JIT mode in older versions, even in non-vsync mode! Last edited by Toni Wilen; 10 March 2012 at 08:54. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AMOS for Windows installer using AROS-68K and WinUAE | Mequa | News | 32 | 04 May 2017 09:08 |
Amos Pro programming on WinUAE | CaptainNow | Retrogaming General Discussion | 26 | 07 April 2015 14:04 |
Winuae bug | BippyM | support.WinUAE | 29 | 22 November 2012 19:12 |
Bug Winuae | Zollex | support.WinUAE | 7 | 03 August 2007 20:52 |
Bug in winuae | Paul | support.WinUAE | 4 | 06 June 2003 20:41 |
|
|