Re: [Piglit] [PATCH] khr_texture_compression_astc: Allow TEXTURE_3D target if sliced_3d is supported
On Thu, Jul 14, 2016 at 02:28:31PM -0700, Anuj Phogat wrote: > Signed-off-by: Anuj Phogat > --- This patch is, Reviewed-by: Nanley Chery > .../khr_texture_compression_astc/khr_compressed_astc-basic.c | 11 > --- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git > a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > index 0269e3a..dda8229 100644 > --- a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > @@ -154,7 +154,8 @@ have_gen_mipmap_support() > * the TEXTURE_CUBE_MAP_ARRAY target. > * > */ > -void test_compressed_teximg_3d(int fi, bool have_cube_map_ext, bool have_hdr) > +void test_compressed_teximg_3d(int fi, bool have_cube_map_ext, > +bool have_hdr_or_sliced_3d) > { > int j; > GLuint tex3D; > @@ -175,7 +176,7 @@ void test_compressed_teximg_3d(int fi, bool > have_cube_map_ext, bool have_hdr) > > /* Test expected GL errors */ > if (good_compressed_tex_3d_targets[j] == GL_TEXTURE_3D > - && !have_hdr) { > + && !have_hdr_or_sliced_3d) { > REQUIRE_ERROR(GL_INVALID_OPERATION); > } else { > REQUIRE_ERROR(GL_NO_ERROR); > @@ -371,13 +372,17 @@ piglit_display(void) > bool have_gen_mipmap = have_gen_mipmap_support(); > bool have_hdr = piglit_is_extension_supported( > "GL_KHR_texture_compression_astc_hdr"); > + bool have_hdr_or_sliced_3d = have_hdr || > + piglit_is_extension_supported( > + "GL_KHR_texture_compression_astc_sliced_3d"); > > for (i = 0; i < ARRAY_SIZE(formats); i++) { > if (have_cube_map_ext) > test_non_square_img(i, have_hdr); > if (have_tex_stor_ext) > test_sub_img(i); > - test_compressed_teximg_3d(i, have_cube_map_ext, have_hdr); > + test_compressed_teximg_3d(i, have_cube_map_ext, > + have_hdr_or_sliced_3d); > test_tex_img(i, have_gen_mipmap); > } > > -- > 2.5.5 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] KHR_debug/object-label: Improve query object label testing.
The test was trying to use timer queries on any desktop GL, even though timer queries were a fairly late extension. Instead, check for occlusion queries and use those, which should work on much more hardware (GL 2.0). Fixes test failure on vc4. --- tests/spec/khr_debug/debug-object-label.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/spec/khr_debug/debug-object-label.c b/tests/spec/khr_debug/debug-object-label.c index ad4c9fc3d051..7e89bd50f418 100644 --- a/tests/spec/khr_debug/debug-object-label.c +++ b/tests/spec/khr_debug/debug-object-label.c @@ -230,11 +230,12 @@ test_object_label_types() } /* GLES >= 3.0 or GL compat */ - if (!piglit_is_gles() || piglit_get_gl_version() >= 30) { + if (piglit_is_extension_supported("GL_ARB_occlusion_query") || + piglit_get_gl_version() >= 30) { /* Test QUERY */ glGenQueries(1, &query); - glBeginQuery(GL_TIME_ELAPSED, query); - glEndQuery(GL_TIME_ELAPSED); + glBeginQuery(GL_SAMPLES_PASSED, query); + glEndQuery(GL_SAMPLES_PASSED); ObjectLabel(GL_QUERY, query, -1, TestLabel); GetObjectLabel(GL_QUERY, query, TestLabelLen + 1, &length[QUERY_IDX], label[QUERY_IDX]); -- 2.8.1 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] copy-pixels: disable texture state before copying
On Fri, Jul 15, 2016 at 11:29 AM, Ilia Mirkin wrote: > The intent was to copy the texture around, not to test the texture > combining logic. (A separate test should probably be done with that > enabled.) > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96943 > Signed-off-by: Ilia Mirkin > --- > tests/general/copy-pixels.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tests/general/copy-pixels.c b/tests/general/copy-pixels.c > index cff1cb6..a45d821 100644 > --- a/tests/general/copy-pixels.c > +++ b/tests/general/copy-pixels.c > @@ -61,6 +61,8 @@ test_color_copypix(int x, int y) > > piglit_draw_rect_tex(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, 0, 0, 1, 1); > > + glDisable(GL_TEXTURE_2D); > + > glRasterPos2i(x, y); > glCopyPixels(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, GL_COLOR); > pass = piglit_probe_image_color(x, y, IMAGE_WIDTH, IMAGE_HEIGHT, > -- > 2.7.3 > Thanks for fixing the test. Reviewed-by: Anuj Phogat ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] copy-pixels: disable texture state before copying
On 07/15/2016 12:29 PM, Ilia Mirkin wrote: The intent was to copy the texture around, not to test the texture combining logic. (A separate test should probably be done with that enabled.) I agree with that. Reviewed-by: Brian Paul Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D96943&d=CwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=S1RTKZDw5I-Sgtu75pu6lEx65o6_l4sbJnNMv8zVgJA&s=96yrBR8VMZpMELVji773WNXcadqMM3sjVR16uOVlnvI&e= Signed-off-by: Ilia Mirkin --- tests/general/copy-pixels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/general/copy-pixels.c b/tests/general/copy-pixels.c index cff1cb6..a45d821 100644 --- a/tests/general/copy-pixels.c +++ b/tests/general/copy-pixels.c @@ -61,6 +61,8 @@ test_color_copypix(int x, int y) piglit_draw_rect_tex(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, 0, 0, 1, 1); + glDisable(GL_TEXTURE_2D); + glRasterPos2i(x, y); glCopyPixels(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, GL_COLOR); pass = piglit_probe_image_color(x, y, IMAGE_WIDTH, IMAGE_HEIGHT, ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] copy-pixels: disable texture state before copying
The intent was to copy the texture around, not to test the texture combining logic. (A separate test should probably be done with that enabled.) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96943 Signed-off-by: Ilia Mirkin --- tests/general/copy-pixels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/general/copy-pixels.c b/tests/general/copy-pixels.c index cff1cb6..a45d821 100644 --- a/tests/general/copy-pixels.c +++ b/tests/general/copy-pixels.c @@ -61,6 +61,8 @@ test_color_copypix(int x, int y) piglit_draw_rect_tex(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, 0, 0, 1, 1); + glDisable(GL_TEXTURE_2D); + glRasterPos2i(x, y); glCopyPixels(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, GL_COLOR); pass = piglit_probe_image_color(x, y, IMAGE_WIDTH, IMAGE_HEIGHT, -- 2.7.3 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] tex3d-maxsize: rewrite to be more robust and do more testing
Ping. On 07/13/2016 03:47 PM, Brian Paul wrote: 1. It seems with NVIDIA's driver that using a proxy texture isn't a sure fire way to know that a given texture format/size can actually be created. Update the find_max_tex3d_size() function to actually try creating a texture with glTexImage3D/glTexStorage3D and see if it works. 2. Improve the speed of texture initialization by copying the first 3D slice to the other slices with glCopyImageSubData(). 3. Use glTexStorage3D when GL_ARB_texture_storage is supported. 4. In addition to GL_RGBA8, test GL_INTENSITY8 and GL_RGBA32F formats. 5. Before testing the largest possible texture, try a couple smaller sizes as a sanity check. 6. Loosen the piglit probe tolerance by one bit to account for inaccuracy caused by GL_NEAREST filtering. Tested with NVIDIA driver, VMware driver and llvmpipe. --- tests/texturing/tex3d-maxsize.c | 285 +--- 1 file changed, 211 insertions(+), 74 deletions(-) diff --git a/tests/texturing/tex3d-maxsize.c b/tests/texturing/tex3d-maxsize.c index e168d14..60c9c63 100644 --- a/tests/texturing/tex3d-maxsize.c +++ b/tests/texturing/tex3d-maxsize.c @@ -30,31 +30,88 @@ PIGLIT_GL_TEST_CONFIG_BEGIN - config.supports_gl_compat_version = 10; + config.supports_gl_compat_version = 12; config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; PIGLIT_GL_TEST_CONFIG_END -static const char *TestName = "tex3d-maxsize"; + +static GLint MaxSize; + + + +/** + * Compute size (in megabytes) of a texture of the given dimensions and + * internal format. + */ +static unsigned +tex_size(GLenum internalFormat, int width, int height, int depth) +{ + uint64_t sz; + + sz = (uint64_t) width * (uint64_t) height * (uint64_t) depth; + + switch (internalFormat) { + case GL_INTENSITY8: + sz *= 1; + break; + case GL_RGBA8: + sz *= 4; + break; + case GL_RGBA32F: + sz *= 16; + break; + default: + assert(!"Unexpected internalFormat"); + } + + return (unsigned) (sz / (uint64_t) (1024 * 1024)); +} + + +/** + * Allocate a 1-level 3D texture. + */ +static void +alloc_tex3d(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height, GLsizei depth) +{ + if (target == GL_TEXTURE_3D) { + glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + } + + if (piglit_is_extension_supported("GL_ARB_texture_storage")) { + glTexStorage3D(target, 1, internalFormat, + width, height, depth); + } + else { + glTexImage3D(target, 0, internalFormat, +width, height, depth, 0, +GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } +} /* * Use proxy texture to find largest possible 3D texture size. */ static void -find_max_tex3d_size(GLint initSize, GLint *width, GLint *height, GLint *depth) +find_max_tex3d_size(GLenum internalFormat, + GLint initSize, GLint *width, GLint *height, GLint *depth) { GLint dim = 0, w, h, d, pw, ph, pd; + piglit_check_gl_error(GL_NO_ERROR); + w = h = d = initSize; while (w >= 1 && h >= 1 && d >= 1) { /* try proxy image */ const int level = 0; - glTexImage3D(GL_PROXY_TEXTURE_3D, level, GL_RGBA8, -w, h, d, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + alloc_tex3d(GL_PROXY_TEXTURE_3D, internalFormat, w, h, d); glGetTexLevelParameteriv(GL_PROXY_TEXTURE_3D, level, GL_TEXTURE_WIDTH, &pw); @@ -63,12 +120,40 @@ find_max_tex3d_size(GLint initSize, GLint *width, GLint *height, GLint *depth) glGetTexLevelParameteriv(GL_PROXY_TEXTURE_3D, level, GL_TEXTURE_DEPTH, &pd); + if (!piglit_check_gl_error(GL_NO_ERROR)) { + printf("Unexpected error during texture proxy test.\n"); + piglit_report_result(PIGLIT_FAIL); + } + if (pw == w && ph == h && pd == d) { - /* success! */ - *width = w; - *height = h; - *depth = d; - return; + /* this size should be supported, but test it to +* be sure. +*/ + GLuint tex; + GLenum err; + + /* Create a texture object for the non-proxy texture below */ + glGenTextures(1, &tex); + glBindTexture(GL_TEXTURE_3D, tex); + alloc_tex3d(GL_TE
[Piglit] [PATCH] arb_shader_image_load_store: set mipmap filtering to ensure texture are complete
From the OpenGL 4.3 Core Specification, section 8.25 ("Texture Image Loads and Stores"): "An access is considered invalid if: * the texture bound to the selected image unit is incomplete;" So when creating a texture in order to test cases that should work, we need to ensure that the texture is complete. --- tests/spec/arb_shader_image_load_store/common.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/spec/arb_shader_image_load_store/common.c b/tests/spec/arb_shader_image_load_store/common.c index cbeaac7..3977458 100644 --- a/tests/spec/arb_shader_image_load_store/common.c +++ b/tests/spec/arb_shader_image_load_store/common.c @@ -141,6 +141,11 @@ upload_image_levels(const struct image_info img, unsigned num_levels, glGenTextures(1, &textures[unit]); glBindTexture(img.target->target, textures[unit]); +if (img.target->target != GL_TEXTURE_BUFFER) { +glTexParameteri(img.target->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); +glTexParameteri(img.target->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); +} + switch (img.target->target) { case GL_TEXTURE_1D: for (l = 0; l < num_levels; ++l) { -- 2.7.4 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit