My program use QtOpenGL to draw a sphere and color it by sampling a texture in a single draw call. It works on Nvdia cards, but when I switch to AMD cards (my laptop and other laptops), it show a black screen. (Note: it only failed with AMD Catalyst Software Suite driver, but works with the AMD Radeon Software Crimson Edition Beta driver at this link).
Here is the normal picture on Nvdia cards, and the black bug picture on AMD cards.
NVDIA
AMD
It seems to be a texture sampling bug (not framebuffer bug) because OpenGL draws normally when I use a simple shading method (color = dot(vertexPixelNormal, lightDirection)) as the following picture.
I use CodeXL from AMD for debugging, and when I click on the texture ID from the CodeXL explorer view, it show exactly my image (Does it mean that my image is updated to GPU successfully?). Here is the OpenGL calls log.
Note: You can't see the function glTextureStorage2DEXT before glTextureSubImage2D in the log because CodeXL doesn't log glTextureStorage2DEXT, which is used by QtOpenGL. I debug step by step and ensure that this function is called.
\
Here is the texture property from CodeXL property view
Here is the fragment shader
#version 150 core
uniform sampler2D matcapTexture;
vec3 matcapColor(vec3 eye, vec3 normal)
{
vec3 reflected = reflect(eye, normal);
float m = 2.0 * sqrt(
pow(reflected.x, 2.0) +
pow(reflected.y, 2.0) +
pow(reflected.z + 1.0, 2.0)
);
vec2 uv = reflected.xy / m + 0.5;
uv.y = 1.0 - uv.y;
return texture(matcapTexture, uv).xyz;
}
in vec4 fragInput; //vec4(eyePosition, depth)
void main()
{
vec3 n = normalize(cross(dFdx(fragInput.xyz), dFdy(fragInput.xyz))); //calculate vertex pixel normal by dfdx,dfdy
const vec3 LightDirection = vec3(0.0f, 0.0f, -1.0f);
vec3 fragColor = matcapColor(LightDirection, n);
gl_FragData[0] = vec4(fragColor.x, fragColor.y, fragColor.z, 1.0f);
}
I spent several days for this bug but can't find any clues. Hope you guys could help me show what's incorrect here. Did I do something that AMD didn't expect?
Thank you for your report. Can you provide a binary version of the application and/or source code, which we could use for investigation?
Hello, thanks for replay. You can download the demo software called Unyk at here by registering your account, and then the website will send a download link to your email. Note that the bug only happen in the AMD Catalyst Software Suite driver, not the Crimson version. Hope to see your answer. I post the problem on a lot of forums, and most people don't see anything wrong with the OpenGL logs from CodeXL.
Please recommend your customers to use the latest version of the Crimson driver. We no longer provide support for the Catalyst driver.
Hi dwitczak, the problem is that I don't see the Crimson version in driver list of Firepro graphics cards
here's the link where I find driver for AMD Firepro cards: Workstation
Can you shed some light on the brand and specific laptop models affected by the problem? Thanks.
I tested on several devices, and It happen both on desktop and laptop with AMD graphics cards with Radeaon driver installed. Now I am using the laptop HP 8570W with AMD Firepro 4000M
Thanks.
As far as the HP8570W laptop is considered, you are going to need to contact your vendor directly to request for an updated driver. The hardware requires OEM-certified drivers, which is the reason you cannot install Crimson drivers, as shared on our web-site, on that specific hardware.