glx-multithread-texture: Avoid front-buffer rendering.
[piglit.git] / tests / shaders / glsl-link-bug38015.c
blobb7d3f356104e9c69f83e651069b0f63c76f07d80
1 /*
2 * Copyright 2011 VMware, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
24 /**
25 * \file glsl-link-bug38015.c
27 * Reproduces i965 crash from FDO bug 38015.
29 * \author Vinson Lee <vlee@vmware.com>
32 #include "piglit-util-gl.h"
34 PIGLIT_GL_TEST_CONFIG_BEGIN
36 config.supports_gl_compat_version = 10;
38 config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
40 PIGLIT_GL_TEST_CONFIG_END
42 static const char fs_text[] =
43 "#extension GL_ARB_shader_texture_lod : enable\n"
44 "uniform sampler2D S0;"
45 "void main(void) {"
46 " vec2 coord = vec2(0.0, 0.0);"
47 " vec2 ddx = vec2(0.0, 0.0);"
48 " vec2 ddy = vec2(0.0, 0.0);"
49 " gl_FragColor = texture2DGradARB(S0, coord, ddx, ddy);"
50 "}";
52 enum piglit_result
53 piglit_display(void)
55 return PIGLIT_FAIL;
58 void piglit_init(int argc, char **argv)
60 GLint frag;
61 GLint prog;
62 const char *fs_text_ptr = fs_text;
64 piglit_require_gl_version(20);
66 /* Intentionally omit check for GL_ARB_shader_texture_lod. */
68 frag = glCreateShader(GL_FRAGMENT_SHADER);
69 glShaderSource(frag, 1, (const GLchar **) &fs_text_ptr, NULL);
70 glCompileShader(frag);
72 prog = glCreateProgram();
73 glAttachShader(prog, frag);
74 glLinkProgram(prog);
76 piglit_report_result(PIGLIT_PASS);