I interested in both a code design and performance aspect if having a separated buffers when sending data to the GPU in HLSL, or another high-level shader language, is better.
This is where a particular shader needs to have a lot of variable data which changes during runtime and as such needs information to be passed by buffers.
I give an very basic example:
cbuffer SomeLargeBuffer : register(cb0)
{
float3 data;
float someData;
float4 largeArray[2500];
float moreData;
...
...
...
...
...
}
or to have
cbuffer SamllerBuffer: register(cb0)
{
float3 data;
float someRelatedData;
}
cbuffer SecondSmallerBuffer : register(cb1)
{
float4 largeArray[2500];
float moreData;
}
cbuffer ThirdBuffer: register(cb2)
{
...
...
...
}