Browse Source

Revert "Create depth-stencil texture instead of renderbuffer on OpenGL 3 / Intel / Windows to work around a driver bug." as the issue is fixed on the latest Intel driver. There was also a OpenGL 2 corrupted rendering bug related to clip planes on the earlier driver version, which was not fixable.

This reverts commit d99fefa68be8ab59b79c8a517067845e15c6fa6f.
Lasse Öörni 10 years ago
parent
commit
7666853b3a

+ 4 - 8
Source/Urho3D/Graphics/OpenGL/OGLGraphics.cpp

@@ -205,7 +205,6 @@ static void GetGLPrimitiveType(unsigned elementCount, PrimitiveType type, unsign
 
 const Vector2 Graphics::pixelUVOffset(0.0f, 0.0f);
 bool Graphics::gl3Support = false;
-bool Graphics::intelGPU = false;
 
 Graphics::Graphics(Context* context_) :
     Object(context_),
@@ -2763,15 +2762,12 @@ void Graphics::CheckFeatureSupport(String& extensions)
     if (numSupportedRTs >= 4)
         deferredSupport_ = true;
     
+    #if defined(__APPLE__) && !defined(IOS)
+    // On OS X check for an Intel driver and use shadow map RGBA dummy color textures, because mixing
+    // depth-only FBO rendering and backbuffer rendering will bug, resulting in a black screen in full
+    // screen mode, and incomplete shadow maps in windowed mode
     String renderer((const char*)glGetString(GL_RENDERER));
     if (renderer.Contains("Intel", false))
-        intelGPU = true;
-
-    #if defined(__APPLE__) && !defined(IOS)
-    // On OS X Intel drivers need to use shadow map RGBA dummy color textures, because mixing depth-
-    // only FBO rendering and backbuffer rendering will bug, resulting in a black screen in full screen
-    // mode, and incomplete shadow maps in windowed mode
-    if (intelGPU)
         dummyColorFormat_ = GetRGBAFormat();
     #endif
     

+ 0 - 4
Source/Urho3D/Graphics/OpenGL/OGLGraphics.h

@@ -443,8 +443,6 @@ public:
     static unsigned GetMaxBones();
     /// Return whether is using an OpenGL 3 context.
     static bool GetGL3Support() { return gl3Support; }
-    /// Return whether is using an Intel GPU. These need some specific workarounds.
-    static bool IsIntelGPU() { return intelGPU; }
 
 private:
     /// Create the application window icon.
@@ -639,8 +637,6 @@ private:
     static const Vector2 pixelUVOffset;
     /// Flag for OpenGL 3 support.
     static bool gl3Support;
-    /// Flag for Intel GPU.
-    static bool intelGPU;
 };
 
 /// Register Graphics library objects.

+ 2 - 8
Source/Urho3D/Graphics/OpenGL/OGLTexture2D.cpp

@@ -440,15 +440,9 @@ bool Texture2D::Create()
     unsigned dataType = GetDataType(format_);
     
     // Create a renderbuffer instead of a texture if depth texture is not properly supported, or if this will be a packed
-    // depth stencil surface. Exception on Intel GPU's on Windows: always create depth textures on OpenGL 3 to work
-    // around a driver bug
+    // depth stencil texture
     #ifndef GL_ES_VERSION_2_0
-    #ifdef WIN32
-    bool depthStencilWorkaround = Graphics::GetGL3Support() && Graphics::IsIntelGPU();
-    #else
-    bool depthStencilWorkaround = false;
-    #endif
-    if (!depthStencilWorkaround && format == Graphics::GetDepthStencilFormat())
+    if (format == Graphics::GetDepthStencilFormat())
     #else
     if (format == GL_DEPTH_COMPONENT16 || format == GL_DEPTH_COMPONENT24_OES || format == GL_DEPTH24_STENCIL8_OES ||
         (format == GL_DEPTH_COMPONENT && !graphics_->GetShadowMapFormat()))