Commit 3be806e8 authored by Nicolai Hähnle's avatar Nicolai Hähnle

New test: bugs/crash-texparameter-before-teximage

parent 7c8a1edc
......@@ -75,6 +75,7 @@ fpgeneric['lrp_sat'] = make_fpgeneric('lrp_sat.fp')
shaders['fp-generic'] = fpgeneric
bugs = Group()
bugs['crash-texparameter-before-teximage'] = PlainExecTest([testBinDir + 'crash-texparameter-before-teximage', '-auto'])
bugs['fdo9833'] = PlainExecTest([testBinDir + 'fdo9833', '-auto'])
bugs['fdo10370'] = PlainExecTest([testBinDir + 'fdo10370', '-auto'])
bugs['fdo14575'] = PlainExecTest([testBinDir + 'fdo14575', '-auto'])
......
......@@ -19,6 +19,7 @@ link_libraries (
piglitutil
)
add_executable (crash-texparameter-before-teximage crash-texparameter-before-teximage.c)
add_executable (fdo9833 fdo9833.c)
add_executable (fdo10370 fdo10370.c)
add_executable (fdo14575 fdo14575.c)
......
/**
* @file crash-texparameter-before-teximage.c
*
* Test case for "crash before first TexImage"; this happened in the R300
* driver before Mesa commit c1fb448ce8dd98f8e5fd5a39707f96cc14535bd4
*
* This bug was originally triggered by Glest.
*/
#include "GL/glut.h"
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
#include "piglit-util.h"
static int Width = 100, Height = 100;
static void Display(void)
{
piglit_report_result(PIGLIT_SUCCESS);
}
static void init()
{
glViewport(0, 0, Width, Height);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
if (glutExtensionSupported("GL_ARB_shadow"))
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE_ARB, GL_ALPHA);
if (glutExtensionSupported("GL_ARB_shadow_ambient"))
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB, 0.1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, -4);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
}
int main(int argc, char**argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(Width, Height);
glutCreateWindow(argv[0]);
glutDisplayFunc(Display);
init();
glutMainLoop();
return 0;
}
// BEGIN_COPYRIGHT -*- glean -*-
//
//
// Copyright (C) 1999 Allen Akin All Rights Reserved.
//
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
......@@ -10,11 +10,11 @@
// sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the
// Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
// KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
......@@ -23,7 +23,7 @@
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
//
// END_COPYRIGHT
// tpointatten.h: Test GL_ARB_point_parameters extension.
......@@ -186,6 +186,8 @@ PointAttenuationTest::testPointRendering(GLboolean smooth)
// draw column of points
glClear(GL_COLOR_BUFFER_BIT);
printf("atten: %f %f %f min/max: %f %f size: %f\n",
atten[0], atten[1], atten[2], min, max, size);
glBegin(GL_POINTS);
for (float z = -6.0; z <= 6.0; z += 1.0) {
glVertex3f(0, z, z);
......@@ -228,6 +230,8 @@ PointAttenuationTest::runOne(BasicResult &r, Window &w)
if (r.pass)
r.pass = testPointRendering(GL_FALSE);
w.swap();
sleep(10);
if (r.pass)
r.pass = testPointRendering(GL_TRUE);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment