mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-13 21:50:06 +00:00
33 lines
663 B
GLSL
33 lines
663 B
GLSL
|
|
||
|
cbuffer ConstantBuffer : register( b0 )
|
||
|
{
|
||
|
matrix World;
|
||
|
matrix View;
|
||
|
matrix Projection;
|
||
|
};
|
||
|
|
||
|
struct VS_INPUT
|
||
|
{
|
||
|
float4 Pos : POSITION;
|
||
|
float3 Norm : NORMAL;
|
||
|
};
|
||
|
|
||
|
struct PS_INPUT
|
||
|
{
|
||
|
float4 Pos : SV_POSITION;
|
||
|
float3 Norm : TEXCOORD0;
|
||
|
};
|
||
|
|
||
|
PS_INPUT main( VS_INPUT input )
|
||
|
{
|
||
|
int ConstantBuffer = 42; // test ConstantBuffer as an identifier
|
||
|
|
||
|
PS_INPUT output = (PS_INPUT)0;
|
||
|
output.Pos = mul( input.Pos, World );
|
||
|
output.Pos = mul( output.Pos, View );
|
||
|
output.Pos = mul( output.Pos, Projection );
|
||
|
output.Norm = mul( input.Norm, World ); // Work when output.Norm = mul( input.Norm, (float3x3)World );
|
||
|
|
||
|
return output;
|
||
|
}
|