Hi Robert,

On Saturday 26 June 2010, Robert Osfield wrote:
> The plan I have wouldn't affect state sorting, and lazy state updating
> of the composed shader programs would be utilized, and caching of the
> composed shader programs would be used once it has been composed.
> Only when you change modes will you need to go look for a new composed
> shader program, and only when you can't find an already cached one for
> the current set of enabled modes will you have to compose an new
> shader program.   At least this is what I have in, and believe it'll
> be essential.
Yep, I believe too that this is important to essential!

So, ok, we will get state sorting for the fixed function pipline state 
attributes because of these being traditionally sorted in the state graph.
Ok, and the additional non fixed function shader snipets will be sorted 
because of being such state attributes too.
Right?

So in effect you will know the final shader combination for a render leaf at 
cull time.
Right?

Wouldn't it be better to match the final shaders programs at cull time instead 
of draw time?
... which would only possible if the state attributes compose call might not 
work on the State object itself, but on some to be defined object that is 
used by the cull visitor to combine/collect/map/hash the shaders. Once we 
emit a render leaf to the render graph, the final shader program is attached 
to the render leaf and just used during call.
Sure, if a new combination appears this one needs to be compiled/linked first.

What is missing in my picture is the backward compatibility. I am not sure how 
this fits here.

So the final key point is that I would move the caching of the shaders away 
from the state object to some new object that is held in the cull visitor or 
somewhere there.
The render leafs will just reference the finally compiled and linked shader 
open gl objects then. The State would only need to avoid reloading the same 
final shader program twice in a series.

My two cents ...

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to