st/mesa: fix fallout from xfb changes.
[mesa.git] / src / mesa / state_tracker / st_context.c
index 65a5218b2bb30f82a814ee6d5a7bd3a3aa452e50..f5a6f8598ca063e1c475c242f33484e1c19cabe4 100644 (file)
@@ -141,9 +141,7 @@ void st_invalidate_state(struct gl_context * ctx, GLbitfield new_state)
 
    /* Invalidate render and compute pipelines. */
    st->dirty.mesa |= new_state;
-   st->dirty.st |= ST_NEW_MESA;
    st->dirty_cp.mesa |= new_state;
-   st->dirty_cp.st |= ST_NEW_MESA;
 
    /* This is the only core Mesa module we depend upon.
     * No longer use swrast, swsetup, tnl.
@@ -186,6 +184,10 @@ st_destroy_context_priv(struct st_context *st)
       u_upload_destroy(st->constbuf_uploader);
    }
 
+   /* free glDrawPixels cache data */
+   free(st->drawpix_cache.image);
+   pipe_resource_reference(&st->drawpix_cache.texture, NULL);
+
    cso_destroy_context(st->cso_context);
    free( st );
 }
@@ -283,9 +285,9 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
 
    /* Need these flags:
     */
-   st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+   ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
 
-   st->ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
+   ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
 
    st->has_stencil_export =
       screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT);
@@ -349,8 +351,8 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
    /* called after _mesa_create_context/_mesa_init_point, fix default user
     * settable max point size up
     */
-   st->ctx->Point.MaxSize = MAX2(ctx->Const.MaxPointSize,
-                                 ctx->Const.MaxPointSizeAA);
+   ctx->Point.MaxSize = MAX2(ctx->Const.MaxPointSize,
+                             ctx->Const.MaxPointSizeAA);
    /* For vertex shaders, make sure not to emit saturate when SM 3.0 is not supported */
    ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].EmitNoSat = !st->has_shader_model3;
 
@@ -472,7 +474,7 @@ void st_destroy_context( struct st_context *st )
    pipe_sampler_view_reference(&st->pixel_xfer.pixelmap_sampler_view, NULL);
    pipe_resource_reference(&st->pixel_xfer.pixelmap_texture, NULL);
 
-   _vbo_DestroyContext(st->ctx);
+   _vbo_DestroyContext(ctx);
 
    st_destroy_program_variants(st);