gallium: clean-up/fix msaa override in state tracker
This commit is contained in:
@@ -254,7 +254,7 @@ static void update_raster_state( struct st_context *st )
|
||||
raster->line_stipple_factor = ctx->Line.StippleFactor - 1;
|
||||
|
||||
/* _NEW_MULTISAMPLE */
|
||||
if (ctx->Multisample._Enabled)
|
||||
if (ctx->Multisample._Enabled || st->force_msaa)
|
||||
raster->multisample = 1;
|
||||
|
||||
/* _NEW_SCISSOR */
|
||||
|
@@ -88,6 +88,19 @@ void st_invalidate_state(GLcontext * ctx, GLuint new_state)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check for multisample env var override.
|
||||
*/
|
||||
int
|
||||
st_get_msaa(void)
|
||||
{
|
||||
const char *msaa = _mesa_getenv("__GL_FSAA_MODE");
|
||||
if (msaa)
|
||||
return atoi(msaa);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static struct st_context *
|
||||
st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
|
||||
{
|
||||
@@ -141,6 +154,8 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
|
||||
|
||||
st->pixel_xfer.cache = _mesa_new_program_cache();
|
||||
|
||||
st->force_msaa = st_get_msaa();
|
||||
|
||||
/* GL limits and extensions */
|
||||
st_init_limits(st);
|
||||
st_init_extensions(st);
|
||||
|
@@ -181,6 +181,8 @@ struct st_context
|
||||
struct blit_state *blit;
|
||||
|
||||
struct cso_context *cso_context;
|
||||
|
||||
int force_msaa;
|
||||
};
|
||||
|
||||
|
||||
@@ -238,4 +240,8 @@ st_fb_orientation(const struct gl_framebuffer *fb)
|
||||
}
|
||||
|
||||
|
||||
extern int
|
||||
st_get_msaa(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -51,13 +51,12 @@ st_create_framebuffer( const __GLcontextModes *visual,
|
||||
{
|
||||
struct st_framebuffer *stfb = CALLOC_STRUCT(st_framebuffer);
|
||||
if (stfb) {
|
||||
int samples = 0;
|
||||
const char *msaa_override = _mesa_getenv("__GL_FSAA_MODE");
|
||||
int samples = st_get_msaa();
|
||||
|
||||
if (visual->sampleBuffers)
|
||||
samples = visual->samples;
|
||||
|
||||
_mesa_initialize_framebuffer(&stfb->Base, visual);
|
||||
if (visual->sampleBuffers) samples = visual->samples;
|
||||
if (msaa_override) {
|
||||
samples = _mesa_atoi(msaa_override);
|
||||
}
|
||||
|
||||
{
|
||||
/* fake frontbuffer */
|
||||
|
Reference in New Issue
Block a user