Пример #1
0
/* Equivalent to common:try_basic, but also checking that the
 * well-known cases that doesn't support multi-texel filtering is not
 * supported.*/
bool
try_local(const GLenum *targets, unsigned num_targets,
          const GLenum *internalformats, unsigned num_internalformats,
          const GLenum pname,
          test_data *data)
{
        bool pass = true;
        unsigned i;
        unsigned j;
        static const GLint possible_values[] = {
                GL_NONE,
                GL_CAVEAT_SUPPORT,
                GL_FULL_SUPPORT,
        };

	for (i = 0; i < num_targets; i++) {
                for (j = 0; j < num_internalformats; j++) {
                        bool error_test;
                        bool value_test = true;
                        bool supported;

                        supported = check_query2_dependencies(pname, targets[i])
                                && test_data_check_supported(data, targets[i],
                                                             internalformats[j]);

                        test_data_execute(data, targets[i], internalformats[j],
                                          pname);

                        error_test =
                                piglit_check_gl_error(GL_NO_ERROR);

                        if (!supported ||
                            !is_multi_texel_filtering_supported(targets[i],
                                                                internalformats[j])) {
                                value_test = test_data_is_unsupported_response(data, pname);
                        } else {
                                value_test =
                                        test_data_check_possible_values(data,
                                                                        possible_values,
                                                                        ARRAY_SIZE(possible_values));
                        }

                        if (error_test && value_test)
                                continue;

                        /* If we are here, the test is failing */
                        print_failing_case(targets[i], internalformats[j],
                                           pname, data);

                        if (!value_test)
                                print_failing_details(targets[i], internalformats[j]);

                        pass = false;
                }
        }

	return pass;
}
Пример #2
0
/*
 * From spec:
 *
 * - INTERNALFORMAT_{X}_TYPE
 *
 * For uncompressed internal formats, queries for these values return
 * the data type used to store the component.
 * For compressed internal formats the types returned specify how
 * components are interpreted after decompression.
 * For textures this query returns the same information as querying
 * GetTexLevelParameter{if}v for TEXTURE_*TYPE would return.  Possible
 * values return include, NONE, SIGNED_NORMALIZED,
 * UNSIGNED_NORMALIZED, FLOAT, INT, UNSIGNED_INT, representing
 * missing, signed normalized fixed point, unsigned normalized fixed
 * point, floating-point, signed unnormalized integer and unsigned
 * unnormalized integer components. NONE is returned for all component
 * types if the format is unsupported.
 *
 * So try_textures_size check if it is 0 when not supported, and that
 * the returned value is on that list of possible values and the same
 * that the one returned by GetTextLevelParameter when supported.
 */
static bool
try_textures_type(const GLenum *targets, unsigned num_targets,
                  const GLenum *internalformats, unsigned num_internalformats,
                  const GLenum pname,
                  const GLenum equivalent_pname,
                  test_data *data)
{
        bool pass = true;
        unsigned i;
        unsigned j;

        for (i = 0; i < num_targets; i++) {
                for (j = 0; j < num_internalformats; j++) {
                        bool error_test;
                        bool value_test;
                        bool supported;

                        supported = check_query2_dependencies(pname, targets[i])
                                && test_data_check_supported(data, targets[i], internalformats[j]);

                        test_data_execute(data, targets[i], internalformats[j],
                                          pname);

                        error_test =
                                piglit_check_gl_error(GL_NO_ERROR);

                        if (!supported) {
                                value_test = test_data_is_unsupported_response(data, pname);
                        } else {

                                value_test = test_data_check_possible_values(data, possible_values,
                                                                             ARRAY_SIZE(possible_values));
                                value_test = value_test &&
                                        test_data_check_against_get_tex_level_parameter(data,
                                                                                        targets[i],
                                                                                        equivalent_pname,
                                                                                        internalformats[j]);
                        }

                        if (error_test && value_test)
                                continue;

                        print_failing_case(targets[i], internalformats[j],
                                           pname, data);

                        pass = false;
                }
        }

	return pass;
}
Пример #3
0
/*
 * The most basic condition. From spec, a lot of pnames has a
 * condition like this:
 *
 * "Possible values returned are <set>. If the resource is not
 *  supported, or if the operation is not supported, NONE is
 *  returned."
 *
 * So this method, calls the callback defined at @data (that should be
 * GetInternalformativ or GetInternalformati64v) using @pname, for all
 * @num_targets at @targets, and all @num_internalformats at
 * @internalformats, and checks the following conditions:
 *
 * * If @pname is not supported (calling INTERNALFORMAT_SUPPORTED),
 *   checks that the value returned is always the same.
 * * If @pname is supported, checks that the returned value is among
 *   one of the values defined at @possible_values
 *
 * @possible_values,@num_possible_values is allowed to be NULL,0, for
 * the cases where the set of returned values is not specified in
 * detail by the spec (like INTERNALFORMAT_PREFERRED). On that case,
 * it is not tested the returned value, and just tested that if not
 * suppported, the returned value is the usupported value defined by
 * the spec.
 *
 */
bool
try_basic(const GLenum *targets, unsigned num_targets,
          const GLenum *internalformats, unsigned num_internalformats,
          const GLenum pname,
          const GLint *possible_values, unsigned num_possible_values,
          test_data *data)
{
        bool pass = true;
        unsigned i;
        unsigned j;

	for (i = 0; i < num_targets; i++) {
                for (j = 0; j < num_internalformats; j++) {
                        bool error_test;
                        bool value_test;
                        bool supported;

                        supported = check_query2_dependencies(pname, targets[i])
                                && test_data_check_supported(data, targets[i],
                                                             internalformats[j]);

                        test_data_execute(data, targets[i], internalformats[j], pname);

                        if (supported && num_possible_values == 0)
                                continue;

                        error_test =
                                piglit_check_gl_error(GL_NO_ERROR);

                        value_test = supported ?
                                test_data_check_possible_values(data, possible_values,
                                                                num_possible_values) :
                                test_data_is_unsupported_response(data, pname);

                        if (error_test && value_test)
                                continue;

                        print_failing_case(targets[i], internalformats[j],
                                           pname, data);

                        pass = false;
                }
        }

	return pass;
}