mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
st/osmesa: add osmesa framebuffer iface hash table per st manager
Commit bbc29393d3 didn't include osmesa state_tracker. This patch adds
necessary initialization.
Fixes crash in OSMesa initialization.
Created-by: Charmaine Lee <charmainel@vmware.com>
Tested-by: Bruce Cherniak <bruce.cherniak@intel.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
1006cd512d
commit
9966c85e01
1 changed files with 11 additions and 0 deletions
|
|
@ -439,6 +439,7 @@ osmesa_st_framebuffer_validate(struct st_context_iface *stctx,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static uint32_t osmesa_fb_ID = 0;
|
||||
|
||||
static struct st_framebuffer_iface *
|
||||
osmesa_create_st_framebuffer(void)
|
||||
|
|
@ -448,6 +449,8 @@ osmesa_create_st_framebuffer(void)
|
|||
stfbi->flush_front = osmesa_st_framebuffer_flush_front;
|
||||
stfbi->validate = osmesa_st_framebuffer_validate;
|
||||
p_atomic_set(&stfbi->stamp, 1);
|
||||
stfbi->ID = p_atomic_inc_return(&osmesa_fb_ID);
|
||||
stfbi->state_manager = get_st_manager();
|
||||
}
|
||||
return stfbi;
|
||||
}
|
||||
|
|
@ -508,6 +511,14 @@ osmesa_find_buffer(enum pipe_format color_format,
|
|||
static void
|
||||
osmesa_destroy_buffer(struct osmesa_buffer *osbuffer)
|
||||
{
|
||||
struct st_api *stapi = get_st_api();
|
||||
|
||||
/*
|
||||
* Notify the state manager that the associated framebuffer interface
|
||||
* is no longer valid.
|
||||
*/
|
||||
stapi->destroy_drawable(stapi, osbuffer->stfb);
|
||||
|
||||
FREE(osbuffer->stfb);
|
||||
FREE(osbuffer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue