summaryrefslogtreecommitdiff
path: root/tests/hlsl/dxsdk/BasicHLSL11/BasicHLSL11_VS.hlsl
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-09 11:34:21 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-09 13:44:59 -0700
commitfcf83dbf9effab3bd98bad2b83b2468b7eb05cfd (patch)
tree41047c94883b86ec085a81597391ce3ef557cd43 /tests/hlsl/dxsdk/BasicHLSL11/BasicHLSL11_VS.hlsl
parent52e8d4b9a27ab0060f874c3a63ab531847be35c0 (diff)
Initial import of code.
Diffstat (limited to 'tests/hlsl/dxsdk/BasicHLSL11/BasicHLSL11_VS.hlsl')
-rw-r--r--tests/hlsl/dxsdk/BasicHLSL11/BasicHLSL11_VS.hlsl49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/hlsl/dxsdk/BasicHLSL11/BasicHLSL11_VS.hlsl b/tests/hlsl/dxsdk/BasicHLSL11/BasicHLSL11_VS.hlsl
new file mode 100644
index 000000000..cb2c1b950
--- /dev/null
+++ b/tests/hlsl/dxsdk/BasicHLSL11/BasicHLSL11_VS.hlsl
@@ -0,0 +1,49 @@
+//TEST:COMPARE_HLSL: -target dxbc-assembly -profile vs_4_0 -entry VSMain
+//--------------------------------------------------------------------------------------
+// File: BasicHLSL11_VS.hlsl
+//
+// The vertex shader file for the BasicHLSL11 sample.
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//--------------------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------------------
+// Globals
+//--------------------------------------------------------------------------------------
+cbuffer cbPerObject : register( b0 )
+{
+ matrix g_mWorldViewProjection : packoffset( c0 );
+ matrix g_mWorld : packoffset( c4 );
+};
+
+//--------------------------------------------------------------------------------------
+// Input / Output structures
+//--------------------------------------------------------------------------------------
+struct VS_INPUT
+{
+ float4 vPosition : POSITION;
+ float3 vNormal : NORMAL;
+ float2 vTexcoord : TEXCOORD0;
+};
+
+struct VS_OUTPUT
+{
+ float3 vNormal : NORMAL;
+ float2 vTexcoord : TEXCOORD0;
+ float4 vPosition : SV_POSITION;
+};
+
+//--------------------------------------------------------------------------------------
+// Vertex Shader
+//--------------------------------------------------------------------------------------
+VS_OUTPUT VSMain( VS_INPUT Input )
+{
+ VS_OUTPUT Output;
+
+ Output.vPosition = mul( Input.vPosition, g_mWorldViewProjection );
+ Output.vNormal = mul( Input.vNormal, (float3x3)g_mWorld );
+ Output.vTexcoord = Input.vTexcoord;
+
+ return Output;
+}
+