diff options
author | Brian Paul <[email protected]> | 2012-08-30 08:45:13 -0600 |
---|---|---|
committer | Paul Berry <[email protected]> | 2012-08-30 08:28:19 -0700 |
commit | 055093e33fc90705c429e948caefedf0e0fb82af (patch) | |
tree | 4296944340cdd9196d7c07ed77d7b718a748af0d /src/mesa/drivers | |
parent | aad7ccd261e67e9d943dcab17ebe8082d7b6f4d9 (diff) |
meta: remove call to _meta_in_progress(), fix multisample enable/disable
This partially reverts d638da23d2ec2e9c52655b1ea138249e7f8bcccb.
With gallium the meta code is not always built so the call to
_meta_in_progress() was unresolved. Simply special-case the
GL_MULTISAMPLE case in the meta code. There might be other special
cases in the future given all the differences between legacy GL,
core GL, GLES, etc.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54234
and https://bugs.freedesktop.org/show_bug.cgi?id=54239
v2 (Paul Berry <[email protected]>): keep _meta_in_progress
function, since it's needed by the i965 driver, but don't call it from
core mesa.
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 3a34b1e684f..4b448fed51b 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -438,6 +438,35 @@ _mesa_meta_free(struct gl_context *ctx) /** + * This is an alternative to _mesa_set_enable() to handle some special cases. + * See comments inside. + */ +static void +meta_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) +{ + switch (cap) { + case GL_MULTISAMPLE: + /* We need to enable/disable multisample when using GLES but this enum + * is not supported there. + */ + if (ctx->Multisample.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.Enabled = state; + break; + default: + _mesa_problem(ctx, "Unexpected cap in _meta_set_enable()"); + return; + } + + if (ctx->Driver.Enable) { + ctx->Driver.Enable(ctx, cap, state); + } +} + + + +/** * Enter meta state. This is like a light-weight version of glPushAttrib * but it also resets most GL state back to default values. * @@ -755,7 +784,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) if (state & MESA_META_MULTISAMPLE) { save->MultisampleEnabled = ctx->Multisample.Enabled; if (ctx->Multisample.Enabled) - _mesa_set_enable(ctx, GL_MULTISAMPLE, GL_FALSE); + meta_set_enable(ctx, GL_MULTISAMPLE, GL_FALSE); } /* misc */ @@ -1057,7 +1086,7 @@ _mesa_meta_end(struct gl_context *ctx) if (state & MESA_META_MULTISAMPLE) { if (ctx->Multisample.Enabled != save->MultisampleEnabled) - _mesa_set_enable(ctx, GL_MULTISAMPLE, save->MultisampleEnabled); + meta_set_enable(ctx, GL_MULTISAMPLE, save->MultisampleEnabled); } /* misc */ |