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

Started by
4 comments, last by circlesoft 16 years, 11 months ago
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!
Advertisement
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.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
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.


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.


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.
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).
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )

This topic is closed to new replies.

Advertisement