cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

Journeyman III
Journeyman III

OpenGL display artifact on W7100

Jump to solution

  Hi all,

I am facing a display issue on a w7100 card with catalyst 14.502 driver. I reduce the problem to a very simple one.

Generate a RGBA32F fbo.

Clear the fbo content to 0.

Draw a first textured-quad in this fbo

Draw a second textured-quad in this fbo

The quads are drawn using the following fragment shader:

uniform sampler2DRect src;

uniform sampler2DRect dst;

void main(void) {

    vec4 dst = texture2DRect(dst, gl_FragCoord.xy);

    vec4 src = texture2DRect(src, gl_TexCoord[0].xy);

    src.rgb = src.rgb * 0.5f;

    src.a = 0.5f;

    gl_FragColor = src + dst;

}

Doing so, I accumulate the content of the 2 quads in the destination fbo.

Then, I draw the texture attached to the framebuffer on the display using the following fragment shader:

uniform sampler2DRect src;

void main(void) {

    vec4 tex = texture2DRect(src, gl_TexCoord[0].xy);

    if (tex.a != 0.0f) {

        tex /= tex.a;

    }

    gl_FragColor = tex;

}

To ensure synchronisation between the read and write operations on the framebuffer, I both try glFlush/glFinish and using glFence. None of them give me a correct result.

I tested this very simple code on HD7700, W8000 and some other gpus, with no issues. I suppose something is wrong in my way of rendering, but there is change in the rendering behavior of Tonga family.

Could you please help me in fixing this simple thing ?

Regards,

Thomas

0 Kudos
Reply
1 Solution

Accepted Solutions
Exemplar
Exemplar

Re: OpenGL display artifact on W7100

Jump to solution
0 Kudos
Reply
4 Replies
Exemplar
Exemplar

Re: OpenGL display artifact on W7100

Jump to solution

Are you reading and writing to the same texture at the same time? If so then it is undefined behaviour and if it somehow working then it is just a luck. If you just want add one texture to another you can just use additive blending. Look at glBlendEquation()

0 Kudos
Reply
Journeyman III
Journeyman III

Re: OpenGL display artifact on W7100

Jump to solution

Hi,

Thanks for the fast answer. I am indeed read and writing to the same texture. I missed it is an undefined behavior (strange it was running fine for a such long time...).

Unfortunately, I am not doing simple texture addition, but it would be ok to introduced an intermediate texture.

Thanks,

Thomas

0 Kudos
Reply
Exemplar
Exemplar

Re: OpenGL display artifact on W7100

Jump to solution
0 Kudos
Reply
Journeyman III
Journeyman III

Re: OpenGL display artifact on W7100

Jump to solution

Thanks.

Thomas

0 Kudos
Reply