During meta-operations (such as _mesa_meta_GenerateMipmap()), we need
to be able to draw even if GL_RASTERIZER_DISCARD is enabled. This
patch causes _mesa_meta_begin() to save the state of
GL_RASTERIZER_DISCARD and disable it (so that drawing can be done
during the meta-op), and causes _mesa_meta_end() to restore it.
Fixes piglit test "EXT_transform_feedback/generatemipmap discard" on
i965 Gen6.
Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/** Miscellaneous (always disabled) */
GLboolean Lighting;
+ GLboolean RasterDiscard;
};
/**
save->Lighting = ctx->Light.Enabled;
if (ctx->Light.Enabled)
_mesa_set_enable(ctx, GL_LIGHTING, GL_FALSE);
+ save->RasterDiscard = ctx->RasterDiscard;
+ if (ctx->RasterDiscard)
+ _mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_FALSE);
}
}
if (save->Lighting) {
_mesa_set_enable(ctx, GL_LIGHTING, GL_TRUE);
}
+ if (save->RasterDiscard) {
+ _mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_TRUE);
+ }
}