Browse Source

MAPPEDMEM

Nick Kastellanos 2 years ago
parent
commit
0bb22bcf55

+ 6 - 0
Aether.Extras.NET4.sln

@@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TilemapImporter.NET4", "Con
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Animation.NET4", "Animation\Aether.Animation.NET4.csproj", "{F08D6D4C-60FB-4543-8D81-594080EB8051}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Animation.NET4.DX", "Animation\Aether.Animation.NET4.DX.csproj", "{57903A6B-1576-4361-8F03-1D5F038A782A}"
+EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aether.Shaders", "Aether.Shaders", "{13D47E11-4A7C-49C8-942E-2543E9C0098A}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.NET4", "Shaders\FXAA\Aether.Shaders.FXAA.NET4.csproj", "{FBBDE2BA-F9F3-4041-8584-2C912C235E26}"
@@ -73,6 +75,10 @@ Global
 		{F08D6D4C-60FB-4543-8D81-594080EB8051}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{F08D6D4C-60FB-4543-8D81-594080EB8051}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F08D6D4C-60FB-4543-8D81-594080EB8051}.Release|Any CPU.Build.0 = Release|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Release|Any CPU.Build.0 = Release|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Release|Any CPU.ActiveCfg = Release|Any CPU

+ 81 - 0
Animation/Aether.Animation.NET4.DX.csproj

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{57903A6B-1576-4361-8F03-1D5F038A782A}</ProjectGuid>
+    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>nkast.Aether.Animation</RootNamespace>
+    <AssemblyName>Aether.Animation</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\Artifacts\Debug\net4.DX\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;WINDOWS MG MAPPEDMEM</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\Artifacts\Release\net4.DX\</OutputPath>
+    <DefineConstants>TRACE;WINDOWS MG MAPPEDMEM</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="mscorlib" />
+    <PackageReference Include="MonoGame.Framework.Portable.9000" Version="3.8.9101">
+      <PrivateAssets>all</PrivateAssets>
+      <ExcludeAssets>runtime</ExcludeAssets>
+    </PackageReference>
+    <PackageReference Include="SharpDX" Version="4.0.1.0">
+      <PrivateAssets>all</PrivateAssets>
+      <ExcludeAssets>runtime</ExcludeAssets>
+    </PackageReference>
+    <PackageReference Include="SharpDX.Direct3D11" Version="4.0.1.0">
+      <PrivateAssets>all</PrivateAssets>
+      <ExcludeAssets>runtime</ExcludeAssets>
+    </PackageReference>
+    <PackageReference Include="SharpDX.DXGI" Version="4.0.1.0">
+      <PrivateAssets>all</PrivateAssets>
+      <ExcludeAssets>runtime</ExcludeAssets>
+    </PackageReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Animation\Animations.cs" />
+    <Compile Include="Animation\Clip.cs" />
+    <Compile Include="Animation\CpuAnimatedVertexBuffer.Unsafe.cs" />
+    <Compile Include="Animation\Extensions.cs" />
+    <Compile Include="Animation\Keyframe.cs" />
+    <Compile Include="ContentReaders\AnimationsReader.cs" />
+    <Compile Include="ContentReaders\ClipReader.cs" />
+    <Compile Include="ContentReaders\CpuAnimatedVertexBufferReader.cs" />
+    <Compile Include="Graphics\VertexTypes\VertexIndicesWeightsPositionNormal.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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.
+      <Target Name="BeforeBuild">
+      </Target>
+      <Target Name="AfterBuild">
+      </Target>
+    -->
+</Project>

+ 5 - 17
Animation/Aether.Animation.NET4.csproj

@@ -19,7 +19,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>..\Artifacts\Debug\net4\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;WINDOWS MG MAPPEDMEM</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;WINDOWS MG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <Prefer32Bit>false</Prefer32Bit>
@@ -29,32 +29,20 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>..\Artifacts\Release\net4\</OutputPath>
-    <DefineConstants>TRACE;WINDOWS MG MAPPEDMEM</DefineConstants>
+    <DefineConstants>TRACE;WINDOWS MG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <Prefer32Bit>false</Prefer32Bit>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="mscorlib" />
     <PackageReference Include="MonoGame.Framework.Portable.9000" Version="3.8.9101">
       <PrivateAssets>all</PrivateAssets>
       <ExcludeAssets>runtime</ExcludeAssets>
     </PackageReference>
