Sign in to follow this  

[hlsl 10] constant buffer has only 14 (not 16) slots available

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I write a scan-heavey gpgpu hlsl like:
cbuffer cb0
{
	uint2 buf0[cbufSize];
}
cbuffer cb1
{
	uint2 buf1[cbufSize];
}
...
cbuffer cb15
{
	uint2 buf15[cbufSize];
}
and error occurs:
Quote:
error X4567: maximum cbuffer exceeded. target has 14 slots my.fx(330,38): There was an error compiling expression
Question: 1, why not 16 slots? is that my struct VS_OUTPUT.. SamplerState samp.. #define N 4096.. and vars in ps(){}.. all takes up in cbuffer slots? How to have 15 or 16 slots? Thanks!

Share this post


Link to post
Share on other sites
Hi, thanks for your smart sugggestion!
It's just that I started the compiling ref from the moment I saw your reply,
and now it hasn't finished...
Quote:
Original post by circlesoft
Have you tried compiling this under a reference device? It could be a driver problem, since they are still under very heavy development right now.


Share this post


Link to post
Share on other sites
Hi, I tried a simplified version of glsl, and ref mode 's D3DX10CreateEffectFromFile() gets a NULL g_pEffect.
But no error tips from ID3D10Blob **ppErrors or VS2005's IDE output windows.
Thanks for any suggestions!

Quote:
Original post by yk_cadcg
Hi, thanks for your smart sugggestion!
It's just that I started the compiling ref from the moment I saw your reply,
and now it hasn't finished...
Quote:
Original post by circlesoft
Have you tried compiling this under a reference device? It could be a driver problem, since they are still under very heavy development right now.


Share this post


Link to post
Share on other sites
It's true that there are only 14 constant buffer slots. Originally there were going to be 15 + ICB, but one of them needed to be reserved for hardware use. Remember that each individual constant buffer can hold 4096 4-vectors, so if you're really filling up all of this data, chances are you're using more data than the API was designed for, and may want to consider using texture buffers instead.

I suspect this could be solved by changing your cbuffers so that all the values are within a single cbuffer. You will run out eventually, but then you can spill into the next buffer.

Share this post


Link to post
Share on other sites
Quote:
Original post by Jalibr
It's true that there are only 14 constant buffer slots. Originally there were going to be 15 + ICB, but one of them needed to be reserved for hardware use. Remember that each individual constant buffer can hold 4096 4-vectors, so if you're really filling up all of this data, chances are you're using more data than the API was designed for, and may want to consider using texture buffers instead.

Aha, that would explain it! Thanks for your answer (and welcome to gamedev).

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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