[Piglit] [Mesa-dev] [PATCH] piglit/general/texunits: fix to check the correct extension and be less pedantic

Luca Barbieri luca at luca-barbieri.com
Thu Apr 15 16:36:50 PDT 2010


My interpretation of the problem was somewhat incorrect.
The issue is that GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS is not exposed,
and the test does not have a sensible default for it.

Indeed, if I force that to 16, the test passes.
So your approach should work (but it is missing
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS).
Checking whether the queries fail or not seems more robust (and simpler) though.

However, I'm somewhat perplexed by the error checking: the idea that
the OpenGL specification mandates errors seems to be problematic.

In particular, extensions can introduce behavior that will cause such
errors to no longer be raised.
For instance, glActiveTexture(GL_TEXTURE0 + 8) will raise an error
according to the unextended spec when GL_MAX_TEXTURE_UNITS = 8, but
not according to ARB_fragment_program with GL_MAX_TEXTURE_UNITS = 8
and GL_MAX_TEXTURE_IMAGE_UNITS = 16.

A client application unaware of ARB_fragment_program has no way of
correctly predicting whether glActiveTexture(GL_TEXTURE0 + 8) will
fail or succeed.

So, it would seem either extensions (and ARB ones at that) are allowed
to change OpenGL in an incompatible way (which clearly is a serious
problem), or such errors are not mandatory.

Thus, I think we should not check that they are raised at all, unless
there is some way of resolving the above issue that I am missing.
Instead, we can just rely on "positive tests" to check that all
defined functionality works, and perhaps just print a warning if
something unexpectedly succeeds.

Finally, Mesa knows the correct value of
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS but is artificially not exposing
it just because ARB_vertex_shader is not supported.
This also does not seem to make much sense.


More information about the Piglit mailing list