Просмотр исходного кода

Removed multisampling hint from textures

Marko Pintera 11 лет назад
Родитель
Сommit
1a4555b0d8

+ 0 - 7
BansheeCore/Include/BsRenderTarget.h

@@ -52,12 +52,6 @@ namespace BansheeEngine
 		 */
 		UINT32 getMultisampleCount() const { return mMultisampleCount; }
 
-		/**
-		 * @brief	Get a render-system specific hint used for determining
-		 *			multisampling type.
-		 */
-		const String& getMultisampleHint() const { return mMultisampleHint; }
-
 		/**
 		 * @brief	Returns true if the render target will wait for vertical sync 
 		 *			before swapping buffers. This will eliminate tearing but may increase
@@ -128,7 +122,6 @@ namespace BansheeEngine
 		bool mIsWindow = false;
 
 		UINT32 mMultisampleCount = 0;
-		String mMultisampleHint;
 	};
 
 	/**

+ 1 - 2
BansheeCore/Include/BsRenderTexture.h

@@ -89,13 +89,12 @@ namespace BansheeEngine
 		 * @param	format				Pixel format used by the texture color surface.
 		 * @param	hwGamma				Should the written pixels be gamma corrected.
 		 * @param	multisampleCount	If higher than 1, texture containing multiple samples per pixel is created.
-		 * @param	multisampleHint		Hint about what kind of multisampling to use. Render system specific.
 		 * @param	createDepth			Should a depth/stencil surface be created along with the color surface.
 		 * @param	depthStencilFormat	Format used by the depth stencil surface, if one is created.
 		 */
 		static RenderTexturePtr create(TextureType textureType, UINT32 width, UINT32 height, 
 			PixelFormat format = PF_R8G8B8A8, bool hwGamma = false, UINT32 multisampleCount = 0, 
-			const String& multisampleHint = "", bool createDepth = true, PixelFormat depthStencilFormat = PF_D24S8);
+			bool createDepth = true, PixelFormat depthStencilFormat = PF_D24S8);
 
 		/**
 		 * @copydoc	TextureManager::createRenderTexture(const RENDER_TEXTURE_DESC&)

+ 7 - 19
BansheeCore/Include/BsTexture.h

@@ -81,14 +81,6 @@ namespace BansheeEngine
 		 */
 		virtual UINT32 getMultisampleCount() const { return mMultisampleCount; }
 
-		/**
-		 * @brief	Get a render-system specific hint used for determining
-		 *			multisampling type.
-		 *
-		 * @note	Thread safe.
-		 */
-		virtual const String& getMultisampleHint() const { return mMultisampleHint; }
-
         /**
          * @brief	Returns the height of the texture.
          *
@@ -296,11 +288,10 @@ namespace BansheeEngine
 		 * @param	hwGammaCorrection	If true the texture data is assumed to have been gamma corrected and will be
 		 *								converted back to linear space when sampled on GPU.
 		 * @param	multisampleCount	If higher than 1, texture containing multiple samples per pixel is created.
-		 * @param	multisampleHint		Hint about what kind of multisampling to use. Render system specific.
 		 */
 		static HTexture create(TextureType texType, UINT32 width, UINT32 height, UINT32 depth,
 			int numMips, PixelFormat format, int usage = TU_DEFAULT,
-			bool hwGammaCorrection = false, UINT32 multisampleCount = 0, const String& multisampleHint = StringUtil::BLANK);
+			bool hwGammaCorrection = false, UINT32 multisampleCount = 0);
 
 
 		/**
@@ -315,29 +306,27 @@ namespace BansheeEngine
 		 * @param	hwGammaCorrection	If true the texture data is assumed to have been gamma corrected and will be
 		 *								converted back to linear space when sampled on GPU.
 		 * @param	multisampleCount	If higher than 1, texture containing multiple samples per pixel is created.
-		 * @param	multisampleHint		Hint about what kind of multisampling to use. Render system specific.
 		 */
 		static HTexture create(TextureType texType, UINT32 width, UINT32 height, int numMips,
 			PixelFormat format, int usage = TU_DEFAULT,
-			bool hwGammaCorrection = false, UINT32 multisampleCount = 0, const String& multisampleHint = StringUtil::BLANK);
+			bool hwGammaCorrection = false, UINT32 multisampleCount = 0);
 
 		/**
-		 * @copydoc	create(TextureType, UINT32, UINT32, UINT32, int, PixelFormat, int, bool, UINT32, const String&)
+		 * @copydoc	create(TextureType, UINT32, UINT32, UINT32, int, PixelFormat, int, bool, UINT32)
 		 *
 		 * @note	Internal method. Creates a texture pointer without a handle. Use "create" for normal usage.
 		 */
 		static TexturePtr _createPtr(TextureType texType, UINT32 width, UINT32 height, UINT32 depth,
 			int num_mips, PixelFormat format, int usage = TU_DEFAULT,
-			bool hwGammaCorrection = false, UINT32 multisampleCount = 0, const String& multisampleHint = StringUtil::BLANK);
+			bool hwGammaCorrection = false, UINT32 multisampleCount = 0);
 
 		/**
-		 * @copydoc	create(TextureType, UINT32, UINT32, int, PixelFormat, int, bool, UINT32, const String&)
+		 * @copydoc	create(TextureType, UINT32, UINT32, int, PixelFormat, int, bool, UINT32)
 		 *
 		 * @note	Internal method. Creates a texture pointer without a handle. Use "create" for normal usage.
 		 */
 		static TexturePtr _createPtr(TextureType texType, UINT32 width, UINT32 height, int num_mips,
-			PixelFormat format, int usage = TU_DEFAULT,
-			bool hwGammaCorrection = false, UINT32 multisampleCount = 0, const String& multisampleHint = StringUtil::BLANK);
+			PixelFormat format, int usage = TU_DEFAULT, bool hwGammaCorrection = false, UINT32 multisampleCount = 0);
 
 	protected:
 		/************************************************************************/
