On Thu, 14 Oct 1999, Martin Lexa wrote:
> Hi All!
Hi there. Sorry about the delay in replying to this post - I was
in Atlanta at the Linux Showcase all last week and ironically enough I had
very limited internet access during that time |-/
> I've started work on Mesa target. I've some very basic stuff
> running and I've some questions (probably to Jon).
> Why are you removed Savage code? I think it should
> be very valuable to have it there. Could you put it there again?
I'll devote a good-sized chunk of text to this explanation,
because it illustrates a lot of important LibGGI extension and target
design issues that will be encountered more and more in the future.
I removed the Savage4 target because I realized that I had not
designed it correctly. Initially, I designed the Savage4 target with the
LibGGI Glide target in mind as a model. However, this was not the best
thing to have done for GGIMesa. LibGGI's featureset is designed to be
basic and simple, which means that LibGGI's target system will not be very
intricate. This may change somewhat, since LibGGI's genkgi target can now
load its own sublibs, but as of now things are still pretty straight
forward. In LibGGI, it makes sense to have only one level of API
retargeting.
Once you leave the realm of basic LibGGI and start looking at
extension libs, though, the APIs start to get more complex. And the
potential size and complexity of the associated target systems which are
used by those extensions to implement their APIs grows even faster. And
it doesn't get much more complex than OpenGL |->. This makes GGIMesa an
excellent testbed for the design of LibGGI targeting systems, but it also
puts a lot more burden on the target coder to design things correctly.
What made me realize that a Savage4-specific target was not
appropriate was the fact that the Savage4 (like most current-generation
video chipsets) exports the Direct3D immediate mode API (D3DIM) from the
hardware itself. As I was writing the Savage4 target code, I realized
that 90%+ of what I was writing was really a D3DIM target, and there was
no reason why the code could not be shared across all hardware which used
D3DIM. The Savage4 code (if indeed any was needed at all), should
properly have been placed into a small sublib which could be loaded by the
generic D3DIM target.
This experience led me to realize a good rule of thumb: that when
designing a LibGGI target set, one should work from the generic to the
specific. So a Savage4 target should not be written until one has written
targets to support all features that are not 100% Savage4-specific. There
are many possible levels of increasing target specificity between the
generic KGI target and a very Savage4-specific target that I had not
accounted for (generic-S3-STREAMS, generic-D3DIM, etc), and those should
have been written first.
One note: Because the application which programs to the LibGGI
family APIs does not know or care about what targets are being used to
implement that API, it is not the end of the world if it becomes necessary
to re-organize a targeting system down the road. The fact that I had to
rework the GGIMesa targeting system to remove the Savage4 target makes no
difference at all to the code which calls GGIMesa API functions. This is
one of the really cool aspects of the LibGGI system. However, we should
still try to get things right the first time |->.
> I've an old snapshot so it's not much important to me, but somebody should
> use it. May be it should be useful to have some template files which
> should fit to all files (something like ddsample.h).
That's not a bad idea. Be aware, though, that beyond the really
basic stuff found in visual.c and mode.c there is not going to be a whole
lot of commonality of function from GGIMesa target to GGIMesa target.
> When I not set driver functions like ctx->Driver.WriteRGBASpan
> will be Mesa use some default values or I should always set this?
It must always be set. There are two sets of Mesa DD functions,
mandatory and optional. The XYZSpan functions are all mandatory. Look in
dd.h for all the details. Hm, I notice that a few of the mandatory
functions are not implemented by GGIMesa yet. I'll fix that as soon as I
can.
> This is only little what I'd like to ask you, but it's very
> offtopic so could I post it ggi-3d? Are you subscribed?
Yes.
Jon
---
'Cloning and the reprogramming of DNA is the first serious step in
becoming one with God.'
- Scientist G. Richard Seed