2
0
Marko Pintera 11 жил өмнө
parent
commit
1c84fb005a

+ 1 - 1
BansheeCore/Include/BsTextureManager.h

@@ -84,7 +84,7 @@ namespace BansheeEngine
 		 *
 		 * @note	Thread safe.
 		 */
-		virtual PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage) = 0;
+		virtual PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma) = 0;
 
 		const HTexture& getDummyTexture() const { return mDummyTexture; }
 

+ 3 - 3
BansheeD3D11RenderSystem/Source/BsD3D11Texture.cpp

@@ -198,7 +198,7 @@ namespace BansheeEngine
 		HRESULT hr;
 		DXGI_FORMAT d3dPF = D3D11Mappings::_getPF(D3D11Mappings::_getClosestSupportedPF(mFormat, mHwGamma), mHwGamma);
 
-		if (mFormat != D3D11Mappings::_getPF(d3dPF, mHwGamma))
+		if (mFormat != D3D11Mappings::_getPF(d3dPF))
 		{
 			BS_EXCEPT(RenderingAPIException, "Provided pixel format is not supported by the driver: " + toString(mFormat));
 		}
@@ -292,7 +292,7 @@ namespace BansheeEngine
 		HRESULT hr;
 		DXGI_FORMAT d3dPF = D3D11Mappings::_getPF(D3D11Mappings::_getClosestSupportedPF(mFormat, mHwGamma), mHwGamma);
 
-		if (mFormat != D3D11Mappings::_getPF(d3dPF, mHwGamma))
+		if (mFormat != D3D11Mappings::_getPF(d3dPF))
 		{
 			BS_EXCEPT(RenderingAPIException, "Provided pixel format is not supported by the driver: " + toString(mFormat));
 		}
@@ -458,7 +458,7 @@ namespace BansheeEngine
 		HRESULT hr;
 		DXGI_FORMAT d3dPF = D3D11Mappings::_getPF(D3D11Mappings::_getClosestSupportedPF(mFormat, mHwGamma), mHwGamma);
 		
-		if (mFormat != D3D11Mappings::_getPF(d3dPF, mHwGamma))
+		if (mFormat != D3D11Mappings::_getPF(d3dPF))
 		{
 			BS_EXCEPT(RenderingAPIException, "Provided pixel format is not supported by the driver: " + toString(mFormat));
 		}

+ 1 - 1
BansheeD3D11RenderSystem/Source/BsD3D11TextureManager.cpp

@@ -40,6 +40,6 @@ namespace BansheeEngine
 		// Basic filtering
 		DXGI_FORMAT d3dPF = D3D11Mappings::_getPF(D3D11Mappings::_getClosestSupportedPF(format, hwGamma), hwGamma);
 
-		return D3D11Mappings::_getPF(d3dPF, hwGamma);
+		return D3D11Mappings::_getPF(d3dPF);
 	}
 }

+ 1 - 1
BansheeD3D9RenderSystem/Include/BsD3D9TextureManager.h

@@ -41,7 +41,7 @@ namespace BansheeEngine
 		~D3D9TextureManager();
 
 		/// @copydoc TextureManager::getNativeFormat
-		PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage);
+		PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma);
 
 	protected:	
 		TexturePtr createTextureImpl();

+ 1 - 1
BansheeD3D9RenderSystem/Source/BsD3D9TextureManager.cpp

@@ -63,7 +63,7 @@ namespace BansheeEngine
 		return bs_core_ptr<D3D9MultiRenderTexture, PoolAlloc>(tex);
 	}
 
-	PixelFormat D3D9TextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage)
+	PixelFormat D3D9TextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma)
 	{
 		if((usage & TU_RENDERTARGET) != 0)
 		{

+ 1 - 1
BansheeGLRenderSystem/Include/BsGLTextureManager.h

@@ -20,7 +20,7 @@ namespace BansheeEngine
 		 * @brief	Converts the provided format for the specified texture type and usage
 		 *			into a format that is supported by OpenGL.
 		 */
-		PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage);
+		PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma);
 
 	protected:
 		/**

+ 1 - 1
BansheeGLRenderSystem/Source/BsGLTextureManager.cpp

@@ -38,7 +38,7 @@ namespace BansheeEngine
 		return bs_core_ptr<GLMultiRenderTexture, PoolAlloc>(tex);
 	}
 
-	PixelFormat GLTextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage)
+	PixelFormat GLTextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma)
 	{
 		// Adjust requested parameters to capabilities
         const RenderSystemCapabilities *caps = RenderSystem::instancePtr()->getCapabilities();