[Piglit] [PATCH 2/2] texunits: don't test glTexEnv with unusable texture units

Brian Paul brian.e.paul at gmail.com
Fri Feb 9 01:31:40 UTC 2018


Reviewed-by: Brian Paul <brianp at vmware.com>


On Thu, Feb 8, 2018 at 5:59 PM, Marek Olšák <maraeo at gmail.com> wrote:

> From: Marek Olšák <marek.olsak at amd.com>
>
> The GL limit is MaxTextureCombinedUnits, but the real usable limit is
> MaxTextureCoordUnits. This is probably a spec bug.
>
> Mesa will ignore glTexEnv calls where unit >= MaxTextureCoordUnits.
> ---
>  tests/general/texunits.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/general/texunits.c b/tests/general/texunits.c
> index b68dcf7..c6fbcb1 100644
> --- a/tests/general/texunits.c
> +++ b/tests/general/texunits.c
> @@ -276,30 +276,30 @@ test_texture_params(void)
>
>  static GLboolean
>  test_texture_env(void)
>  {
>     /* Texture Environment state is fixed-function; not used by shaders */
>     int i;
>
>     clear_errors();
>
>     /* set per-unit state */
> -   for (i = 0; i < MaxTextureCombinedUnits; i++) {
> +   for (i = 0; i < MaxTextureCoordUnits; i++) {
>        glActiveTexture(GL_TEXTURE0 + i);
>        glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, Random[i]);
>        if (!piglit_check_gl_error(GL_NO_ERROR)) {
>           return GL_FALSE;
>        }
>     }
>
>     /* check per-unit state */
> -   for (i = 0; i < MaxTextureCombinedUnits; i++) {
> +   for (i = 0; i < MaxTextureCoordUnits; i++) {
>        GLfloat v[4];
>        glActiveTexture(GL_TEXTURE0 + i);
>        glGetTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, v);
>        if (!equal4v(v, Random[i])) {
>           printf("Setting per-unit env state failed for unit %d\n", i);
>           report4v(Random[i], v);
>           return GL_FALSE;
>        }
>     }
>
> --
> 2.7.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20180208/05a56801/attachment.html>


More information about the Piglit mailing list