Hello,
I tried some polygon anti-aliasing with OSMesa16 (RGBA buffer like
osdemo16) and all seemed OK with
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA), but with
glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ONE) the blending went berzerk. I
found that mesa was reading back the wrong frame buffer alpha values
with _mesa_read_rgba_span in swrast/s_span.c
inside _mesa_read_rgba_span: (*swrast->Driver.ReadRGBASpan) reads the
correct r,g,b,a values, but then
"if (buffer->UseSoftwareAlphaBuffers)" evaluates true and
_mesa_read_alpha_span buggers the alpha values.
I saw in osmesa.c inside OSMesaCreateContextExt that there is a value
"swalpha" set to GL_FALSE for RGBA buffers, but this value fails to make
its way into osmesa->gl_buffer->UseSoftwareAlphaBuffers during the rest
of the initialization. If during the init I manually set
UseSoftwareAlphaBuffers to false, the blending looks OK and I think that
the software uses a faster read function for the RGBA buffer in memory
(havn't confirmed this yet).
cheers
jp
|