Bug 17005 - inconsistent comment/error message and src code in _mesa_BindTexture()
Summary: inconsistent comment/error message and src code in _mesa_BindTexture()
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: Other All
: low trivial
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: janitor
Depends on:
Blocks:
 
Reported: 2008-08-06 01:50 UTC by Jacek
Modified: 2008-08-07 06:55 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Jacek 2008-08-06 01:50:48 UTC
OpenGL spec, ver. 2.1 Section J.5 specifies/clarifies a requirement concerning texture target type (and not the dimensionality) of the to-be-bound texture: "the texture object passed to BindTexture must match the specified target, not just the dimensionality of target".

The comment/error message in the Mesa code refers to the texture dimensionality:
...
/* error checking */
if (newTexObj->Target != 0 && newTexObj->Target != target) {
   /* the named texture object's dimensions don't match the target */
   _mesa_error( ctx, GL_INVALID_OPERATION,
                "glBindTexture(wrong dimensionality)" );
    return;
...
while it should refer to the target type (as the src code does).

There is a problem in the FarCry, ver 1.4, which generates the following OpenGL calls sequence:
glBindTexture(GL_TEXTURE_RECTANGLE_ARB,4326); 
...
glBindTexture(GL_TEXTURE_2D,4326);
...
In this case, the texture dimensionality is the same.
Comment 1 Brian Paul 2008-08-06 07:53:26 UTC
The comment probably goes back to when we only had 1D, 2D and 3D targets.  Fixed in git.
Comment 2 Jacek 2008-08-07 02:51:46 UTC
There is still the "wrong dimensionality" message in the _mesa_error() log :):
_mesa_error( ctx, GL_INVALID_OPERATION, "glBindTexture(wrong dimensionality)" );
Comment 3 Brian Paul 2008-08-07 06:55:26 UTC
Error msg fixed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.