i965/fs: Add support for translating ir_triop_fma into MAD.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_context.c
index 7860e1fc0368fedadfed1a30bde85f99fb95df97..37c17705a3bd32d387f5e9ed09d7c2da2124d30a 100644 (file)
@@ -332,6 +332,7 @@ static const struct dri_debug_control debug_control[] = {
    { "shader_time", DEBUG_SHADER_TIME },
    { "no16",  DEBUG_NO16 },
    { "blorp", DEBUG_BLORP },
+   { "vue",   DEBUG_VUE },
    { NULL,    0 }
 };
 
@@ -399,6 +400,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
    intelInitPixelFuncs(functions);
    intelInitBufferObjectFuncs(functions);
    intel_init_syncobj_functions(functions);
+   brw_init_object_purgeable_functions(functions);
 }
 
 static bool
@@ -481,6 +483,7 @@ intelInitContext(struct brw_context *brw,
    }
 
    brw->intelScreen = intelScreen;
+   brw->bufmgr = intelScreen->bufmgr;
 
    if (!_mesa_initialize_context(&brw->ctx, api, mesaVis, shareCtx,
                                  functions)) {
@@ -540,8 +543,6 @@ intelInitContext(struct brw_context *brw,
     */
    brw->max_gtt_map_object_size = gtt_size / 4;
 
-   brw->bufmgr = intelScreen->bufmgr;
-
    bo_reuse_mode = driQueryOptioni(&brw->optionCache, "bo_reuse");
    switch (bo_reuse_mode) {
    case DRI_CONF_BO_REUSE_DISABLED:
@@ -754,11 +755,15 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
         driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1;
       }
 
+      /* The sRGB workaround changes the renderbuffer's format. We must change
+       * the format before the renderbuffer's miptree get's allocated, otherwise
+       * the formats of the renderbuffer and its miptree will differ.
+       */
+      intel_gles3_srgb_workaround(brw, fb);
+      intel_gles3_srgb_workaround(brw, readFb);
+
       intel_prepare_render(brw);
       _mesa_make_current(ctx, fb, readFb);
-
-      intel_gles3_srgb_workaround(brw, ctx->WinSysDrawBuffer);
-      intel_gles3_srgb_workaround(brw, ctx->WinSysReadBuffer);
    }
    else {
       _mesa_make_current(NULL, NULL, NULL);