Procházet zdrojové kódy

Tiny bit of documentation

Marko Pintera před 11 roky
rodič
revize
182d94e9a7

+ 11 - 1
BoostPort.txt

@@ -13,4 +13,14 @@ Once ported to VS:
 --------------
 --------------
 Other:
 Other:
  - std::function allocates memory yet I'm not using a custom allocator for it. Replace std::function with custom Function method.
  - std::function allocates memory yet I'm not using a custom allocator for it. Replace std::function with custom Function method.
- - Ability to construct Module using startUp without having to do allocation outside of it
+ - Ability to construct Module using startUp without having to do allocation outside of it
+
+
+ REFACTOR GpuProgram
+  - Get rid of HighLevelGpuProgram and merge everything into GpuProgram if possible
+  - Right now HighLevelGpuProgram always creates just one instance of GpuProgram internally, and I don't see why they should be separate
+  - Possibly also determine how to neatly handle compilation faliure. Error should be reported and dummy shader should be returned.
+
+ FreeImaged.lib -> FreeImage.lib
+freetypeD -> freetype
+all fbx libs -> libfbxsdk-md.lib

+ 21 - 66
CamelotCore/Include/CmGpuProgramManager.h

@@ -1,74 +1,28 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
+#pragma once
 
 
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef __GpuProgramManager_H_
-#define __GpuProgramManager_H_
-
-// Precompiler options
 #include "CmPrerequisites.h"
 #include "CmPrerequisites.h"
 #include "CmException.h"
 #include "CmException.h"
 #include "CmGpuProgram.h"
 #include "CmGpuProgram.h"
 #include "CmModule.h"
 #include "CmModule.h"
 
 
-namespace BansheeEngine {
-
-	/** \addtogroup Core
-	*  @{
-	*/
-	/** \addtogroup Resources
-	*  @{
-	*/
+namespace BansheeEngine 
+{
+	/**
+	 * @brief	Handles creation of GPU programs for a specific language. Program source
+	 *			will be parses and a usable GPU program which you may bind to the pipeline
+	 *			will be returned.
+	 */
 	class CM_EXPORT GpuProgramManager : public Module<GpuProgramManager>
 	class CM_EXPORT GpuProgramManager : public Module<GpuProgramManager>
 	{
 	{
-	public:
-
-		typedef Set<String>::type SyntaxCodes;
-
-	protected:
-		/** General create method
-        */
-        virtual GpuProgramPtr create(const String& source, const String& entryPoint, GpuProgramType gptype, GpuProgramProfile profile) = 0;
-
 	public:
 	public:
 		GpuProgramManager();
 		GpuProgramManager();
 		virtual ~GpuProgramManager();
 		virtual ~GpuProgramManager();
-
-		/** Returns the syntaxes that this manager supports. */
-		virtual const SyntaxCodes& getSupportedSyntax(void) const;
-		 
-
-        /** Returns whether a given syntax code (e.g. "ps_1_3", "fp20", "arbvp1") is supported. */
-        virtual bool isSyntaxSupported(const String& syntaxCode) const;
-		
-		
-		/** Converts a generic GpuProgramProfile identifier into a render-system specific one.  
-		* 
-		*  Returns an empty string if it can't convert it.
-		*/
+	
+		/**
+		 * @brief	Converts a generic GpuProgramProfile identifier into a render-system specific one.
+		 *			Obviously this depends on the currently set render system.
+		 *			Returns an empty string if conversion can't be done.
+		 */
 		virtual String gpuProgProfileToRSSpecificProfile(GpuProgramProfile gpuProgProfile) const;
 		virtual String gpuProgProfileToRSSpecificProfile(GpuProgramProfile gpuProgProfile) const;
         
         
 		/** Create a GPU program from a string of assembly code.
 		/** Create a GPU program from a string of assembly code.
@@ -86,10 +40,11 @@ namespace BansheeEngine {
         @param syntaxCode The name of the syntax to be used for this program e.g. arbvp1, vs_1_1
         @param syntaxCode The name of the syntax to be used for this program e.g. arbvp1, vs_1_1
 		*/
 		*/
 		GpuProgramPtr createProgram(const String& source, const String& entryPoint, GpuProgramType gptype, GpuProgramProfile profile);
 		GpuProgramPtr createProgram(const String& source, const String& entryPoint, GpuProgramType gptype, GpuProgramProfile profile);
-	};
-
-	/** @} */
-	/** @} */
-}
 
 
-#endif
+	protected:
+		/**
+		 * @brief	Internal create method that you should override in GpuProgramManager implementation for a specific language.
+		 */
+		virtual GpuProgramPtr create(const String& source, const String& entryPoint, GpuProgramType gptype, GpuProgramProfile profile) = 0;
+	};
+}

+ 7 - 59
CamelotCore/Source/CmGpuProgramManager.cpp

@@ -1,80 +1,28 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmGpuProgramManager.h"
 #include "CmGpuProgramManager.h"
 #include "CmRenderSystem.h"
 #include "CmRenderSystem.h"
 
 
-
-namespace BansheeEngine {
-	//---------------------------------------------------------------------------
+namespace BansheeEngine 
+{
 	GpuProgramManager::GpuProgramManager()
 	GpuProgramManager::GpuProgramManager()
-	{
-		// subclasses should register with resource group manager
-	}
-	//---------------------------------------------------------------------------
+	{ }
+
 	GpuProgramManager::~GpuProgramManager()
 	GpuProgramManager::~GpuProgramManager()
-	{
-		// subclasses should unregister with resource group manager
-	}
-    //---------------------------------------------------------------------------
+	{ }
+
 	GpuProgramPtr GpuProgramManager::createProgram(const String& source, const String& entryPoint, GpuProgramType gptype, GpuProgramProfile profile)
 	GpuProgramPtr GpuProgramManager::createProgram(const String& source, const String& entryPoint, GpuProgramType gptype, GpuProgramProfile profile)
     {
     {
 		GpuProgramPtr prg = create(source, entryPoint, gptype, profile);
 		GpuProgramPtr prg = create(source, entryPoint, gptype, profile);
 		prg->_setThisPtr(prg);
 		prg->_setThisPtr(prg);
 
 
-		// TODO: Gpu programs get initialized by their parent HighLevelGpuProgram. I might handle that more intuitively later but
+		// TODO: GPU programs get initialized by their parent HighLevelGpuProgram. I might handle that more intuitively later but
 		// it works just fine as it is
 		// it works just fine as it is
 		//prg->initialize();
 		//prg->initialize();
 
 
         return prg;
         return prg;
     }
     }
-    //---------------------------------------------------------------------------
-	const GpuProgramManager::SyntaxCodes& GpuProgramManager::getSupportedSyntax(void) const
-    {
-		// Use the current render system
-		RenderSystem* rs = BansheeEngine::RenderSystem::instancePtr();
-
-		// Get the supported syntaxed from RenderSystemCapabilities 
-		return rs->getCapabilities()->getSupportedShaderProfiles();
-    }
-    //---------------------------------------------------------------------------
-    bool GpuProgramManager::isSyntaxSupported(const String& syntaxCode) const
-        {
-			// Use the current render system
-			RenderSystem* rs = BansheeEngine::RenderSystem::instancePtr();
-
-			// Get the supported syntaxed from RenderSystemCapabilities 
-			return rs->getCapabilities()->isShaderProfileSupported(syntaxCode);
-		}
 
 
-	//---------------------------------------------------------------------------
 	String GpuProgramManager::gpuProgProfileToRSSpecificProfile(GpuProgramProfile gpuProgProfile) const
 	String GpuProgramManager::gpuProgProfileToRSSpecificProfile(GpuProgramProfile gpuProgProfile) const
 	{
 	{
-		// Use the current render system
 		RenderSystem* rs = BansheeEngine::RenderSystem::instancePtr();
 		RenderSystem* rs = BansheeEngine::RenderSystem::instancePtr();
 
 
 		return  rs->getCapabilities()->gpuProgProfileToRSSpecificProfile(gpuProgProfile);
 		return  rs->getCapabilities()->gpuProgProfileToRSSpecificProfile(gpuProgProfile);

+ 1 - 1
Dependencies.txt

@@ -17,7 +17,7 @@ Place dependency files in:
 Banshee plug-in dependencies:
 Banshee plug-in dependencies:
 
 
 CamelotFBXImporter (optional) relies on:
 CamelotFBXImporter (optional) relies on:
- - FBX SDK 2013.3
+ - FBX SDK 2015.1
    - http://usa.autodesk.com/fbx
    - http://usa.autodesk.com/fbx
 
 
 CamelotFreeImgImporter (optional) relies on:
 CamelotFreeImgImporter (optional) relies on: