浏览代码

D3D9 render system ported to x64

Marko Pintera 13 年之前
父节点
当前提交
9b005cea53

+ 65 - 0
CamelotD3D9Renderer/CamelotD3D9Renderer.vcxproj

@@ -5,10 +5,18 @@
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   </ItemGroup>
   <PropertyGroup Label="Globals">
   <PropertyGroup Label="Globals">
     <ProjectGuid>{796B6DFF-BA04-42B7-A43A-2B14D707A33A}</ProjectGuid>
     <ProjectGuid>{796B6DFF-BA04-42B7-A43A-2B14D707A33A}</ProjectGuid>
@@ -22,6 +30,12 @@
     <PlatformToolset>v110</PlatformToolset>
     <PlatformToolset>v110</PlatformToolset>
     <CharacterSet>NotSet</CharacterSet>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <UseDebugLibraries>false</UseDebugLibraries>
@@ -29,22 +43,41 @@
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>NotSet</CharacterSet>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
   </ImportGroup>
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <OutDir>..\bin\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <OutDir>..\bin\$(Configuration)\</OutDir>
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
@@ -59,6 +92,20 @@
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;.\Include;..\CamelotRenderer\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>CM_RSD3D9_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>d3d9.lib;d3dx9.lib;DxErr.lib;dxguid.lib;CamelotRenderer.lib;CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;..\lib\$(Platform)\$(Configuration);..\Dependencies\lib\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
@@ -77,6 +124,24 @@
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
       <ImportLibrary>..\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;.\Include;..\CamelotRenderer\Include;..\CamelotUtility\Include;..\Dependencies\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>CM_RSD3D9_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>d3d9.lib;d3dx9.lib;DxErr.lib;dxguid.lib;CamelotRenderer.lib;CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;..\lib\$(Platform)\$(Configuration);..\Dependencies\lib\x64\Release</AdditionalLibraryDirectories>
+      <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\CmD3D9Device.h" />
     <ClInclude Include="Include\CmD3D9Device.h" />
     <ClInclude Include="Include\CmD3D9DeviceManager.h" />
     <ClInclude Include="Include\CmD3D9DeviceManager.h" />

+ 1 - 1
CamelotD3D9Renderer/Include/CmD3D9GpuProgram.h

