gallium: add pipe_screen::resource_changed
Add a hook to tell drivers that an imported resource may have changed and they need to update their internal derived resources. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
This commit is contained in:
parent
5872850b88
commit
30853f55a3
|
@ -707,6 +707,20 @@ which isn't multisampled.
|
|||
|
||||
|
||||
|
||||
resource_changed
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Mark a resource as changed so derived internal resources will be recreated
|
||||
on next use.
|
||||
|
||||
When importing external images that can't be directly used as texture sampler
|
||||
source, internal copies may have to be created that the hardware can sample
|
||||
from. When those resources are reimported, the image data may have changed, and
|
||||
the previously derived internal resources must be invalidated to avoid sampling
|
||||
from old copies.
|
||||
|
||||
|
||||
|
||||
resource_destroy
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -224,6 +224,14 @@ struct pipe_screen {
|
|||
struct winsys_handle *handle,
|
||||
unsigned usage);
|
||||
|
||||
/**
|
||||
* Mark the resource as changed so derived internal resources will be
|
||||
* recreated on next use.
|
||||
*
|
||||
* This is necessary when reimporting external images that can't be directly
|
||||
* used as texture sampler source, to avoid sampling from old copies.
|
||||
*/
|
||||
void (*resource_changed)(struct pipe_screen *, struct pipe_resource *pt);
|
||||
|
||||
void (*resource_destroy)(struct pipe_screen *,
|
||||
struct pipe_resource *pt);
|
||||
|
|
Loading…
Reference in New Issue