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

Can RWTexture2D variables as a parameter for a user-defined function

$
0
0
Hi, I am newer of Direct3D 11, and I want to get help from you. In Direct3D samples, we usually define RWTexture2D variables globally, and use it in functions directly. Is it legal to transfer this variable as a parameter of a user-defined function? RWTexture2D<float4> texture : regiters(u0); void setData(RWTexture2D<float4> tex, float2 data) { tex[uint2(0, 0)] = data; } PS_OUTPUT main(PS_INPUT input) { setData(texture, float2(0.0, 0.0)); PS_OUTPUT output; return output; }

Viewing all articles
Browse latest Browse all 17825

Trending Articles



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