xref: /third_party/glslang/Test/hlsl.cbuffer-identifier.vert
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/glslang/Test/
1617a3babSopenharmony_ci
2617a3babSopenharmony_cicbuffer ConstantBuffer : register( b0 )
3617a3babSopenharmony_ci{
4617a3babSopenharmony_ci    matrix World;
5617a3babSopenharmony_ci    matrix View;
6617a3babSopenharmony_ci    matrix Projection;
7617a3babSopenharmony_ci};
8617a3babSopenharmony_ci
9617a3babSopenharmony_cistruct VS_INPUT
10617a3babSopenharmony_ci{
11617a3babSopenharmony_ci    float4 Pos : POSITION;
12617a3babSopenharmony_ci    float3 Norm : NORMAL;
13617a3babSopenharmony_ci};
14617a3babSopenharmony_ci
15617a3babSopenharmony_cistruct PS_INPUT
16617a3babSopenharmony_ci{
17617a3babSopenharmony_ci    float4 Pos : SV_POSITION;
18617a3babSopenharmony_ci    float3 Norm : TEXCOORD0;
19617a3babSopenharmony_ci};
20617a3babSopenharmony_ci
21617a3babSopenharmony_ciPS_INPUT main( VS_INPUT input )
22617a3babSopenharmony_ci{
23617a3babSopenharmony_ci    int ConstantBuffer = 42;  // test ConstantBuffer as an identifier
24617a3babSopenharmony_ci
25617a3babSopenharmony_ci    PS_INPUT output = (PS_INPUT)0;
26617a3babSopenharmony_ci    output.Pos = mul( input.Pos, World );
27617a3babSopenharmony_ci    output.Pos = mul( output.Pos, View );
28617a3babSopenharmony_ci    output.Pos = mul( output.Pos, Projection );
29617a3babSopenharmony_ci    output.Norm = mul( input.Norm, World );  // Work when output.Norm = mul( input.Norm, (float3x3)World );
30617a3babSopenharmony_ci
31617a3babSopenharmony_ci    return output;
32617a3babSopenharmony_ci}
33

Indexes created Thu Nov 07 10:32:03 CST 2024