diff --git a/gapii/cc/chunk_writer.cpp b/gapii/cc/chunk_writer.cpp index 82095b72ae..549b936780 100644 --- a/gapii/cc/chunk_writer.cpp +++ b/gapii/cc/chunk_writer.cpp @@ -70,7 +70,6 @@ bool ChunkWriterImpl::write(std::string& s) { void ChunkWriterImpl::flush() { size_t bufferSize = mBuffer.size(); - // If we flush en empty buffer, this will return false, which is incorrect. mStreamGood = mWriter->write(mBuffer.data(), mBuffer.size()) == bufferSize; mBuffer.clear(); } diff --git a/gapii/cc/pool.h b/gapii/cc/pool.h index 1aef33a9d6..ef52a5da56 100644 --- a/gapii/cc/pool.h +++ b/gapii/cc/pool.h @@ -25,8 +25,8 @@ namespace gapii { class Pool { public: static std::shared_ptr create(uint32_t id, uint64_t size); -// This creates a pool that can be serialized, but has no actual -// backing memory + // This creates a pool that can be serialized, but has no actual + // backing memory static std::shared_ptr create_virtual(uint32_t id, uint64_t size); ~Pool(); diff --git a/gapis/api/vulkan/state_rebuilder.go b/gapis/api/vulkan/state_rebuilder.go index 31d77514a1..da4202dfdf 100644 --- a/gapis/api/vulkan/state_rebuilder.go +++ b/gapis/api/vulkan/state_rebuilder.go @@ -795,7 +795,10 @@ func (sb *stateBuilder) allocAndFillScratchBuffer(device *DeviceObject, data []u VkMemoryAllocateInfo{ VkStructureType_VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NewVoidᶜᵖ(memory.Nullptr), - size * 2, // Overallocate by a factor of 2. + size * 2, + // Since we cannot guess how much the driver will actually + // request of us, overallocate by a factor of 2. This should + // be enough. memoryTypeIndex, }).Ptr()), memory.Nullptr, @@ -859,7 +862,7 @@ func (sb *stateBuilder) getSparseQueueFor(lastBoundQueue *QueueObject, device Vk if lastBoundQueue != nil { queueProperties := sb.s.PhysicalDevices.Get(sb.s.Devices.Get(lastBoundQueue.Device).PhysicalDevice).QueueFamilyProperties - if 0 != (uint32(queueProperties.Get(lastBoundQueue.Family).QueueFlags)&uint32(VkQueueFlagBits_VK_QUEUE_SPARSE_BINDING_BIT)) { + if 0 != (uint32(queueProperties.Get(lastBoundQueue.Family).QueueFlags) & uint32(VkQueueFlagBits_VK_QUEUE_SPARSE_BINDING_BIT)) { return lastBoundQueue } } diff --git a/gapis/api/vulkan/vulkan.go b/gapis/api/vulkan/vulkan.go index d250b51ae6..945f4359b7 100644 --- a/gapis/api/vulkan/vulkan.go +++ b/gapis/api/vulkan/vulkan.go @@ -75,6 +75,8 @@ func (*State) Root(ctx context.Context, p *path.State) (path.Node, error) { return p, nil } +// SetupInitialState recreates the command lamdas from the state block. +// These are not encoded so we have to set them up here. func (c *State) SetupInitialState(ctx context.Context) { for _, b := range *c.CommandBuffers.Map { for _, v := range b.CommandReferences.KeysSorted() {