Results for spec/glsl-1.30/sampler-array-index-03.frag

Overview

Status: fail
Result: fail

Back to summary

Details

Detail Value
returncode 1
time 0.249000072479
note Returncode was 1
errors
  • Successfully compiled fragment shader tests/spec/glsl-1.30\\compiler\\constant-expressions\\sampler-array-index-03.frag: Fragment shader was successfully compiled to run on hardware.
info
Returncode: 1

Errors:
Successfully compiled fragment shader tests/spec/glsl-1.30\compiler\constant-expressions\sampler-array-index-03.frag: Fragment shader was successfully compiled to run on hardware.



Output:
Shader source:
// [config]
// expect_result: fail
// glsl_version: 1.30
// [end config]
//
// Check that sampler arrays cannot be indexed with non-constant expressions.
//
// From page 23 (29 of PDF) of GLSL 1.30 spec:
//     Samplers aggregated into arrays within a shader (using square brackets
//     [ ]) can only be indexed with integral constant expressions
//
// See also
// spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-01.frag.
//
// This test verifies that the compiler will reject something sensible.  This is
// to the letter of the spec.  It is likely that many compilers will accept this
// case.

#version 130

varying vec2 tc[gl_MaxTextureImageUnits];
uniform sampler2D s[gl_MaxTextureImageUnits];

void main() {
	vec4 c = vec4(0.0);

	for (int i = 0; i < gl_MaxTextureImageUnits; i++)
		c += texture(s[i], tc[i]);

	gl_FragColor = c;
}

Back to summary