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

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

## 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 on other sites
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 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 circlesoftHave 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 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:
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 circlesoftHave 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 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 on other sites
Quote:
 Original post by JalibrIt'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).

1. 1
2. 2
Rutin
21
3. 3
4. 4
frob
17
5. 5

• 9
• 12
• 9
• 33
• 13
• ### Forum Statistics

• Total Topics
632591
• Total Posts
3007250

×