I'm using this to set HLSL Pixel Shader parameters
ID3DXConstantTable::SetVector(m_pDevice, name, vector);
This is the shader I'm trying to configure
https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/SuperRes/SuperResEx.hlsl
I successfully use the function to set "size1" and "args0", but it fails for "p0" and "p1". Why is that? Is there something different between p0 and args0? If I simply replace p0 with args0 with the same code, then it doesn't crash.
Fail to Set Some Pixel Shader Parameters
Where/how does it crash if you don't do that?f I simply replace p0 with args0 with the same code, then it doesn't crash.
#define width (p0[0])
#define height (p0[1])
Could it be these lines? What if you replace them with .x/.y?
SetVector fails.Where/how does it crash if you don't do that?
Could it be these lines? What if you replace them with .x/.y?#define width (p0[0]) #define height (p0[1])
Why would these be an issue when this works?
float4 size1 : register(c2);
#define originalSize size1
#define ddxddy (originalSize.zw)
Btw is there a way to set c2 instead of size1 ?
It crashes when you call SetVector? That's kinda important. What's the crash message? What's the arguments to the function? Why is it crashing? Are you using bad pointers on that line?SetVector fails.Where/how does it crash if you don't do that?
He suggested you change it into “what works”.Why would these be an issue when this works?
But since those macros are not used in the file, there is no reason that would be the problem.
I agree that you need to investigate the call to SetVector(), the sizes of your globals (in the shader), and their register locations (since you manually placed them).
Change all of them to float4, add space between your register locations, and examine the SetVector() call.
L. Spiro
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement