created StockShaderCodeGenerator tool (sscg)

removed old shader files
included sscg in pre-build events of RenderSystem DX10 and GL3 to generate shader files before compiling
This commit is contained in:
Glatzemann 2011-11-15 12:11:24 +00:00
parent 7ad880db18
commit 711d4aa68b
17 changed files with 966 additions and 145 deletions

View File

@ -88,6 +88,9 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>"$(ProjectDir)../Tools/bin/sscg.exe" ../../shader/DX10/build.xml</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@ -1,10 +1,8 @@
#region Using Statements
#region Using Statements
using System;
#endregion // Using Statements
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
@ -47,90 +45,123 @@ using System;
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
#endregion // License
namespace ANX.Framework.Windows.DX10
{
internal static class ShaderByteCode
{
internal static class ShaderByteCode
{
#region SpriteBatchShader
internal static byte[] SpriteBatchByteCode = new byte[]
{
068,
088, 066, 067, 076, 188, 007, 250, 222, 184, 008, 085, 030, 093, 218, 008, 162, 103, 199, 180, 001,
000, 000, 000, 044, 008, 000, 000, 001, 000, 000, 000, 036, 000, 000, 000, 070, 088, 049, 048, 000,
008, 000, 000, 001, 016, 255, 254, 001, 000, 000, 000, 001, 000, 000, 000, 002, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 012, 007, 000, 000, 000,
000, 000, 000, 001, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 001,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 002, 000, 000, 000, 002, 000, 000, 000, 000,
000, 000, 000, 036, 071, 108, 111, 098, 097, 108, 115, 000, 102, 108, 111, 097, 116, 052, 120, 052,
000, 013, 000, 000, 000, 001, 000, 000, 000, 000, 000, 000, 000, 064, 000, 000, 000, 064, 000, 000,
000, 064, 000, 000, 000, 011, 100, 000, 000, 077, 097, 116, 114, 105, 120, 084, 114, 097, 110, 115,
102, 111, 114, 109, 000, 084, 101, 120, 116, 117, 114, 101, 050, 068, 000, 066, 000, 000, 000, 002,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 012,
000, 000, 000, 084, 101, 120, 116, 117, 114, 101, 000, 083, 097, 109, 112, 108, 101, 114, 083, 116,
097, 116, 101, 000, 112, 000, 000, 000, 002, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 021, 000, 000, 000, 084, 101, 120, 116, 117, 114, 101, 083,
097, 109, 112, 108, 101, 114, 000, 083, 112, 114, 105, 116, 101, 084, 101, 099, 104, 110, 105, 113,
117, 101, 000, 083, 112, 114, 105, 116, 101, 067, 111, 108, 111, 114, 080, 097, 115, 115, 000, 001,
000, 000, 000, 002, 000, 000, 000, 000, 000, 000, 000, 128, 003, 000, 000, 068, 088, 066, 067, 093,
023, 212, 206, 149, 008, 160, 173, 236, 209, 184, 180, 025, 147, 008, 113, 001, 000, 000, 000, 128,
003, 000, 000, 005, 000, 000, 000, 052, 000, 000, 000, 008, 001, 000, 000, 120, 001, 000, 000, 236,
001, 000, 000, 004, 003, 000, 000, 082, 068, 069, 070, 204, 000, 000, 000, 001, 000, 000, 000, 072,
000, 000, 000, 001, 000, 000, 000, 028, 000, 000, 000, 000, 004, 254, 255, 000, 001, 000, 000, 152,
000, 000, 000, 060, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 000, 000, 000, 000, 036, 071, 108, 111, 098,
097, 108, 115, 000, 171, 171, 171, 060, 000, 000, 000, 001, 000, 000, 000, 096, 000, 000, 000, 064,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 120, 000, 000, 000, 000, 000, 000, 000, 064,
000, 000, 000, 002, 000, 000, 000, 136, 000, 000, 000, 000, 000, 000, 000, 077, 097, 116, 114, 105,
120, 084, 114, 097, 110, 115, 102, 111, 114, 109, 000, 003, 000, 003, 000, 004, 000, 004, 000, 000,
000, 000, 000, 000, 000, 000, 000, 077, 105, 099, 114, 111, 115, 111, 102, 116, 032, 040, 082, 041,
032, 072, 076, 083, 076, 032, 083, 104, 097, 100, 101, 114, 032, 067, 111, 109, 112, 105, 108, 101,
114, 032, 057, 046, 050, 057, 046, 057, 053, 050, 046, 051, 049, 049, 049, 000, 171, 171, 171, 073,
083, 071, 078, 104, 000, 000, 000, 003, 000, 000, 000, 008, 000, 000, 000, 080, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 003, 000, 000, 000, 000, 000, 000, 000, 015, 015, 000, 000, 089,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 003, 000, 000, 000, 001, 000, 000, 000, 015,
015, 000, 000, 095, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 003, 000, 000, 000, 002,
000, 000, 000, 003, 003, 000, 000, 080, 079, 083, 073, 084, 073, 079, 078, 000, 067, 079, 076, 079,
082, 000, 084, 069, 088, 067, 079, 079, 082, 068, 000, 079, 083, 071, 078, 108, 000, 000, 000, 003,
000, 000, 000, 008, 000, 000, 000, 080, 000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 003,
000, 000, 000, 000, 000, 000, 000, 015, 000, 000, 000, 092, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 003, 000, 000, 000, 001, 000, 000, 000, 015, 000, 000, 000, 098, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 003, 000, 000, 000, 002, 000, 000, 000, 003, 012, 000, 000, 083,
086, 095, 080, 079, 083, 073, 084, 073, 079, 078, 000, 067, 079, 076, 079, 082, 000, 084, 069, 088,
067, 079, 079, 082, 068, 000, 171, 083, 072, 068, 082, 016, 001, 000, 000, 064, 000, 001, 000, 068,
000, 000, 000, 089, 000, 000, 004, 070, 142, 032, 000, 000, 000, 000, 000, 004, 000, 000, 000, 095,
000, 000, 003, 242, 016, 016, 000, 000, 000, 000, 000, 095, 000, 000, 003, 242, 016, 016, 000, 001,
000, 000, 000, 095, 000, 000, 003, 050, 016, 016, 000, 002, 000, 000, 000, 103, 000, 000, 004, 242,
032, 016, 000, 000, 000, 000, 000, 001, 000, 000, 000, 101, 000, 000, 003, 242, 032, 016, 000, 001,
000, 000, 000, 101, 000, 000, 003, 050, 032, 016, 000, 002, 000, 000, 000, 017, 000, 000, 008, 018,
032, 016, 000, 000, 000, 000, 000, 070, 030, 016, 000, 000, 000, 000, 000, 070, 142, 032, 000, 000,
000, 000, 000, 000, 000, 000, 000, 017, 000, 000, 008, 034, 032, 016, 000, 000, 000, 000, 000, 070,
030, 016, 000, 000, 000, 000, 000, 070, 142, 032, 000, 000, 000, 000, 000, 001, 000, 000, 000, 017,
000, 000, 008, 066, 032, 016, 000, 000, 000, 000, 000, 070, 030, 016, 000, 000, 000, 000, 000, 070,
142, 032, 000, 000, 000, 000, 000, 002, 000, 000, 000, 017, 000, 000, 008, 130, 032, 016, 000, 000,
000, 000, 000, 070, 030, 016, 000, 000, 000, 000, 000, 070, 142, 032, 000, 000, 000, 000, 000, 003,
000, 000, 000, 054, 000, 000, 005, 242, 032, 016, 000, 001, 000, 000, 000, 070, 030, 016, 000, 001,
000, 000, 000, 054, 000, 000, 005, 050, 032, 016, 000, 002, 000, 000, 000, 070, 016, 016, 000, 002,
000, 000, 000, 062, 000, 000, 001, 083, 084, 065, 084, 116, 000, 000, 000, 007, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 006, 000, 000, 000, 004, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 001, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 002, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 212, 000, 000, 000, 000, 000, 000, 000, 160,
002, 000, 000, 068, 088, 066, 067, 029, 076, 118, 093, 197, 015, 041, 178, 119, 144, 245, 077, 096,
029, 105, 032, 001, 000, 000, 000, 160, 002, 000, 000, 005, 000, 000, 000, 052, 000, 000, 000, 224,
000, 000, 000, 084, 001, 000, 000, 136, 001, 000, 000, 036, 002, 000, 000, 082, 068, 069, 070, 164,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 002, 000, 000, 000, 028, 000, 000, 000, 000,
004, 255, 255, 000, 001, 000, 000, 115, 000, 000, 000, 092, 000, 000, 000, 003, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 001,
000, 000, 000, 107, 000, 000, 000, 002, 000, 000, 000, 005, 000, 000, 000, 004, 000, 000, 000, 255,
255, 255, 255, 000, 000, 000, 000, 001, 000, 000, 000, 013, 000, 000, 000, 084, 101, 120, 116, 117,
114, 101, 083, 097, 109, 112, 108, 101, 114, 000, 084, 101, 120, 116, 117, 114, 101, 000, 077, 105,
099, 114, 111, 115, 111, 102, 116, 032, 040, 082, 041, 032, 072, 076, 083, 076, 032, 083, 104, 097,
100, 101, 114, 032, 067, 111, 109, 112, 105, 108, 101, 114, 032, 057, 046, 050, 057, 046, 057, 053,
050, 046, 051, 049, 049, 049, 000, 073, 083, 071, 078, 108, 000, 000, 000, 003, 000, 000, 000, 008,
000, 000, 000, 080, 000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 003, 000, 000, 000, 000,
000, 000, 000, 015, 000, 000, 000, 092, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 003,
000, 000, 000, 001, 000, 000, 000, 015, 015, 000, 000, 098, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 003, 000, 000, 000, 002, 000, 000, 000, 003, 003, 000, 000, 083, 086, 095, 080, 079,
083, 073, 084, 073, 079, 078, 000, 067, 079, 076, 079, 082, 000, 084, 069, 088, 067, 079, 079, 082,
068, 000, 171, 079, 083, 071, 078, 044, 000, 000, 000, 001, 000, 000, 000, 008, 000, 000, 000, 032,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 003, 000, 000, 000, 000, 000, 000, 000, 015,
000, 000, 000, 083, 086, 095, 084, 097, 114, 103, 101, 116, 000, 171, 171, 083, 072, 068, 082, 148,
000, 000, 000, 064, 000, 000, 000, 037, 000, 000, 000, 090, 000, 000, 003, 000, 096, 016, 000, 000,
000, 000, 000, 088, 024, 000, 004, 000, 112, 016, 000, 000, 000, 000, 000, 085, 085, 000, 000, 098,
016, 000, 003, 242, 016, 016, 000, 001, 000, 000, 000, 098, 016, 000, 003, 050, 016, 016, 000, 002,
000, 000, 000, 101, 000, 000, 003, 242, 032, 016, 000, 000, 000, 000, 000, 104, 000, 000, 002, 001,
000, 000, 000, 069, 000, 000, 009, 242, 000, 016, 000, 000, 000, 000, 000, 070, 016, 016, 000, 002,
000, 000, 000, 070, 126, 016, 000, 000, 000, 000, 000, 000, 096, 016, 000, 000, 000, 000, 000, 056,
000, 000, 007, 242, 032, 016, 000, 000, 000, 000, 000, 070, 014, 016, 000, 000, 000, 000, 000, 070,
030, 016, 000, 001, 000, 000, 000, 062, 000, 000, 001, 083, 084, 065, 084, 116, 000, 000, 000, 003,
000, 000, 000, 001, 000, 000, 000, 000, 000, 000, 000, 003, 000, 000, 000, 001, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 096, 004, 000, 000, 000,
000, 000, 000, 004, 000, 000, 000, 064, 000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 255,
255, 255, 255, 000, 000, 000, 000, 050, 000, 000, 000, 022, 000, 000, 000, 000, 000, 000, 000, 000,
000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 104, 000, 000, 000, 076,
000, 000, 000, 000, 000, 000, 000, 255, 255, 255, 255, 000, 000, 000, 000, 153, 000, 000, 000, 125,
000, 000, 000, 000, 000, 000, 000, 255, 255, 255, 255, 000, 000, 000, 000, 000, 000, 000, 000, 168,
000, 000, 000, 001, 000, 000, 000, 000, 000, 000, 000, 184, 000, 000, 000, 003, 000, 000, 000, 000,
000, 000, 000, 008, 000, 000, 000, 000, 000, 000, 000, 001, 000, 000, 000, 200, 000, 000, 000, 006,
000, 000, 000, 000, 000, 000, 000, 007, 000, 000, 000, 088, 004, 000, 000, 007, 000, 000, 000, 000,
000, 000, 000, 007, 000, 000, 000, 004, 007, 000, 000
};
#endregion //SpriteBatchShader
#region SpriteBatchShader
internal static byte[] SpriteBatchByteCode = new byte[]
{
68, 88, 66, 67, 76, 188, 7, 250, 222, 184, 8, 85, 30, 93, 218, 8, 162, 103, 199, 180, 1,
0, 0, 0, 44, 8, 0, 0, 1, 0, 0, 0, 36, 0, 0, 0, 70, 88, 49, 48, 0, 8, 0, 0, 1, 16, 255, 254,
1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 7,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 102, 108,
111, 97, 116, 52, 120, 52, 0, 13, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0,
64, 0, 0, 0, 11, 100, 0, 0, 77, 97, 116, 114, 105, 120, 84, 114, 97, 110, 115, 102, 111, 114,
109, 0, 84, 101, 120, 116, 117, 114, 101, 50, 68, 0, 66, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 84, 101, 120, 116, 117, 114, 101, 0, 83, 97, 109,
112, 108, 101, 114, 83, 116, 97, 116, 101, 0, 112, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 84, 101, 120, 116, 117, 114, 101, 83, 97, 109, 112, 108,
101, 114, 0, 83, 112, 114, 105, 116, 101, 84, 101, 99, 104, 110, 105, 113, 117, 101, 0, 83, 112,
114, 105, 116, 101, 67, 111, 108, 111, 114, 80, 97, 115, 115, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0,
0, 0, 128, 3, 0, 0, 68, 88, 66, 67, 93, 23, 212, 206, 149, 8, 160, 173, 236, 209, 184, 180, 25,
147, 8, 113, 1, 0, 0, 0, 128, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 8, 1, 0, 0, 120, 1, 0, 0, 236,
1, 0, 0, 4, 3, 0, 0, 82, 68, 69, 70, 204, 0, 0, 0, 1, 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 0, 28, 0,
0, 0, 0, 4, 254, 255, 0, 1, 0, 0, 152, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171,
171, 171, 60, 0, 0, 0, 1, 0, 0, 0, 96, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0,
0, 0, 0, 0, 0, 64, 0, 0, 0, 2, 0, 0, 0, 136, 0, 0, 0, 0, 0, 0, 0, 77, 97, 116, 114, 105, 120,
84, 114, 97, 110, 115, 102, 111, 114, 109, 0, 3, 0, 3, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104,
97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 57, 46, 50, 57, 46, 57, 53,
50, 46, 51, 49, 49, 49, 0, 171, 171, 171, 73, 83, 71, 78, 104, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0,
0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 15, 0, 0, 89, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 15, 15, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 3, 0, 0, 80, 79, 83, 73, 84, 73, 79, 78, 0, 67, 79, 76, 79, 82,
0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 79, 83, 71, 78, 108, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 15, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
0, 2, 0, 0, 0, 3, 12, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 83, 72, 68, 82, 16, 1, 0, 0, 64, 0, 1, 0, 68, 0, 0, 0,
89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 4, 0, 0, 0, 95, 0, 0, 3, 242, 16, 16, 0, 0, 0, 0, 0,
95, 0, 0, 3, 242, 16, 16, 0, 1, 0, 0, 0, 95, 0, 0, 3, 50, 16, 16, 0, 2, 0, 0, 0, 103, 0, 0, 4,
242, 32, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3,
50, 32, 16, 0, 2, 0, 0, 0, 17, 0, 0, 8, 18, 32, 16, 0, 0, 0, 0, 0, 70, 30, 16, 0, 0, 0, 0, 0, 70,
142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 34, 32, 16, 0, 0, 0, 0, 0, 70, 30, 16, 0, 0, 0, 0,
0, 70, 142, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 17, 0, 0, 8, 66, 32, 16, 0, 0, 0, 0, 0, 70, 30, 16, 0, 0,
0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 17, 0, 0, 8, 130, 32, 16, 0, 0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 3, 0, 0, 0, 54, 0, 0, 5, 242, 32, 16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 1, 0, 0, 0, 54, 0, 0, 5, 50, 32, 16, 0, 2, 0, 0, 0, 70, 16, 16, 0, 2, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0,
160, 2, 0, 0, 68, 88, 66, 67, 29, 76, 118, 93, 197, 15, 41, 178, 119, 144, 245, 77, 96, 29, 105, 32, 1,
0, 0, 0, 160, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 224, 0, 0, 0, 84, 1, 0, 0, 136, 1, 0, 0, 36, 2, 0, 0,
82, 68, 69, 70, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0,
0, 115, 0, 0, 0, 92, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 107, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0,
0, 13, 0, 0, 0, 84, 101, 120, 116, 117, 114, 101, 83, 97, 109, 112, 108, 101, 114, 0, 84, 101, 120, 116,
117, 114, 101, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 57, 46, 50, 57, 46, 57, 53, 50, 46,
51, 49, 49, 49, 0, 73, 83, 71, 78, 108, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 15, 15,
0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84,
73, 79, 78, 0, 67, 79, 76, 79, 82, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0,
0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 97,
114, 103, 101, 116, 0, 171, 171, 83, 72, 68, 82, 148, 0, 0, 0, 64, 0, 0, 0, 37, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16,
0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 242, 16, 16, 0, 1, 0, 0, 0, 98,
16, 0, 3, 50, 16, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0, 69, 0, 0, 9,
242, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 2, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 56, 0, 0,
7, 242, 32, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 70, 30, 16, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116,
0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,
4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 50, 0, 0, 0, 22, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255,
255, 0, 0, 0, 0, 153, 0, 0, 0, 125, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 184, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 200, 0, 0, 0, 6, 0, 0, 0, 0,
0, 0, 0, 7, 0, 0, 0, 88, 4, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 4, 7, 0, 0
};
#endregion // SpriteBatchShader
}
}
}

