summaryrefslogtreecommitdiff
path: root/tests/shaders/fp-fragment-position.c
AgeCommit message (Collapse)AuthorFilesLines
2014-07-15util/gl: Rename piglit-util-gl-common.hChad Versace1-1/+1
There are no longer any source files in tests/util that are specific to a particular OpenGL API. In other words, all OpenGL utility sources in tests/util are now "common" and shared by all OpenGL APIs. So remove the 'common' in filename 'piglit-util-gl-common.h'. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-16Rework the PIGLIT_GL_VISUAL flags, fix RGB vs RGBA vs ALPHA confusionMarek Olšák1-1/+1
Changes: - SINGLE is removed, because its value was 0 - ALPHA is removed, because it becomes redundant with this change - RGB asks for an RGB visual - RGBA asks for an RGBA visual - if RGB and RGBA are unset, it asks for a visual without RGB(A) Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> v2: fix glut
2012-10-29fp-fragment-position: use auto mipmap generation instead of gluBuild2DMipmaps()Brian Paul1-4/+5
To remove dependency on glu.h Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-15Fix missing glu.h inclusionsMarek Olšák1-0/+1
The texgrad test has been completely broken because of this.
2012-10-09util: Add fields to piglit_gl_test_config for listing supported GL flavors (v2)Chad Versace1-0/+2
This patch has 3 interrelated components. 1) Add the following fields to piglit_gl_test_config: supports_gl_core_version supports_gl_compat_version supports_gl_es1 supports_gl_es2 These allow a test to specify what GL flavors under which it can run. For details, see the documentation for struct piglit_gl_test_config. 2. In tests/util/piglit-framework-gl, implement support for the new fields. 3. In each GL test source, add one of the new fields to the PIGLIT_GL_TEST_CONFIG_BEGIN/END block. For GLES1 tests, add `supports_gl_es1 = true`. For GLES2 tests, add `supports_gl_es2 = true`. For desktop GL tests, add `supports_gl_compat_version = 10`. For an explanation of why version 1.0 is used for desktop GL tests, see the documentation for supports_gl_compat_version. No tests yet require a GL core context. v2: Replace silly sum of booleans with a logical conjuction. For Anholt. Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Paul Berry <stereotype441@gmail.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09util: Convert GL tests to use PIGLIT_GL_CONFIG_BEGIN/ENDChad Versace1-4/+7
This patch has two components. 1. In tests/util/piglit-framework-gl.h, replace the definition of PIGLIT_GL_TEST_MAIN with the macro block PIGLIT_GL_CONFIG_BEGIN/END. The macro PIGLIT_GL_TEST_MAIN was very restrictive. It was a fixed-arity macro function that allowed a test to set only set 3 values: window width, height, and visual. It would have been difficult to shoehorn optional test attributes into such a fixed-arity macro function. Allowing optional attributes is an essential feature because a following commit adds optional fields to struct piglit_gl_test_config. The macro block PIGLIT_GL_TEST_CONFIG_BEGIN/END is more flexible. Within it the test is allowed to arbitrarilty modify the piglit_gl_test_config structure. 2. In each GL test source, replace PIGLIT_GL_TEST_MAIN with a PIGLIT_GL_TEST_CONFIG_BEGIN/END block. Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Paul Berry <stereotype441@gmail.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09util,tests: Replace GLUT visual enums with PIGLTI_GL_VISUAL enums (v2)Chad Versace1-1/+1
I'm trying to transition Piglit from using GLUT to using Waffle. That requires either killing or wrapping all GLUT code. Define enum piglit_gl_visual in piglit-framework.h, of which each value matches its corresponding GLUT visual enum. Do the following substitution in all util and test sources: GLUT_RGB -> PIGLIT_GL_VISUAL_RGB GLUT_RGBA -> PIGLIT_GL_VISUAL_RGBA GLUT_DOUBLE -> PIGLIT_GL_VISUAL_DOUBLE GLUT_ACCUM -> PIGLIT_GL_VISUAL_ACCUM GLUT_ALPHA -> PIGLIT_GL_VISUAL_ALPHA GLUT_DEPTH -> PIGLIT_GL_VISUAL_DEPTH GLUT_STENCIL -> PIGLIT_GL_VISUAL_STENCIL v2: Remove GLUT_INDEX, for Ken. Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Paul Berry <stereotype441@gmail.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-10Convert simple if(piglit_get_gl_version() < N) { SKIP } to requireChris Forbes1-4/+1
Generated from the following semantic patch: @@ expression VER; expression MSG; @@ - if (piglit_get_gl_version() < VER) { - printf(MSG); - piglit_report_result(PIGLIT_SKIP); ( - exit(1); | ) - } + piglit_require_gl_version(VER); Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2012-09-04tests: Remove all uses of glutGetChad Versace1-6/+0
I'm trying to transition Piglit from using GLUT to using Waffle. This requires killing all uses of GLUT functions, one-by-one. glutGet was only used in one test: fp-fragment-position. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-04Convert all glutSwapBuffers to piglit_present_resultsChris Forbes1-1/+1
V2: Don't break tests/general/read-front Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-28util: Move piglit-util to piglit-util-gl-commonBlaž Tomažič1-1/+1
Move piglit-util.* to piglit-util-gl-common.* Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-20tests: Let each test define main()Chad Versace1-2/+5
Each test that did not define main() now does so using PIGLIT_GL_TEST_MAIN(). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-07Stop using GLEW_VERSION_* macrosPaul Berry1-1/+1
Several tests were checking the GL version using GLEW's GLEW_VERSION_* macros. This patch changes the tests to use piglit_get_gl_version(), which provides the same functionality in a way that is not dependent on GLEW. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-31fp-fragment-position: fix test to not require swap buffers.Dave Airlie1-3/+2
This makes this test just do back buffer readback and only swaps buffer in the non automatic case. Fixes test on llvmpipe/softpipe. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14fp-fragment-position: Use piglit_probe_pixel_rgba.Eric Anholt1-49/+16
2011-04-29Rename PIGLIT_SUCCESS and PIGLIT_FAILURE to PIGLIT_PASS and PIGLIT_FAIL, resp.Marek Olšák1-1/+1
2009-10-15Use GLEW for vp / fp code instead of piglit "pgl" wrappersIan Romanick1-4/+4
2009-09-29Move most piglit tests to using the framework.Eric Anholt1-47/+22
This saves a giant pile of code, and should encourage cleaner testcases from people writing tests in the future.
2009-09-29Replace the copy-and-pasted header setup with consistent use of piglit-util.h.Eric Anholt1-11/+0
2009-08-21Check for OpenGL 1.3 for tests that use glActiveTexture.Vinson Lee1-0/+7
2009-08-04shaders: Remove a bunch of copies of piglit_escape_exit_key().Eric Anholt1-15/+1
2009-07-07fp-fragment-position: Fix compile errors with MSVC.Vinson Lee1-0/+2
2009-04-30Warnings cleanup, resulting in a number of actual bugfixes.Eric Anholt1-15/+0
2009-04-23Mac OS fixes for shaders testsVinson Lee1-0/+4
Include GLUT/glut.h instead of GL/glut.h. Added function pointer changes for fp-fog.c. With this patch, all the shaders tests compile and run on Mac OS.
2008-06-30Cleanup/Code sharing: Use piglit-util functions in a number of placesNicolai Haehnle1-46/+2
2008-06-29Add fragment program / vertex program helper code to piglit-utilNicolai Haehnle1-44/+3
2008-06-20Various fixes by Brian Paul.Nicolai Haehnle1-6/+35
Quote from his description: In fp-fragment-position.c the 4th fragment program uses fragment.position to index a 2D texture. Since all the fragment positions are integers > 1 the default GL_REPEAT texture wrap mode converts all the texcoords to zero. Actually, though, that's not true. Because of the way texcoords are processed, the fractional part of the coords is not always zero but some epsilon value. That caused us to sample with different texcoords than the test expects. I think it's more useful to scale the fragment position to put it into the nominal [0,1] range to get a color that varies per pixel. My patch does that, and adds some assorted comments to the code. --- In fp-list-mask.c and texrect-many.c and texdepth.c I added GLUT_ALPHA to glutInitDisplayMode(). We had failures because GLUT was sometimes choosing visuals without an alpha channel. --- < The logic in vp-bad-program.c was incorrect. When glProgramString() is called with an invalid program, we raise an error, but the previous program (if any) stays in effect. So the subsequent glBegin() would never raise an error. The proper way to check for glBegin raising an error with an invalid program is to simply bind a non-existant program. I made the same fix in glean a while ago. There's still some other failures I need to look into (and I'm not sure where the faults are) but I need to move onto some other things now.
2008-02-21Move FindLine to shared code instead of cargo-culting it around.Eric Anholt1-12/+1
2007-03-24Initial commitNicolai Hähnle1-0/+498