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;
}
↧