View File

@ -53,6 +53,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RasterizerStateGL3.cs" />
<Compile Include="SamplerStateGL3.cs" />
<Compile Include="ShaderByteCode.cs" />
<Compile Include="Texture2DGL3.cs" />
<Compile Include="VertexBufferGL3.cs" />
<Compile Include="WindowsGameHost.cs" />
@ -65,6 +66,9 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>"$(ProjectDir)../Tools/bin/sscg.exe" ../../shader/GL3/build.xml</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@ -0,0 +1,263 @@
#region Using Statements
using System;
#endregion // Using Statements
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
// This file is released under the Ms-PL license.
//
//
//
// Microsoft Public License (Ms-PL)
//
// This license governs use of the accompanying software. If you use the software, you accept this license.
// If you do not accept the license, do not use the software.
//
// 1.Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
// here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//
// 2.Grant of Rights
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
// or any derivative works that you create.
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
// in the software or derivative works of the contribution in the software.
//
// 3.Conditions and Limitations
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
// patent license from such contributor to the software ends automatically.
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
// notices that are present in the software.
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
// object code form, you may only do so under a license that complies with this license.
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
#endregion // License
namespace ANX.Framework.Windows.GL3
{
internal static class ShaderByteCode
{
#region SpriteBatchShader
internal static byte[] SpriteBatchByteCode = new byte[]
{
047,
047, 013, 010, 047, 047, 032, 084, 104, 105, 115, 032, 102, 105, 108, 101, 032, 105, 115, 032, 112,
097, 114, 116, 032, 111, 102, 032, 116, 104, 101, 032, 065, 078, 088, 046, 070, 114, 097, 109, 101,
119, 111, 114, 107, 032, 099, 114, 101, 097, 116, 101, 100, 032, 098, 121, 032, 116, 104, 101, 032,
034, 065, 078, 088, 046, 070, 114, 097, 109, 101, 119, 111, 114, 107, 032, 100, 101, 118, 101, 108,
111, 112, 101, 114, 032, 103, 114, 111, 117, 112, 034, 046, 013, 010, 047, 047, 013, 010, 047, 047,
032, 084, 104, 105, 115, 032, 102, 105, 108, 101, 032, 105, 115, 032, 114, 101, 108, 101, 097, 115,
101, 100, 032, 117, 110, 100, 101, 114, 032, 116, 104, 101, 032, 077, 115, 045, 080, 076, 032, 108,
105, 099, 101, 110, 115, 101, 046, 013, 010, 047, 047, 013, 010, 047, 047, 013, 010, 047, 047, 013,
010, 047, 047, 032, 077, 105, 099, 114, 111, 115, 111, 102, 116, 032, 080, 117, 098, 108, 105, 099,
032, 076, 105, 099, 101, 110, 115, 101, 032, 040, 077, 115, 045, 080, 076, 041, 013, 010, 047, 047,
013, 010, 047, 047, 032, 084, 104, 105, 115, 032, 108, 105, 099, 101, 110, 115, 101, 032, 103, 111,
118, 101, 114, 110, 115, 032, 117, 115, 101, 032, 111, 102, 032, 116, 104, 101, 032, 097, 099, 099,
111, 109, 112, 097, 110, 121, 105, 110, 103, 032, 115, 111, 102, 116, 119, 097, 114, 101, 046, 032,
073, 102, 032, 121, 111, 117, 032, 117, 115, 101, 032, 116, 104, 101, 032, 115, 111, 102, 116, 119,
097, 114, 101, 044, 032, 121, 111, 117, 032, 097, 099, 099, 101, 112, 116, 032, 116, 104, 105, 115,
032, 108, 105, 099, 101, 110, 115, 101, 046, 032, 013, 010, 047, 047, 032, 073, 102, 032, 121, 111,
117, 032, 100, 111, 032, 110, 111, 116, 032, 097, 099, 099, 101, 112, 116, 032, 116, 104, 101, 032,
108, 105, 099, 101, 110, 115, 101, 044, 032, 100, 111, 032, 110, 111, 116, 032, 117, 115, 101, 032,
116, 104, 101, 032, 115, 111, 102, 116, 119, 097, 114, 101, 046, 013, 010, 047, 047, 013, 010, 047,
047, 032, 049, 046, 068, 101, 102, 105, 110, 105, 116, 105, 111, 110, 115, 013, 010, 047, 047, 032,
032, 032, 084, 104, 101, 032, 116, 101, 114, 109, 115, 032, 034, 114, 101, 112, 114, 111, 100, 117,
099, 101, 044, 034, 032, 034, 114, 101, 112, 114, 111, 100, 117, 099, 116, 105, 111, 110, 044, 034,
032, 034, 100, 101, 114, 105, 118, 097, 116, 105, 118, 101, 032, 119, 111, 114, 107, 115, 044, 034,
032, 097, 110, 100, 032, 034, 100, 105, 115, 116, 114, 105, 098, 117, 116, 105, 111, 110, 034, 032,
104, 097, 118, 101, 032, 116, 104, 101, 032, 115, 097, 109, 101, 032, 109, 101, 097, 110, 105, 110,
103, 032, 013, 010, 047, 047, 032, 032, 032, 104, 101, 114, 101, 032, 097, 115, 032, 117, 110, 100,
101, 114, 032, 085, 046, 083, 046, 032, 099, 111, 112, 121, 114, 105, 103, 104, 116, 032, 108, 097,
119, 046, 013, 010, 047, 047, 032, 032, 032, 065, 032, 034, 099, 111, 110, 116, 114, 105, 098, 117,
116, 105, 111, 110, 034, 032, 105, 115, 032, 116, 104, 101, 032, 111, 114, 105, 103, 105, 110, 097,
108, 032, 115, 111, 102, 116, 119, 097, 114, 101, 044, 032, 111, 114, 032, 097, 110, 121, 032, 097,
100, 100, 105, 116, 105, 111, 110, 115, 032, 111, 114, 032, 099, 104, 097, 110, 103, 101, 115, 032,
116, 111, 032, 116, 104, 101, 032, 115, 111, 102, 116, 119, 097, 114, 101, 046, 013, 010, 047, 047,
032, 032, 032, 065, 032, 034, 099, 111, 110, 116, 114, 105, 098, 117, 116, 111, 114, 034, 032, 105,
115, 032, 097, 110, 121, 032, 112, 101, 114, 115, 111, 110, 032, 116, 104, 097, 116, 032, 100, 105,
115, 116, 114, 105, 098, 117, 116, 101, 115, 032, 105, 116, 115, 032, 099, 111, 110, 116, 114, 105,
098, 117, 116, 105, 111, 110, 032, 117, 110, 100, 101, 114, 032, 116, 104, 105, 115, 032, 108, 105,
099, 101, 110, 115, 101, 046, 013, 010, 047, 047, 032, 032, 032, 034, 076, 105, 099, 101, 110, 115,
101, 100, 032, 112, 097, 116, 101, 110, 116, 115, 034, 032, 097, 114, 101, 032, 097, 032, 099, 111,
110, 116, 114, 105, 098, 117, 116, 111, 114, 039, 115, 032, 112, 097, 116, 101, 110, 116, 032, 099,
108, 097, 105, 109, 115, 032, 116, 104, 097, 116, 032, 114, 101, 097, 100, 032, 100, 105, 114, 101,
099, 116, 108, 121, 032, 111, 110, 032, 105, 116, 115, 032, 099, 111, 110, 116, 114, 105, 098, 117,
116, 105, 111, 110, 046, 013, 010, 047, 047, 013, 010, 047, 047, 032, 050, 046, 071, 114, 097, 110,
116, 032, 111, 102, 032, 082, 105, 103, 104, 116, 115, 013, 010, 047, 047, 032, 032, 032, 040, 065,
041, 032, 067, 111, 112, 121, 114, 105, 103, 104, 116, 032, 071, 114, 097, 110, 116, 045, 032, 083,
117, 098, 106, 101, 099, 116, 032, 116, 111, 032, 116, 104, 101, 032, 116, 101, 114, 109, 115, 032,
111, 102, 032, 116, 104, 105, 115, 032, 108, 105, 099, 101, 110, 115, 101, 044, 032, 105, 110, 099,
108, 117, 100, 105, 110, 103, 032, 116, 104, 101, 032, 108, 105, 099, 101, 110, 115, 101, 032, 099,
111, 110, 100, 105, 116, 105, 111, 110, 115, 032, 097, 110, 100, 032, 108, 105, 109, 105, 116, 097,
116, 105, 111, 110, 115, 032, 013, 010, 047, 047, 032, 032, 032, 032, 032, 032, 032, 105, 110, 032,
115, 101, 099, 116, 105, 111, 110, 032, 051, 044, 032, 101, 097, 099, 104, 032, 099, 111, 110, 116,
114, 105, 098, 117, 116, 111, 114, 032, 103, 114, 097, 110, 116, 115, 032, 121, 111, 117, 032, 097,
032, 110, 111, 110, 045, 101, 120, 099, 108, 117, 115, 105, 118, 101, 044, 032, 119, 111, 114, 108,
100, 119, 105, 100, 101, 044, 032, 114, 111, 121, 097, 108, 116, 121, 045, 102, 114, 101, 101, 032,
099, 111, 112, 121, 114, 105, 103, 104, 116, 032, 108, 105, 099, 101, 110, 115, 101, 032, 116, 111,
032, 013, 010, 047, 047, 032, 032, 032, 032, 032, 032, 032, 114, 101, 112, 114, 111, 100, 117, 099,
101, 032, 105, 116, 115, 032, 099, 111, 110, 116, 114, 105, 098, 117, 116, 105, 111, 110, 044, 032,
112, 114, 101, 112, 097, 114, 101, 032, 100, 101, 114, 105, 118, 097, 116, 105, 118, 101, 032, 119,
111, 114, 107, 115, 032, 111, 102, 032, 105, 116, 115, 032, 099, 111, 110, 116, 114, 105, 098, 117,
116, 105, 111, 110, 044, 032, 097, 110, 100, 032, 100, 105, 115, 116, 114, 105, 098, 117, 116, 101,
032, 105, 116, 115, 032, 099, 111, 110, 116, 114, 105, 098, 117, 116, 105, 111, 110, 013, 010, 047,
047, 032, 032, 032, 032, 032, 032, 032, 111, 114, 032, 097, 110, 121, 032, 100, 101, 114, 105, 118,
097, 116, 105, 118, 101, 032, 119, 111, 114, 107, 115, 032, 116, 104, 097, 116, 032, 121, 111, 117,
032, 099, 114, 101, 097, 116, 101, 046, 013, 010, 047, 047, 032, 032, 032, 040, 066, 041, 032, 080,
097, 116, 101, 110, 116, 032, 071, 114, 097, 110, 116, 045, 032, 083, 117, 098, 106, 101, 099, 116,
032, 116, 111, 032, 116, 104, 101, 032, 116, 101, 114, 109, 115, 032, 111, 102, 032, 116, 104, 105,
115, 032, 108, 105, 099, 101, 110, 115, 101, 044, 032, 105, 110, 099, 108, 117, 100, 105, 110, 103,
032, 116, 104, 101, 032, 108, 105, 099, 101, 110, 115, 101, 032, 099, 111, 110, 100, 105, 116, 105,
111, 110, 115, 032, 097, 110, 100, 032, 108, 105, 109, 105, 116, 097, 116, 105, 111, 110, 115, 032,
105, 110, 032, 013, 010, 047, 047, 032, 032, 032, 032, 032, 032, 032, 115, 101, 099, 116, 105, 111,
110, 032, 051, 044, 032, 101, 097, 099, 104, 032, 099, 111, 110, 116, 114, 105, 098, 117, 116, 111,
114, 032, 103, 114, 097, 110, 116, 115, 032, 121, 111, 117, 032, 097, 032, 110, 111, 110, 045, 101,
120, 099, 108, 117, 115, 105, 118, 101, 044, 032, 119, 111, 114, 108, 100, 119, 105, 100, 101, 044,
032, 114, 111, 121, 097, 108, 116, 121, 045, 102, 114, 101, 101, 032, 108, 105, 099, 101, 110, 115,
101, 032, 117, 110, 100, 101, 114, 032, 105, 116, 115, 032, 108, 105, 099, 101, 110, 115, 101, 100,
013, 010, 047, 047, 032, 032, 032, 032, 032, 032, 032, 112, 097, 116, 101, 110, 116, 115, 032, 116,
111, 032, 109, 097, 107, 101, 044, 032, 104, 097, 118, 101, 032, 109, 097, 100, 101, 044, 032, 117,
115, 101, 044, 032, 115, 101, 108, 108, 044, 032, 111, 102, 102, 101, 114, 032, 102, 111, 114, 032,
115, 097, 108, 101, 044, 032, 105, 109, 112, 111, 114, 116, 044, 032, 097, 110, 100, 047, 111, 114,
032, 111, 116, 104, 101, 114, 119, 105, 115, 101, 032, 100, 105, 115, 112, 111, 115, 101, 032, 111,
102, 032, 105, 116, 115, 032, 099, 111, 110, 116, 114, 105, 098, 117, 116, 105, 111, 110, 032, 013,
010, 047, 047, 032, 032, 032, 032, 032, 032, 032, 105, 110, 032, 116, 104, 101, 032, 115, 111, 102,
116, 119, 097, 114, 101, 032, 111, 114, 032, 100, 101, 114, 105, 118, 097, 116, 105, 118, 101, 032,
119, 111, 114, 107, 115, 032, 111, 102, 032, 116, 104, 101, 032, 099, 111, 110, 116, 114, 105, 098,
117, 116, 105, 111, 110, 032, 105, 110, 032, 116, 104, 101, 032, 115, 111, 102, 116, 119, 097, 114,
101, 046, 013, 010, 047, 047, 013, 010, 047, 047, 032, 051, 046, 067, 111, 110, 100, 105, 116, 105,
111, 110, 115, 032, 097, 110, 100, 032, 076, 105, 109, 105, 116, 097, 116, 105, 111, 110, 115, 013,
010, 047, 047, 032, 032, 032, 040, 065, 041, 032, 078, 111, 032, 084, 114, 097, 100, 101, 109, 097,
114, 107, 032, 076, 105, 099, 101, 110, 115, 101, 045, 032, 084, 104, 105, 115, 032, 108, 105, 099,
101, 110, 115, 101, 032, 100, 111, 101, 115, 032, 110, 111, 116, 032, 103, 114, 097, 110, 116, 032,
121, 111, 117, 032, 114, 105, 103, 104, 116, 115, 032, 116, 111, 032, 117, 115, 101, 032, 097, 110,
121, 032, 099, 111, 110, 116, 114, 105, 098, 117, 116, 111, 114, 115, 039, 032, 110, 097, 109, 101,
044, 032, 108, 111, 103, 111, 044, 032, 111, 114, 032, 116, 114, 097, 100, 101, 109, 097, 114, 107,
115, 046, 013, 010, 047, 047, 032, 032, 032, 040, 066, 041, 032, 073, 102, 032, 121, 111, 117, 032,
098, 114, 105, 110, 103, 032, 097, 032, 112, 097, 116, 101, 110, 116, 032, 099, 108, 097, 105, 109,
032, 097, 103, 097, 105, 110, 115, 116, 032, 097, 110, 121, 032, 099, 111, 110, 116, 114, 105, 098,
117, 116, 111, 114, 032, 111, 118, 101, 114, 032, 112, 097, 116, 101, 110, 116, 115, 032, 116, 104,
097, 116, 032, 121, 111, 117, 032, 099, 108, 097, 105, 109, 032, 097, 114, 101, 032, 105, 110, 102,
114, 105, 110, 103, 101, 100, 032, 098, 121, 032, 116, 104, 101, 032, 115, 111, 102, 116, 119, 097,
114, 101, 044, 032, 121, 111, 117, 114, 032, 013, 010, 047, 047, 032, 032, 032, 032, 032, 032, 032,
112, 097, 116, 101, 110, 116, 032, 108, 105, 099, 101, 110, 115, 101, 032, 102, 114, 111, 109, 032,
115, 117, 099, 104, 032, 099, 111, 110, 116, 114, 105, 098, 117, 116, 111, 114, 032, 116, 111, 032,
116, 104, 101, 032, 115, 111, 102, 116, 119, 097, 114, 101, 032, 101, 110, 100, 115, 032, 097, 117,
116, 111, 109, 097, 116, 105, 099, 097, 108, 108, 121, 046, 013, 010, 047, 047, 032, 032, 032, 040,
067, 041, 032, 073, 102, 032, 121, 111, 117, 032, 100, 105, 115, 116, 114, 105, 098, 117, 116, 101,
032, 097, 110, 121, 032, 112, 111, 114, 116, 105, 111, 110, 032, 111, 102, 032, 116, 104, 101, 032,
115, 111, 102, 116, 119, 097, 114, 101, 044, 032, 121, 111, 117, 032, 109, 117, 115, 116, 032, 114,
101, 116, 097, 105, 110, 032, 097, 108, 108, 032, 099, 111, 112, 121, 114, 105, 103, 104, 116, 044,
032, 112, 097, 116, 101, 110, 116, 044, 032, 116, 114, 097, 100, 101, 109, 097, 114, 107, 044, 032,
097, 110, 100, 032, 097, 116, 116, 114, 105, 098, 117, 116, 105, 111, 110, 032, 013, 010, 047, 047,
032, 032, 032, 032, 032, 032, 032, 110, 111, 116, 105, 099, 101, 115, 032, 116, 104, 097, 116, 032,
097, 114, 101, 032, 112, 114, 101, 115, 101, 110, 116, 032, 105, 110, 032, 116, 104, 101, 032, 115,
111, 102, 116, 119, 097, 114, 101, 046, 013, 010, 047, 047, 032, 032, 032, 040, 068, 041, 032, 073,
102, 032, 121, 111, 117, 032, 100, 105, 115, 116, 114, 105, 098, 117, 116, 101, 032, 097, 110, 121,
032, 112, 111, 114, 116, 105, 111, 110, 032, 111, 102, 032, 116, 104, 101, 032, 115, 111, 102, 116,
119, 097, 114, 101, 032, 105, 110, 032, 115, 111, 117, 114, 099, 101, 032, 099, 111, 100, 101, 032,
102, 111, 114, 109, 044, 032, 121, 111, 117, 032, 109, 097, 121, 032, 100, 111, 032, 115, 111, 032,
111, 110, 108, 121, 032, 117, 110, 100, 101, 114, 032, 116, 104, 105, 115, 032, 108, 105, 099, 101,
110, 115, 101, 032, 098, 121, 032, 105, 110, 099, 108, 117, 100, 105, 110, 103, 013, 010, 047, 047,
032, 032, 032, 032, 032, 032, 032, 097, 032, 099, 111, 109, 112, 108, 101, 116, 101, 032, 099, 111,
112, 121, 032, 111, 102, 032, 116, 104, 105, 115, 032, 108, 105, 099, 101, 110, 115, 101, 032, 119,
105, 116, 104, 032, 121, 111, 117, 114, 032, 100, 105, 115, 116, 114, 105, 098, 117, 116, 105, 111,
110, 046, 032, 073, 102, 032, 121, 111, 117, 032, 100, 105, 115, 116, 114, 105, 098, 117, 116, 101,
032, 097, 110, 121, 032, 112, 111, 114, 116, 105, 111, 110, 032, 111, 102, 032, 116, 104, 101, 032,
115, 111, 102, 116, 119, 097, 114, 101, 032, 105, 110, 032, 099, 111, 109, 112, 105, 108, 101, 100,
032, 111, 114, 032, 013, 010, 047, 047, 032, 032, 032, 032, 032, 032, 032, 111, 098, 106, 101, 099,
116, 032, 099, 111, 100, 101, 032, 102, 111, 114, 109, 044, 032, 121, 111, 117, 032, 109, 097, 121,
032, 111, 110, 108, 121, 032, 100, 111, 032, 115, 111, 032, 117, 110, 100, 101, 114, 032, 097, 032,
108, 105, 099, 101, 110, 115, 101, 032, 116, 104, 097, 116, 032, 099, 111, 109, 112, 108, 105, 101,
115, 032, 119, 105, 116, 104, 032, 116, 104, 105, 115, 032, 108, 105, 099, 101, 110, 115, 101, 046,
013, 010, 047, 047, 032, 032, 032, 040, 069, 041, 032, 084, 104, 101, 032, 115, 111, 102, 116, 119,
097, 114, 101, 032, 105, 115, 032, 108, 105, 099, 101, 110, 115, 101, 100, 032, 034, 097, 115, 045,
105, 115, 046, 034, 032, 089, 111, 117, 032, 098, 101, 097, 114, 032, 116, 104, 101, 032, 114, 105,
115, 107, 032, 111, 102, 032, 117, 115, 105, 110, 103, 032, 105, 116, 046, 032, 084, 104, 101, 032,
099, 111, 110, 116, 114, 105, 098, 117, 116, 111, 114, 115, 032, 103, 105, 118, 101, 032, 110, 111,
032, 101, 120, 112, 114, 101, 115, 115, 032, 119, 097, 114, 114, 097, 110, 116, 105, 101, 115, 044,
032, 103, 117, 097, 114, 097, 110, 116, 101, 101, 115, 044, 013, 010, 047, 047, 032, 032, 032, 032,
032, 032, 032, 111, 114, 032, 099, 111, 110, 100, 105, 116, 105, 111, 110, 115, 046, 032, 089, 111,
117, 032, 109, 097, 121, 032, 104, 097, 118, 101, 032, 097, 100, 100, 105, 116, 105, 111, 110, 097,
108, 032, 099, 111, 110, 115, 117, 109, 101, 114, 032, 114, 105, 103, 104, 116, 115, 032, 117, 110,
100, 101, 114, 032, 121, 111, 117, 114, 032, 108, 111, 099, 097, 108, 032, 108, 097, 119, 115, 032,
119, 104, 105, 099, 104, 032, 116, 104, 105, 115, 032, 108, 105, 099, 101, 110, 115, 101, 032, 099,
097, 110, 110, 111, 116, 032, 099, 104, 097, 110, 103, 101, 046, 032, 084, 111, 032, 116, 104, 101,
013, 010, 047, 047, 032, 032, 032, 032, 032, 032, 032, 101, 120, 116, 101, 110, 116, 032, 112, 101,
114, 109, 105, 116, 116, 101, 100, 032, 117, 110, 100, 101, 114, 032, 121, 111, 117, 114, 032, 108,
111, 099, 097, 108, 032, 108, 097, 119, 115, 044, 032, 116, 104, 101, 032, 099, 111, 110, 116, 114,
105, 098, 117, 116, 111, 114, 115, 032, 101, 120, 099, 108, 117, 100, 101, 032, 116, 104, 101, 032,
105, 109, 112, 108, 105, 101, 100, 032, 119, 097, 114, 114, 097, 110, 116, 105, 101, 115, 032, 111,
102, 032, 109, 101, 114, 099, 104, 097, 110, 116, 097, 098, 105, 108, 105, 116, 121, 044, 032, 102,
105, 116, 110, 101, 115, 115, 032, 102, 111, 114, 032, 097, 032, 013, 010, 047, 047, 032, 032, 032,
032, 032, 032, 032, 112, 097, 114, 116, 105, 099, 117, 108, 097, 114, 032, 112, 117, 114, 112, 111,
115, 101, 032, 097, 110, 100, 032, 110, 111, 110, 045, 105, 110, 102, 114, 105, 110, 103, 101, 109,
101, 110, 116, 046, 013, 010, 013, 010, 117, 110, 105, 102, 111, 114, 109, 032, 109, 097, 116, 052,
032, 077, 097, 116, 114, 105, 120, 084, 114, 097, 110, 115, 102, 111, 114, 109, 059, 013, 010, 013,
010, 047, 047, 084, 079, 068, 079, 058, 032, 114, 101, 119, 114, 105, 116, 101, 032, 116, 111, 032,
071, 076, 083, 076, 032, 102, 114, 111, 109, 032, 104, 101, 114, 101, 032, 111, 110, 013, 010, 084,
101, 120, 116, 117, 114, 101, 050, 068, 060, 102, 108, 111, 097, 116, 052, 062, 032, 084, 101, 120,
116, 117, 114, 101, 032, 058, 032, 114, 101, 103, 105, 115, 116, 101, 114, 040, 116, 048, 041, 059,
013, 010, 032, 032, 032, 115, 097, 109, 112, 108, 101, 114, 032, 084, 101, 120, 116, 117, 114, 101,
083, 097, 109, 112, 108, 101, 114, 032, 058, 032, 114, 101, 103, 105, 115, 116, 101, 114, 040, 115,
048, 041, 059, 013, 010, 013, 010, 115, 116, 114, 117, 099, 116, 032, 086, 101, 114, 116, 101, 120,
083, 104, 097, 100, 101, 114, 073, 110, 112, 117, 116, 013, 010, 123, 013, 010, 009, 102, 108, 111,
097, 116, 052, 032, 112, 111, 115, 032, 058, 032, 080, 079, 083, 073, 084, 073, 079, 078, 059, 013,
010, 009, 102, 108, 111, 097, 116, 052, 032, 099, 111, 108, 032, 058, 032, 067, 079, 076, 079, 082,
059, 013, 010, 009, 102, 108, 111, 097, 116, 050, 032, 116, 101, 120, 032, 058, 032, 084, 069, 088,
067, 079, 079, 082, 068, 048, 059, 013, 010, 125, 059, 013, 010, 013, 010, 115, 116, 114, 117, 099,
116, 032, 080, 105, 120, 101, 108, 083, 104, 097, 100, 101, 114, 073, 110, 112, 117, 116, 013, 010,
123, 013, 010, 009, 102, 108, 111, 097, 116, 052, 032, 112, 111, 115, 032, 058, 032, 083, 086, 095,
080, 079, 083, 073, 084, 073, 079, 078, 059, 013, 010, 009, 102, 108, 111, 097, 116, 052, 032, 099,
111, 108, 032, 058, 032, 067, 079, 076, 079, 082, 059, 013, 010, 009, 102, 108, 111, 097, 116, 050,
032, 116, 101, 120, 032, 058, 032, 084, 069, 088, 067, 079, 079, 082, 068, 048, 059, 013, 010, 125,
059, 013, 010, 013, 010, 080, 105, 120, 101, 108, 083, 104, 097, 100, 101, 114, 073, 110, 112, 117,
116, 032, 083, 112, 114, 105, 116, 101, 086, 101, 114, 116, 101, 120, 083, 104, 097, 100, 101, 114,
040, 032, 086, 101, 114, 116, 101, 120, 083, 104, 097, 100, 101, 114, 073, 110, 112, 117, 116, 032,
105, 110, 112, 117, 116, 032, 041, 013, 010, 123, 013, 010, 009, 080, 105, 120, 101, 108, 083, 104,
097, 100, 101, 114, 073, 110, 112, 117, 116, 032, 111, 117, 116, 112, 117, 116, 032, 061, 032, 040,
080, 105, 120, 101, 108, 083, 104, 097, 100, 101, 114, 073, 110, 112, 117, 116, 041, 048, 059, 013,
010, 009, 013, 010, 009, 111, 117, 116, 112, 117, 116, 046, 112, 111, 115, 032, 061, 032, 109, 117,
108, 040, 105, 110, 112, 117, 116, 046, 112, 111, 115, 044, 032, 077, 097, 116, 114, 105, 120, 084,
114, 097, 110, 115, 102, 111, 114, 109, 041, 059, 013, 010, 009, 111, 117, 116, 112, 117, 116, 046,
099, 111, 108, 032, 061, 032, 105, 110, 112, 117, 116, 046, 099, 111, 108, 059, 013, 010, 009, 111,
117, 116, 112, 117, 116, 046, 116, 101, 120, 032, 061, 032, 105, 110, 112, 117, 116, 046, 116, 101,
120, 059, 013, 010, 013, 010, 009, 114, 101, 116, 117, 114, 110, 032, 111, 117, 116, 112, 117, 116,
059, 013, 010, 125, 013, 010, 013, 010, 102, 108, 111, 097, 116, 052, 032, 083, 112, 114, 105, 116,
101, 080, 105, 120, 101, 108, 083, 104, 097, 100, 101, 114, 040, 032, 080, 105, 120, 101, 108, 083,
104, 097, 100, 101, 114, 073, 110, 112, 117, 116, 032, 105, 110, 112, 117, 116, 032, 041, 032, 058,
032, 083, 086, 095, 084, 097, 114, 103, 101, 116, 013, 010, 123, 013, 010, 009, 114, 101, 116, 117,
114, 110, 032, 084, 101, 120, 116, 117, 114, 101, 046, 083, 097, 109, 112, 108, 101, 040, 084, 101,
120, 116, 117, 114, 101, 083, 097, 109, 112, 108, 101, 114, 044, 032, 105, 110, 112, 117, 116, 046,
116, 101, 120, 041, 032, 042, 032, 105, 110, 112, 117, 116, 046, 099, 111, 108, 059, 013, 010, 125,
013, 010, 013, 010, 116, 101, 099, 104, 110, 105, 113, 117, 101, 049, 048, 032, 083, 112, 114, 105,
116, 101, 084, 101, 099, 104, 110, 105, 113, 117, 101, 013, 010, 123, 013, 010, 009, 112, 097, 115,
115, 032, 083, 112, 114, 105, 116, 101, 067, 111, 108, 111, 114, 080, 097, 115, 115, 013, 010, 009,
123, 013, 010, 009, 009, 083, 101, 116, 071, 101, 111, 109, 101, 116, 114, 121, 083, 104, 097, 100,
101, 114, 040, 032, 048, 032, 041, 059, 013, 010, 009, 009, 083, 101, 116, 086, 101, 114, 116, 101,
120, 083, 104, 097, 100, 101, 114, 040, 032, 067, 111, 109, 112, 105, 108, 101, 083, 104, 097, 100,
101, 114, 040, 032, 118, 115, 095, 052, 095, 048, 044, 032, 083, 112, 114, 105, 116, 101, 086, 101,
114, 116, 101, 120, 083, 104, 097, 100, 101, 114, 040, 041, 032, 041, 032, 041, 059, 013, 010, 009,
009, 083, 101, 116, 080, 105, 120, 101, 108, 083, 104, 097, 100, 101, 114, 040, 032, 067, 111, 109,
112, 105, 108, 101, 083, 104, 097, 100, 101, 114, 040, 032, 112, 115, 095, 052, 095, 048, 044, 032,
083, 112, 114, 105, 116, 101, 080, 105, 120, 101, 108, 083, 104, 097, 100, 101, 114, 040, 041, 032,
041, 032, 041, 059, 013, 010, 009, 125, 013, 010, 125, 013, 010
};
#endregion //SpriteBatchShader
}
}

View File

@ -58,6 +58,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GL3", "GL3", "{E4FFD875-95FC-48F2-8B6D-8483D0B71666}"
ProjectSection(SolutionItems) = preProject
shader\GL3\build.xml = shader\GL3\build.xml
shader\GL3\SpriteBatch_GLSL.fx = shader\GL3\SpriteBatch_GLSL.fx
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StockShaderCodeGenerator", "Tools\StockShaderCodeGenerator\StockShaderCodeGenerator.csproj", "{D73E5FF4-AE88-4637-8159-120FBDA564BF}"

View File

@ -46,14 +46,6 @@
<ProcessorParameters_OutputFormat>DX10_HLSL</ProcessorParameters_OutputFormat>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Effects\SpriteEffect.fx">
<Name>SpriteEffect</Name>
<Importer>EffectImporter</Importer>
<Processor>AnxEffectProcessor</Processor>
<ProcessorParameters_OutputFormat>DX10_HLSL</ProcessorParameters_OutputFormat>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Textures\DotWhiteTopLeft5x5.png">
<Name>DotWhiteTopLeft5x5</Name>
@ -84,14 +76,6 @@
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Effects\SpriteEffect_GLSL.fx">
<Name>SpriteEffect_GLSL</Name>
<Importer>EffectImporter</Importer>
<Processor>AnxEffectProcessor</Processor>
<ProcessorParameters_OutputFormat>OPEN_GL3_GLSL</ProcessorParameters_OutputFormat>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -0,0 +1,126 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.Windows.DX10;
using System.IO;
#endregion // Using Statements
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
// This file is released under the Ms-PL license.
//
//
//
// Microsoft Public License (Ms-PL)
//
// This license governs use of the accompanying software. If you use the software, you accept this license.
// If you do not accept the license, do not use the software.
//
// 1.Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
// here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//
// 2.Grant of Rights
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
// or any derivative works that you create.
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
// in the software or derivative works of the contribution in the software.
//
// 3.Conditions and Limitations
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
// patent license from such contributor to the software ends automatically.
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
// notices that are present in the software.
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
// object code form, you may only do so under a license that complies with this license.
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
#endregion // License
namespace StockShaderCodeGenerator
{
public static class CodeGenerator
{
public static void Generate()
{
Console.WriteLine("generating output...");
using (StreamWriter target = new StreamWriter(Configuration.Target, false))
{
//
// write header
//
target.WriteLine("#region Using Statements");
target.WriteLine("using System;");
target.WriteLine("#endregion // Using Statements");
target.WriteLine();
target.WriteLine("#region License");
foreach (string line in System.IO.File.ReadAllLines(Configuration.LicenseFile))
{
target.WriteLine(line);
}
target.WriteLine("#endregion // License");
target.WriteLine();
target.WriteLine("namespace {0}", Configuration.Namespace);
target.WriteLine("{");
target.WriteLine("\tinternal static class ShaderByteCode");
target.WriteLine("\t{");
for (int i = 0; i < Configuration.Shaders.Count; i++)
{
Shader s = Configuration.Shaders[i];
target.WriteLine("\t\t#region {0}Shader", s.Type);
target.WriteLine("\t\tinternal static byte[] {0}ByteCode = new byte[]", s.Type);
target.WriteLine("\t\t{");
target.Write("\t\t\t");
for (int j = 0; j < s.ByteCode.Length; j++)
{
target.Write(s.ByteCode[j].ToString("D3"));
if (j < s.ByteCode.Length - 1)
{
target.Write(", ");
}
if (j % 20 == 0)
{
target.WriteLine();
target.Write("\t\t\t");
}
}
target.WriteLine();
target.WriteLine("\t\t};");
target.WriteLine("\t\t#endregion //{0}Shader", s.Type);
target.WriteLine();
}
target.WriteLine("\t}");
target.WriteLine("}");
}
Console.WriteLine("finished generating output...");
}
}
}