-    <PackageReference Include="SharpDX" Version="4.0.1.0">
-      <PrivateAssets>all</PrivateAssets>
-      <ExcludeAssets>runtime</ExcludeAssets>
-    </PackageReference>
-    <PackageReference Include="SharpDX.Direct3D11"  Version="4.0.1.0">
-      <PrivateAssets>all</PrivateAssets>
-      <ExcludeAssets>runtime</ExcludeAssets>
-    </PackageReference>
-    <PackageReference Include="SharpDX.DXGI"  Version="4.0.1.0">
-      <PrivateAssets>all</PrivateAssets>
-      <ExcludeAssets>runtime</ExcludeAssets>
-    </PackageReference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="mscorlib" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Animation\Animations.cs" />

+ 2 - 2
Animation/Animation/CpuAnimatedVertexBuffer.Unsafe.cs

@@ -83,7 +83,7 @@ namespace nkast.Aether.Animation
             int vertexStride = VertexPositionNormalTexture.VertexDeclaration.VertexStride;
             int offsetInBytes = startIndex * vertexStride;
             SetData(offsetInBytes, _gpuVertices, startIndex, elementCount, vertexStride, SetDataOptions.NoOverwrite);
-#endif
+            #endif
         }
 
         private unsafe void InnerUpdateVertices(VertexPositionNormalTexture* pgpuVertices, Matrix[] boneTransforms, int startIndex, int elementCount)
@@ -92,7 +92,7 @@ namespace nkast.Aether.Animation
             {   
                 #if USE_NATIVE_ANIMATION
                 _cpuVertexBufferHelper.UpdateVertices((long)pBoneTransforms, (long)pgpuVertices, startIndex, elementCount);
-#else
+                #else
                 fixed (VertexIndicesWeightsPositionNormal* pcpuVertices = _cpuVertices)
                 {
                     Matrix transformSum = Matrix.Identity;

+ 6 - 0
Samples.WINDOWS.sln

@@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TilemapImporter.NET4", "Con
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Animation.NET4", "Animation\Aether.Animation.NET4.csproj", "{F08D6D4C-60FB-4543-8D81-594080EB8051}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Animation.NET4.DX", "Animation\Aether.Animation.NET4.DX.csproj", "{57903A6B-1576-4361-8F03-1D5F038A782A}"
+EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aether.Shaders", "Aether.Shaders", "{13D47E11-4A7C-49C8-942E-2543E9C0098A}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aether.Shaders.FXAA.NET4", "Shaders\FXAA\Aether.Shaders.FXAA.NET4.csproj", "{FBBDE2BA-F9F3-4041-8584-2C912C235E26}"
@@ -91,6 +93,10 @@ Global
 		{F08D6D4C-60FB-4543-8D81-594080EB8051}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{F08D6D4C-60FB-4543-8D81-594080EB8051}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F08D6D4C-60FB-4543-8D81-594080EB8051}.Release|Any CPU.Build.0 = Release|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{57903A6B-1576-4361-8F03-1D5F038A782A}.Release|Any CPU.Build.0 = Release|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{FBBDE2BA-F9F3-4041-8584-2C912C235E26}.Release|Any CPU.ActiveCfg = Release|Any CPU

+ 2 - 2
Samples/Animation/Game1.cs

@@ -11,8 +11,8 @@ namespace Samples.Animation
 {
     enum DrawMode : int
     {
-        CPU,
         GPU,
+        CPU,
     }
 
     public class Game1 : Microsoft.Xna.Framework.Game
@@ -25,7 +25,7 @@ namespace Samples.Animation
         Model _model_CPU;
         Model _model_GPU;
         Animations _animations;
-        DrawMode drawMode = DrawMode.CPU;
+        DrawMode drawMode = DrawMode.GPU;
 
         KeyboardState prevKeyboardState;
 

+ 3 - 3
Samples/Animation/Samples.Animation.WINDOWS.csproj

@@ -64,9 +64,9 @@
     <None Include="app.manifest" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\Animation\Aether.Animation.NET4.csproj">
-      <Project>{f08d6d4c-60fb-4543-8d81-594080eb8051}</Project>
-      <Name>Aether.Animation.NET4</Name>
+    <ProjectReference Include="..\..\Animation\Aether.Animation.NET4.DX.csproj">
+      <Project>{57903a6b-1576-4361-8f03-1d5f038a782a}</Project>
+      <Name>Aether.Animation.NET4.DX</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\Shaders\InfiniteGrid\Aether.Shaders.InfiniteGrid.NET4.csproj">
       <Project>{08296a2e-becf-4db9-a518-8a613d07b80e}</Project>