Hi
I was wondering if any one knows much about optimisation for structured buffers. I am wondering if merging two buffers into one single buffer is better ?
An example of what i mean:
//two buffers
RWStructuredBuffer<float2> buffer0;
RWStructuredBuffer<float2> buffer1;
or
//one buffer where buffer 0 is .xy and buffer 1 is .zw
RWStructuredBuffer<float4> buffer01;
or
// one buffer where it is twice as large so buffer 0 is [0 to n-1] buffer 1 is [n to 2n-1]
RWStructuredBuffer<float2> buffer01;
or
// one buffer where it is four times as large with the data packed like so:
// [0] float2.x
// [1] float2.y
// as well as buffer 1 starting at [2n-1, 4n-1]
RWStructuredBuffer<float> buffer01;
Which is better, what does a GPU prefer in terms of performance and memory usage? I can't find much answers on this topic annoyingly, so maybe some one here has a better understanding of how GPUs handle this stuff.
FYI it might seem like a micro optimisation, but thats because i need to be, its a run time fast fourier transform and thus needs to be optimised to hell and back, so i'm starting off by seeing what is the ideal buffer setup.
Thanks