Buffer of arrays in HLSL compute shader I'm trying to follow along with a tutorial that uses an OpenGL compute shader, but I'm using D3D11. What they do is:

layout (std430, binding = 0) buffer indices {
    int j[];
};


I have no experience with this and very little with directX, but that looks like a buffer of integer arrays. I've looked around and read that the equivalent to this OpenGL buffer in D3D11 is an RWBuffer. Using a compute shader, this is what I've tried. Note, I didn't redefine them in my code as they appear here, I just listed them together here.

RWBuffer indices
{
    int j[];
}

RWBuffer&lt;{int j[];}&gt; indices;

struct index
{
    //requires explicit length, which is why this doesn't work
    int j[];
}
RWStructuredBuffer&lt;index&gt; indices;


But, none of those worked. The end goal is to access them like so:

//id is SV_DispatchThreadID
indices.j[int(id.y)]


This seems like an inappropriately simple question to post, but I wasn't able to find documentation, even on MSDN, on defining buffers and what's allowed and not, etc.
It looks to me like you want a buffer containing a single array of integers (not a buffer containing multiple arrays, whatever that would mean). So, you should be able to just do this:

RWBuffer&lt;int&gt; indices;


then access it like this:

indices[int(id.y)]