Stefan Dösinger stefan at codeweavers.com
Mon Dec 8 08:15:40 CST 2008

> I would expect the relevant state to be dirty, but you say this
> depends on where the function is called from?
States are marked clean before the application function is called. This is needed to handle e.g. the relationship between the vertex declaration and the lighting enable state.

What I mean is this:
pixelshader(bla bla bla) {
	/* I know I have to apply the pixelshader */

pixelshader(bla bla bla) {
	/* I know I have to apply the vertex shader */

shader_whatever_select() {
	/* What do I have to do? Apply pixel shader? Or the vertex shader? or both? */

> Well, you can hardly argue that eg. vertex shader enable is a proper
> vertex state to begin with.
The vertex shader enable doesn't have any say without the vertex declaration. And the vertex declaration has a similar effect on e.g. D3DRS_FOGVERTEXMODE. This state is treated differently in different shader model versions and different GL pipeline implementations on the fragment side. Is FOGVERTEXMODE a proper state or not?

What I want to say is: We open a can of worms if we try to separate first class(programmable/ffp switch) states and second class states(ffp states) in the general state manager. This should really be left up to the actual pipeline implementation.

(sidenote: The current fog code is a mess)

More information about the wine-devel mailing list