Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm implementing tonemapping in a pixel shader, for hdr lighting.

The vertex shader outputs vertices with colors. I need to find the max color and save it in a global.

However when I try and write the global in my hlsl code,

//clamp the max color below by this color
clamp( maxColor, output.color, float4( 1e6,1e6,1e6,1e6 ) ) ;

I see:

error X3025: global variables are implicitly constant, enable compatibility mode to allow modification

What is the correct way to declare a shader global in d3d11 that the vertex shader can write to, and the pixel shader can read?

I realize this is a bit tough since the vertex shaders are supposed to run in parallel, and introducing a shader global that they all write to means a lock..

share|improve this question

1 Answer 1

This is not possible with 11.0.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.