diff options
author | Ilia Mirkin <[email protected]> | 2016-06-04 13:26:46 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-06-07 22:27:04 -0400 |
commit | 6e6fd911da8a1d9cd62fe0a8a4cc0fb7bdccfe02 (patch) | |
tree | c8ca9d74c904f69b4c8a597d2bb21ab6afa8a562 /src/mesa/state_tracker | |
parent | d9546b0c5d1a5136a92276cdd7c14883f0c62737 (diff) |
st/mesa: use buffer usage history to set dirty flags for revalidation
We were previously unconditionally doing this for arrays and ubo's, and
ignoring texture/storage/atomic buffers. Instead use the usage history
to determine which atoms need to be revalidated.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 8bbc2f0af4b..1a8aea3c198 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -332,8 +332,19 @@ st_bufferobj_data(struct gl_context *ctx, } } - /* BufferData may change an array or uniform buffer, need to update it */ - st->dirty.st |= ST_NEW_VERTEX_ARRAYS | ST_NEW_UNIFORM_BUFFER; + /* The current buffer may be bound, so we have to revalidate all atoms that + * might be using it. + */ + /* TODO: Add arrays to usage history */ + st->dirty.st |= ST_NEW_VERTEX_ARRAYS; + if (st_obj->Base.UsageHistory & USAGE_UNIFORM_BUFFER) + st->dirty.st |= ST_NEW_UNIFORM_BUFFER; + if (st_obj->Base.UsageHistory & USAGE_SHADER_STORAGE_BUFFER) + st->dirty.st |= ST_NEW_STORAGE_BUFFER; + if (st_obj->Base.UsageHistory & USAGE_TEXTURE_BUFFER) + st->dirty.st |= ST_NEW_SAMPLER_VIEWS | ST_NEW_IMAGE_UNITS; + if (st_obj->Base.UsageHistory & USAGE_ATOMIC_COUNTER_BUFFER) + st->dirty.st |= ST_NEW_ATOMIC_BUFFER; return GL_TRUE; } |