@@ -54,7 +54,7 @@ namespace CamelotEngine {
 
 
 		/** Tells the program to load from some externally created microcode instead of a file or source. 
 		/** Tells the program to load from some externally created microcode instead of a file or source. 
 		*/
 		*/
-		void setExternalMicrocode(const void* pMicrocode, size_t size);
+		void setExternalMicrocode(const void* pMicrocode, UINT32 size);
         /** Tells the program to load from some externally created microcode instead of a file or source. 
         /** Tells the program to load from some externally created microcode instead of a file or source. 
         @remarks
         @remarks
             add ref count to pMicrocode when setting
             add ref count to pMicrocode when setting

+ 3 - 3
CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h

@@ -106,7 +106,7 @@ namespace CamelotEngine
 		}
 		}
 
 
 		/// return anisotropy level
 		/// return anisotropy level
-		DWORD _getCurrentAnisotropy(size_t unit);
+		DWORD _getCurrentAnisotropy(UINT32 unit);
 		/// check if a FSAA is supported
 		/// check if a FSAA is supported
 		bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen);
 		bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen);
 		
 		
@@ -203,7 +203,7 @@ namespace CamelotEngine
 			multisample type.
 			multisample type.
 			@returns A directx surface, or 0 if there is no compatible depthstencil possible.
 			@returns A directx surface, or 0 if there is no compatible depthstencil possible.
 		*/
 		*/
-		IDirect3DSurface9* getDepthStencilFor(D3DFORMAT fmt, D3DMULTISAMPLE_TYPE multisample, DWORD multisample_quality, UINT16 width, UINT16 height);
+		IDirect3DSurface9* getDepthStencilFor(D3DFORMAT fmt, D3DMULTISAMPLE_TYPE multisample, DWORD multisample_quality, UINT32 width, UINT32 height);
 
 
 		/** Clear all cached depth stencil surfaces
 		/** Clear all cached depth stencil surfaces
 		*/
 		*/
@@ -215,7 +215,7 @@ namespace CamelotEngine
         bool checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
         bool checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
 
 
 		/// Take in some requested FSAA settings and output supported D3D settings
 		/// Take in some requested FSAA settings and output supported D3D settings
-		void determineFSAASettings(IDirect3DDevice9* d3d9Device, UINT16 fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
+		void determineFSAASettings(IDirect3DDevice9* d3d9Device, UINT32 fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
 			bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality);
 			bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality);
 	public:
 	public:
 		// constructor
 		// constructor

+ 3 - 3
CamelotD3D9Renderer/Include/CmD3D9VertexDeclaration.h

@@ -43,12 +43,12 @@ namespace CamelotEngine {
         ~D3D9VertexDeclaration();
         ~D3D9VertexDeclaration();
         
         
         /** See VertexDeclaration */
         /** See VertexDeclaration */
-        const VertexElement& addElement(unsigned short source, size_t offset, VertexElementType theType,
+        const VertexElement& addElement(unsigned short source, UINT32 offset, VertexElementType theType,
             VertexElementSemantic semantic, unsigned short index = 0);
             VertexElementSemantic semantic, unsigned short index = 0);
 
 
         /** See VertexDeclaration */
         /** See VertexDeclaration */
         const VertexElement& insertElement(unsigned short atPosition,
         const VertexElement& insertElement(unsigned short atPosition,
-            unsigned short source, size_t offset, VertexElementType theType,
+            unsigned short source, UINT32 offset, VertexElementType theType,
             VertexElementSemantic semantic, unsigned short index = 0);
             VertexElementSemantic semantic, unsigned short index = 0);
 
 
         /** See VertexDeclaration */
         /** See VertexDeclaration */
@@ -62,7 +62,7 @@ namespace CamelotEngine {
 
 
 
 
         /** See VertexDeclaration */
         /** See VertexDeclaration */
-        void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType,
+        void modifyElement(unsigned short elem_index, unsigned short source, UINT32 offset, VertexElementType theType,
             VertexElementSemantic semantic, unsigned short index = 0);
             VertexElementSemantic semantic, unsigned short index = 0);
 
 
 		// Called immediately after the Direct3D device has been created.
 		// Called immediately after the Direct3D device has been created.

+ 1 - 1
CamelotD3D9Renderer/Source/CmD3D9GpuProgram.cpp

@@ -46,7 +46,7 @@ namespace CamelotEngine {
 	}
 	}
     
     
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void D3D9GpuProgram::setExternalMicrocode(const void* pMicrocode, size_t size)
+	void D3D9GpuProgram::setExternalMicrocode(const void* pMicrocode, UINT32 size)
 	{
 	{
 		LPD3DXBUFFER pBuffer=0;
 		LPD3DXBUFFER pBuffer=0;
 		HRESULT hr=D3DXCreateBuffer(size, &pBuffer);
 		HRESULT hr=D3DXCreateBuffer(size, &pBuffer);

+ 1 - 1
CamelotD3D9Renderer/Source/CmD3D9HLSLProgram.cpp

@@ -325,7 +325,7 @@ namespace CamelotEngine {
             if (desc.Type == D3DXPT_FLOAT || desc.Type == D3DXPT_INT || desc.Type == D3DXPT_BOOL ||
             if (desc.Type == D3DXPT_FLOAT || desc.Type == D3DXPT_INT || desc.Type == D3DXPT_BOOL ||
 				desc.Type == D3DXPT_SAMPLER1D || desc.Type == D3DXPT_SAMPLER2D || desc.Type == D3DXPT_SAMPLER3D || desc.Type == D3DXPT_SAMPLERCUBE)
 				desc.Type == D3DXPT_SAMPLER1D || desc.Type == D3DXPT_SAMPLER2D || desc.Type == D3DXPT_SAMPLER3D || desc.Type == D3DXPT_SAMPLERCUBE)
             {
             {
-                size_t paramIndex = desc.RegisterIndex;
+                UINT32 paramIndex = desc.RegisterIndex;
                 String name = prefix + paramName;
                 String name = prefix + paramName;
                 
                 
 				GpuConstantDefinition def;
 				GpuConstantDefinition def;

+ 1 - 1
CamelotD3D9Renderer/Source/CmD3D9Texture.cpp

@@ -293,7 +293,7 @@ namespace CamelotEngine
 	{
 	{
 		UINT32 instanceSize = getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
 		UINT32 instanceSize = getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
 
 
-		return instanceSize * mMapDeviceToTextureResources.size();
+		return instanceSize * (UINT32)mMapDeviceToTextureResources.size();
 	}
 	}
 	/****************************************************************************************/
 	/****************************************************************************************/
 	void D3D9Texture::determinePool()
 	void D3D9Texture::determinePool()

+ 3 - 3
CamelotD3D9Renderer/Source/CmD3D9VertexDeclaration.cpp

@@ -44,7 +44,7 @@ namespace CamelotEngine {
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     const VertexElement& D3D9VertexDeclaration::addElement(unsigned short source, 
     const VertexElement& D3D9VertexDeclaration::addElement(unsigned short source, 
-        size_t offset, VertexElementType theType,
+        UINT32 offset, VertexElementType theType,
         VertexElementSemantic semantic, unsigned short index)
         VertexElementSemantic semantic, unsigned short index)
     {
     {
         releaseDeclaration();   
         releaseDeclaration();   
@@ -52,7 +52,7 @@ namespace CamelotEngine {
     }
     }
     //-----------------------------------------------------------------------------
     //-----------------------------------------------------------------------------
     const VertexElement& D3D9VertexDeclaration::insertElement(unsigned short atPosition,
     const VertexElement& D3D9VertexDeclaration::insertElement(unsigned short atPosition,
-        unsigned short source, size_t offset, VertexElementType theType,
+        unsigned short source, UINT32 offset, VertexElementType theType,
         VertexElementSemantic semantic, unsigned short index)
         VertexElementSemantic semantic, unsigned short index)
     {
     {
         releaseDeclaration();   
         releaseDeclaration();   
@@ -78,7 +78,7 @@ namespace CamelotEngine {
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     void D3D9VertexDeclaration::modifyElement(unsigned short elem_index, 
     void D3D9VertexDeclaration::modifyElement(unsigned short elem_index, 
-        unsigned short source, size_t offset, VertexElementType theType,
+        unsigned short source, UINT32 offset, VertexElementType theType,
         VertexElementSemantic semantic, unsigned short index)
         VertexElementSemantic semantic, unsigned short index)
     {
     {
         VertexDeclaration::modifyElement(elem_index, source, offset, theType, semantic, index);
         VertexDeclaration::modifyElement(elem_index, source, offset, theType, semantic, index);

+ 1 - 1
CamelotRenderer.sln

@@ -103,7 +103,7 @@ Global
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|Mixed Platforms.Build.0 = Debug|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|Mixed Platforms.Build.0 = Debug|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|Win32.ActiveCfg = Debug|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|Win32.ActiveCfg = Debug|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|Win32.Build.0 = Debug|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|Win32.Build.0 = Debug|Win32
-		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|x64.ActiveCfg = Debug|Win32
+		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Debug|x64.ActiveCfg = Debug|x64
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Release|Any CPU.ActiveCfg = Release|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Release|Any CPU.ActiveCfg = Release|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Release|Mixed Platforms.Build.0 = Release|Win32
 		{796B6DFF-BA04-42B7-A43A-2B14D707A33A}.Release|Mixed Platforms.Build.0 = Release|Win32