From d24359cbb75c0f0d675ac3b3f58a6fa80cbcb00d Mon Sep 17 00:00:00 2001 From: Qining Date: Mon, 18 Jun 2018 17:06:34 -0400 Subject: [PATCH] Vulkan: Fix missing fetches of physical device properties (#1997) When mutating for replay, the new physical device enumeration commands does not fetch the properties, this results into failure when using the physical device object later --- gapis/api/vulkan/replay.go | 3 +++ gapis/api/vulkan/synthetic.api | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/gapis/api/vulkan/replay.go b/gapis/api/vulkan/replay.go index 320c723493..7c3c8831c4 100644 --- a/gapis/api/vulkan/replay.go +++ b/gapis/api/vulkan/replay.go @@ -277,6 +277,9 @@ func (t *makeAttachementReadable) Transform(ctx context.Context, id api.CmdID, c propList = append(propList, allProps.PhyDevToProperties().Get(dev).Clone(s.Arena, api.CloneContext{})) } newEnumerate := buildReplayEnumeratePhysicalDevices(ctx, s, cb, e.Instance(), numDev, devs, propList) + for _, e := range cmd.Extras().All() { + newEnumerate.Extras().Add(e) + } out.MutateAndWrite(ctx, id, newEnumerate) return } diff --git a/gapis/api/vulkan/synthetic.api b/gapis/api/vulkan/synthetic.api index 8b869c234d..5629b3dae7 100644 --- a/gapis/api/vulkan/synthetic.api +++ b/gapis/api/vulkan/synthetic.api @@ -133,6 +133,8 @@ cmd VkResult replayEnumeratePhysicalDevices( device := ? devices[i] = device } + props := fetchPhysicalDeviceProperties(instance, devices) + memProps := fetchPhysicalDeviceMemoryProperties(instance, devices) for i in (0 .. count) { object := switch (PhysicalDevices[devices[i]] == null) { case true: @@ -143,6 +145,12 @@ cmd VkResult replayEnumeratePhysicalDevices( object.Instance = instance object.Index = i object.VulkanHandle = devices[i] + if memProps != null { + object.MemoryProperties = memProps.PhyDevToMemoryProperties[devices[i]] + } + if props != null { + object.PhysicalDeviceProperties = props.PhyDevToProperties[devices[i]] + } PhysicalDevices[devices[i]] = object } return ?