HLSL: add in/out/inout qualifiers.
This commit is contained in:
parent
f02bea288f
commit
9249c709b0
6 changed files with 264 additions and 0 deletions
25
Test/hlsl.inoutquals.frag
Normal file
25
Test/hlsl.inoutquals.frag
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
struct PS_OUTPUT
|
||||
{
|
||||
float4 Color : SV_Target0;
|
||||
float Depth : SV_Depth;
|
||||
};
|
||||
|
||||
void MyFunc(in float x, out float y, inout float z)
|
||||
{
|
||||
y = x;
|
||||
z = y;
|
||||
x = -1; // no effect since x = in param
|
||||
}
|
||||
|
||||
PS_OUTPUT main(noperspective in float4 inpos : SV_Position)
|
||||
{
|
||||
PS_OUTPUT psout;
|
||||
|
||||
float x = 7, y, z = 3;
|
||||
MyFunc(x, y, z);
|
||||
|
||||
psout.Color = float4(x, y, z, 1);
|
||||
psout.Depth = inpos.w;
|
||||
|
||||
return psout;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue