Today, we were experiencing some crazy behavior in Shader, seeing the uniform variables being overwritten by some outside force. It would work for a while, but then would start messing up reliably after about 30 seconds of panning around our map.
After trying everything else, we finally figured out that changing “register(b6)” to “register(b5)” worked, miraculously (and we see no other side-effects yet from this).
#ifdef
COMPILEPS
cbuffer CustomPS : register(b5) <== changing this from (b6) to (b5) FIXES the issue.
{
bool cShowRelief; <== this parameter alone GOES HAYWIRE, sporadically. (gets overwritten?)
float cAlpha;
float cOwnshipAltitudeFt;
float cAltThreshWarn;
float cAltThreshDanger;
}
#endif
Questions:
- Is there any reason why we can’t/shouldn’t use register b5?
- Does anyone have any clues as to why register b6 could have some sort of cross-talk/overwriting occurring?