Sign in to follow this  
JohnnyCode

write to an uniform variable in shader

Recommended Posts

Thanks. My intention is to detect wheather the pixel function has been run, and I do not want to lock the render target. Is there no way to output from pixel function somewhere else but render target? Maybe if I declared the uniform with some different semantic...

Share this post


Link to post
Share on other sites
Uniforms are named as such because they're constant values over all the vertices and pixels that are being processed when you make a draw call, so the name very much implies the meaning. Another way to think about it is, a pixel shader can run for hundreds and thousands of times...how can each of those write data to a single variable in a meaningful way? That's what render targets are for!

I don't know what sort of problem you're trying to solve, but if you're drawing something to a texture and want to make sure its working, why not run PIX? You can view resources and the results of draw calls to ensure things are working.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this