View File

@ -0,0 +1,115 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.Windows.DX10;
using ANX.Framework.Windows.GL3;
#endregion // Using Statements
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
// This file is released under the Ms-PL license.
//
//
//
// Microsoft Public License (Ms-PL)
//
// This license governs use of the accompanying software. If you use the software, you accept this license.
// If you do not accept the license, do not use the software.
//
// 1.Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
// here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//
// 2.Grant of Rights
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
// or any derivative works that you create.
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
// in the software or derivative works of the contribution in the software.
//
// 3.Conditions and Limitations
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
// patent license from such contributor to the software ends automatically.
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
// notices that are present in the software.
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
// object code form, you may only do so under a license that complies with this license.
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
#endregion // License
namespace StockShaderCodeGenerator
{
public static class Compiler
{
public static void GenerateShaders()
{
Console.WriteLine("generating shaders...");
for (int i = 0; i < Configuration.Shaders.Count; i++)
{
Shader s = Configuration.Shaders[i];
Console.WriteLine("-> loading shader for type '{0}' (file: '{1}')", s.Type, s.Source);
String source = String.Empty;
if (System.IO.File.Exists(s.Source))
{
source = System.IO.File.ReadAllText(s.Source);
}
Console.Write("--> compiling shader... ");
try
{
s.ByteCode = CompileShader(s.RenderSystem, source);
Console.WriteLine("{0} bytes compiled size", s.ByteCode.Length);
s.ShaderCompiled = true;
}
catch (Exception ex)
{
s.ShaderCompiled = false;
Console.WriteLine("--> error occured while compiling shader: {0}", ex.Message);
}
Configuration.Shaders[i] = s;
}
Console.WriteLine("finished generating shaders...");
}
private static Byte[] CompileShader(string RenderSystem, string sourceCode)
{
byte[] byteCode;
switch (RenderSystem)
{
case "ANX.Framework.Windows.DX10":
byteCode = Effect_DX10.CompileFXShader(sourceCode);
break;
case "ANX.Framework.Windows.GL3":
byteCode = EffectGL3.CompileShader(sourceCode);
break;
default:
throw new NotImplementedException("compiling shaders for " + RenderSystem + " not yet implemented...");
}
return byteCode;
}
}
}

