Source code

Revision control

Copy as Markdown

Other Tools

<!--
Copyright (c) 2019 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>Disallowed uniform block layouts</title>
<link rel="stylesheet" href="../../resources/js-test-style.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="fshaderPackedUniformBlock" type="x-shader/x-fragment">#version 300 es
precision mediump float;
out vec4 my_FragColor;
layout(packed) uniform foo {
vec4 bar;
};
void main() {
my_FragColor = bar;
}
</script>
<script id="fshaderSharedUniformBlock" type="x-shader/x-fragment">#version 300 es
precision mediump float;
out vec4 my_FragColor;
layout(shared) uniform foo {
vec4 bar;
};
void main() {
my_FragColor = bar;
}
</script>
<script type="application/javascript">
"use strict";
description("WebGL does not allow interface blocks with shared or packed layouts.");
GLSLConformanceTester.runTests([
{
fShaderId: 'fshaderPackedUniformBlock',
fShaderSuccess: false,
passMsg: 'Packed uniform buffers are disallowed'
},
{
fShaderId: 'fshaderSharedUniformBlock',
fShaderSuccess: false,
passMsg: 'Shared uniform buffers are disallowed'
}
], 2);
</script>
</body>
</html>