Bug 91847 - glGenerateTextureMipmap not working (no errors) unless glActiveTexture(GL_TEXTURE1) is called before
Summary: glGenerateTextureMipmap not working (no errors) unless glActiveTexture(GL_TEX...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 10.6
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-02 09:01 UTC by CapsAdmin
Modified: 2015-09-15 16:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Always bind the texture in _mesa_meta_GenerateMipmap (935 bytes, patch)
2015-09-02 23:00 UTC, Ian Romanick
Details | Splinter Review
apitrace replay (982.27 KB, application/x-xz)
2015-09-03 12:51 UTC, CapsAdmin
Details

Description CapsAdmin 2015-09-02 09:01:05 UTC
On #dri-devel fredrikh pointed out that the problem might be in meta here:

http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/common/meta_generate_mipmap.c?id=mesa-10.6.3#n205

as a suggested workaround calling glActiveTexture(GL_TEXTURE1) before calling glGenerateTextureMipmap() works.

In my project I have a DSA wrapper when DSA is not available and that seems to work just fine.
Comment 1 Ian Romanick 2015-09-02 23:00:28 UTC
Created attachment 118057 [details] [review]
Always bind the texture in _mesa_meta_GenerateMipmap

Does this fix the problem?
Comment 2 CapsAdmin 2015-09-03 12:50:58 UTC
I'm having some issues building and installing mesa but I've attached an apitrace. The text is not supposed to have any black border around it and the snow should be white. (the text is scaled up 4x and the snow is scaled down so mip maps are being used)
Comment 3 CapsAdmin 2015-09-03 12:51:44 UTC
Created attachment 118066 [details]
apitrace replay
Comment 4 Ian Romanick 2015-09-09 20:06:25 UTC
That seems to fix the problem here.  I've sent the patch to mesa-dev for review, and I'm working on a piglit test case.
Comment 5 Ian Romanick 2015-09-15 16:30:48 UTC
Should be fixed by the commit below.  I believe this is in 11.0, and it should eventually be in a 10.6 stable release.

commit 767c33e88138afa64443417860b264a494eba33d
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Wed Sep 2 16:06:58 2015 -0700

    meta: Always bind the texture
    
    We may have been called from glGenerateTextureMipmap with CurrentUnit
    still set to 0, so we don't know when we can skip binding the texture.
    Assume that _mesa_BindTexture will be fast if we're rebinding the same
    texture.
    
    v2: Remove currentTexUnitSave because it is now unused.  Suggested by
    both Neil and Anuj.
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91847
    Cc: "11.0" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Neil Roberts <neil@linux.intel.com>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>


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.