diff options
author | Mathias Fröhlich <[email protected]> | 2019-02-26 06:39:05 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2019-03-04 17:03:06 +0100 |
commit | 904a0552aabf0624f1d7507b89d8a9a7bdd3bad5 (patch) | |
tree | 6e6c7b88a12fe0809ccd50e6aa81252f831c52fc | |
parent | e727f8c8b814b9c36d4a8b52829c2bf7281765be (diff) |
st/mesa: Invalidate the gallium array atom only if needed.
Now that the buffer object usage history tracks if it is
being used as vertex buffer object, we can restrict setting
the ST_NEW_VERTEX_ARRAYS bit to dirty on glBufferData calls to
buffers that are potentially used as vertex buffer object.
Also put a note that the same could be done for index arrays
used in indexed draws.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 5ebe94f4545..b05f2516980 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -357,8 +357,10 @@ bufferobj_data(struct gl_context *ctx, /* The current buffer may be bound, so we have to revalidate all atoms that * might be using it. */ - /* TODO: Add arrays to usage history */ - ctx->NewDriverState |= ST_NEW_VERTEX_ARRAYS; + if (st_obj->Base.UsageHistory & USAGE_ARRAY_BUFFER) + ctx->NewDriverState |= ST_NEW_VERTEX_ARRAYS; + /* if (st_obj->Base.UsageHistory & USAGE_ELEMENT_ARRAY_BUFFER) */ + /* ctx->NewDriverState |= TODO: Handle indices as gallium state; */ if (st_obj->Base.UsageHistory & USAGE_UNIFORM_BUFFER) ctx->NewDriverState |= ST_NEW_UNIFORM_BUFFER; if (st_obj->Base.UsageHistory & USAGE_SHADER_STORAGE_BUFFER) |