Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Same EffectParameter In VS and PS Doesn't Update #802

tomspilman opened this Issue · 5 comments

2 participants


From codeplex...

"If I have an effect parameter that's used both in the Vertex Shader and the Pixel Shader, it goes in two constant buffers, but when it's set in the first buffer (probably the VS one) the dirty flag goes away and it's never updated in the PS's buffer."


I'm stepping through code right now and it's not obvious to find the real culprit... it looks like the StateKey gets tested properly, so the issue is happening deeper down..?

However I can confirm that it's caching/dirty-flagging related, and I've only seen it happen with a parameter that's both used in a VS and PS of the same shader.
If I comment out this in ConstantBuffer.Update() :

if (param.StateKey < _stateKey) 

It works as expected.


Okay, turns out the problem is unrelated to what I thought it was, but it's still a bug.

I have two clones of an Effect. This means they share the same fragment program OpenGL object, but not the same constant buffers.
The two clones set the same variable to different values once at init-time, and never change it again.
On the first Apply, each effects updates the uniform with the value from their constant buffer.
On subsequent Apply's, since there's nothing to update, both effects are stuck with whichever effect was updated last.


Ah... then it is the same as this bug:


... i'll be working on these bugs this week and clearing off these tickets.


Indeed :)
Cool, I'll work around it for the moment. Thanks!

@tomspilman tomspilman was assigned

This should be fixed or is part of #780

@tomspilman tomspilman closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.