Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

HLSL StructuredBuffer usage

$
0
0

Hi,

I am a newbie for DirectX and HLSL shader.

In my HLSL shader,  I would like to use a StructuredBuffer to store a volume data:

 

On GPU:

uniform StructuredBuffer<float> _VolBuffer;

float SampleVol(int index1D ) {

return __VolBuffer[index1D];
}

 

However, I am not clear how to initialize this buffer from CPU side, i.e., how to create this buffer and fill with some initial data?

 

Thanks.

 

YL


Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>