layers: Update descriptor tracking in core_validation
authorTobin Ehlis <tobine@google.com>
Fri, 25 Mar 2016 17:49:51 +0000 (11:49 -0600)
committerTobin Ehlis <tobine@google.com>
Wed, 30 Mar 2016 14:32:15 +0000 (08:32 -0600)
commitbbea4bdeb35d547d14e05874dd46c5ba727e073f
tree1a83dc1baf72d7533d1bc5029109396fe024afae
parentfa1c1736c21d297a6794d587124530ecc8450631
layers: Update descriptor tracking in core_validation

Old mem_tracker code to record updated storage image/buffers was naive in
that is gathered any image/buffer updates to descriptor sets and marked as
updated every such image/buffer that was referenced by currently bound sets.

In reality sets may be bound but not used. This is captured in the
"active_slots" construct of the pipeline.

The code here updates tracking for the updated buffers by waiting until
a draw cmd for gfx pipe or dispatch cmd for compute pipe, and then gathering
the updated images/buffers based on which slots are active.

I've multi-purposed validate_draw_state() to now be
validate_and_update_draw_state() as it includes recording of the images/buffers
from the active_slots, which is then used to mark those as read.
Also, that same function is now being called for compute dispatch cmds so
"draw" state is not ideal.
There is still some rework that needs to be done to improve this situation.
layers/core_validation.cpp
layers/core_validation.h