diff options
author | Kenneth Graunke <[email protected]> | 2017-06-09 12:57:09 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-06-12 01:10:36 -0700 |
commit | b7153c3e9f9d2d430b0338313587a00e531e4800 (patch) | |
tree | 19ca5082731f2c7809c00d14e47677515f0f3c47 | |
parent | fae3b139055f32c4d076c170726393995be96d1b (diff) |
i965: Call intel_prepare_render() from intel_update_state()
The resolve code looks at the current color draw buffers. These are not
valid until intel_prepare_render() is called. You can end up with one
color buffer bound, but where the renderbuffer has zero width/height and
no miptree allocated.
You can get a call chain like: _mesa_Clear -> _mesa_update_state ->
intel_update_state, where no brw driver hooks were called, so there is
no other point at which we could have called this.
Fixes crashes in KWin where Clear was causing intel_disable_rb_aux_buffer
to crash on irb != NULL but irb->mt == NULL.
According to Tapani, this also fixes crashes seen on Android.
Reviewed-by: Jason Ekstrand <[email protected]>
Tested-by: Tapani Pälli <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 6d27866fcea..5433f9080ee 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -201,6 +201,8 @@ intel_update_state(struct gl_context * ctx) _mesa_unlock_context_textures(ctx); + intel_prepare_render(brw); + /* Resolve the depth buffer's HiZ buffer. */ depth_irb = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_DEPTH); if (depth_irb && depth_irb->mt) { |