1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-limited-indexing.frag.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +<!-- 1.5 +Copyright (c) 2011 The Chromium Authors. All rights reserved. 1.6 +Use of this source code is governed by a BSD-style license that can be 1.7 +found in the LICENSE file. 1.8 +--> 1.9 +<!DOCTYPE html> 1.10 +<html> 1.11 +<head> 1.12 +<meta charset="utf-8"> 1.13 +<title>WebGL GLSL Conformance Tests</title> 1.14 +<link rel="stylesheet" href="../../../resources/js-test-style.css"/> 1.15 +<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> 1.16 +<script src="../../../resources/js-test-pre.js"></script> 1.17 +<script src="../../resources/webgl-test-utils.js"></script> 1.18 +<script src="../../resources/glsl-conformance-test.js"></script> 1.19 +</head> 1.20 +<body> 1.21 +<div id="description"></div> 1.22 +<div id="console"></div> 1.23 +<script id="vertexShader" type="text/something-not-javascript"> 1.24 +// vertex shader should succeed 1.25 +attribute vec4 a_weights; 1.26 +varying vec4 v_weights; 1.27 + 1.28 +void main() { 1.29 + v_weights = a_weights; 1.30 + gl_Position = vec4(0.0, 0.0, 0.0, 1.0); 1.31 +} 1.32 +</script> 1.33 +<script id="fragmentShader" type="text/something-not-javascript"> 1.34 +// fragment shader with appropriately limited indexing expression should succeed 1.35 +// http://www.khronos.org/registry/webgl/specs/latest/#SUPPORTED_GLSL_CONSTRUCTS 1.36 +precision mediump float; 1.37 + 1.38 +uniform vec4 u_colors[8]; 1.39 +varying vec4 v_weights; 1.40 + 1.41 +void main() 1.42 +{ 1.43 + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); 1.44 + for (int i = 0; i < 4; i++) { 1.45 + color += u_colors[i] * v_weights[i]; 1.46 + } 1.47 + gl_FragColor = color; 1.48 +} 1.49 +</script> 1.50 +<script> 1.51 +GLSLConformanceTester.runTest(); 1.52 +successfullyParsed = true; 1.53 +</script> 1.54 +</body> 1.55 +</html>