XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

D3D11_SHADER_VARIABLE_DESC DefaultValue field is always 0

Last post 6/18/2009 1:50 PM by jkolb. 2 replies.
  • 6/17/2009 4:38 PM

    D3D11_SHADER_VARIABLE_DESC DefaultValue field is always 0

    I have variables in my shader declared as such:

    float3 f3MotionVector = float3(0.0f, 0.0f, 0.0f);
    float4 fvWhite        = float4(1.0f, 1.0f, 1.0f, 1.0f);

    float4 fvTintColor = {1.0f, 0.0f, 1.0f, 1.0f};
    float fBumpMapSmoothness = 1.0f;
    float fSmoothness = 1.0f;

    I can use shader reflection to get the variables to populate my constant buffer with but I need to set the default values in the buffer.  Unfortunately the DefaultValue field is always 0.  Is there another way I can get at these values or a way to make the DefaultValue field not 0?

    Using the March 09 SDK.

    Thanks,
    Jeremy
  • 6/17/2009 8:54 PM In reply to

    Re: D3D11_SHADER_VARIABLE_DESC DefaultValue field is always 0

    Not currently, the compiler doesn't emit this information, and nobody has complained since DX10 came out. I suppose that's changed now, so I'll bump the priority on this.
  • 6/18/2009 1:50 PM In reply to

    Re: D3D11_SHADER_VARIABLE_DESC DefaultValue field is always 0

    Thanks.  It's important since otherwise default values don't mean much and there are cases where we depend on them.
Page 1 of 1 (3 items) Previous Next