@@ -378,7 +367,7 @@ namespace BansheeEngine
 		 * @copydoc	GpuResource::initialize
 		 */
 		void initialize(TextureType textureType, UINT32 width, UINT32 height, UINT32 depth, UINT32 numMipmaps, 
-			PixelFormat format, int usage, bool hwGamma, UINT32 multisampleCount, const String& multisampleHint);
+			PixelFormat format, int usage, bool hwGamma, UINT32 multisampleCount);
 
 		/**
 		 * @copydoc	lock
@@ -408,7 +397,6 @@ namespace BansheeEngine
 		UINT32 mNumMipmaps; // Immutable
 		bool mHwGamma; // Immutable
 		UINT32 mMultisampleCount; // Immutable
-		String mMultisampleHint; // Immutable
 
 		TextureType mTextureType; // Immutable
 		PixelFormat mFormat; // Immutable

+ 4 - 5
BansheeCore/Include/BsTextureManager.h

@@ -25,17 +25,16 @@ namespace BansheeEngine
 		 */
         TexturePtr createTexture(TextureType texType, UINT32 width, UINT32 height, UINT32 depth, 
 			int numMips, PixelFormat format, int usage = TU_DEFAULT, bool hwGammaCorrection = false, 
-			UINT32 multisampleCount = 0, const String& multisampleHint = StringUtil::BLANK);
+			UINT32 multisampleCount = 0);
 			
 		/**
 		 * @copydoc	Texture::create(TextureType, UINT32, UINT32, int, PixelFormat, int, bool, UINT32, const String&)
 		 */
 		TexturePtr createTexture(TextureType texType, UINT32 width, UINT32 height, int numMips,
-			PixelFormat format, int usage = TU_DEFAULT, bool hwGammaCorrection = false, UINT32 multisampleCount = 0,
-			const String& multisampleHint = StringUtil::BLANK)
+			PixelFormat format, int usage = TU_DEFAULT, bool hwGammaCorrection = false, UINT32 multisampleCount = 0)
 		{
 			return createTexture(texType, width, height, 1, 
-				numMips, format, usage, hwGammaCorrection, multisampleCount, multisampleHint);
+				numMips, format, usage, hwGammaCorrection, multisampleCount);
 		}
 
 		/**
@@ -64,7 +63,7 @@ namespace BansheeEngine
 		 */
 		virtual RenderTexturePtr createRenderTexture(TextureType textureType, UINT32 width, UINT32 height, 
 			PixelFormat format = PF_R8G8B8A8, bool hwGamma = false, UINT32 multisampleCount = 0, 
-			const String& multisampleHint = "", bool createDepth = true, PixelFormat depthStencilFormat = PF_D24S8);
+			bool createDepth = true, PixelFormat depthStencilFormat = PF_D24S8);
 
 		/**
 		 * @brief	Creates a RenderTexture using the description struct.

+ 1 - 3
BansheeCore/Include/BsTextureRTTI.h

@@ -23,7 +23,6 @@ namespace BansheeEngine
 		BS_SETGET_MEMBER(mNumMipmaps, UINT32, Texture)
 		BS_SETGET_MEMBER(mHwGamma, bool, Texture)
 		BS_SETGET_MEMBER(mMultisampleCount, UINT32, Texture)
-		BS_SETGET_MEMBER(mMultisampleHint, String, Texture)
 		BS_SETGET_MEMBER(mTextureType, TextureType, Texture)
 		BS_SETGET_MEMBER(mFormat, PixelFormat, Texture)
 
@@ -89,7 +88,6 @@ namespace BansheeEngine
 			BS_ADD_PLAINFIELD(mNumMipmaps, 5, TextureRTTI)
 			BS_ADD_PLAINFIELD(mHwGamma, 6, TextureRTTI)
 			BS_ADD_PLAINFIELD(mMultisampleCount, 7, TextureRTTI)
-			BS_ADD_PLAINFIELD(mMultisampleHint, 8, TextureRTTI)
 			BS_ADD_PLAINFIELD(mTextureType, 9, TextureRTTI)
 			BS_ADD_PLAINFIELD(mFormat, 10, TextureRTTI)
 
@@ -117,7 +115,7 @@ namespace BansheeEngine
 			// in mRTTIData.
 			texture->initialize(texture->getTextureType(), texture->getWidth(), texture->getHeight(), texture->getDepth(), 
 				texture->getNumMipmaps(), texture->getFormat(), texture->getUsage(), texture->isHardwareGammaEnabled(), 
-				texture->getMultisampleCount(), texture->getMultisampleHint());
+				texture->getMultisampleCount());
 
 			Vector<PixelDataPtr>* pixelData = any_cast<Vector<PixelDataPtr>*>(texture->mRTTIData);
 			for(size_t i = 0; i < pixelData->size(); i++)

+ 2 - 7
BansheeCore/Source/BsMultiRenderTexture.cpp

@@ -76,13 +76,11 @@ namespace BansheeEngine
 
 			if(mColorSurfaces[i]->getTexture()->getWidth() != firstSurfaceDesc->getTexture()->getWidth() ||
 				mColorSurfaces[i]->getTexture()->getHeight() != firstSurfaceDesc->getTexture()->getHeight() ||
-				mColorSurfaces[i]->getTexture()->getMultisampleCount() != firstSurfaceDesc->getTexture()->getMultisampleCount() ||
-				mColorSurfaces[i]->getTexture()->getMultisampleHint() != firstSurfaceDesc->getTexture()->getMultisampleHint())
+				mColorSurfaces[i]->getTexture()->getMultisampleCount() != firstSurfaceDesc->getTexture()->getMultisampleCount())
 			{
 				String errorInfo = "\nWidth: " + toString(mColorSurfaces[i]->getTexture()->getWidth()) + "/" + toString(firstSurfaceDesc->getTexture()->getWidth());
 				errorInfo += "\nHeight: " + toString(mColorSurfaces[i]->getTexture()->getHeight()) + "/" + toString(firstSurfaceDesc->getTexture()->getHeight());
 				errorInfo += "\nMultisample Count: " + toString(mColorSurfaces[i]->getTexture()->getMultisampleCount()) + "/" + toString(firstSurfaceDesc->getTexture()->getMultisampleCount());
-				errorInfo += "\nMultisample Hint: " + mColorSurfaces[i]->getTexture()->getMultisampleHint() + "/" + firstSurfaceDesc->getTexture()->getMultisampleHint();
 
 				BS_EXCEPT(InvalidParametersException, "Provided texture and depth stencil buffer don't match!" + errorInfo);
 			}
@@ -111,13 +109,11 @@ namespace BansheeEngine
 
 		if(mDepthStencilSurface->getTexture()->getWidth() != firstSurfaceDesc->getTexture()->getWidth() ||
 			mDepthStencilSurface->getTexture()->getHeight() != firstSurfaceDesc->getTexture()->getHeight() ||
-			mDepthStencilSurface->getTexture()->getMultisampleCount() != firstSurfaceDesc->getTexture()->getMultisampleCount() ||
-			mDepthStencilSurface->getTexture()->getMultisampleHint() != firstSurfaceDesc->getTexture()->getMultisampleHint())
+			mDepthStencilSurface->getTexture()->getMultisampleCount() != firstSurfaceDesc->getTexture()->getMultisampleCount())
 		{
 			String errorInfo = "\nWidth: " + toString(mDepthStencilSurface->getTexture()->getWidth()) + "/" + toString(firstSurfaceDesc->getTexture()->getWidth());
 			errorInfo += "\nHeight: " + toString(mDepthStencilSurface->getTexture()->getHeight()) + "/" + toString(firstSurfaceDesc->getTexture()->getHeight());
 			errorInfo += "\nMultisample Count: " + toString(mDepthStencilSurface->getTexture()->getMultisampleCount()) + "/" + toString(firstSurfaceDesc->getTexture()->getMultisampleCount());
-			errorInfo += "\nMultisample Hint: " + mDepthStencilSurface->getTexture()->getMultisampleHint() + "/" + firstSurfaceDesc->getTexture()->getMultisampleHint();
 
 			BS_EXCEPT(InvalidParametersException, "Provided texture and depth stencil buffer don't match!" + errorInfo);
 		}
@@ -151,7 +147,6 @@ namespace BansheeEngine
 				properties->mActive = true;
 				properties->mHwGamma = texture->isHardwareGammaEnabled();
 				properties->mMultisampleCount = texture->getMultisampleCount();
-				properties->mMultisampleHint = texture->getMultisampleHint();
 				properties->mIsWindow = false;
 				properties->mRequiresTextureFlipping = requiresTextureFlipping();
 

+ 3 - 6
BansheeCore/Source/BsRenderTexture.cpp

@@ -79,13 +79,11 @@ namespace BansheeEngine
 
 		if (mColorSurface->getTexture()->getWidth() != mDepthStencilSurface->getTexture()->getWidth() ||
 			mColorSurface->getTexture()->getHeight() != mDepthStencilSurface->getTexture()->getHeight() ||
-			mColorSurface->getTexture()->getMultisampleCount() != mDepthStencilSurface->getTexture()->getMultisampleCount() ||
-			mColorSurface->getTexture()->getMultisampleHint() != mDepthStencilSurface->getTexture()->getMultisampleHint())
+			mColorSurface->getTexture()->getMultisampleCount() != mDepthStencilSurface->getTexture()->getMultisampleCount())
 		{
 			String errorInfo = "\nWidth: " + toString(mColorSurface->getTexture()->getWidth()) + "/" + toString(mDepthStencilSurface->getTexture()->getWidth());
 			errorInfo += "\nHeight: " + toString(mColorSurface->getTexture()->getHeight()) + "/" + toString(mDepthStencilSurface->getTexture()->getHeight());
 			errorInfo += "\nMultisample Count: " + toString(mColorSurface->getTexture()->getMultisampleCount()) + "/" + toString(mDepthStencilSurface->getTexture()->getMultisampleCount());
-			errorInfo += "\nMultisample Hint: " + mColorSurface->getTexture()->getMultisampleHint() + "/" + mDepthStencilSurface->getTexture()->getMultisampleHint();
 
 			BS_EXCEPT(InvalidParametersException, "Provided texture and depth stencil buffer don't match!" + errorInfo);
 		}
@@ -97,11 +95,11 @@ namespace BansheeEngine
 	}
 
 	RenderTexturePtr RenderTexture::create(TextureType textureType, UINT32 width, UINT32 height, 
-		PixelFormat format, bool hwGamma, UINT32 multisampleCount, const String& multisampleHint, 
+		PixelFormat format, bool hwGamma, UINT32 multisampleCount, 
 		bool createDepth, PixelFormat depthStencilFormat)
 	{
 		return TextureManager::instance().createRenderTexture(textureType, width, height, format, hwGamma, 
-			multisampleCount, multisampleHint, createDepth, depthStencilFormat);
+			multisampleCount, createDepth, depthStencilFormat);
 	}
 
 	RenderTexturePtr RenderTexture::create(const RENDER_TEXTURE_DESC& desc)
@@ -137,7 +135,6 @@ namespace BansheeEngine
 			properties->mColorDepth = BansheeEngine::PixelUtil::getNumElemBits(texture->getFormat());
 			properties->mHwGamma = texture->isHardwareGammaEnabled();
 			properties->mMultisampleCount = texture->getMultisampleCount();
-			properties->mMultisampleHint = texture->getMultisampleHint();
 		}
 
 		properties->mActive = true;

+ 0 - 1
BansheeCore/Source/BsRenderWindow.cpp

@@ -67,7 +67,6 @@ namespace BansheeEngine
 		properties->mVSync = desc.vsync;
 		properties->mVSyncInterval = desc.vsyncInterval;
 		properties->mMultisampleCount = desc.multisampleCount;
-		properties->mMultisampleHint = desc.multisampleHint;
 		properties->mLeft = desc.left;
 		properties->mTop = desc.top;
 		properties->mIsFullScreen = desc.fullscreen;

+ 9 - 10
BansheeCore/Source/BsTexture.cpp

@@ -19,7 +19,7 @@ namespace BansheeEngine
     }
 
 	void Texture::initialize(TextureType textureType, UINT32 width, UINT32 height, UINT32 depth, UINT32 numMipmaps, 
-		PixelFormat format, int usage, bool hwGamma, UINT32 multisampleCount, const String& multisampleHint)
+		PixelFormat format, int usage, bool hwGamma, UINT32 multisampleCount)
 	{
 		mTextureType = textureType;
 		mWidth = width;
@@ -29,7 +29,6 @@ namespace BansheeEngine
 		mUsage = usage;
 		mHwGamma = hwGamma;
 		mMultisampleCount = multisampleCount;
-		mMultisampleHint = multisampleHint;
 
 		// Adjust format if required
 		mFormat = TextureManager::instance().getNativeFormat(mTextureType, format, mUsage, hwGamma);
@@ -306,35 +305,35 @@ namespace BansheeEngine
 	/* 								STATICS	                      			*/
 	/************************************************************************/
 	HTexture Texture::create(TextureType texType, UINT32 width, UINT32 height, UINT32 depth, 
-		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount, const String& multisampleHint)
+		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount)
 	{
 		TexturePtr texturePtr = _createPtr(texType, 
-			width, height, depth, num_mips, format, usage, hwGammaCorrection, multisampleCount, multisampleHint);
+			width, height, depth, num_mips, format, usage, hwGammaCorrection, multisampleCount);
 
 		return static_resource_cast<Texture>(gResources()._createResourceHandle(texturePtr));
 	}
 	
 	HTexture Texture::create(TextureType texType, UINT32 width, UINT32 height, 
-		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount, const String& multisampleHint)
+		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount)
 	{
 		TexturePtr texturePtr = _createPtr(texType, 
-			width, height, num_mips, format, usage, hwGammaCorrection, multisampleCount, multisampleHint);
+			width, height, num_mips, format, usage, hwGammaCorrection, multisampleCount);
 
 		return static_resource_cast<Texture>(gResources()._createResourceHandle(texturePtr));
 	}
 
 	TexturePtr Texture::_createPtr(TextureType texType, UINT32 width, UINT32 height, UINT32 depth, 
-		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount, const String& multisampleHint)
+		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount)
 	{
 		return TextureManager::instance().createTexture(texType, 
-			width, height, depth, num_mips, format, usage, hwGammaCorrection, multisampleCount, multisampleHint);
+			width, height, depth, num_mips, format, usage, hwGammaCorrection, multisampleCount);
 	}
 
 	TexturePtr Texture::_createPtr(TextureType texType, UINT32 width, UINT32 height, 
-		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount, const String& multisampleHint)
+		int num_mips, PixelFormat format, int usage, bool hwGammaCorrection, UINT32 multisampleCount)
 	{
 		return TextureManager::instance().createTexture(texType, 
-			width, height, num_mips, format, usage, hwGammaCorrection, multisampleCount, multisampleHint);
+			width, height, num_mips, format, usage, hwGammaCorrection, multisampleCount);
 	}
 
 	const HTexture& Texture::dummy()

