Reviewed-by: Marek Olšák <marek.ol...@amd.com> Marek
On Tue, Oct 24, 2017 at 11:25 AM, Alejandro Piñeiro <apinhe...@igalia.com> wrote: > --- > > Alternative fix to "arb_internalformat_query2: fix TBO testing > (v3)". As mentioned on a different email, testing with target > TEXTURE_BUFFER is correct, and we need to get the unsupported answer. > > This patch prevents to do the sanity check against GetTexParameteriv, > because as Marek and Ilia pointed, it is not a valid enum for that > one. > > > .../image-format-compatibility-type.c | 29 +++++++++++++++++++--- > 1 file changed, 25 insertions(+), 4 deletions(-) > > diff --git > a/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c > b/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c > index 28bf2926a..081fb78d5 100644 > --- a/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c > +++ b/tests/spec/arb_internalformat_query2/image-format-compatibility-type.c > @@ -38,6 +38,24 @@ PIGLIT_GL_TEST_CONFIG_BEGIN > > PIGLIT_GL_TEST_CONFIG_END > > +/* > + * On this test we use GetTexParameteriv to check the correct > + * value. We can't use texture_targets because TEXTURE_BUFFER is not a > + * valid enum for GetTexParameteriv > + */ > +static const GLenum get_tex_parameter_targets[] = { > + GL_TEXTURE_1D, > + GL_TEXTURE_1D_ARRAY, > + GL_TEXTURE_2D, > + GL_TEXTURE_2D_ARRAY, > + GL_TEXTURE_3D, > + GL_TEXTURE_CUBE_MAP, > + GL_TEXTURE_CUBE_MAP_ARRAY, > + GL_TEXTURE_RECTANGLE, > + GL_TEXTURE_2D_MULTISAMPLE, > + GL_TEXTURE_2D_MULTISAMPLE_ARRAY, > +}; > + > enum piglit_result > piglit_display(void) > { > @@ -98,7 +116,7 @@ try_local(const GLenum *targets, unsigned num_targets, > bool error_test; > bool value_test; > bool supported; > - bool is_texture; > + bool is_valid_target; > > supported = check_query2_dependencies(pname, > targets[i]) > && test_data_check_supported(data, > targets[i], > @@ -109,16 +127,19 @@ try_local(const GLenum *targets, unsigned num_targets, > error_test = > piglit_check_gl_error(GL_NO_ERROR); > > - is_texture = value_on_set((const > GLint*)texture_targets, ARRAY_SIZE(texture_targets), > - (GLint) targets[i]); > + is_valid_target = value_on_set((const > GLint*)get_tex_parameter_targets, > + > ARRAY_SIZE(get_tex_parameter_targets), > + (GLint) targets[i]); > > - if (is_texture && supported) { > + if (is_valid_target && supported) { > param = get_tex_parameter_value(targets[i], > internalformats[j]); > error_test = error_test && > piglit_check_gl_error(GL_NO_ERROR); > > value_test = test_data_value_at_index(data, > 0) == param; > } else { > + if (targets[i] == GL_TEXTURE_BUFFER) > + fprintf(stderr, "setting > unsupported\n"); > value_test = > test_data_is_unsupported_response(data, pname); > } > > -- > 2.11.0 > _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit