mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
svga: only destroy render target view from a context that created it
A texture can be destroyed from a different context from which it is created, but destroying the render target view from a different context will cause svga device errors. Similar to shader resource view, this patch skips destroying render target view or depth stencil view from a non-parent context. Fixes driver errors running NobelClinician Viewer application. Tested with NobelClinician Viewer, MTT piglit, glretrace. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
b4c4ee0762
commit
a421d45e61
1 changed files with 24 additions and 13 deletions
|
|
@ -534,6 +534,16 @@ svga_surface_destroy(struct pipe_context *pipe,
|
||||||
if (s->view_id != SVGA3D_INVALID_ID) {
|
if (s->view_id != SVGA3D_INVALID_ID) {
|
||||||
unsigned try;
|
unsigned try;
|
||||||
|
|
||||||
|
/* The SVGA3D device will generate a device error if the
|
||||||
|
* render target view or depth stencil view is destroyed from
|
||||||
|
* a context other than the one it was created with.
|
||||||
|
* Similar to shader resource view, in this case, we will skip
|
||||||
|
* the destroy for now.
|
||||||
|
*/
|
||||||
|
if (surf->context != pipe) {
|
||||||
|
_debug_printf("context mismatch in %s\n", __func__);
|
||||||
|
}
|
||||||
|
else {
|
||||||
assert(svga_have_vgpu10(svga));
|
assert(svga_have_vgpu10(svga));
|
||||||
for (try = 0; try < 2; try++) {
|
for (try = 0; try < 2; try++) {
|
||||||
if (util_format_is_depth_or_stencil(s->base.format)) {
|
if (util_format_is_depth_or_stencil(s->base.format)) {
|
||||||
|
|
@ -549,6 +559,7 @@ svga_surface_destroy(struct pipe_context *pipe,
|
||||||
assert(ret == PIPE_OK);
|
assert(ret == PIPE_OK);
|
||||||
util_bitmask_clear(svga->surface_view_id_bm, s->view_id);
|
util_bitmask_clear(svga->surface_view_id_bm, s->view_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pipe_resource_reference(&surf->texture, NULL);
|
pipe_resource_reference(&surf->texture, NULL);
|
||||||
FREE(surf);
|
FREE(surf);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue