Merge branch '7.8'
[mesa.git] / src / mesa / drivers / dri / nouveau / nv04_context.c
index 1056171342ced506c3023ef3d9c7a5fbd64d693c..6834f7cd3dc60fb2e868651c7dab809990c37305 100644 (file)
@@ -40,6 +40,7 @@ nv04_context_engine(GLcontext *ctx)
 
        if (ctx->Texture.Unit[0].EnvMode == GL_COMBINE ||
            ctx->Texture.Unit[0].EnvMode == GL_BLEND ||
+           ctx->Texture.Unit[0].EnvMode == GL_ADD ||
            ctx->Texture.Unit[1]._ReallyEnabled ||
            ctx->Stencil.Enabled)
                fahrenheit = hw->eng3dm;
@@ -74,18 +75,16 @@ nv04_channel_flush_notify(struct nouveau_channel *chan)
        struct nouveau_context *nctx = chan->user_private;
        GLcontext *ctx = &nctx->base;
 
-       if (nctx->fallback < SWRAST && ctx->DrawBuffer) {
-               GLcontext *ctx = &nctx->base;
-
+       if (nctx->fallback < SWRAST) {
                /* Flushing seems to clobber the engine context. */
-               context_dirty_i(ctx, TEX_OBJ, 0);
-               context_dirty_i(ctx, TEX_OBJ, 1);
-               context_dirty_i(ctx, TEX_ENV, 0);
-               context_dirty_i(ctx, TEX_ENV, 1);
-               context_dirty(ctx, CONTROL);
-               context_dirty(ctx, BLEND);
-
-               nouveau_state_emit(ctx);
+               context_emit(ctx, TEX_OBJ0);
+               context_emit(ctx, TEX_OBJ1);
+               context_emit(ctx, TEX_ENV0);
+               context_emit(ctx, TEX_ENV1);
+               context_emit(ctx, CONTROL);
+               context_emit(ctx, BLEND);
+
+               nouveau_bo_state_emit(ctx);
        }
 }
 
@@ -199,9 +198,9 @@ nv04_context_create(struct nouveau_screen *screen, const GLvisual *visual,
        if (ret)
                goto fail;
 
+       init_dummy_texture(ctx);
        nv04_hwctx_init(ctx);
        nv04_render_init(ctx);
-       init_dummy_texture(ctx);
 
        return ctx;
 
@@ -264,7 +263,6 @@ const struct nouveau_driver nv04_driver = {
                nouveau_emit_nothing,
                nouveau_emit_nothing,
                nouveau_emit_nothing,
-               nouveau_emit_nothing,
                nv04_emit_scissor,
                nv04_defer_blend,
                nv04_defer_control,
@@ -278,6 +276,10 @@ const struct nouveau_driver nv04_driver = {
                nouveau_emit_nothing,
                nouveau_emit_nothing,
                nouveau_emit_nothing,
+               nouveau_emit_nothing,
+               nouveau_emit_nothing,
+               nouveau_emit_nothing,
+               nouveau_emit_nothing,
                nv04_emit_tex_obj,
                nv04_emit_tex_obj,
                nouveau_emit_nothing,