2
\$\begingroup\$

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..

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

This is not possible with 11.0.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .