Browse Source

A couple shader issues rooted out in WebGL

Josh Engebretson 10 years ago
parent
commit
c0ee6a7221

+ 5 - 0
Source/Atomic/Graphics/OpenGL/OGLGraphics.cpp

@@ -1465,8 +1465,13 @@ void Graphics::SetTexture(unsigned index, Texture* texture)
                         glDisable(textureTypes_[index]);
                         glDisable(textureTypes_[index]);
                 }
                 }
 
 
+// ATOMIC BEGIN - glEnable GL_TEXTURE_2D is invalid, should check this on ES2 as well
+#ifndef EMSCRIPTEN
                 if (!gl3Support)
                 if (!gl3Support)
                     glEnable(glType);
                     glEnable(glType);
+#endif
+// ATOMIC END
+
                 textureTypes_[index] = glType;
                 textureTypes_[index] = glType;
             }
             }
 
 

+ 2 - 0
Source/Atomic/Graphics/Shader.cpp

@@ -102,7 +102,9 @@ bool Shader::BeginLoad(Deserializer& source)
 #ifdef ATOMIC_OPENGL
 #ifdef ATOMIC_OPENGL
     vsSourceCode_.Replace("void VS(", "void main(");
     vsSourceCode_.Replace("void VS(", "void main(");
     psSourceCode_.Replace("void PS(", "void main(");
     psSourceCode_.Replace("void PS(", "void main(");
+    // ATOMIC BEGIN - reported shader compiler error here: https://github.com/urho3d/Urho3D/issues/870
     psSourceCode_.Replace("attribute ", "// attribute ");
     psSourceCode_.Replace("attribute ", "// attribute ");
+    // ATOMIC END
 #endif
 #endif
 
 
     RefreshMemoryUse();
     RefreshMemoryUse();