summaryrefslogtreecommitdiff
path: root/tests/texturing
AgeCommit message (Collapse)AuthorFilesLines
2015-07-27compressedteximage: bump the texture size to reproduce a radeonsi bug (v2)Marek Olšák1-1/+4
v2: for some reason, the bigger size has more precision issues Reviewed-by: Brian Paul <brianp@vmware.com>
2015-07-22tex3d-maxsize: print max 3D texture size that's found/testedBrian Paul1-0/+4
2015-07-21Test sampling functions with constant zero argumentsNeil Roberts2-0/+257
Tests various texture sampling functions using constant 0 values for the arguments. The i965 driver has optimisations for trailing 0 arguments to sampler messages so the intention is to test these code paths.
2015-07-20texwrap: skip if integers or offset used with non-2DDave Airlie1-0/+8
The test doesn't support these cases yet, since the shaders are hardcoded to use 2D samplers. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-02Test luminance, rgba texture handling in glReadPixels() with PBOAnuj Phogat1-6/+61
Testing with PBO currently fails on Mesa i965 driver. V2: Fix a copy-paste error. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-06-02Test luminance, rgba texture handling in glGetTexImage() with PBOAnuj Phogat1-6/+60
Testing with PBO currently fails on Mesa i965 driver. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-05-28texwrap: fix missing brace.Dave Airlie1-1/+1
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-05-28texwrap: test wrapping texture offsetsDave Airlie1-2/+58
while writing softpipe support I realised we didn't have tests for any of this, this just adds a new parameter to texwrap to test texture offsets, Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-05-13s3tc-errors: Use -4, not -3 as an invalid x offsetJames Jones1-1/+1
The code in question passes "-3" for the X offset of a TexSubImage2D operation. TexSubImage2D is defined to generate INVALID_VALUE for offsets that are less than the negative border width, and that is what the test expects. However, TexSubImage2D is also defined to generate INVALID_OPERATION for offsets that are not multiples of 4 when using S3TC textures, as this test does. Therefore, implementations can legitimately generate either error here. To avoid ambiguity, use -4 instead. Passes on GeForce GTX 680 (binary driver 346.47) Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-05-11Don't use default texture objectAnuj Phogat1-1/+6
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-05-11Add usage information to getteximage-targetsAnuj Phogat1-43/+75
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-29copyteximage: Fix the z coordinate used for rendering 3D texturesNeil Roberts1-1/+1
The copyteximage test tries to render each layer of a 3D texture by rendering a quad with the same z value in the texture coordinates for each vertex. It was picking this value by just dividing the layer number by the depth of the texture. I think this is wrong because it will effectively point to the nearest face of the cube represented by the 3D texel that we want. This point is equidistant between two texels so it might be valid for an implementation to pick the other texel. What we actually want is to set the texture coordinate to the center of the texel. This patch makes it do that by just adding 0.5 before doing the division. This doesn't seem to make any practical difference on Intel hardware or with the software renderer in Mesa but at least in theory I think it is more correct.
2015-04-13texwrap: add GL_ARB_texture_stencil8 supportDave Airlie1-1/+13
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-13fbo-formats: add texture_stencil8 supportDave Airlie1-0/+1
Make sure to disable stencil textures everywhere we disable depth ones. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-02texturing: Testing glGenerateMipmap(GL_TEXTURE_CUBE_MAP) without glTexStorage2D.Laura Ekstrand2-0/+91
This test reproduces the cause of Mesa Bug 89526 in Piglit. While investigating 89526, it was discovered that Piglit had no tests that created a cube map texture without glTexStorage2D and then called glGenerateMipmap on it. For this reason, the offending commit was upstreamed before the failure was caught. This test successfully fails when commit 1ee000a is present and passes when 1ee000a is reverted. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-03-25tex-miplevel-selection: Fix textureProj failures due to precision errorsIago Toral Quiroga1-4/+4
The textureProj tests multiply expected texture coordinates by the projector in advance so that when the driver does the division we obtain the same coordinates. However, the division can lead to small rounding errors that can affect the selected layer and fail the tests. This is currently happening on Intel hardware for all projector tests involving 3D textures. When we test a 3D texture for texture level 0 we have 32 layers, which means that each layer takes 1/32 = 0.03125 space in the [0, 1] texture coordinate space. The test uses 0.5 for the Z coordinate, which is exactly the boundary between layers 15 and 16 (16 * 0.03125 = 0.5). Because we first multiply 0.5 by the projector in CPU and then we divide the coordinate by the driver in the GPU, the result may be subject to rounding/precision errors and if the result of this operation is even slighly smaller than 0.5 the hardware will select layer 15 instead of layer 16, leading to the test failures we currently see, at least on Intel hardware, for all piglit tests that involve textureProj with 3D textures. The patch prevents this rounding from affecting the result of the test by using 0.51 as the target texture coordinates instead of 0.5. Because 0.51 is 0.01 into layer 16, we are giving a small room for rounding/precision errors that won't lead the hardware to select a different layer. This fixes all projector tests on Intel hardware: bin/tex-miplevel-selection *ProjGradARB 3D -fbo -auto bin/tex-miplevel-selection *ProjLod 3D -fbo -auto bin/tex-miplevel-selection textureProj 3D -fbo -auto bin/tex-miplevel-selection textureProjGrad 3D -fbo -auto bin/tex-miplevel-selection textureProjGradOffset 3D -fbo -auto bin/tex-miplevel-selection textureProjOffset 3D -fbo -auto bin/tex-miplevel-selection "textureProj(bias)" 3D -fbo -auto bin/tex-miplevel-selection "textureProjOffset(bias)" 3D -fbo -auto Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81405
2015-03-02Don't use default texture objectAnuj Phogat1-0/+3
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
2015-03-02Fix arguments count check and the test nameAnuj Phogat1-2/+2
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
2015-02-24getteximage-luminance: remove obsolete piglit_dispatch_default_init() callEmil Velikov1-1/+1
By the time piglit_init() is executed, the context is creates and the dispatch table has been initialised. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-02-18getteximage-targets: Allow S3TC tests with GL_ANGLE_texture_compression_dxt5Ian Romanick1-1/+9
Since this test only uses pre-compressed DXT5 data, it can safely run with GL_ANGLE_texture_compression_dxt5. This extension is advertised by at least the Mesa i965 driver even when libtxc_dxtn is not installed. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2015-01-13cubemap-mismatch: new test of mismatched cube map facesBrian Paul2-0/+99
OpenGL actually allows creating a cube map with different sizes and formats per-face. Though, it can't actually be used for texturing. This test checks that no unexpected error is raised when such a texture is created and that the GL actually keeps track of the per-face sizes. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2015-01-13texture-packed-formats: Don't try bother with ABGR_EXT formatsJason Ekstrand1-13/+0
Since GL_ABGR_EXT was extension number 1 to the GL spec, it didn't take packed formats into account. As far as I can tell from the way the packed formats extensions are written, packed formats with GL_ABGR_EXT isn't allowed by the spec. NVIDIA allows it but AMD doesn't and our driver hasn't allowed ith with UNSIGNED_INT_5_5_5_1 as of c471b09bf4. Let's stop testing invalid things. Tested-by: Mark Janes <mark.a.janes@intel.com> Reviewed-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
2015-01-13texsubimage: Optionally use a PBO for the subimage uploadNeil Roberts1-12/+36
If the pbo option is given on the command line then the image sub-data will instead be uploaded from a PBO rather than directly from the malloc'd array. This is worth testing because the drivers often have different code-paths for PBO uploads. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-09texsubimage: Test GL_ARB_texture_cube_map_arrayNeil Roberts1-4/+67
If texsubimage is passed cube_map_array on the command line it will try updating a subregion of a cube map array. All of the faces of all of the layers of the texutre are rendered using a special vertex shader to modify the texture coordinates so that they pick a particular face based on the z coordinate modulo 6. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08textureSize: Silence GCC maybe-uninitialized warning.Vinson Lee1-1/+1
textureSize.c: In function 'generate_GLSL': textureSize.c:367:22: warning: 'gs' may be used uninitialized in this function [-Wmaybe-uninitialized] if (!vs || (gs_code && !gs) || !fs) ^ Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-01-08tex-miplevel-selection: Fix GCC maybe-uninitialized warnings.Vinson Lee1-1/+2
tex-miplevel-selection.c: In function 'piglit_init': tex-miplevel-selection.c:919:58: warning: 'num_layers' may be used uninitialized in this function [-Wmaybe-uninitialized] (gltarget != GL_TEXTURE_3D && layer == TEST_LAYER % num_layers)) { ^ tex-miplevel-selection.c:486:8: warning: 'type_str' may be used uninitialized in this function [-Wmaybe-uninitialized] if (!strcmp(type_str, "float")) ^ tex-miplevel-selection.c:764:4: warning: 'target_str' may be used uninitialized in this function [-Wmaybe-uninitialized] sprintf(fscode, GL3_FS_CODE, version, target_str, ^ Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-01-08texsubimage: Add tests for array texturesNeil Roberts1-25/+112
If the 'array' command line option is passed to the texsubimage test it will now try updating subregions of 1D and 2D array textures. This requires a shader to render. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-12-18texsubimage: Update the textures with different valuesNeil Roberts1-52/+145
Previously the test was updating sub regions of the test texture with the same values that were already in the texture. Therefore an implementation that does nothing on glTexSubImage2D would pass which doesn't seem very useful. This patch makes it create two reference images with different values. At each update the entire texture is recreated with the values from the first image and then a sub region is updated with the values from the second image. The values are then compared as before via glReadPixels but at each texel it decides whether to compare with the first or second image depending on whether the texel is in the updated region. Reviewed-by: Brian Paul <brianp@vmware.com>
2014-12-18texsubimage: Render all of the images of a 3D textureNeil Roberts1-7/+28
Previously when testing a 3D texture the test would just draw a single image with the width and height of the texture and the z coordinates set to span across the depth. This wouldn't end up drawing all of the texels in the texture so instead it will now render all of the images in a vertical line. In order to do this the test needs a taller window than the default 160 pixels. Reviewed-by: Brian Paul <brianp@vmware.com>
2014-12-18texsubimage: Fix updating a sub-region of a 3D textureNeil Roberts1-1/+1
When the texture target is GL_TEXTURE_3D the test wasn't updating a sub-region of the texture due to what looks like a typo. The test was passing anyway because the data it uploads is the same as the original data so doing nothing is valid behaviour according to the test. Reviewed-by: Brian Paul <brianp@vmware.com>
2014-12-14teximage-colors: Add comment to silence Coverity defect.Vinson Lee1-0/+1
Silences Coverity report about missing break in switch. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2014-12-13teximage-colors: Remove self assignment.Vinson Lee1-1/+0
Fix self assignment defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-By: Jason Ekstrand <jason.ekstrand@intel.com>
2014-12-03util: convert piglit_getmicroseconds to piglit_time_get_nanoEmil Velikov1-3/+3
This way we can actually reuse it in {arb,ext}_timer_query Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-11-08tests/util: Consolidate the MSVC ffs implementations.José Fonseca2-42/+0
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-29texture-packed-formats: Move the probes to a separate loop.Eric Anholt1-5/+13
This avoids having to flush rendering after every texture operation. Combined with a vc4 driver fix, reduces runtime of the test on simulation from 160s to 44s. It's still provoking a lot of flushes, because each slice of the 3d texture uploads is being DISCARD_RANGE-mapped individually. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29texture-packed-formats: Move some GL state transitions outside of the loop.Eric Anholt1-10/+10
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29texture-packed-formats: Draw each rect as a 4x4 quad.Eric Anholt1-28/+11
There are only 4x4 texels, so let's just draw each one, and actually sample them all. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29texture-packed-formats: Reformat to piglit whitespace style.Eric Anholt1-257/+261
Editing was irritating because indentation was wrong. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29texture-packed-formats: Drop unused blend code.Eric Anholt1-8/+0
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-27tests/texturing/bptc: Don't use zero-sized array initializers.José Fonseca2-13/+13
IIRC they are not a standard C feature. At any rate, they aren't accepted by MSVC. Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-21Replaced assert(glGetError()) with gl_check_gl_error()Juliet fru2-8/+16
Report PIGLIT_FAIL if there's an unexpected error. Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-13teximage-colors: fix bogus precision assumptions and other issuesRoland Scheidegger1-5/+40
Some formats had some "implied" precision which relied on the driver picking a specific hw format (e.g. RGB4 and RGB5 both relied on driver picking 565). These tests will now be skipped (for the exact test). Others didn't have any implied precision but relied on driver picking a format with at least 8 bits even though the internal format only implied 4. Also, the exact tests for srgb8 and srgb8_alpha8 were failing too due to using GL_BYTE instead of GL_UNSIGNED_BYTE. With these fixes the only tests llvmpipe is failing seem to be the exact GL_RGB8_SNORM and GL_RGB16_SNORM ones (1, 2 or 4 channels work and the errors seem to be one bit so maybe triggers some conversion somewhere using different signed conversion formula). v2: fix indentation Reviewed-by: Brian Paul <brianp@vmware.com> Revuewed-by: Jason Exstrand <jason.ekstrand@intel.com>
2014-09-18teximage-color: Fix un_to_float for 32-bit buildsNeil Roberts1-1/+1
The un_to_float function was trying to get the maximum value given a number of bits by shifting ~0ul by the number of bits. For the GL_UNSIGNED_INT type this function was also being used to get a maximum value for a 32-bit quantity. However on a 32-bit build this would mean that it is shifting a 32-bit integer (unsigned long is 32-bit) by 32 bits. The C spec leaves it undefined what happens if you do a shift that is greater than the number of bits in the type. GCC takes advantage of that to make the shift a no-op so the maximum was ending up as zero and the test fails. This patch makes it shift ~0u in the other direction so that it doesn't matter what size unsigned int is and it won't try to shift by 32. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83695 Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Tested-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-17teximage-colors: Don't try to do exact upload/download on 12-bit formatsJason Ekstrand1-3/+3
Since we can't give a 12-bit input, trying to do an exact test doesn't really make sense. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-05Add a test for glTexImage color conversionsJason Ekstrand2-0/+873
This test tests most of the color conversions possible on glTexImage. The test executable also takes a --benchmark flag to allow you to benchmark any of the color conversion operations. It does not test any of transfer operations nor does it test compressed or depth/stencil texture formats. Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-05Make getteximage-luminance less susceptible to rounding errorJason Ekstrand1-1/+1
In the readpixels_rgba_as_lum test, use three values which don't nicely convert to unsigned bytes and then sum them and assume that we'll be very close to the floatin-point sum. If the implementation rounds down during texture upload, the test used to fail. This switches it to use the pixman-standard tollerance of 3.0 / 255. Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-19tex-miplevel-selection: test textureGrad with cubemapsMarek Olšák1-1/+19
llvmpipe passes, which is probably the only driver which implements it correctly.
2014-08-12Add a test for all of the modes of the two half-float formats of BPTCNeil Roberts2-0/+1010
The test creates a texture with a block for each of the possible modes of the half-float formats of BPTC and then retrieves it as a half-float texture via glGetTexImage. This should test that the decompressor works correctly with all possible code paths. It doesn't test rendering the texture because that is a bit more tricky to do accurately as it is not possible to create a half-float render target. The data is generated randomly with an external program which also generated the expected results. There are expected results for both the signed and unsigned formats.
2014-08-12compressedteximage: Add tests for the four BPTC formatsNeil Roberts1-0/+10
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-12texwrap: Add the BPTC formatsNeil Roberts1-0/+13
Reviewed-by: Marek Olšák <marek.olsak@amd.com>