This topic is 2139 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

I've been rewriting my engine so that it doesn't use D3DX and I've gotten almost everything done ... except I can't get SetVertexShaderConstantB/I to work. SetVertexShaderConstantF works just fine (and I'm considering just using that, but I'm bullheaded).

So, in my vertex shader I'll have something like:

bool bIsSelected : register(c4);


And in my rendering path, after I have called SetVertexShader, I will do something like:

         uint u = 1;
hr = gp_DXInterface->SetVertexShaderConstantB(4, (const BOOL*)&u, 1);


Yet, bIsSelected will always be false.  I don't see any errors or warnings.  Has anyone else got these functions to work?

EDIT:  For what it's worth, calling SetVertexShaderConstantF works to set bIsSelected.

Edited by neeker

##### Share on other sites

That function sets the constant boolean registers, which are named b0-b7. You've mapped "bIsSelected" to a constant float register (c0-c255), so to set the value you must use SetVertexShaderConstantF. Try mapping your constant to b0.

As for SetVertexShaderConstantI, that function works with constant integer registers.

##### Share on other sites

Very good.  Thank you MJP!

• 11
• 9
• 17
• 13
• 11