Skip to main content
gamedev.net
🔒 Locked

FXC error

Started by KumGame 3 replies 2.4k views
Original Post
KumGame
KumGame
Hi all, I'm working on DirectX fx files. What I exactly want is to generate assembly shaders from the fx files. For this I'm using the 'fxc' tool.. I'm using an ATI Radeon 9200 card and D3DX9 Shader Compiler 9.12.589.0000 Unfortunately I get the following error for almost all my fx files (though I tried to reduce the number of constants used in the file) error X4507: maximum constant register index exceeded - Try reducing number of constants referenced How do I know that how many constants I can use in my shader? Interestingly, the same fx file was compiled without any error when I used the compiler D3DX9 Shader Compiler 5.04.00.3900 Why is this happening? Thanks in advance ;-)
circlesoft
circlesoft
Quote:
Original post by KumGame
error X4507: maximum constant register index exceeded - Try reducing number of constants referenced
How do I know that how many constants I can use in my shader?

Go to the Caps viewer, and look at the MaxVertexShaderConst entry. If you want to access it at runtime, it's just D3DCAPS9::MaxVertexShaderConst.

For a 9200, this is 192 float4's.
KumGame
KumGame
Thanks for the reply..

But any idea why it compiles without any error on a lower version of shder compiler?
xyzzy00
xyzzy00
Run FXC with the /Vd option, and look at the way the constants are arranged in the disassembly. Something about the code generation probably changed between the two versions of the compiler. If you were close to the limit before, there is a chance that the change pushed you over the edge.

If it looks like the compiler is doing something completely brain-dead now, post your shader here, and send it to directx@microsoft.com.

xyzzy
KumGame
KumGame
Hello all,

I have observed another strange behaviour.

My .fx file had some '#include's. I just removed those '#include's and moved only those declarations & definitions which are needed in my .fx file from '#include'ed file to my .fx file. IT COMPILED PROPERLY.

So my worry is that, if only few of the variables/functions from the included file is getting used, why the 'fxc' gives the error 'maximum constant register index exceeded' ?

Sorry I couldn't post my .fx file here.

Thanks in advance,
KumGame

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.