}
}
+static void
+intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ struct brw_context *brw = brw_context(ctx);
+ __DRIcontext *driContext = brw->driContext;
+
+ if (brw->saved_viewport)
+ brw->saved_viewport(ctx, x, y, w, h);
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ dri2InvalidateDrawable(driContext->driDrawablePriv);
+ dri2InvalidateDrawable(driContext->driReadablePriv);
+ }
+}
+
static const struct dri_debug_control debug_control[] = {
{ "tex", DEBUG_TEXTURE},
{ "state", DEBUG_STATE},
{ "shader_time", DEBUG_SHADER_TIME },
{ "no16", DEBUG_NO16 },
{ "blorp", DEBUG_BLORP },
+ { "vue", DEBUG_VUE },
{ NULL, 0 }
};
intelInitPixelFuncs(functions);
intelInitBufferObjectFuncs(functions);
intel_init_syncobj_functions(functions);
+ brw_init_object_purgeable_functions(functions);
}
static bool
dri_ctx_error))
return false;
+ /* Can't rely on invalidate events, fall back to glViewport hack */
+ if (!driContextPriv->driScreenPriv->dri2.useInvalidate) {
+ brw->saved_viewport = functions->Viewport;
+ functions->Viewport = intel_viewport;
+ }
+
if (mesaVis == NULL) {
memset(&visual, 0, sizeof visual);
mesaVis = &visual;
}
brw->intelScreen = intelScreen;
+ brw->bufmgr = intelScreen->bufmgr;
if (!_mesa_initialize_context(&brw->ctx, api, mesaVis, shareCtx,
functions)) {
*/
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:
* software fallbacks (which we have to support on legacy GL to do weird
* glDrawPixels(), glBitmap(), and other functions).
*/
- if (api != API_OPENGL_CORE) {
+ if (api != API_OPENGL_CORE && api != API_OPENGLES2) {
_swrast_CreateContext(ctx);
}
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);