View File

@ -0,0 +1,165 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
#endregion // Using Statements
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
// This file is released under the Ms-PL license.
//
//
//
// Microsoft Public License (Ms-PL)
//
// This license governs use of the accompanying software. If you use the software, you accept this license.
// If you do not accept the license, do not use the software.
//
// 1.Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
// here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//
// 2.Grant of Rights
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
// or any derivative works that you create.
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
// in the software or derivative works of the contribution in the software.
//
// 3.Conditions and Limitations
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
// patent license from such contributor to the software ends automatically.
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
// notices that are present in the software.
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
// object code form, you may only do so under a license that complies with this license.
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
#endregion // License
namespace StockShaderCodeGenerator
{
public static class Configuration
{
private static string buildFileName;
private static bool configurationValid;
private static string licenseFile;
private static string target;
private static string outputNamespace;
public readonly static List<Shader> Shaders = new List<Shader>();
public static void LoadConfiguration(String file)
{
buildFileName = file;
if (!System.IO.File.Exists(file))
{
Console.WriteLine("Could not find build file...");
return;
}
XDocument doc = XDocument.Load(buildFileName);
if (doc.Root.Name.LocalName != "Build")
{
Console.WriteLine("Failed to load configuration because the build file has no Build-Node as the root element!");
return;
}
else
{
if (doc.Root.HasAttributes)
{
licenseFile = doc.Root.Attribute("License").Value;
if (System.IO.File.Exists(licenseFile))
{
Console.WriteLine("using license file '{0}' to include", licenseFile);
}
else
{
Console.WriteLine("license file '{0}' does not exist", licenseFile);
return;
}
target = doc.Root.Attribute("Target").Value;
Console.WriteLine("writing output to '{0}'", target);
outputNamespace = doc.Root.Attribute("Namespace").Value;
Console.WriteLine("using namespace '{0}'", outputNamespace);
}
if (doc.Root.HasElements)
{
XElement[] shaderElements = doc.Root.Elements("Shader").ToArray<XElement>();
if (shaderElements.Length > 0)
{
foreach (XElement shaderElement in shaderElements)
{
Shader shader = new Shader();
shader.Type = shaderElement.Attribute("Type").Value;
shader.RenderSystem = shaderElement.Attribute("RenderSystem").Value;
shader.Source = shaderElement.Attribute("Source").Value;
Shaders.Add(shader);
}
}
else
{
Console.WriteLine("no shader tags found in configuration file...");
return;
}
}
}
configurationValid = true;
}
public static bool ConfigurationValid
{
get
{
return configurationValid;
}
}
public static string Target
{
get
{
return target;
}
}
public static string LicenseFile
{
get
{
return licenseFile;
}
}
public static string Namespace
{
get
{
return outputNamespace;
}
}
}
}

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
#endregion // Private Members
@ -59,8 +60,36 @@ namespace StockShaderCodeGenerator
{
static void Main(string[] args)
{
Console.WriteLine(System.IO.Path.GetFullPath("/"));
Console.ReadLine();
Console.WriteLine("ANX.Framework StockShaderCodeGenerator (sscg) Version " + Assembly.GetExecutingAssembly().GetName().Version);
string buildFile;
if (args.Length < 1)
{
Console.WriteLine("No command line arguments provided. Trying to load build.xml from current directory.");
buildFile = "build.xml";
}
else
{
buildFile = args[0];
}
Console.WriteLine("Creating configuration using '{0}' configuration file.", buildFile);
Configuration.LoadConfiguration(buildFile);
if (Configuration.ConfigurationValid)
{
Compiler.GenerateShaders();
}
CodeGenerator.Generate();
//#if DEBUG
// Console.WriteLine("Press enter to exit.");
// Console.ReadLine();
//#endif
}
}
}

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("0.7.1.*")]
[assembly: AssemblyFileVersion("0.7.1.0")]