+ 5 - 5
BansheeCore/Source/BsTextureManager.cpp

@@ -37,11 +37,11 @@ namespace BansheeEngine
 	}
 
     TexturePtr TextureManager::createTexture(TextureType texType, UINT32 width, UINT32 height, UINT32 depth, int numMipmaps,
-        PixelFormat format, int usage, bool hwGamma, UINT32 multisampleCount, const String& multisampleHint)
+        PixelFormat format, int usage, bool hwGamma, UINT32 multisampleCount)
     {
         TexturePtr ret = createTextureImpl();
 		ret->_setThisPtr(ret);
-		ret->initialize(texType, width, height, depth, static_cast<size_t>(numMipmaps), format, usage, hwGamma, multisampleCount, multisampleHint);
+		ret->initialize(texType, width, height, depth, static_cast<size_t>(numMipmaps), format, usage, hwGamma, multisampleCount);
 
 		return ret;
     }
@@ -55,15 +55,15 @@ namespace BansheeEngine
 	}
 
 	RenderTexturePtr TextureManager::createRenderTexture(TextureType textureType, UINT32 width, UINT32 height, 
-			PixelFormat format, bool hwGamma, UINT32 multisampleCount, const String& multisampleHint, 
+			PixelFormat format, bool hwGamma, UINT32 multisampleCount, 
 			bool createDepth, PixelFormat depthStencilFormat)
 	{
-		TexturePtr texture = createTexture(textureType, width, height, 0, format, TU_RENDERTARGET, hwGamma, multisampleCount, multisampleHint);
+		TexturePtr texture = createTexture(textureType, width, height, 0, format, TU_RENDERTARGET, hwGamma, multisampleCount);
 
 		TexturePtr depthStencil = nullptr;
 		if(createDepth)
 		{
-			depthStencil = createTexture(TEX_TYPE_2D, width, height, 0, depthStencilFormat, TU_DEPTHSTENCIL, false, multisampleCount, multisampleHint);
+			depthStencil = createTexture(TEX_TYPE_2D, width, height, 0, depthStencilFormat, TU_DEPTHSTENCIL, false, multisampleCount);
 		}
 
 		RENDER_TEXTURE_DESC desc;

+ 1 - 2
BansheeD3D11RenderSystem/Include/BsD3D11RenderSystem.h

@@ -184,11 +184,10 @@ namespace BansheeEngine
 		 * @brief	Determines DXGI multisample settings from the provided parameters.
 		 *
 		 * @param	multisampleCount	Number of requested samples.
-		 * @param	multisampleHint		String describing an optional hint to which multisample method to use.
 		 * @param	format				Pixel format used by the render target.
 		 * @param	outputSampleDesc	Output structure that will contain the requested multisample settings.
 		 */
-		void determineMultisampleSettings(UINT32 multisampleCount, const String& multisampleHint, DXGI_FORMAT format, DXGI_SAMPLE_DESC* outputSampleDesc);
+		void determineMultisampleSettings(UINT32 multisampleCount, DXGI_FORMAT format, DXGI_SAMPLE_DESC* outputSampleDesc);
 
 		/**
 		 * @brief	Returns the main DXGI factory object.

+ 25 - 34
BansheeD3D11RenderSystem/Source/BsD3D11RenderSystem.cpp

@@ -947,32 +947,23 @@ namespace BansheeEngine
 		return rsc;
 	}
 
-	void D3D11RenderSystem::determineMultisampleSettings(UINT32 multisampleCount, const String& multisampleHint, DXGI_FORMAT format, DXGI_SAMPLE_DESC* outputSampleDesc)
+	void D3D11RenderSystem::determineMultisampleSettings(UINT32 multisampleCount, DXGI_FORMAT format, DXGI_SAMPLE_DESC* outputSampleDesc)
 	{
-		bool ok = false;
-		bool qualityHint = multisampleHint.find("Quality") != String::npos;
-		size_t origCount = multisampleCount;
-		bool tryCSAA = false;
-		// NVIDIA, prefer CSAA if available for 8+
-		// it would be tempting to use getCapabilities()->getVendor() == GPU_NVIDIA but
-		// if this is the first window, caps will not be initialised yet
-		
-		if (mActiveD3DDriver->getAdapterIdentifier().VendorId == 0x10DE && 
-			multisampleCount >= 8)
-		{
-			tryCSAA	 = true;
-		}
+		bool tryCSAA = false; // Note: Disabled for now, but leaving the code for later so it might be useful
+		enum CSAAMode { CSAA_Normal, CSAA_Quality };
+		CSAAMode csaaMode = CSAA_Normal;
 
-		while (!ok)
+		bool foundValid = false;
+		size_t origNumSamples = multisampleCount;
+		while (!foundValid)
 		{
 			// Deal with special cases
 			if (tryCSAA)
 			{
-				// see http://developer.nvidia.com/object/coverage-sampled-aa.html
 				switch(multisampleCount)
 				{
 				case 8:
-					if (qualityHint)
+					if (csaaMode == CSAA_Quality)
 					{
 						outputSampleDesc->Count = 8;
 						outputSampleDesc->Quality = 8;
@@ -984,7 +975,7 @@ namespace BansheeEngine
 					}
 					break;
 				case 16:
-					if (qualityHint)
+					if (csaaMode == CSAA_Quality)
 					{
 						outputSampleDesc->Count = 8;
 						outputSampleDesc->Quality = 16;
@@ -1000,7 +991,7 @@ namespace BansheeEngine
 			else // !CSAA
 			{
 				outputSampleDesc->Count = multisampleCount == 0 ? 1 : multisampleCount;
-				outputSampleDesc->Quality = 0;
+				outputSampleDesc->Quality = D3D11_STANDARD_MULTISAMPLE_PATTERN;
 			}
 
 
@@ -1010,43 +1001,43 @@ namespace BansheeEngine
 
 			if (SUCCEEDED(hr) && (!tryCSAA || outQuality > outputSampleDesc->Quality))
 			{
-				ok = true;
+				foundValid = true;
 			}
 			else
 			{
-				// downgrade
+				// Downgrade
 				if (tryCSAA && multisampleCount == 8)
 				{
-					// for CSAA, we'll try downgrading with quality mode at all samples.
+					// For CSAA, we'll try downgrading with quality mode at all samples.
 					// then try without quality, then drop CSAA
-					if (qualityHint)
+					if (csaaMode == CSAA_Quality)
 					{
-						// drop quality first
-						qualityHint = false;
+						// Drop quality first
+						csaaMode = CSAA_Normal;
 					}
 					else
 					{
-						// drop CSAA entirely 
+						// Drop CSAA entirely 
 						tryCSAA = false;
 					}
-					// return to original requested samples
-					multisampleCount = static_cast<UINT32>(origCount);
+
+					// Return to original requested samples
+					multisampleCount = static_cast<UINT32>(origNumSamples);
 				}
 				else
 				{
-					// drop samples
-					--multisampleCount;
+					// Drop samples
+					multisampleCount--;
 
 					if (multisampleCount == 1)
 					{
-						// ran out of options, no multisampling
+						// Ran out of options, no multisampling
 						multisampleCount = 0;
-						ok = true;
+						foundValid = true;
 					}
 				}
 			}
-
-		} // while !ok
+		} 
 	}
 
 	VertexElementType D3D11RenderSystem::getColorVertexElementType() const

+ 2 - 2
BansheeD3D11RenderSystem/Source/BsD3D11RenderWindow.cpp

@@ -619,7 +619,7 @@ namespace BansheeEngine
 		mSwapChainDesc.Windowed	= true;
 
 		D3D11RenderSystem* rs = static_cast<D3D11RenderSystem*>(RenderSystem::instancePtr());
-		rs->determineMultisampleSettings(getProperties().getMultisampleCount(), getProperties().getMultisampleHint(), format, &mMultisampleType);
+		rs->determineMultisampleSettings(getProperties().getMultisampleCount(), format, &mMultisampleType);
 		mSwapChainDesc.SampleDesc.Count = mMultisampleType.Count;
 		mSwapChainDesc.SampleDesc.Quality = mMultisampleType.Quality;
 		
@@ -672,7 +672,7 @@ namespace BansheeEngine
 
 		mDepthStencilBuffer = TextureManager::instance().createTexture(TEX_TYPE_2D, 
 			BBDesc.Width, BBDesc.Height, 0, PF_D24S8, TU_DEPTHSTENCIL, false, 
-			getProperties().getMultisampleCount(), getProperties().getMultisampleHint());
+			getProperties().getMultisampleCount());
 
 		if(mDepthStencilView != nullptr)
 		{

+ 2 - 2
BansheeD3D11RenderSystem/Source/BsD3D11Texture.cpp

@@ -340,7 +340,7 @@ namespace BansheeEngine
 
 			DXGI_SAMPLE_DESC sampleDesc;
 			D3D11RenderSystem* rs = static_cast<D3D11RenderSystem*>(RenderSystem::instancePtr());
-			rs->determineMultisampleSettings(mMultisampleCount, mMultisampleHint, d3dPF, &sampleDesc);
+			rs->determineMultisampleSettings(mMultisampleCount, d3dPF, &sampleDesc);
 			desc.SampleDesc		= sampleDesc;
 
 			if(getTextureType() == TEX_TYPE_CUBE_MAP)
@@ -357,7 +357,7 @@ namespace BansheeEngine
 
 			DXGI_SAMPLE_DESC sampleDesc;
 			D3D11RenderSystem* rs = static_cast<D3D11RenderSystem*>(RenderSystem::instancePtr());
-			rs->determineMultisampleSettings(mMultisampleCount, mMultisampleHint, d3dPF, &sampleDesc);
+			rs->determineMultisampleSettings(mMultisampleCount, d3dPF, &sampleDesc);
 			desc.SampleDesc		= sampleDesc;
 
 			if(getTextureType() == TEX_TYPE_CUBE_MAP)

+ 1 - 2
BansheeD3D9RenderSystem/Include/BsD3D9RenderSystem.h

@@ -212,13 +212,12 @@ namespace BansheeEngine
 		 *
 		 * @param	d3d9Device				Device to check for multisampling.
 		 * @param	multisampleCount		Number of requested samples.
-		 * @param	multisampleHint			String describing an optional hint to which multisample method to use.
 		 * @param	d3dPixelFormat			Pixel format used by the render target.
 		 * @param	fullscreen				Are we testing multisampling for a full-screen render target.
 		 * @param	outMultisampleType		Output parameter containing DirectX type representing valid multisample type.
 		 * @param	outMultisampleQuality	Output parameter containing multisample quality.
 		 */
-		void determineMultisampleSettings(IDirect3DDevice9* d3d9Device, UINT32 multisampleCount, const String& multisampleHint, D3DFORMAT d3dPixelFormat,
+		void determineMultisampleSettings(IDirect3DDevice9* d3d9Device, UINT32 multisampleCount, D3DFORMAT d3dPixelFormat,
 			bool fullScreen, D3DMULTISAMPLE_TYPE* outMultisampleType, DWORD* outMultisampleQuality) const;
 
 		/**

+ 24 - 34
BansheeD3D9RenderSystem/Source/BsD3D9RenderSystem.cpp

@@ -2126,13 +2126,12 @@ namespace BansheeEngine
 		}
 	}
 
-	void D3D9RenderSystem::determineMultisampleSettings(IDirect3DDevice9* d3d9Device,
-		UINT32 multisampleCount, const String& multisampleHint, D3DFORMAT d3dPixelFormat, 
+	void D3D9RenderSystem::determineMultisampleSettings(IDirect3DDevice9* d3d9Device, UINT32 multisampleCount, D3DFORMAT d3dPixelFormat, 
 		bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality) const
 	{
-		bool ok = false;
-		bool qualityHint = multisampleHint.find("Quality") != String::npos;
-		UINT32 origCount = multisampleCount;
+		bool tryCSAA = false; // Note: Disabled for now, but leaving the code for later so it might be useful
+		enum CSAAMode { CSAA_Normal, CSAA_Quality };
+		CSAAMode csaaMode = CSAA_Normal;
 
 		D3D9DriverList* driverList = getDirect3DDrivers();
 		D3D9Driver* deviceDriver = mActiveD3DDriver;
@@ -2149,26 +2148,17 @@ namespace BansheeEngine
 			}
 		}
 
-		bool tryCSAA = false;
-		// NVIDIA, prefer CSAA if available for 8+
-		// it would be tempting to use getCapabilities()->getVendor() == GPU_NVIDIA but
-		// if this is the first window, caps will not be initialised yet
-		if (deviceDriver->getAdapterIdentifier().VendorId == 0x10DE && 
-			multisampleCount >= 8)
-		{
-			tryCSAA	 = true;
-		}
-
-		while (!ok)
+		UINT32 origNumSamples = multisampleCount;
+		bool foundValid = false;
+		while (!foundValid)
 		{
 			// Deal with special cases
 			if (tryCSAA)
 			{
-				// see http://developer.nvidia.com/object/coverage-sampled-aa.html
 				switch(multisampleCount)
 				{
 				case 8:
-					if (qualityHint)
+					if (csaaMode == CSAA_Quality)
 					{
 						*outMultisampleType = D3DMULTISAMPLE_8_SAMPLES;
 						*outMultisampleQuality = 0;
@@ -2180,7 +2170,7 @@ namespace BansheeEngine
 					}
 					break;
 				case 16:
-					if (qualityHint)
+					if (csaaMode == CSAA_Quality)
 					{
 						*outMultisampleType = D3DMULTISAMPLE_8_SAMPLES;
 						*outMultisampleQuality = 2;
@@ -2213,43 +2203,43 @@ namespace BansheeEngine
 			if (SUCCEEDED(hr) && 
 				(!tryCSAA || outQuality > *outMultisampleQuality))
 			{
-				ok = true;
+				foundValid = true;
 			}
 			else
 			{
-				// downgrade
+				// Downgrade
 				if (tryCSAA && multisampleCount == 8)
 				{
-					// for CSAA, we'll try downgrading with quality mode at all samples.
+					// For CSAA, we'll try downgrading with quality mode at all samples.
 					// then try without quality, then drop CSAA
-					if (qualityHint)
+					if (csaaMode == CSAA_Quality)
 					{
-						// drop quality first
-						qualityHint = false;
+						// Drop quality first
+						csaaMode = CSAA_Normal;
 					}
 					else
 					{
-						// drop CSAA entirely 
+						// Drop CSAA entirely 
 						tryCSAA = false;
 					}
-					// return to original requested samples
-					multisampleCount = origCount;
+
+					// Return to original requested samples
+					multisampleCount = origNumSamples;
 				}
 				else
 				{
-					// drop samples
-					--multisampleCount;
+					// Drop samples
+					multisampleCount--;
 
 					if (multisampleCount == 1)
 					{
-						// ran out of options, no multisampling
+						// Ran out of options, no multisampling
 						multisampleCount = 0;
-						ok = true;
+						foundValid = true;
 					}
 				}
 			}
-
-		} // while !ok
+		}
 	}
 
 	void D3D9RenderSystem::setClipPlanesImpl(const PlaneList& clipPlanes)

+ 1 - 1
BansheeD3D9RenderSystem/Source/BsD3D9RenderWindow.cpp

@@ -576,7 +576,7 @@ namespace BansheeEngine
 		D3DMULTISAMPLE_TYPE multisampleType;
 		DWORD multisampleQuality;
 
-		rs->determineMultisampleSettings(mDevice->getD3D9Device(), getProperties().getMultisampleCount(), getProperties().getMultisampleHint(), 
+		rs->determineMultisampleSettings(mDevice->getD3D9Device(), getProperties().getMultisampleCount(), 
 			presentParams->BackBufferFormat, getProperties().isFullScreen(), &multisampleType, &multisampleQuality);
 
 		presentParams->MultiSampleType = multisampleType;

+ 1 - 1
BansheeD3D9RenderSystem/Source/BsD3D9Texture.cpp

@@ -403,7 +403,7 @@ namespace BansheeEngine
 		if ((mUsage & TU_RENDERTARGET) != 0 || (mUsage & TU_DEPTHSTENCIL) != 0)
 		{
 			D3D9RenderSystem* rsys = static_cast<D3D9RenderSystem*>(BansheeEngine::RenderSystem::instancePtr());
-			rsys->determineMultisampleSettings(d3d9Device, mMultisampleCount, mMultisampleHint, d3dPF, false, &mMultisampleType, &mMultisampleQuality);
+			rsys->determineMultisampleSettings(d3d9Device, mMultisampleCount, d3dPF, false, &mMultisampleType, &mMultisampleQuality);
 		}
 		else
 		{

+ 0 - 6
SceneView.txt

@@ -10,12 +10,6 @@
 
 -------------
 
-Get rid of multisample hint from Texture and move it to RenderTarget (RENDER_TEXTURE_DESC actually)
- - Seems they only use it for some kind of qality hint
- - Possibly replace it with an enum if I can't remove it?
-
--------------
-
 Optionally port PixelUtility to compressing, converting, generating mipmaps, applying gamma to PixelData
  - Also getMaxMimaps and other methods for retrieving pixel format information