WinRT: included shaders in SDL library (moved from SDLWinRTTestApp)
authorDavid Ludwig <dludwig@pobox.com>
Tue, 20 Nov 2012 08:46:10 -0500
changeset 8346 a15d524f1d2e
parent 8345 a7bbc0d7f381
child 8347 f0e61c2638ad
WinRT: included shaders in SDL library (moved from SDLWinRTTestApp)
VisualC/SDL/SDL_VS2012_WinRT.vcxproj
src/video/windowsrt/SDL_winrtrenderer.cpp
src/video/windowsrt/SimpleVertexShader.hlsl
--- a/VisualC/SDL/SDL_VS2012_WinRT.vcxproj	Tue Nov 20 08:12:12 2012 -0500
+++ b/VisualC/SDL/SDL_VS2012_WinRT.vcxproj	Tue Nov 20 08:46:10 2012 -0500
@@ -261,6 +261,24 @@
     <ClInclude Include="..\..\src\video\windowsrt\SDL_winrtrenderer.h" />
     <ClInclude Include="..\..\src\video\windowsrt\SDL_winrtvideo.h" />
   </ItemGroup>
+  <ItemGroup>
+    <FxCompile Include="..\..\src\video\windowsrt\SimplePixelShader.hlsl">
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Pixel</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Pixel</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
+    </FxCompile>
+    <FxCompile Include="..\..\src\video\windowsrt\SimpleVertexShader.hlsl">
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Vertex</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Vertex</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
+    </FxCompile>
+  </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{aeaea3a2-d4e6-45b1-8ec6-53d84287fc14}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
--- a/src/video/windowsrt/SDL_winrtrenderer.cpp	Tue Nov 20 08:12:12 2012 -0500
+++ b/src/video/windowsrt/SDL_winrtrenderer.cpp	Tue Nov 20 08:46:10 2012 -0500
@@ -16,8 +16,8 @@
 {
 	Direct3DBase::CreateDeviceResources();
 
-	auto loadVSTask = DX::ReadDataAsync("SimpleVertexShader.cso");
-	auto loadPSTask = DX::ReadDataAsync("SimplePixelShader.cso");
+	auto loadVSTask = DX::ReadDataAsync("SDL_VS2012_WinRT\\SimpleVertexShader.cso");
+	auto loadPSTask = DX::ReadDataAsync("SDL_VS2012_WinRT\\SimplePixelShader.cso");
 
 	auto createVSTask = loadVSTask.then([this](Platform::Array<byte>^ fileData) {
 		DX::ThrowIfFailed(
--- a/src/video/windowsrt/SimpleVertexShader.hlsl	Tue Nov 20 08:12:12 2012 -0500
+++ b/src/video/windowsrt/SimpleVertexShader.hlsl	Tue Nov 20 08:46:10 2012 -0500
@@ -1,9 +1,5 @@
-cbuffer ModelViewProjectionConstantBuffer : register(b0)
-{
-	matrix model;
-	matrix view;
-	matrix projection;
-};
+
+//#pragma pack_matrix( row_major )
 
 struct VertexShaderInput
 {
@@ -20,16 +16,7 @@
 VertexShaderOutput main(VertexShaderInput input)
 {
 	VertexShaderOutput output;
-	float4 pos = float4(input.pos, 1.0f);
-
-	// Transform the vertex position into projected space.
-	pos = mul(pos, model);
-	pos = mul(pos, view);
-	pos = mul(pos, projection);
-	output.pos = pos;
-
-	// Pass through the color without modification.
+	output.pos = float4(input.pos, 1.0f);
 	output.color = input.color;
-
 	return output;
 }