Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for bad impl #44

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,18 @@ <h1>Uniform Buffers</h1>
</div>
</script>

<script type="text/template" id="webglBadImplementation">
<div class="header">
<p>&times; This browser claims to supports WebGL <%= report.webglVersion %>, but it has an invalid or incomplete implementation.</p>
<p>
Check out <a href="http://get.webgl.org/">Get WebGL</a>,
or try installing the latest version of
<a href="https://www.google.com/chrome">Chrome</a>, or
<a href="https://www.mozilla.org/en-US/firefox/">Firefox</a>.
</p>
</div>
</script>

<script type="text/template" id="webglVersionTabs">
<div class="webglVersionTabs">
<a href="?v=1" class="<%= report.webglVersion === 1 ? 'active' : '' %>">WebGL 1</a>
Expand Down
9 changes: 8 additions & 1 deletion webglreport.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(function() {

var canvas = $('<canvas />', { width: '1', height: '1' }).appendTo('body');
var gl;
var possibleNames = (webglVersion === 2) ? ['webgl2', 'experimental-webgl2'] : ['webgl', 'experimental-webgl'];
var possibleNames = (webglVersion === 2) ? ['webgl2'] : ['webgl', 'experimental-webgl'];
var contextName = _.find(possibleNames, function (name) {
gl = canvas[0].getContext(name, { stencil: true });
return !!gl;
Expand Down Expand Up @@ -467,6 +467,13 @@ $(function() {
});
}

if (gl.getError()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question, how sensitive is this line? Is there some chance that some version of Firefox or some other browser will trip over this and fail the test even when WebGL is working? I know that Firefox can be pretty verbose with its WebGL warnings, but I don't remember if gl.getError is triggered by those warnings or only serious errors.

This might be fine, I just had to ask.

// The implementatiion is bad
$('#output').addClass('warn');
renderReport($('#webglBadImplementation').html());
return;
}

if (window.externalHost) {
// Tab is running with Chrome Frame
renderReport($('#webglSupportedChromeFrameTemplate').html());
Expand Down