Skip to content

Draft: vkr: implement in-place dispatching of blob args

Juston Li requested to merge justonli/virglrenderer:vkr-in-place-dispatch into main

Instead of temporarily allocating blob arrays for dispatching and then copying to/from shmem, directly pass the offset in the decoder/encoder where the blob is located or will be written for dispatching; saving the extra memory use and copy.

Currently vkGetPipelineCache and vkGetQueryPoolResults have such blob outputs.

vkCmdUpdateBuffer, vkCmdPushConstants, vkCreatePipelineCache, VkWriteDescriptorSetInlineUniformBlock, and commands with VkSpecializationInfo have such blob inputs.

Split up protocol syncs from venus-protocol!85 to make reviewing easier:

  • Patch 1 adds acquire/release functions for the encoder to set a busy bit when the encoder stream resource is being written too. Syncs protocol to use these acquire/release functions. Drops locking in encoder_write.
  • Patch 2 adds helper for getting the shmem address. (Just adds the cur and offset that was passed in with a size check) and makes memcpy explicitly skip if copying is not needed.
  • Patch 3 syncs protocol adding sizeof helpers for calculating the offset of where output args should land in the encoder
  • Patch 4 syncs protocol adding encoder to _args_temp functions to set the encoder address
  • Patch 5 syncs protocol implementing the in-place arg address setting for calls with blob arrays.

Testing

Rise of the tomb raider

dEQP-VK.pipeline.*
dEQP mustpass vk-default.txt
Edited by Juston Li

Merge request reports