Bug 49996 - DH61AG - HD Graphics 3000 - OpenGL sampler objects on Ubuntu Linux 12.04 do not work
Summary: DH61AG - HD Graphics 3000 - OpenGL sampler objects on Ubuntu Linux 12.04 do n...
Status: RESOLVED WORKSFORME
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 8.0
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Kenneth Graunke
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-16 03:12 UTC by Mark Newiger
Modified: 2018-04-24 07:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Mark Newiger 2012-05-16 03:12:36 UTC
Configuration:
- Intel SandyBridge PC Mainboard DH61AG and integrated Intel HD Graphics 3000
- Dual OS: Windows 7 32bit and Ubuntu 12.04 32bit

When using OpenGL sampler objects for configuring textures, on Ubuntu Linux you have to create a mipmap chain by calling “glGenerateMipmap()”. Otherwise the texture sampling will not work (e.g. returns black).
Take the following example:
// Init
int texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(…);

int sampler;
glGenSamplers(1, &sampler);
glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

// Render loop
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
glBindSampler(0, sampler);
…

This works perfectly on Windows but not on Ubuntu Linux. For Ubuntu Linux I have to add the following:
//Init
…
glTexImage2D(…);
glGenerateMipmap(GL_TEXTURE_2D);

Without the mipmap the texture sampling does not work, although mipmaps are not used. When using the traditional texture filter configuration, this problem does not occur and the code behaves the same on Windows and Linux:
// Render loop
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
Comment 1 Kenneth Graunke 2012-05-17 08:10:17 UTC
Thanks, I'll take a look at this as soon as I can.  It may be a driver issue on our part.
Comment 2 Eric Anholt 2012-05-21 14:19:39 UTC
I had taken a look for some likely bugs and didn't find them.  At this point it's a matter of writing an actual test app for piglit.

(Or maybe just updating to Master -- Brian did some rewrite related to sampler objects I think).
Comment 3 Timothy Arceri 2018-04-24 06:36:54 UTC
Is this still an issue? Ken do you think we can close this one now?
Comment 4 Kenneth Graunke 2018-04-24 07:32:30 UTC
Sorry we never figured this one out.  If it's still a problem, feel free to reopen.


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.