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

Fixing a few compile errors in OpenGL render API, due to some earlier refactors

BearishSun 9 лет назад
Родитель
Сommit
8b24b07bd6

+ 1 - 1
Source/BansheeGLRenderAPI/Source/BsGLFrameBufferObject.cpp

@@ -64,7 +64,7 @@ namespace BansheeEngine
         // Store basic stats
         UINT32 width = mColor[0].buffer->getWidth();
         UINT32 height = mColor[0].buffer->getHeight();
-        UINT16 maxSupportedMRTs = RenderAPICore::instancePtr()->getCapabilities().getNumMultiRenderTargets();
+        UINT16 maxSupportedMRTs = RenderAPICore::instancePtr()->getCapabilities(0).getNumMultiRenderTargets();
 
 		// Bind simple buffer to add color attachments
 		glBindFramebuffer(GL_FRAMEBUFFER, mFB);

+ 0 - 20
Source/BansheeGLRenderAPI/Source/BsGLTextureManager.cpp

@@ -27,29 +27,9 @@ namespace BansheeEngine
 
 	PixelFormat GLTextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma)
 	{
-		// Adjust requested parameters to capabilities
-        const RenderAPICapabilities& caps = RenderAPICore::instance().getCapabilities();
-
-		// Check compressed texture support
-		// If a compressed format not supported, revert to PF_A8R8G8B8
-		if(PixelUtil::isCompressed(format) && !caps.hasCapability(RSC_TEXTURE_COMPRESSION_DXT))
-		{
-			return PF_A8R8G8B8;
-		}
-
-		// If floating point textures not supported, revert to PF_A8R8G8B8
-		if(PixelUtil::isFloatingPoint(format) && !caps.hasCapability(RSC_TEXTURE_FLOAT))
-		{
-			return PF_A8R8G8B8;
-		}
-        
         // Check if this is a valid rendertarget format
 		if(usage & TU_RENDERTARGET)
-        {
-            /// Get closest supported alternative
-            /// If mFormat is supported it's returned
             return GLRTTManager::instance().getSupportedAlternative(format);
-        }
 
 		return GLPixelUtil::getClosestValidFormat(format);
 	}

+ 2 - 2
Source/BansheeGLRenderAPI/Source/GLSL/src/BsGLSLGpuProgram.cpp

@@ -207,8 +207,8 @@ namespace BansheeEngine
 		if (!isRequiredCapabilitiesSupported())
 			return false;
 
-		RenderAPICore* rapi = BansheeEngine::RenderAPICore::instancePtr();
-		return rapi->getCapabilities().isShaderProfileSupported("glsl");
+		RenderAPICore* rapi = RenderAPICore::instancePtr();
+		return rapi->getCapabilities(0).isShaderProfileSupported("glsl");
 	}
 }