malc wrote:
> Hello,
> 
> Can someone please comment on the behavior of Mesa in following case:
> 
> shader = GenFragmentShadersATI
> BindFragmentShaderATI (shader)
> BeginFragmentShaderATI ()
> [..fragment shader code..]
> EndFragmentShaderATI ()
> Enable (FRAGMENT_SHADER_ATI)
> 
> sometime later (apparently AFTER using aforementioned shader at least
> once)
> 
> BindFragmentShaderATI (shader)
> BeginFragmentShaderATI ()
> [..new fragment shader code..]
> EndFragmentShaderATI ()
> 
> Under Mesa it looks as if second version never really replaces the
> first one. Reading the extension specification wasn't very revealing.
> FWIW it looks as if ATIs binary drivers behave "correctly" i.e. second
> version does replace the first one upon completion of Begin/End.
> 
> Here's a simple test-case:
> http://www.boblycat.org/~malc/atifs.c
Actually, I'm unsure if it's legal to redefine a shader, but probably 
yes (there are even comments in atifragshader.c along those lines). The 
code in core mesa at least assumes it's possible.
I think what you're seeing is the inability of the r200 driver to detect 
if a shader has actually changed, for performance reasons it will not 
redo the "compilation" if it thinks that the current shader is already 
compiled. Since it does this decision only based on the shader id (which 
stays the same) it will never detect it has changed.
Guess I'll need to fix that, in fact the code is pretty weak in that 
area - it does not store the compiled data associated with the shader, 
so if you switch shaders (with different ids) it needs to recompile them 
everytime. This is largely due because compilation doesn't take that 
long, and you're the first to use ati fs apart from some demos and 
doom3/quake4 (which use a grand total of 1 shader), so I've never seen 
an app using more than 1 shader...
As a workaround in the meantime, I'd suggest you just use different 
shaders instead of redefining.

> http://www.boblycat.org/~malc/atifs.tgz (same as the above + Makefile)
This link doesn't work.

Roland

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to