Home Technical Talk

Compute Shader StructuredBuffer Question

polycounter lvl 4
Offline / Send Message
echofourpapa polycounter lvl 4
This is probably a very noob questions, but when writing compute shaders, is it better to pass your data in as a struct in a single StructuredBuffer or as multiple individual StructuredBuffers of floats?  
Here's some examples:

struct Data
{
      float DataA;
      float DataB;
      float DataC;
};

RWStructuredBuffer<Data> MyData;


or:

RWStructuredBuffer<float> MyDataA;
RWStructuredBuffer<float> MyDataB;
RWStructuredBuffer<float> MyDataC;
Sign In or Register to comment.