Skip to content
Permalink
Browse files
Persistent WebGL Warning "vertex WARNING: 0:1: extension 'GL_ARB_gpu_…
…shader5' is not supported" in Safari 10.1.2

https://bugs.webkit.org/show_bug.cgi?id=175783
<rdar://problem/33623867>

Reviewed by Alex Christensen.

Source/WebCore:

The version of ANGLE we use inserts this line into each shader:
It causes our lower-level GLSL compiler to give a warning, which is
confusing to developers because they didn't write this code.

Until we upgrade our OpenGL support to version 4.1, we should remove
this error message from the log returned to the developer.
See https://bugs.webkit.org/show_bug.cgi?id=175785

Test: fast/canvas/webgl/no-info-log-for-simple-shaders.html

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getUnmangledInfoLog): Search for and remove
this warning.

LayoutTests:

* fast/canvas/webgl/no-info-log-for-simple-shaders-expected.txt: Added.
* fast/canvas/webgl/no-info-log-for-simple-shaders.html: Added.

Canonical link: https://commits.webkit.org/192442@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
grorg committed Aug 21, 2017
1 parent 731071f commit f627185d138d2ca178e8e07ac89e9cab7d7cca5e
@@ -1,3 +1,14 @@
2017-08-21 Dean Jackson <dino@apple.com>

Persistent WebGL Warning "vertex WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported" in Safari 10.1.2
https://bugs.webkit.org/show_bug.cgi?id=175783
<rdar://problem/33623867>

Reviewed by Alex Christensen.

* fast/canvas/webgl/no-info-log-for-simple-shaders-expected.txt: Added.
* fast/canvas/webgl/no-info-log-for-simple-shaders.html: Added.

2017-08-21 Matt Lewis <jlewis3@apple.com>

Marked svg/animations/smil-leak-list-property-instances.svg as flaky on macOS WK1.
@@ -0,0 +1,36 @@
<script id="vertexShaderSource" type="text/glsl">
attribute vec2 position;

void main() {
gl_Position = vec4(position.x, position.y, 1.0, 1.0);
}
</script>
<script id="fragmentShaderSource" type="text/glsl">
void main() {
gl_FragColor = vec4(0.0, 0.7, 0.0, 1.0);
}
</script>

<canvas width="200" height="200"></canvas>

<div id="output"></div>

<script>
if (window.testRunner)
testRunner.dumpAsText();

window.addEventListener("load", _ => {
var canvas = document.querySelector("canvas")
var gl = canvas.getContext("webgl");

var vertexShader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vertexShader, document.getElementById("vertexShaderSource").textContent);
gl.compileShader(vertexShader);
document.getElementById("output").textContent += gl.getShaderInfoLog(vertexShader);

var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fragmentShader, document.getElementById("fragmentShaderSource").textContent);
gl.compileShader(fragmentShader);
document.getElementById("output").textContent += gl.getShaderInfoLog(fragmentShader);
}, false);
</script>
@@ -1,3 +1,26 @@
2017-08-21 Dean Jackson <dino@apple.com>

Persistent WebGL Warning "vertex WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported" in Safari 10.1.2
https://bugs.webkit.org/show_bug.cgi?id=175783
<rdar://problem/33623867>

Reviewed by Alex Christensen.

The version of ANGLE we use inserts this line into each shader:
#extension GL_ARB_gpu_shader5 : enable
It causes our lower-level GLSL compiler to give a warning, which is
confusing to developers because they didn't write this code.

Until we upgrade our OpenGL support to version 4.1, we should remove
this error message from the log returned to the developer.
See https://bugs.webkit.org/show_bug.cgi?id=175785

Test: fast/canvas/webgl/no-info-log-for-simple-shaders.html

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getUnmangledInfoLog): Search for and remove
this warning.

2017-08-21 Andy Estes <aestes@apple.com>

[Payment Request] Use ExistingExceptionError to propagate JS exceptions thrown during JSON stringification
@@ -1563,14 +1563,20 @@ void GraphicsContext3D::getNonBuiltInActiveSymbolCount(Platform3DObject program,

String GraphicsContext3D::getUnmangledInfoLog(Platform3DObject shaders[2], GC3Dsizei count, const String& log)
{
LOG(WebGL, "Was: %s", log.utf8().data());
LOG(WebGL, "Original ShaderInfoLog:\n%s", log.utf8().data());

JSC::Yarr::RegularExpression regExp("webgl_[0123456789abcdefABCDEF]+", TextCaseSensitive);

StringBuilder processedLog;

int startFrom = 0;
// ANGLE inserts a "#extension" line into the shader source that
// causes a warning in some compilers. There is no point showing
// this warning to the user since they didn't write the code that
// is causing it.
static const NeverDestroyed<String> angleWarning = ASCIILiteral { "WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported\n" };
int startFrom = log.startsWith(angleWarning) ? angleWarning.get().length() : 0;
int matchedLength = 0;

do {
int start = regExp.match(log, startFrom, &matchedLength);
if (start == -1)
@@ -1587,7 +1593,7 @@ String GraphicsContext3D::getUnmangledInfoLog(Platform3DObject shaders[2], GC3Ds

processedLog.append(log.substring(startFrom, log.length() - startFrom));

LOG(WebGL, "-->: %s", processedLog.toString().utf8().data());
LOG(WebGL, "Unmangled ShaderInfoLog:\n%s", processedLog.toString().utf8().data());
return processedLog.toString();
}

0 comments on commit f627185

Please sign in to comment.