Skip to content
Merged
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
1 change: 1 addition & 0 deletions sdk/tests/conformance/glsl/misc/00_test_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ shader-with-default-precision.vert.html
shader-with-dfdx-no-ext.frag.html
shader-with-dfdx.frag.html
--min-version 1.0.2 shader-with-do-loop.html
--min-version 1.0.4 shader-with-double-underscore.html
shader-with-error-directive.html
shader-with-explicit-int-cast.vert.html
shader-with-float-return-value.frag.html
Expand Down
43 changes: 43 additions & 0 deletions sdk/tests/conformance/glsl/misc/shader-with-double-underscore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--
Copyright (c) 2026 The Khronos Group Inc.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE.txt file.
-->

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL GLSL Conformance Tests</title>
<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
<script src="../../../js/js-test-pre.js"></script>
<script src="../../../js/webgl-test-utils.js"></script>
<script src="../../../js/glsl-conformance-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script id="vertexShader" type="text/something-not-javascript">
// vertex shader that uses double-underscore in identifier should succeed
attribute vec4 foo__bar;
void main()
{
gl_Position = foo__bar;
}
</script>
<script id="fragmentShader" type="text/something-not-javascript">
// fragment shader that uses double-underscore in identifier should succeed
attribute vec4 foo__bar;
void main()
{
gl_FragColor = foo__bar;
}
</script>
<script>
"use strict";
GLSLConformanceTester.runTest();
var successfullyParsed = true;
</script>
</body>
</html>
10 changes: 10 additions & 0 deletions specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4668,6 +4668,16 @@ <h3><a name="CURRENT_PROGRAM_INVALIDATED">Current program invalidated upon unsuc
</p>
</div>


<h3><a name="DOUBLE_UNDERSCORE_IN_SHADER_IDENTIFIERS">Double-Underscore in Shader Identifiers</a></h3>
<p>
Identifiers in shaders may contain double-underscores, for example as in <code>"g__Foo"</code>.
</p>
<div class="note rationale">
To ensure robust portablility, implementations shall support this even if the underlying driver does not support this. (via e.g. mangling)
</div>


<!-- ======================================================================================================= -->

<h2>References</h2>
Expand Down