View File

@ -1,3 +1,10 @@
#region Using Statements
using System;
#endregion // Using Statements
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
@ -41,47 +48,16 @@
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
uniform extern float4x4 MatrixTransform;
#endregion // License
Texture2D<float4> Texture : register(t0);
sampler TextureSampler : register(s0);
struct VertexShaderInput
namespace StockShaderCodeGenerator
{
float4 pos : POSITION;
float4 col : COLOR;
float2 tex : TEXCOORD0;
};
struct PixelShaderInput
{
float4 pos : SV_POSITION;
float4 col : COLOR;
float2 tex : TEXCOORD0;
};
PixelShaderInput SpriteVertexShader( VertexShaderInput input )
{
PixelShaderInput output = (PixelShaderInput)0;
output.pos = mul(input.pos, MatrixTransform);
output.col = input.col;
output.tex = input.tex;
return output;
}
float4 SpritePixelShader( PixelShaderInput input ) : SV_Target
{
return Texture.Sample(TextureSampler, input.tex) * input.col;
}
technique10 SpriteTechnique
{
pass SpriteColorPass
{
SetGeometryShader( 0 );
SetVertexShader( CompileShader( vs_4_0, SpriteVertexShader() ) );
SetPixelShader( CompileShader( ps_4_0, SpritePixelShader() ) );
}
public struct Shader
{
public string Type;
public string Source;
public string RenderSystem;
public bool ShaderCompiled;
public byte[] ByteCode;
}
}

View File

@ -43,8 +43,26 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration.cs" />
<Compile Include="Compiler.cs" />
<Compile Include="CodeGenerator.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Shader.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
<Name>ANX.Framework.Windows.DX10</Name>
</ProjectReference>
<ProjectReference Include="..\..\ANX.Framework.Windows.GL3\ANX.Framework.Windows.GL3.csproj">
<Project>{EB8258E0-6741-4DB9-B756-1EBDF67B1ED6}</Project>
<Name>ANX.Framework.Windows.GL3</Name>
</ProjectReference>
<ProjectReference Include="..\..\ANX.Framework\ANX.Framework.csproj">
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
<Name>ANX.Framework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -0,0 +1,87 @@
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
// This file is released under the Ms-PL license.
//
//
//
// Microsoft Public License (Ms-PL)
//
// This license governs use of the accompanying software. If you use the software, you accept this license.
// If you do not accept the license, do not use the software.
//
// 1.Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
// here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//
// 2.Grant of Rights
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
// or any derivative works that you create.
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
// in the software or derivative works of the contribution in the software.
//
// 3.Conditions and Limitations
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
// patent license from such contributor to the software ends automatically.
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
// notices that are present in the software.
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
// object code form, you may only do so under a license that complies with this license.
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
uniform extern float4x4 MatrixTransform;
Texture2D<float4> Texture : register(t0);
sampler TextureSampler : register(s0);
struct VertexShaderInput
{
float4 pos : POSITION;
float4 col : COLOR;
float2 tex : TEXCOORD0;
};
struct PixelShaderInput
{
float4 pos : SV_POSITION;
float4 col : COLOR;
float2 tex : TEXCOORD0;
};
PixelShaderInput SpriteVertexShader( VertexShaderInput input )
{
PixelShaderInput output = (PixelShaderInput)0;
output.pos = mul(input.pos, MatrixTransform);
output.col = input.col;
output.tex = input.tex;
return output;
}
float4 SpritePixelShader( PixelShaderInput input ) : SV_Target
{
return Texture.Sample(TextureSampler, input.tex) * input.col;
}
technique10 SpriteTechnique
{
pass SpriteColorPass
{
SetGeometryShader( 0 );
SetVertexShader( CompileShader( vs_4_0, SpriteVertexShader() ) );
SetPixelShader( CompileShader( ps_4_0, SpritePixelShader() ) );
}
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<Build License="../../doc/license.txt"
Target="../../ANX.Framework.Windows.DX10/ShaderByteCode.cs"
Namespace="ANX.Framework.Windows.DX10">
<Shader Type="SpriteBatch"
Source="../../Shader/DX10/SpriteBatch.fx"
RenderSystem="ANX.Framework.Windows.DX10"
/>
</Build>

View File

@ -43,6 +43,7 @@
uniform mat4 MatrixTransform;
//TODO: rewrite to GLSL from here on
Texture2D<float4> Texture : register(t0);
sampler TextureSampler : register(s0);

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<Build License="../../doc/license.txt"
Target="../../ANX.Framework.Windows.GL3/ShaderByteCode.cs"
Namespace="ANX.Framework.Windows.GL3">
<Shader Type="SpriteBatch"
Source="../../Shader/GL3/SpriteBatch_GLSL.fx"
RenderSystem="ANX.Framework.Windows.GL3"
/>
</Build>