Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
22695 Discussions

HD4000 OpenGL Shading Language Texture bug?

idata
Employee
1,965 Views

Dear Support Team,

Our OpenGL-based library fails to run correctly on Intel HD 4000. After a lot of debugging, I've managed to isolate a problem that concerns building a custom mip-map-pyramid using shaders.

I've created a small reproduction case for this problem (source code is available at https://github.com/hetcomp/hpmc/blob/iss9/tests/simplemipmapbuildup.cpp https://github.com/hetcomp/hpmc/blob/iss9/tests/simplemipmapbuildup.cpp 😞

First, I create a mipmap'ed texture 2D and create an FBO for each level.

Then, I populate the base level with a GPGPU pass, and then use the following shader to reduce the pyramid:

uniform sampler2D tex;

uniform vec2 delta; // = vec2( -0.5/w, 0.5/w ), w is width of prev level

void

main(){

vec4 sums = vec4(

texture2D( tex, gl_TexCoord[0].xy+delta.xx )+

texture2D( tex, gl_TexCoord[0].xy+delta.yx )+

texture2D( tex, gl_TexCoord[0].xy+delta.xy )+

texture2D( tex, gl_TexCoord[0].xy+delta.yy ) );

gl_FragColor = sums;

}

using

for(GLsizei k=1; k<=size_l2; k++ ) {

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, k-1 );

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, k-1 );

to steer which texture level that should be sampled from.

The correct result is

Level 0

[0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1]

[0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1]

[0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1]

[0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1]

Level 1

[0,0,4,4] [1,0,4,4] [3,0,4,4] [4,0,4,4] [4,0,4,4] [3,0,4,4] [1,0,4,4] [0,0,4,4]

[1,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [1,0,4,4]

[3,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [3,0,4,4]

[4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4]

[4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4]

[3,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [3,0,4,4]

[1,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [4,0,4,4] [1,0,4,4]

[0,0,4,4] [1,0,4,4] [3,0,4,4] [4,0,4,4] [4,0,4,4] [3,0,4,4] [1,0,4,4] [0,0,4,4]

Level 2

[6,0,16,16] [15,0,16,16] [15,0,16,16] [6,0,16,16]

[15,0,16,16] [16,0,16,16] [16,0,16,16] [15,0,16,16]

[15,0,16,16] [16,0,16,16] [16,0,16,16] [15,0,16,16]

[6,0,16,16] [15,0,16,16] [15,0,16,16] [6,0,16,16]

Level 3

[52,0,64,64] [52,0,64,64]

[52,0,64,64] [52,0,64,64]

Level 4

[208,0,256,256]

However, when running the code on an HD 4000, I get the following:

Level 0

[0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1] [0,0,1,1]

[0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1]

[0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [0,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1]

[0,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1,0,1,1] [1...

0 Kudos
2 Replies
Marcos_U_Intel
Employee
703 Views

Hello,

We truly appreciate your feedback. Our software support and engineering group is working on future generations of this software that may implement better features. Your feedback for sure is important and will be forwarded to higher levels of support.

Thank you one more time for your interest in our products and how to improve their range of features.

Looking forward to assisting you further.

Regards,

Michael

0 Kudos
ROBERT_U_Intel
Employee
703 Views

@cdyk Great work at narrowing down the issue with OGL. Your analysis was very helpful with debugging the issue. A fix will be available in a future release if the Intel HD Graphics driver. I will post an update when the driver is available.

0 Kudos
Reply