|
|
you cannot do this simply because you cannot read back from a pixel or vertex shader, except through a render target I guess. What does this means? you have to read back the result from a texture.
how to solve your problem? it really depends on your problem...maybe you should explain some more what you're trying to do with this "red color" thing.
HLSL has the same restrictions as the ASM equivalents do. It's not because you can name a variable that you can read back from it, simply because the input registers in a pixel or vertex shader are write only.
just look at it as a one way train...
Your Inputs ---> HLSL ---> GPU ---> screen or render target
but oops, your inputs never change. Think about them as "pass by value" instead of "pass by reference" or taking the "address of". Once they're in the train, they never go back.
|