AMD FixedFuncShader isn't compatible with newest HLSL

Started by
1 comment, last by Nik02 11 years, 8 months ago
D:\Users\Documents\Visual Studio 2010\Projects\PerfectSim\PerfectSim\FixedFuncShader.fx(27): error X4556: Error: invalid register 'b0' in register binding.


bool bSpecular : register(b0) = false;


What's wrong?
I am not very pleased with MS gradually...
Advertisement
http://msdn.microsoft.com/en-us/library/windows/desktop/dd607359%28v=vs.85%29.aspx

Yeah, solution, trivial but troublesome
In SM4 and up, shader constants do not have dedicated registers at all; instead, equivalent (and much more flexible) functionality for passing data from host to GPU is provided by constant buffers.

In SM3, the "b" registers were used to send boolean values to the shaders. Nowadays, the "b" denotes "buffer".

In SM4 and up, when you define a global constant outside any constant buffers, it is allocated in a global constant buffer. While you can't assign a specific register to it, you can still use shader reflection to find its buffer and offset from within the host program.

Niko Suni

This topic is closed to new replies.

Advertisement