message: Mark barriers as containing optional resources
diff: @@ -1213,6 +1213,10 @@ void DoSerialise(SerialiserType &ser, VkBufferMemoryBarrier &el)
  RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER);
  SerialiseNext(ser, el.sType, el.pNext);
  + // Resources in this struct are optional, because if we decided a resource wasn't used - we
  + // might still have recorded some barriers on it
  + OPTIONAL_RESOURCES();
  +
  SERIALISE_MEMBER_TYPED(VkAccessFlagBits, srcAccessMask);
  SERIALISE_MEMBER_TYPED(VkAccessFlagBits, dstAccessMask);
  // serialise as signed because then QUEUE_FAMILY_IGNORED is -1 and queue
  @@ -1230,6 +1234,10 @@ void DoSerialise(SerialiserType &ser, VkImageMemoryBarrier &el)
  RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER);
  SerialiseNext(ser, el.sType, el.pNext);
  + // Resources in this struct are optional, because if we decided a resource wasn't used - we
  + // might still have recorded some barriers on it
  + OPTIONAL_RESOURCES();
  +
  SERIALISE_MEMBER_TYPED(VkAccessFlagBits, srcAccessMask);
  SERIALISE_MEMBER_TYPED(VkAccessFlagBits, dstAccessMask);
  SERIALISE_MEMBER(oldLayout);
  