Jump to content
  • Advertisement
Sign in to follow this  
matt77hias

Manual bind to slot 4294967295 failed

Recommended Posts

The HLSL compiler keeps outputting the following error:

FXC : error X4567: maximum cbuffer exceeded. target has 14 slots, manual bind to slot 4294967295 failed

without mentioning in which file or at which line this occurs.

I also have no idea where the number comes from as I basically use only 5 slots:

#define SLOT_CBUFFER_GAME  0
#define SLOT_CBUFFER_PRIMARY_CAMERA  1
#define SLOT_CBUFFER_COLOR  2
#define SLOT_CBUFFER_LIGHTING  2
#define SLOT_CBUFFER_MODEL  3
#define SLOT_CBUFFER_SECONDARY_CAMERA  4

Any ideas? And how can get more feedback from the compiler?

Edited by matt77hias

Share this post


Link to post
Share on other sites
Advertisement
3 minutes ago, iedoc said:

can you post the shader (or effects file) that's failing to compile?

The compiler doesn't output the file name:

1>------ Build started: Project: MAGE, Configuration: Release x64 ------
1>FXC : error X4567: maximum cbuffer exceeded. target has 14 slots, manual bind to slot 4294967295 failed
1>

Idd for a rebuild:

1>------ Rebuild All started: Project: MAGE, Configuration: Release x64 ------
1>compilation header save succeeded; see D:\Users\Matthias\Documents\Visual Studio 2017\Projects\MAGE\MAGE\MAGE\src\shader\cso\aa\fxaa_CS.hpp
...
1>compilation header save succeeded; see D:\Users\Matthias\Documents\Visual Studio 2017\Projects\MAGE\MAGE\MAGE\src\shader\cso\deferred\deferred_ward_duer_PS.hpp
1>FXC : error X4567: maximum cbuffer exceeded. target has 14 slots, manual bind to slot 4294967295 failed

Edited by matt77hias

Share this post


Link to post
Share on other sites

Found the culprit manually: undefined macro

Though it would have helped if the compiler mentioned the file :)

Edited by matt77hias

Share this post


Link to post
Share on other sites
16 hours ago, galop1n said:

4294967295 is -1 btw, it usually smell bad to see that value cast as an unsigned

Apparently that is the value assigned by the HLSL pre-processor for a non existing macro. Bit strange compared to the C++ pre-processor who would have complained if the macro didn't exist.

Share this post


Link to post
Share on other sites

The C/C++ preprocessor does not warn on that, they fallback to 0.

To warn, you need :

gcc/clang : -Wundef ( not in -Wall )

VS : #pragma warning (enable : 4668) ( default to on only at level 4, no one use level 4 )

 

Share this post


Link to post
Share on other sites
1 hour ago, galop1n said:

VS : #pragma warning (enable : 4668) ( default to on only at level 4, no one use level 4 )

No one uses Wall. It is perfectly sane to use W4. I use and would use it always.

Furthermore, it does not result in a warning but in an error.

Share this post


Link to post
Share on other sites
1 minute ago, matt77hias said:

No one uses Wall. It is perfectly sane to use W4. I use and would use it always.

Furthermore, it does not result in a warning but in an error.

My bad, i got confused between the naming convention of gcc and vs for the warning levels :) Yes, W4 is fine, but warning are warning unless you turn on warning as errors :) And this warning is not on by default at W4, I just checked :( You need to turn it on with the pragma.

 warning C4668: 'NONON' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'

 

 

Share this post


Link to post
Share on other sites
3 minutes ago, galop1n said:

And this warning is not on by default at W4, I just checked  You need to turn it on with the pragma.

Wait are we still talking about the same thing?

I basically removed the macro define, so we have a program such as:

int main() {
   const int x = 5 + MY_MACRO;
}

which fails to compile with gcc and MVC++

But even if I would have something like this:

#define MY_MACRO

int main() {
   const int x = 5 + MY_MACRO;
}

it will still fail with gcc and MVC++.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!