diff options
author | Jason Ekstrand <[email protected]> | 2015-07-31 09:11:47 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-07-31 09:11:47 -0700 |
commit | 1f49a7d9fc0eda5dfba03b0e3faca93e57b39132 (patch) | |
tree | 548a23c59260199fd45dacc42bf23252fb1e8cfb /src/vulkan/anv_batch_chain.c | |
parent | 220a01d525cc49380e97b87695f454f5e76ce69a (diff) |
vk/batch_chain: Decrement num_relocs instead of incrementing it
Diffstat (limited to 'src/vulkan/anv_batch_chain.c')
-rw-r--r-- | src/vulkan/anv_batch_chain.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vulkan/anv_batch_chain.c b/src/vulkan/anv_batch_chain.c index 04528bb06b6..c34f58b2534 100644 --- a/src/vulkan/anv_batch_chain.c +++ b/src/vulkan/anv_batch_chain.c @@ -720,7 +720,15 @@ anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary, .AddressSpaceIndicator = ASI_PPGTT, .BatchBufferStartAddress = { &this_bbo->bo, offset }, }; - last_bbo->relocs.num_relocs++; + /* The pack function below is going to insert a relocation. In order + * to allow us to splice this secondary into a primary multiple + * times, we can't have relocations from previous splices in this + * splice. In order to deal with this, we simply decrement the + * relocation count prior to inserting the next one. In order to + * handle the base case, num_relocs was artificially incremented in + * end_batch_buffer(). + */ + last_bbo->relocs.num_relocs--; GEN8_MI_BATCH_BUFFER_START_pack(&secondary->batch, last_bbo->bo.map + last_bbo->length, &ret); |