[AD] Shader/Programmable pipeline discussion

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Well as I said before I want to get some feedback about how to properly
integrate shaders and the programmable pipelines into Allegro.

The main problem is that to use the programmable pipelines, you need
shaders. This brings up the question, do you put the "shader addon"
into the core? That's probably the simplest solution. The other option
is to have the shader addon provide some "default shaders", which you
would retrieve from the addon then pass to Allegro. Allegro would just
have a hook to set its shader objects. This is ok, the catch is that
it will be very tightly coupled with Allegro internals anyway, so there
isn't much gain. The little gain you get is from having removed some
extra code from core so it's smaller if you don't use shaders.

Of course there's a third option, not using the shader addon for internal
stuff and just rewriting only the necessary bits and the default
shaders. I think I like this option least though. Even though the
shader addon is quite small, I don't like the redundant code..

I guess if I had to choose one now, without knowing the implications
exactly (right now my PP code for iPhone duplicates some of the shader
addon code) I would choose the second option, having some default
shaders in the shader addon and registering those with Allegro somehow.

So just to give a rundown of what the programmable pipeline is going
to mean to the current codebase, I'll basically be switching all
transformations from OpenGL/D3D native to our own ALLEGRO_TRANSFORMs,
storing that in the display, and using it as needed, multiplied by the
current user transform set with al_use_transform. This is all done and
working well for me already, but needs cleaned up.

Comments before I start butchering code? Is this going to be big
problems when it comes to merging 5.1 back to 5.0?
--
Trent Gamblin





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/