diff options
author | Marek Olšák <[email protected]> | 2019-12-10 15:35:10 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-01-17 15:04:35 -0500 |
commit | bec9c90b5ecf9cc2dc580f9ff297f94ba5aa3506 (patch) | |
tree | e61b3332c2caa14fdf3f588a57d6999601b0e252 /src | |
parent | ddb80f9276b940ae1e8a3473a8d0a1ad3402536e (diff) |
gallium: add st_context_iface::flush_resource to call FLUSH_VERTICES
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/include/state_tracker/st_api.h | 7 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_manager.c | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 0b953d6fb38..955d84b5b44 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -396,6 +396,13 @@ struct st_context_iface void* notify_before_flush_cb_args); /** + * Flush all enqueued vertices (e.g. vbo module) and call + * pipe_context::flush_resource. + */ + void (*flush_resource)(struct st_context_iface *stctxi, + struct pipe_resource *resource); + + /** * Replace the texture image of a texture object at the specified level. * * This function is optional. diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index c3688c4818e..a504ace5dff 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -688,6 +688,19 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags, st->gfx_shaders_may_be_dirty = true; } +static void +st_context_flush_resource(struct st_context_iface *stctxi, + struct pipe_resource *resource) +{ + struct st_context *st = (struct st_context *) stctxi; + struct pipe_context *pipe = st->pipe; + + FLUSH_VERTICES(st->ctx, 0); + FLUSH_CURRENT(st->ctx, 0); + + pipe->flush_resource(pipe, resource); +} + static bool st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type tex_type, @@ -982,6 +995,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, st->iface.destroy = st_context_destroy; st->iface.flush = st_context_flush; + st->iface.flush_resource = st_context_flush_resource; st->iface.teximage = st_context_teximage; st->iface.copy = st_context_copy; st->iface.share = st_context_share; |