Shader compiler unprepared to make ESSL output when GLES is used
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 13:07:17 +0000 (13:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 13:07:17 +0000 (13:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=87718

Patch by Roland Takacs <takacs.roland@stud.u-szeged.hu> on 2012-06-26
Reviewed by Noam Rosenthal.

Defined a new member that says what type of output code must be generated
(SH_GLSL_OUTPUT, SH_ESSL_OUTPUT). It is set within the constructor.

* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
(WebCore::ANGLEWebKitBridge::validateShaderSource):
* platform/graphics/ANGLEWebKitBridge.h:
(ANGLEWebKitBridge):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121259 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

index c3df106..f882df6 100755 (executable)
@@ -1,3 +1,21 @@
+2012-06-26  Roland Takacs  <takacs.roland@stud.u-szeged.hu>
+
+        Shader compiler unprepared to make ESSL output when GLES is used
+        https://bugs.webkit.org/show_bug.cgi?id=87718
+
+        Reviewed by Noam Rosenthal.
+
+        Defined a new member that says what type of output code must be generated
+        (SH_GLSL_OUTPUT, SH_ESSL_OUTPUT). It is set within the constructor.
+
+        * platform/graphics/ANGLEWebKitBridge.cpp:
+        (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
+        (WebCore::ANGLEWebKitBridge::validateShaderSource):
+        * platform/graphics/ANGLEWebKitBridge.h:
+        (ANGLEWebKitBridge):
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+
 2012-06-26  Philip Rogers  <pdr@google.com>
 
         Fix bug where animations failed to start
index 73848bd..c931666 100644 (file)
 
 namespace WebCore {
 
-
-ANGLEWebKitBridge::ANGLEWebKitBridge() :
+ANGLEWebKitBridge::ANGLEWebKitBridge(ShShaderOutput shaderOutput) :
     builtCompilers(false),
     m_fragmentCompiler(0),
-    m_vertexCompiler(0)
+    m_vertexCompiler(0),
+    m_shaderOutput(shaderOutput)
 {
     ShInitialize();
 }
@@ -69,8 +69,8 @@ void ANGLEWebKitBridge::setResources(ShBuiltInResources resources)
 bool ANGLEWebKitBridge::validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog)
 {
     if (!builtCompilers) {
-        m_fragmentCompiler = ShConstructCompiler(SH_FRAGMENT_SHADER, SH_WEBGL_SPEC, SH_GLSL_OUTPUT, &m_resources);
-        m_vertexCompiler = ShConstructCompiler(SH_VERTEX_SHADER, SH_WEBGL_SPEC, SH_GLSL_OUTPUT, &m_resources);
+        m_fragmentCompiler = ShConstructCompiler(SH_FRAGMENT_SHADER, SH_WEBGL_SPEC, m_shaderOutput, &m_resources);
+        m_vertexCompiler = ShConstructCompiler(SH_VERTEX_SHADER, SH_WEBGL_SPEC, m_shaderOutput, &m_resources);
         if (!m_fragmentCompiler || !m_vertexCompiler) {
             cleanupCompilers();
             return false;
index 7d6ad78..d75b5f2 100644 (file)
@@ -47,7 +47,7 @@ enum ANGLEShaderType {
 class ANGLEWebKitBridge {
 public:
 
-    ANGLEWebKitBridge();
+    ANGLEWebKitBridge(ShShaderOutput = SH_GLSL_OUTPUT);
     ~ANGLEWebKitBridge();
     
     ShBuiltInResources getResources() { return m_resources; }
@@ -64,6 +64,8 @@ private:
     ShHandle m_fragmentCompiler;
     ShHandle m_vertexCompiler;
 
+    ShShaderOutput m_shaderOutput;
+
     ShBuiltInResources m_resources;
 };
 
index 37b1817..6f8749b 100644 (file)
@@ -313,6 +313,7 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri
 GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
     : m_currentWidth(0)
     , m_currentHeight(0)
+    , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
     , m_attrs(attrs)
     , m_texture(0)
     , m_compositorTexture(0)