Reputation: 1253
how do you enable compatibility mode in HLSL? I'm using Visual studio and xna.
I want to be able to change global variables from within the pixel shader and then retrieve them from the pixel shader after a pass of the pixel shader, but I can't change the global variables from within the pixel shader without getting an error that tells me they are constant and that I must enable compatibility mode.
So how do I enable this?
Upvotes: 3
Views: 1932
Reputation: 27195
While I've not seen that error before, I'm going to go out on a limb and say that you're misinterpreting it.
I'm pretty sure what you're trying to do is impossible, on the basis that a pixel shader is run multiple times in parallel. Which pixel should be the one to set the global variable that you want to read?
(Internally these global variables map to "constant registers" - key word here being constant. They are set when you make a draw call, and are read-only from the point of view of the shader.)
Upvotes: 2