HLSL: Index to unaligned/packed floats

后端 未结 1 624
北荒
北荒 2021-01-24 04:38

I have a vertex shader (2.0) doing some instancing - each vertex specifies an index into an array.

If I have an array like this:

float instanceData[100];         


        
1条回答
  •  时光取名叫无心
    2021-01-24 05:12

    Does that helps?:

    float4 packedInstanceData[25];
    ...
    float data = packedInstanceData[index / 4][index % 4];
    

    0 讨论(0)
提交回复
热议问题