Yeah, that's why I concluded that the triangles overlap, because the fragment shader should have any effect outside of the triangle.
This is my [abridged] frag code:
Note that prior to the shader invocation, ex_image contains `clear_value` in every pixel. So if this shader runs once on a pixel, it should output green, but if it runs twice, it should output white.#version 420
#include <shaderCommon.h> //defs for 'red' 'green' etc
#include <gtest/AtomicCounter.h> //defs for binding locations
layout(binding = AC_ATOMIC_BINDING, offset = 0) uniform atomic_uint buffer_index_counter;
layout(binding = AC_IMAGE_EXCHANGE_UNIT, r32ui) coherent uniform uimage2D ex_image;
uniform uint clear_value;
uniform uint viewport_height;
uniform uint viewport_width;
out vec4 out_color;
void main
{
ivec2 pixel_coords = ivec2(int(gl_FragCoord.x),
int(gl_FragCoord.y));
uint count = atomicCounterIncrement(buffer_index_counter);
uint val = imageAtomicExchange(ex_image,
pixel_coords,
uint(gl_FragCoord.x));
if((val == uint(gl_FragCoord.x)) && (val != clear_value)) {
out_color = white;
}
else {
out_color = green;
}
}
I would expect the output to be pure green, as the fragment shader should only be run once per pixel. Indeed, in windows, I do get pure green.
Strangely, the line appears to be anti-aliased (try zooming way in using an image-editing program).
This is definitely a line (heh) of thought worth pursuing. I'm not familiar with MSAA though. How would the expected number of samples differ between MSAA and a buffer where the triangles simply overlap?
And why might GL be running in MSAA mode when I create a context with a non-MS buffer and never explicitly enable it?
This is certainly something I can check for. I could render a triangle with the texture as a render target, then render again with the texture bound as an image that I write too.
No effect.
I'm planning on preparing a self-contained test program to submit with a bug report. I'll give this a try tomorrow while I'm doing that.
Thanks for all the help and suggestions, guy.





