port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DE4D6FE6-D1FB-41A1-8ABA-19635B8FFD7A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Aiwaz.Contracts</RootNamespace>
<AssemblyName>Aiwaz.Contracts</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="SlimDX, Version=2.0.8.42, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Extern\SlimDX\x86\SlimDX.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resource.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="EngineStates.cs" />
<Compile Include="IBone.cs" />
<Compile Include="ICamera.cs" />
<Compile Include="IGeometryBuffer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="IPickHull.cs" />
<Compile Include="IRenderTargetBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="IResource.cs" />
<Compile Include="IShader.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="IShaderParameterCollection.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ISwapChain.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ITexture.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ITransformationAnimation.cs" />
<Compile Include="IUpdatable.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Reference.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>

View File

@@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,10 @@
namespace Aiwaz.Contracts
{
public class EngineStates
{
public IShader LastShader;
public IRenderTargetBase LastRenderTarget;
public IGeometryBuffer LastVertexBufferProvider;
public IGeometryBuffer LastIndexBufferProvider;
};
}

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using SlimDX;
namespace Aiwaz.Contracts
{
public interface IBone
{
Matrix GetTransformationAtTime(float time, Matrix rootTransformationMatrix);
Dictionary<int, IBone> BoneIndexList { get; }
List<IBone> ChildBones { get; }
int Index { get; }
Matrix[] MatrixArray { get; }
string Name { get; }
Matrix PoseTransformation { get; }
IBone Parent { get; set; }
ITransformationAnimation TransformationAnimation { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using SlimDX;
namespace Aiwaz.Contracts
{
public class ViewFrustum
{
public Plane[] Plane = new Plane[6];
};
public interface ICamera
{
Matrix ProjectionMatrix { get; }
Matrix ViewMatrix { get; }
float FarClip { get; set; }
float NearClip { get; set; }
ViewFrustum ViewFrustum { get; }
};
public interface IPerspectiveCamera
{
float Fov { get; set; }
float AspectRatio { get; set; }
};
public interface IOrthographicCamera
{
float Width { get; set; }
float Height { get; set; }
};
}

View File

@@ -0,0 +1,158 @@
using System;
using System.Collections.Generic;
namespace Aiwaz.Contracts
{
public struct VertexElement
{
public enum Format
{
Position,
PositionT,
Normal,
Binormal,
Tangent,
Color,
BlendWeight,
BlendIndices,
Texture2D,
Texture3D,
Texture4D,
PointSize
};
public VertexElement(Format argFormat)
: this(argFormat, 0)
{
}
public VertexElement(Format argFormat, int argNameIndex)
{
NameIndex = argNameIndex;
WellKnownFormat = argFormat;
switch (argFormat)
{
case Format.PositionT:
{
SemanticName = "POSITIONT";
ElementFormat = SlimDX.DXGI.Format.R32G32B32A32_Float;
Size = 4 * sizeof(float);
break;
}
case Format.Normal:
{
SemanticName = "NORMAL";
ElementFormat = SlimDX.DXGI.Format.R32G32B32_Float;
Size = 3 * sizeof(float);
break;
}
case Format.Binormal:
{
SemanticName = "BINORMAL";
ElementFormat = SlimDX.DXGI.Format.R32G32B32_Float;
Size = 3 * sizeof(float);
break;
}
case Format.Tangent:
{
SemanticName = "TANGENT";
ElementFormat = SlimDX.DXGI.Format.R32G32B32_Float;
Size = 3 * sizeof(float);
break;
}
case Format.Color:
{
SemanticName = "COLOR";
ElementFormat = SlimDX.DXGI.Format.R8G8B8A8_UNorm;
Size = 4 * sizeof(byte);
break;
}
case Format.BlendWeight:
{
SemanticName = "BLENDWEIGHT";
ElementFormat = SlimDX.DXGI.Format.R32G32B32A32_Float;
Size = 4 * sizeof(float);
break;
}
case Format.BlendIndices:
{
SemanticName = "BLENDINDICES";
ElementFormat = SlimDX.DXGI.Format.R32G32B32A32_SInt;
Size = 4 * sizeof(int);
break;
}
case Format.Texture2D:
{
SemanticName = "TEXCOORD";
ElementFormat = SlimDX.DXGI.Format.R32G32_Float;
Size = 2 * sizeof(float);
break;
}
case Format.Texture3D:
{
SemanticName = "TEXCOORD";
ElementFormat = SlimDX.DXGI.Format.R32G32B32_Float;
Size = 3 * sizeof(float);
break;
}
case Format.Texture4D:
{
SemanticName = "TEXCOORD";
ElementFormat = SlimDX.DXGI.Format.R32G32B32A32_Float;
Size = 4 * sizeof(float);
break;
}
case Format.PointSize:
{
SemanticName = "PSIZE";
ElementFormat = SlimDX.DXGI.Format.R32_Float;
Size = 1 * sizeof(float);
break;
}
case Format.Position:
default:
{
SemanticName = "POSITION";
ElementFormat = SlimDX.DXGI.Format.R32G32B32_Float;
Size = 3 * sizeof(float);
break;
}
}
}
public string SemanticName;
public SlimDX.DXGI.Format ElementFormat;
public Format WellKnownFormat;
public int NameIndex;
public int Size;
};
public interface IGeometryBuffer
{
void ConvertToAdjacency();
void DeleteIndexData();
void DeleteVertexData();
int IndexBufferLength { get; }
int IndexBufferOffset { get; set; }
int IndexBufferUsableLength { get; set; }
void SetIndexData(IEnumerable<uint> argIndexData, bool argNeedsDynamicAccess);
void SetIndexData(int argIndexCount, SlimDX.DataStream argIndexData, bool argNeedsDynamicAccess);
void SetVertexData<TVertex>(IEnumerable<TVertex> argVertexData, VertexElement[] argVertexElements, bool argNeedsDynamicAccess) where TVertex : struct;
void SetVertexData(int argVertexCount, SlimDX.DataStream argVertexData, VertexElement[] argVertexElements, bool argNeedsDynamicAccess);
SlimDX.DataStream MapIndexBufferRaw(SlimDX.Direct3D10.MapMode argAccessMode);
uint[] MapIndexBuffer(SlimDX.Direct3D10.MapMode argAccessMode);
SlimDX.DataStream MapVertexBufferRaw(SlimDX.Direct3D10.MapMode argAccessMode);
TVertex[] MapVertexBuffer<TVertex>(SlimDX.Direct3D10.MapMode argAccessMode) where TVertex : struct;
void UnmapIndexBuffer();
void UnmapVertexBuffer();
SlimDX.Direct3D10.PrimitiveTopology PrimitiveTopology { get; set; }
int VertexBufferLength { get; }
bool IsPickable { get; set; }
IPickHull PickHull { get; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SlimDX;
namespace Aiwaz.Contracts
{
public interface IPickHull
{
bool TryPick(Ray pickRay, Matrix worldMatrix, out float distance);
BoundingSphere CalcBoundingSphere(Matrix worldMatrix);
BoundingBox CalcBoundingBox(Matrix worldMatrix);
}
}

View File

@@ -0,0 +1,60 @@
using SlimDX;
using SlimDX.Direct3D10;
namespace Aiwaz.Contracts
{
public class ViewPort
{
public ViewPort()
{
MaxDepth = 1.0f;
}
public int TopLeftX;
public int TopLeftY;
public int Width;
public int Height;
public float MinDepth;
public float MaxDepth;
public static implicit operator SlimDX.Direct3D10.Viewport(ViewPort vp)
{
return new SlimDX.Direct3D10.Viewport(vp.TopLeftX, vp.TopLeftY, vp.Width, vp.Height, vp.MinDepth, vp.MaxDepth);
}
};
public enum BindFlags
{
None = 0x000,
ClearDepthStencil = 0x001,
ClearColor = 0x002,
ClearAll = 0x00F,
BindAdditionalTexture0 = 0x010,
BindAdditionalTexture1 = 0x020,
BindAdditionalTexture2 = 0x040,
BindAdditionalTexture3 = 0x080,
BindBaseTexture = 0x100,
BindAllTextures = 0xFF0,
Default = ClearAll | BindAllTextures
};
public interface IRenderTargetBase
{
float ClearDepth { get; set; }
byte ClearStencil { get; set; }
Color4 ClearColor { get; set; }
ViewPort ViewPort { get; set; }
int RenderTargetWidth { get; }
int RenderTargetHeight { get; }
SlimDX.DXGI.Format RenderTargetFormat { get; }
bool HasDepthStencilBuffer { get; set; }
RenderTargetView DX10RenderTargetView { get; }
DepthStencilView DX10DepthStencilView { get; }
void AddAdditionalRenderTarget(IRenderTargetBase target);
void RemoveAdditionalRenderTarget(IRenderTargetBase target);
void Bind(BindFlags bindFlags);
void UnbindAllRenderTargets();
};
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
namespace Aiwaz.Contracts
{
public interface ICreationParams
{
}
public interface IResource
{
ICreationParams CreationParams { get; }
string WellKnownName { get; set; }
IResource Parent { get; set; }
ObservableCollection<IResource> Children { get; }
}
}

View File

@@ -0,0 +1,12 @@
using SlimDX.Direct3D10;
namespace Aiwaz.Contracts
{
public interface IShader
{
string TechniqueName { get; set; }
EffectTechnique Technique { get; }
byte Priority { get; set; }
int CurrentPass { get; }
Effect Effect { get; }
};
}

View File

@@ -0,0 +1,32 @@
using SlimDX.Direct3D10;
using SlimDX;
namespace Aiwaz.Contracts
{
public enum ParameterBindType
{
BindBySemantic,
BindByVariable
};
public interface IShaderParameter
{
ParameterBindType ParameterNameType { get; }
void ApplyValue(EffectVariable argVariable);
};
public interface IShaderParameterSet
{
bool IsPreconditionForFollowingShaders { get; set; }
void SetParameter(string argParameterName, IShaderParameter ar_Parameter_);
void SetParameter(string argParameterName, ITexture argParameter, ParameterBindType argParamNameType);
void SetParameter(string argParameterName, float argParameter, ParameterBindType argParamNameType);
void SetParameter(string argParameterName, Vector3 ar_Parameter_, ParameterBindType argParamNameType);
void SetParameter(string argParameterName, Vector4 ar_Parameter_, ParameterBindType argParamNameType);
void SetParameter(string argParameterName, Matrix argParameter, ParameterBindType argParamNameType);
void SetParameter(string argParameterName, bool argParameter, ParameterBindType argParamNameType);
void SetParameter(string argParameterName, Reference argParameter, ParameterBindType argParamNameType);
void RemoveParameter(string argParameterName);
};
}

View File

@@ -0,0 +1,11 @@
namespace Aiwaz.Contracts
{
public interface ISwapChain
{
void Resize(int argWidth, int argHeight);
void Present();
bool Fullscreen { get; set; }
bool VSync { get; set; }
}
}

View File

@@ -0,0 +1,82 @@
using SlimDX.Direct3D10;
namespace Aiwaz.Contracts
{
public struct LockedTextureData
{
public byte[] Data;
public int RowPitch;
};
public class TextureInitialData
{
public TextureInitialData(byte[] Data, int Pitch)
{
this.Data = Data;
this.Pitch = Pitch;
}
public byte[] Data;
public int Pitch;
};
public struct CreateTextureDescriptor
{
public int Width;
public int Height;
public int Elements;
public int MipLevels;
public SlimDX.DXGI.Format Format;
public ResourceUsage AccessType;
public TextureInitialData InitialData;
public static CreateTextureDescriptor AsSingleTexture(int Width, int Height, SlimDX.DXGI.Format Format, int MipLevels)
{
return AsSingleTexture(Width, Height, Format, MipLevels, null, ResourceUsage.Default);
}
public static CreateTextureDescriptor AsSingleTexture(int Width, int Height, SlimDX.DXGI.Format Format, int MipLevels, TextureInitialData InitialData, ResourceUsage AccessType)
{
CreateTextureDescriptor Desc = new CreateTextureDescriptor();
Desc.Width = Width;
Desc.Height = Height;
Desc.Elements = 0;
Desc.Format = Format;
Desc.AccessType = AccessType;
Desc.InitialData = InitialData;
Desc.MipLevels = MipLevels;
return Desc;
}
public static CreateTextureDescriptor AsArrayTexture(int Width, int Height, int Elements, SlimDX.DXGI.Format Format, int MipLevels, TextureInitialData InitialData)
{
CreateTextureDescriptor Desc = new CreateTextureDescriptor();
Desc.Width = Width;
Desc.Height = Height;
Desc.Elements = Elements;
Desc.Format = Format;
Desc.AccessType = ResourceUsage.Default;
Desc.InitialData = InitialData;
Desc.MipLevels = MipLevels;
return Desc;
}
};
public interface ITexture
{
string BindingName { get; set; }
int TextureWidth { get; }
int TextureHeight { get; }
int TextureArraySize { get; }
SlimDX.DXGI.Format TextureFormat { get; }
ShaderResourceView ResourceView { get; }
Texture2D Texture2D { get; }
SlimDX.DataRectangle MapTextureBuffer(MapMode mode);
SlimDX.DataRectangle MapTextureBuffer(MapMode mode, int arrayElement);
void UnmapTextureBuffer();
};
}

View File

@@ -0,0 +1,32 @@
using SlimDX;
namespace Aiwaz.Contracts
{
public enum KeyFrameTarget
{
Position = 0,
Rotation,
Scale
}
public struct KeyFrame
{
KeyFrame(KeyFrameTarget argTarget, Vector3 argValue, float argTime)
{
Target = argTarget;
Value = argValue;
Time = argTime;
}
KeyFrameTarget Target;
Vector3 Value;
float Time;
}
public interface ITransformationAnimation
{
float Duration { get; }
void AddKeyFrame(KeyFrame argKeyFrame);
Matrix GetTransformationAtTime(float argT); // [0.0] - [1.0]
};
}

View File

@@ -0,0 +1,8 @@
namespace Aiwaz.Contracts
{
public interface IUpdatable
{
void Update(bool argForceUpdate);
bool WantsUpdate { get; }
};
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Aiwaz.Contracts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Aiwaz.Contracts")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0413d7de-46a8-4b64-bdee-e4427bf03026")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,31 @@
namespace Aiwaz.Contracts
{
public class Reference
{
public Reference(object inValue)
{
this.RawValue = inValue;
}
public Reference()
{
}
public object RawValue { get; set; }
}
public class ReferenceT<T> : Reference
{
public ReferenceT(T inValue)
{
this.RawValue = inValue;
}
public ReferenceT()
{
}
public T Value { get { return (T)this.RawValue; } set { this.RawValue = value; } }
}
}

View File

@@ -0,0 +1,114 @@
namespace Aiwaz.Contracts
{
public class AiwazResourceAttribute : System.Attribute
{
public string Name { get; protected set;}
public string Description { get; protected set; }
public AiwazResourceAttribute(string name, string description)
{
this.Name = name;
this.Description = description;
}
}
public static class DataFormatByteSize
{
public static uint GetByteSize(this SlimDX.DXGI.Format argFormat)
{
switch (argFormat)
{
case SlimDX.DXGI.Format.Unknown: return 0;
case SlimDX.DXGI.Format.R32G32B32A32_Typeless: return 16;
case SlimDX.DXGI.Format.R32G32B32A32_Float: return 16;
case SlimDX.DXGI.Format.R32G32B32A32_UInt: return 16;
case SlimDX.DXGI.Format.R32G32B32A32_SInt: return 16;
case SlimDX.DXGI.Format.R32G32B32_Typeless: return 12;
case SlimDX.DXGI.Format.R32G32B32_Float: return 12;
case SlimDX.DXGI.Format.R32G32B32_UInt: return 12;
case SlimDX.DXGI.Format.R32G32B32_SInt: return 12;
case SlimDX.DXGI.Format.R16G16B16A16_Typeless: return 8;
case SlimDX.DXGI.Format.R16G16B16A16_Float: return 8;
case SlimDX.DXGI.Format.R16G16B16A16_UNorm: return 8;
case SlimDX.DXGI.Format.R16G16B16A16_UInt: return 8;
case SlimDX.DXGI.Format.R16G16B16A16_SNorm: return 8;
case SlimDX.DXGI.Format.R16G16B16A16_SInt: return 8;
case SlimDX.DXGI.Format.R32G32_Typeless: return 8;
case SlimDX.DXGI.Format.R32G32_Float: return 8;
case SlimDX.DXGI.Format.R32G32_UInt: return 8;
case SlimDX.DXGI.Format.R32G32_SInt: return 8;
case SlimDX.DXGI.Format.R32G8X24_Typeless: return 8;
case SlimDX.DXGI.Format.D32_Float_S8X24_UInt: return 8;
case SlimDX.DXGI.Format.R32_Float_X8X24_Typeless: return 8;
case SlimDX.DXGI.Format.X32_Typeless_G8X24_UInt: return 8;
case SlimDX.DXGI.Format.R10G10B10A2_Typeless: return 4;
case SlimDX.DXGI.Format.R10G10B10A2_UNorm: return 4;
case SlimDX.DXGI.Format.R10G10B10A2_UInt: return 4;
case SlimDX.DXGI.Format.R11G11B10_Float: return 4;
case SlimDX.DXGI.Format.R8G8B8A8_Typeless: return 4;
case SlimDX.DXGI.Format.R8G8B8A8_UNorm: return 4;
case SlimDX.DXGI.Format.R8G8B8A8_UNorm_SRGB: return 4;
case SlimDX.DXGI.Format.R8G8B8A8_UInt: return 4;
case SlimDX.DXGI.Format.R8G8B8A8_SNorm: return 4;
case SlimDX.DXGI.Format.R8G8B8A8_SInt: return 4;
case SlimDX.DXGI.Format.R16G16_Typeless: return 4;
case SlimDX.DXGI.Format.R16G16_Float: return 4;
case SlimDX.DXGI.Format.R16G16_UNorm: return 4;
case SlimDX.DXGI.Format.R16G16_UInt: return 4;
case SlimDX.DXGI.Format.R16G16_SNorm: return 4;
case SlimDX.DXGI.Format.R16G16_SInt: return 4;
case SlimDX.DXGI.Format.R32_Typeless: return 4;
case SlimDX.DXGI.Format.D32_Float: return 4;
case SlimDX.DXGI.Format.R32_Float: return 4;
case SlimDX.DXGI.Format.R32_UInt: return 4;
case SlimDX.DXGI.Format.R32_SInt: return 4;
case SlimDX.DXGI.Format.R24G8_Typeless: return 4;
case SlimDX.DXGI.Format.D24_UNorm_S8_UInt: return 4;
case SlimDX.DXGI.Format.R24_UNorm_X8_Typeless: return 4;
case SlimDX.DXGI.Format.X24_Typeless_G8_UInt: return 4;
case SlimDX.DXGI.Format.R8G8_Typeless: return 2;
case SlimDX.DXGI.Format.R8G8_UNorm: return 2;
case SlimDX.DXGI.Format.R8G8_UInt: return 2;
case SlimDX.DXGI.Format.R8G8_SNorm: return 2;
case SlimDX.DXGI.Format.R8G8_SInt: return 2;
case SlimDX.DXGI.Format.R16_Typeless: return 2;
case SlimDX.DXGI.Format.R16_Float: return 2;
case SlimDX.DXGI.Format.D16_UNorm: return 2;
case SlimDX.DXGI.Format.R16_UNorm: return 2;
case SlimDX.DXGI.Format.R16_UInt: return 2;
case SlimDX.DXGI.Format.R16_SNorm: return 2;
case SlimDX.DXGI.Format.R16_SInt: return 2;
case SlimDX.DXGI.Format.R8_Typeless: return 1;
case SlimDX.DXGI.Format.R8_UNorm: return 1;
case SlimDX.DXGI.Format.R8_UInt: return 1;
case SlimDX.DXGI.Format.R8_SNorm: return 1;
case SlimDX.DXGI.Format.R8_SInt: return 1;
case SlimDX.DXGI.Format.A8_UNorm: return 1;
case SlimDX.DXGI.Format.R1_UNorm: return 1;
case SlimDX.DXGI.Format.R9G9B9E5_SharedExp: return 4;
case SlimDX.DXGI.Format.R8G8_B8G8_UNorm: return 4;
case SlimDX.DXGI.Format.G8R8_G8B8_UNorm: return 4;
case SlimDX.DXGI.Format.BC1_Typeless: return 2;
case SlimDX.DXGI.Format.BC1_UNorm: return 2;
case SlimDX.DXGI.Format.BC1_UNorm_SRGB: return 2;
case SlimDX.DXGI.Format.BC2_Typeless: return 3;
case SlimDX.DXGI.Format.BC2_UNorm: return 3;
case SlimDX.DXGI.Format.BC2_UNorm_SRGB: return 3;
case SlimDX.DXGI.Format.BC3_Typeless: return 4;
case SlimDX.DXGI.Format.BC3_UNorm: return 4;
case SlimDX.DXGI.Format.BC3_UNorm_SRGB: return 4;
case SlimDX.DXGI.Format.BC4_Typeless: return 1;
case SlimDX.DXGI.Format.BC4_UNorm: return 1;
case SlimDX.DXGI.Format.BC4_SNorm: return 1;
case SlimDX.DXGI.Format.BC5_Typeless: return 2;
case SlimDX.DXGI.Format.BC5_UNorm: return 2;
case SlimDX.DXGI.Format.BC5_SNorm: return 2;
case SlimDX.DXGI.Format.B5G6R5_UNorm: return 2;
case SlimDX.DXGI.Format.B5G5R5A1_UNorm: return 2;
case SlimDX.DXGI.Format.B8G8R8A8_UNorm: return 4;
case SlimDX.DXGI.Format.B8G8R8X8_UNorm: return 4;
default: return 0;
}
}
}
}