summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-09-12 15:40:19 -0700
committerJason Ekstrand <[email protected]>2017-09-18 12:17:59 -0700
commit0699319bb0c3fb247e748e26a8158a0397c80632 (patch)
tree1c8262d3878be43236015d43ce00011afcbcc63d /src/mesa
parentd80cbbeaff9329fdc78ae3d97097c1e65dfcdd61 (diff)
i965: Use prepare_external instead of make_shareable in setTexBuffer2
The setTexBuffer2 hook from GLX is used to implement glxBindTexImageEXT which has tighter restrictions than just "it's shared". In particular, it says that any rendering to the image while it is bound causes the contents to become undefined. This means that we can do whatever aux tracking we want between glxBindTexImageEXT and glxReleaseTexImageEXT so long as we always transition from external in Bind and to external in Release. The fact that we were using make_shareable before was a problem because it would resolve away 100% of the aux data and then throw away our reference to the aux buffer. If the aux data was shared with some other application (i.e. if we're using I915_FORMAT_MOD_Y_TILED_CCS) then we would forget that the aux data even existed for the rest of eternity. This is fine for the first frame but any subsequent calls to glxBindTexImageEXT would bind the texture as if it has no aux whatsoever and no resolves would happen and texturing would happen as if there is no aux. This was causing rendering corruption in mutter when running on top of X11 with modifiers. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 9ecfd7fc4ff..7712f7085f4 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -438,7 +438,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
internal_format = GL_RGB;
}
- intel_miptree_make_shareable(brw, rb->mt);
+ intel_miptree_prepare_external(brw, rb->mt);
_mesa_lock_texture(&brw->ctx, texObj);
texImage = _mesa_get_tex_image(ctx, texObj, target, 0);