Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

This is not possible with 11.0.

share|improve this answer

Your Answer


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.