mesa: fix issues around multisample enable
multisample enable is enabled by default, however gl mandates multisample rendering rules only apply if there's also a multisampled buffer.
This commit is contained in:
@@ -373,7 +373,7 @@ static int r300Fallback(GLcontext * ctx)
|
||||
|
||||
if (!r300->disable_lowimpact_fallback) {
|
||||
FALLBACK_IF(ctx->Polygon.StippleFlag);
|
||||
FALLBACK_IF(ctx->Multisample.Enabled);
|
||||
FALLBACK_IF(ctx->Multisample._Enabled);
|
||||
FALLBACK_IF(ctx->Line.StippleFlag);
|
||||
FALLBACK_IF(ctx->Line.SmoothFlag);
|
||||
FALLBACK_IF(ctx->Point.SmoothFlag);
|
||||
|
@@ -829,7 +829,7 @@ _mesa_init_scissor(GLcontext *ctx)
|
||||
void
|
||||
_mesa_init_multisample(GLcontext *ctx)
|
||||
{
|
||||
ctx->Multisample.Enabled = GL_FALSE;
|
||||
ctx->Multisample.Enabled = GL_TRUE;
|
||||
ctx->Multisample.SampleAlphaToCoverage = GL_FALSE;
|
||||
ctx->Multisample.SampleAlphaToOne = GL_FALSE;
|
||||
ctx->Multisample.SampleCoverage = GL_FALSE;
|
||||
|
@@ -958,6 +958,7 @@ struct gl_list_extensions
|
||||
struct gl_multisample_attrib
|
||||
{
|
||||
GLboolean Enabled;
|
||||
GLboolean _Enabled; /**< true if Enabled and multisample buffer */
|
||||
GLboolean SampleAlphaToCoverage;
|
||||
GLboolean SampleAlphaToOne;
|
||||
GLboolean SampleCoverage;
|
||||
|
@@ -1060,6 +1060,20 @@ update_viewport_matrix(GLcontext *ctx)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update derived multisample state.
|
||||
*/
|
||||
static void
|
||||
update_multisample(GLcontext *ctx)
|
||||
{
|
||||
ctx->Multisample._Enabled = GL_FALSE;
|
||||
if (ctx->DrawBuffer) {
|
||||
if (ctx->DrawBuffer->Visual.sampleBuffers)
|
||||
ctx->Multisample._Enabled = GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update derived color/blend/logicop state.
|
||||
*/
|
||||
@@ -1223,6 +1237,9 @@ _mesa_update_state_locked( GLcontext *ctx )
|
||||
if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT))
|
||||
update_viewport_matrix(ctx);
|
||||
|
||||
if (new_state & _NEW_MULTISAMPLE)
|
||||
update_multisample( ctx );
|
||||
|
||||
if (new_state & _NEW_COLOR)
|
||||
update_color( ctx );
|
||||
|
||||
|
@@ -263,7 +263,7 @@ smooth_point(GLcontext *ctx, const SWvertex *vert)
|
||||
size = get_size(ctx, vert, GL_TRUE);
|
||||
|
||||
/* alpha attenuation / fade factor */
|
||||
if (ctx->Multisample.Enabled) {
|
||||
if (ctx->Multisample._Enabled) {
|
||||
if (vert->pointSize >= ctx->Point.Threshold) {
|
||||
alphaAtten = 1.0F;
|
||||
}
|
||||
|
Reference in New Issue
Block a user