Amiga.org
Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: fishy_fiz on September 21, 2011, 04:40:24 AM
-
As some of you may be aware Im somewhat of an amithlon fan. Ive used it on various machines over the years starting with an athlon xp 1800+ , through to an athlon64 3400+, and now my core2duo@3.86ghz. Finally with the last upgrade Im content with the performance of anything I throw at it. 68k UAE works nicely with aga games, even those that require a bit more grunt (breathless, xtrememe racing, etc.), fpse runs nicely, quake 1 and 2, descent freespace, etc. all run well at high resoultions, pctask runs at higher end 486 type speeds (havent benchmarked it, but Id suspect its at least that from the software I ran), even payback runs great at 640x480 using software rendered wazp3d with mipmapping, anti-aliasing, etc. enabled.
In short Im perfectly content with my amithlon box. It's not so much about the speed itself, but the ability to run software without thinking "if only it were a little faster".
Anyway, that said and done I'll get to the main point of this thread.
While impressed with the speed of wazp3d when software rendering, even with eye candy enabled Ive always been curious about hardware 3d acceleration for amithlon. There's plenty of rumors and suggestions around, but the only clue Ive ever found that I trust is in the docs of euae, although being that amithlon and uae work somewhat different Im not sure they'd exactly apply, and besides, it's not exactly what Im after (essentially being able to assign a pci lane to use elbox drivers).
Ultimately what Im trying to find out is where to start if someone was inclined to try to create thier own 3d drivers for use with amithlon. An Openpci driver using stormmesa seems the logical choice, making it not just for amithlon use, but hypothetically if I was to start a bounty for such a driver, what would need to be done exactly?
There's no reason os3.x users with suitable hardware couldnt be enjoying some of the titles os4.x/mos/aros people are. Winuae users in theory already could be given the ability to use hosts 3d hardware for warp3d. (infact I believe there's a 68k version of cube and tuxracer already, not to mention the titles Ive earlier mentioned).
Anyway, thanks for listening to me ramble and I'd appreciate any feedback on what exactly is required to get 3d acceleration working with amithlon.
-
I'd start with the Linux side.
The drivers in the Amithlon kernel have been modified to give more direct access from the Amiga side, so you'd want to extend that. Looking at the diffs makes them pretty obvious.
First, get 3D working on the Linux side without using X. Your best bet might be DirectFBGL. This might give better 2D as well, the drivers are much better now than they were back then, but you'll need to keep those old Amithlon patches working too.
Then you'd probably want to modify Wazp3D to use your 3D extensions instead of software rendering.
I haven't really looked at Warp3D, but I'd assume it's some modified subset of OpenGL. With any luck, you'd mostly end up with the calls being passed pretty much straight through to DirectFBGL.
-
The thing is though Id prefer to do things through the amiga os side, this is why openpci seems the best option, Id like any work done to work on both amithlon and any other amiga system using openpci. Given amithlons direct hardware access when not using linux drivers Id imagine it'd be a "cleaner" way of doing it as well. Pretty much all the framework is in place. There's already stormmesa and warp3d (waprd3d does indeed use a subset of gl).
To my knowledge its as "simple" as writing a driver for warp3d (wazp3d is probably the better bet as its easier to change if need be).
Thanks though for your input. While Im not 100% sure on the amiga os side of things I had even less of an idea about the linux side of things.
-
The part of the framework that screws the pooch is RTG and how Amiga-ish OS's like to keep things like this trade secrets.
Without an RTG video card driver you're dead in the water and the powers that be don't want you to do that.
They've already made all the 68k money they can, no sense in letting you continue using or extending it. Now, go pay for your overpriced PPC like a good little consumer, OK?
You can't hear the disgust in my voice can you? :furious:
-
The thing is though Id prefer to do things through the amiga os side, this is why openpci seems the best option, Id like any work done to work on both amithlon and any other amiga system using openpci. Given amithlons direct hardware access when not using linux drivers Id imagine it'd be a "cleaner" way of doing it as well. Pretty much all the framework is in place. There's already stormmesa and warp3d (waprd3d does indeed use a subset of gl).
I don't think OpenPCI would be used for more than to find the gfx card base address. After the base address is found, the gfx card register and memory accesses should theoretically go to the correct place. It would be possible to read a gfxaddr ENV: variable also as Warp3D did with the PPC version. This is not currently working with the 68k W3D libraries by the way. I checked. I didn't see with a quick look how the gfxaddr of boards is located in W3D. The OpenPCI.library, pci.library, prometheus.library etc. are not opened. The board base address is probably found through P96 or CGFX. A 2D P96 or CGFX driver that allocates it's memory directly on the card and possibly also has other restrictions is likely necessary. If you had a 2D P96 driver specifically for that card running directly on the card and good 68k emulation (some cards require 32 bit accesses for example), then I would say, give W3D a try. There's a lot of things that can go wrong though. Why not switch to AROS where Wazp3D can give hardware acceleration?
To my knowledge its as "simple" as writing a driver for warp3d (wazp3d is probably the better bet as its easier to change if need be).
Writing a gfx card driver is anything but simple. A fully functional and mostly bug free gfx driver will take many man hours to complete. The Warp3D "driver" functions are not that difficult to reverse engineer for a driver and the data structures are already defined in Warp3D.h. The Wazp3D route would probably be better for most programmers and it has less bugs than the actual Warp3D drivers.
-
In regards to AROS, I already have an AROS box, but amithlon + os3.x is still my fav. amiga system. For all thier pros and cons none of the NG options really appease me the way os3.x does. I like the almost d.i.y. nature of os3.x, the millions of little bits and pieces to handcraft your system, and with the sort of grunt amithlon provides make the 2 a great combination (for my tastes). Basically Id just like to be able to extend my os3.x usage, even if it means I have to do some work, or pay others for that to happen.
And yes, I realise it's not simple to write a driver, hence my use of quotes around "simple" :)
-
Hello
Wazp3D can use hardware in WinUAE (and also AROS) so certainly something similar can be done in Amithlon
In Wazp3D/WinUAE it works this way
Wazp3D.library implement the 88 functions from original Warp3D
Those functions call an other (simpler) library i called soft3d.library
soft3d works at low-level: it is something like a 3d driver (23 functions only)
soft3d.library exists as 68k on WinUAE side (It can render as software 68k)
soft3d.dll exists as x86 on PC side (It can render as software x86)
This soft3d.dll can also use the PC opengl32.dll for hardware rendering :-)
a given function in soft3d.library jump to same function in soft3d.dll with the "winuaenative" special calls that allow to call x86 code from WinUAE
(BTW many thanks to quarktex author for this part of the code)
So for Amithlon
1) Find how to do something like the "winuaenative" special calls
2) wrap soft3d x86 to make it use an hardware renderer (OpenGL)
Alain Thellier
Note: having soft3d give the great advantage to have only 23 "winuaenative" special calls from 68k to x86
-
Might I suggest asking Karlos for his thoughts on the matter?
-
Why ?
Isn't woof the author of Warp3d or maintainer ?
Wouldn't he know ?
-
@fishy_fiz
Amithlon used a modified Prometheus driver with a Voodoo3 IIRC.
-
@Crumb
I vaguely remember something about Bernd showing amithlon running with an existing 68k voodoo driver, but my memory is a bit hazey as to the details. There was a little controversy about it though if I recall correctly. After reading the uae-jit docs in euae I started thinking maybe it was through the elbox drivers, as he gives a description there how to assign a pci slot that can use amiga drivers there. Whether or not its related to how he used a 3d accelerated voodoo3 in amithlon or not Im not sure.
Id like the find out the real story here. Ive heard many variations on it over the years, but never seen any proof to clarify the real story for me.
That aside though for now Im more interested in how to get 3d acceleration working in amithlon without the need for these sort of "hacks". A lot of it is beyond me at the moment, but the more I learn the more I can research it :)
-
@Crumb
I vaguely remember something about Bernd showing amithlon running with an existing 68k voodoo driver, but my memory is a bit hazey as to the details. There was a little controversy about it though if I recall correctly. After reading the uae-jit docs in euae I started thinking maybe it was through the elbox drivers, as he gives a description there how to assign a pci slot that can use amiga drivers there. Whether or not its related to how he used a 3d accelerated voodoo3 in amithlon or not Im not sure.
Id like the find out the real story here. Ive heard many variations on it over the years, but never seen any proof to clarify the real story for me.
That aside though for now Im more interested in how to get 3d acceleration working in amithlon without the need for these sort of "hacks". A lot of it is beyond me at the moment, but the more I learn the more I can research it :)
Perhaps you could post your questions at moobunny as Bernie is a regular poster there.
-
Why ?
Isn't woof the author of Warp3d or maintainer ?
Wouldn't he know ?
I think woof maintains Wazp3D, not Warp3D. He has, however, highlighted a number of bugs in existing Warp3D applications and drivers.
-
@fishy_fiz
Bernd told me it was a modified Voodoo3 driver (from Prometheus IIRC although it's true that his first JIT for UAE supported using real PCI cards using Mediator drivers)
-
Might I suggest asking Karlos for his thoughts on the matter?
Not much to suggest that I haven't repeated before like some broken record. Totally and utterly forget Warp3D as a driver layer. When all we had were Permedia2, CV3D and basic Voodoo, it was enough, but not any more.
My suggestion for OS 3.x, regardless of what hardware it is running on, would be:
1) Create a new driver layer, totally from scratch that is designed from the ground up to be as efficient as possible (as real 68K processors aren't fast).
2) Make sure the driver system works directly with suitable OS BitMaps and has no special needs (other than allocating VRAM for depth/stencil/texture buffers). Then provide as complete a set of accelerated 2D and 3D operations as possible. After all, OpenGL isn't just for 3D. Once installed, it should be also be possible to various patch graphics.library to use it since existing RTG sucks as far as acceleration is concerned. For this, some sort of fast, minimal locking protocol should be supported that allows the bare minimum of potentially-destroyed registers to be backed up and restored that is essentially independent of whatever is used for the main 3D stuff. This is essential if you plan to accelerate individual graphics.library calls as you can't afford the setup overhead of a typical W3D_LockHardware() style call.
3) Provide a transformation / lighting / clipping pipeline in the driver layer, abstracting it such that hardware specific drivers can leverage hardware acceleration for this on Radeon cards and that other hardware can at least interleave the necessary calculations on the CPU with the rasterizing operations going on on the card to get the best out of any parallelism that can be had.
4) Provide a thin-layer wrapper for OpenGL/glut around the whole thing.
5) Provide a thin-layer wrapper for Warp3D around it, bypassing any T&L stage.
You could look at Gallium and the like to get some inspiration, but I'd not recommend it for the basis of a 68K driver system as whatever you create needs to be designed and built with the limitations of existing 68K systems in mind and not just what is theoretically possible on far faster emulated systems. If you do it right, it should scale up on the latter but still deliver usable performance on the former.
-
I think woof maintains Wazp3D, not Warp3D. He has, however, highlighted a number of bugs in existing Warp3D applications and drivers.
alain is sure one of the best informed people available and willing to help, what concerns functionality of w3d as of today. of the people who speak out openly its either kas1e, matthey or you who could be named along him. if there is anyone else, they do not show up.
-
Bernd told me it was a modified Voodoo3 driver (from Prometheus IIRC although it's true that his first JIT for UAE supported using real PCI cards using Mediator drivers)
Was the Voodoo 3 driver modified to work with OpenPCI? It's possible that Warp3D would work with this P96 driver if all the board information needed could be obtained from P96 as I suspect (OpenPCI->P96->Warp3D).
-
Hello
Yesterday I maded some web searchs and I wasnt able to really found out : How can I call "native x86 code" within Amithlon ?
==> this is the most important thing to find out
So ... people that want a native Amithlon driver : just found the necessary docs and compilers to "call "native x86 code"
Especially usefull will be an example source and all the compiler/sdk stuff to rebuild it
@Karlos
About future legacy Warp3D for New Amigas I think the better/simpler will be to have Wazp3D -> Mesa -> Gallium (like Aros do)
Of course to be efficient it will not be 1/1 calls (each Warp3D call -> an OpenGL call)
but something smarter that call OpenGL only when necessary (ie states changed)
Alain Thellier - WaZp3D Author
-
Ive just used the 68k hosted cross compiler to generate x86 amiga os bins (http://aminet.net/package/dev/gcc/x86-ami-gcc). Once its compiled a person just needs to use runelf to run the exe. There's also linux and ygwin hosted cross compilers, but Ive never used them.
Is that what you was asking? Id be a happy man to have an amithlon native wazp3d, even software rendered, so if there's anything I can do to help please let me know :)
-
I think woof maintains Wazp3D, not Warp3D. He has, however, highlighted a number of bugs in existing Warp3D applications and drivers.
That comment was no slight on you btw Karlos :)
And I meant Wazp3d not warp :)
-
Hello
Wazp3D can use hardware in WinUAE (and also AROS) so certainly something similar can be done in Amithlon
wazp3d do no use any hardware in winuae, it uses the x86 cpu only to call functions and it is very buggy
idem for aros...or ppc...or amithlon or real amiga ....only uses cpu
the only wrapper that uses real hardware acceleration on winuae is quartex warp3d library which is much faster and better than wazp3D....cause it call directX in windows and of course will use the hardware of the gfx card
-
@laserback
I WROTE Wazp3D (and also use it almost every day) so believe me :
Wazp3D can use hardware in WinUAE since version 48
Wazp3D can use hardware in Aros since latest version 50
(You can use Aros port with Cow3D on Aminet)
BTW i have also quarktex sources : it dont seems to use directx but mostly opengl
@fishy_fiz
That is not enough to have soft3d compiled as x86 : What I need is calling several functions (23 functions in fact) with parameters in this soft3d-x86
What I need is something like "call an x86 function with parameters from inside a 68k program"
Alain Thellier
-
@laserback
I WROTE Wazp3D (and also use it almost every day) so believe me :
Wazp3D can use hardware in WinUAE since version 48
Wazp3D can use hardware in Aros since latest version 50
ok you say you are the author but it seems that hardware accel on wapz3d is not working very well cause quartex library is much faster
the other day I tested blitzquake (aminet) on both libraries......quartex library was much fast and smooth..
even with wazp3d the textures on blitzquake are not correct
-
@woof
The main 2 "substantial" big endian x86/amithlon things I can think of off the top of my head are ahi and povray. Would looking at the sources of them be of any use (particularly ahi maybe?).
Oh, and I thought you might be interested to hear that v50 of wazp3d is working much better for me now. Some of the glitches were from an unrelated problem.
-
>with wazp3d the textures on blitzquake are not correct
textures ??? certainly you dont have installed Wazp3D correctly
See this image it is Wazp3d with hardware rendering
http://thellier.free.fr/quake-hard2.png
You must also set with Wazp3D-Prefs:
Renderer: hard
AntiAlias Image
Use Filtering
>ahi and povray. Would looking at the sources
just do it and if you find a "call to an x86 function with parameters from inside a 68k program" just let me know...
>v50 of wazp3d is working much better for me now
I told you ;-)
Alain