How to Configure STRUCT ConstantTable with DX9

Started by
1 comment, last by Nik02 8 years, 3 months ago

I have written code with DX9 that uses HLSL pixel shaders and configure their constants with SetPixelShaderConstantF, SetPixelShaderConstantB and SetPixelShaderConstantI.

I've come across this shader, which is PS_3_0, but it is using STRUCT as input instead of float4.

https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/Super-xBR/super-xbr.hlsl

How do I configure that?

Advertisement

Well... after further investigation, it turns out the STRUCT doesn't appear to be used at all; rather, the parameters were defined in the separate included file. Those are standard vectors.

Note that the Set* methods mentioned have a count parameter, which will specify the number of constants to set.

If your structure is comprised of one constant type (such as float4), you can effectively use the count parameter to pass it to the device with one call.

Niko Suni

This topic is closed to new replies.

Advertisement