Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
WinRT: included shaders in SDL library (moved from SDLWinRTTestApp)
- Loading branch information
|
@@ -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> |
|
|
|
@@ -16,8 +16,8 @@ void SDL_winrtrenderer::CreateDeviceResources() |
|
|
{ |
|
|
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( |
|
|
|
|
@@ -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 @@ struct VertexShaderOutput |
|
|
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; |
|
|
} |