Title: [156205] trunk/Source/WebCore
- Revision
- 156205
- Author
- [email protected]
- Date
- 2013-09-20 15:17:09 -0700 (Fri, 20 Sep 2013)
Log Message
Shaders that fail to compile should be marked as such
https://bugs.webkit.org/show_bug.cgi?id=121721
Reviewed by Simon Fraser.
1. Add a new logging channel for WebGL.
2. If a translated shader fails to compile (technically
this should never happen), mark it as invalid.
Test: https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shader-with-non-reserved-words.html
* platform/Logging.h: New WebGL channel.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::compileShader): Log the raw and translated
input to glCompileShader, but mark the entry as invalid.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (156204 => 156205)
--- trunk/Source/WebCore/ChangeLog 2013-09-20 21:58:46 UTC (rev 156204)
+++ trunk/Source/WebCore/ChangeLog 2013-09-20 22:17:09 UTC (rev 156205)
@@ -1,3 +1,22 @@
+2013-09-20 Dean Jackson <[email protected]>
+
+ Shaders that fail to compile should be marked as such
+ https://bugs.webkit.org/show_bug.cgi?id=121721
+
+ Reviewed by Simon Fraser.
+
+ 1. Add a new logging channel for WebGL.
+
+ 2. If a translated shader fails to compile (technically
+ this should never happen), mark it as invalid.
+
+ Test: https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shader-with-non-reserved-words.html
+
+ * platform/Logging.h: New WebGL channel.
+ * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+ (WebCore::GraphicsContext3D::compileShader): Log the raw and translated
+ input to glCompileShader, but mark the entry as invalid.
+
2013-09-20 Mario Sanchez Prada <[email protected]>
[ATK] Do not expose aria-help in ATK based platforms
Modified: trunk/Source/WebCore/platform/Logging.h (156204 => 156205)
--- trunk/Source/WebCore/platform/Logging.h 2013-09-20 21:58:46 UTC (rev 156204)
+++ trunk/Source/WebCore/platform/Logging.h 2013-09-20 22:17:09 UTC (rev 156205)
@@ -66,6 +66,7 @@
M(StorageAPI) \
M(Threading) \
M(WebAudio) \
+ M(WebGL) \
#define DECLARE_LOG_CHANNEL(name) \
extern WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name);
Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (156204 => 156205)
--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2013-09-20 21:58:46 UTC (rev 156204)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2013-09-20 22:17:09 UTC (rev 156205)
@@ -42,6 +42,7 @@
#include "ImageData.h"
#include "IntRect.h"
#include "IntSize.h"
+#include "Logging.h"
#include "NotImplemented.h"
#include <cstring>
#include <runtime/ArrayBuffer.h>
@@ -469,10 +470,15 @@
::glGetShaderInfoLog(shader, length, &size, info.get());
entry.log = info.get();
+
+ if (GLCompileSuccess != GL_TRUE) {
+ entry.isValid = false;
+ LOG(WebGL, "Error: shader translator produced a shader that OpenGL would not compile.");
+ LOG(WebGL, "--- begin original shader source ---\n%s\n--- end original shader source ---\n", getShaderSource(shader).utf8().data());
+ LOG(WebGL, "--- begin translated shader source ---\n%s\n--- end translated shader source ---", translatedShaderPtr);
+ }
}
- // ASSERT that ANGLE generated GLSL will be accepted by OpenGL.
- ASSERT(GLCompileSuccess == GL_TRUE);
#if PLATFORM(BLACKBERRY) && !defined(NDEBUG)
if (GLCompileSuccess != GL_TRUE)
BBLOG(BlackBerry::Platform::LogLevelWarn, "The shader validated, but didn't compile.\n");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes