diff --git a/gapil/resolver/inference.go b/gapil/resolver/inference.go index 87eb146fb5..bcdc8c4c11 100644 --- a/gapil/resolver/inference.go +++ b/gapil/resolver/inference.go @@ -118,6 +118,12 @@ func lhsToObserved(rv *resolver, lhs semantic.Node) semantic.Expression { return nil } return &semantic.MapIndex{Map: o, Index: lhs.Index, Type: lhs.Type} + case *semantic.Cast: + o := lhsToObserved(rv, lhs.Object) + if o == nil { + return nil + } + return &semantic.Cast{Object: lhs.Object, Type: lhs.Type} case *semantic.Parameter: if f := rv.scope.function; f != nil && f.Subroutine && lhs == f.Return { rv.errorf(lhs, "unknowns cannot be used to infer return values in subroutines") diff --git a/gapis/api/vulkan/vulkan.api b/gapis/api/vulkan/vulkan.api index 69ad6b0c2a..fc8329f0dd 100644 --- a/gapis/api/vulkan/vulkan.api +++ b/gapis/api/vulkan/vulkan.api @@ -3191,8 +3191,17 @@ cmd void vkGetImageMemoryRequirements2KHR( VkMemoryRequirements2KHR* pMemoryRequirements) { if !(device in Devices) { vkErrorInvalidDevice(device) } info := pInfo[0] - // TODO: handle pNext for 'info' + memReqs := pMemoryRequirements[0] + if memReqs.pNext != null { + nPNext := numberOfPNext(as!const void*(memReqs.pNext)) + next := MutableVoidPtr(as!void*(memReqs.pNext)) + for i in (0 .. nPNext) { + _ = as!const VkStructureType*(next.Ptr)[0] + next.Ptr = as!VulkanStructHeader*(next.Ptr)[0].PNext + } + } + // TODO: handle pNext for 'info' fence if pMemoryRequirements == null { vkErrorNullPointer("VkMemoryRequirements2KHR") } @@ -3208,17 +3217,18 @@ cmd void vkGetImageMemoryRequirements2KHR( numPNext := numberOfPNext(as!const void*(memReq.pNext)) next := MutableVoidPtr(as!void*(memReq.pNext)) for i in (0 .. numPNext) { - sType := as!const VkStructureType*(next.Ptr)[0:1][0] + sType := as!const VkStructureType*(next.Ptr)[0] switch sType { case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: { - ext := as!VkMemoryDedicatedRequirementsKHR*(next.Ptr)[0:1][0] + ext := as!VkMemoryDedicatedRequirementsKHR(?) Images[info.image].DedicatedRequirementsKHR = new!DedicatedRequirementsKHR( PrefersDedicatedAllocation: ext.prefersDedicatedAllocation, RequiresDedicatedAllocation: ext.requiresDedicatedAllocation, ) + as!VkMemoryDedicatedRequirementsKHR*(next.Ptr)[0] = ext } } - next.Ptr = as!VulkanStructHeader*(next.Ptr)[0:1][0].PNext + next.Ptr = as!VulkanStructHeader*(next.Ptr)[0].PNext } } } @@ -3233,6 +3243,16 @@ cmd void vkGetBufferMemoryRequirements2KHR( info := pInfo[0] // TODO: handle pNext + memReqs := pMemoryRequirements[0] + if memReqs.pNext != null { + nPNext := numberOfPNext(as!const void*(memReqs.pNext)) + next := MutableVoidPtr(as!void*(memReqs.pNext)) + for i in (0 .. nPNext) { + _ = as!const VkStructureType*(next.Ptr)[0] + next.Ptr = as!VulkanStructHeader*(next.Ptr)[0].PNext + } + } + fence if pMemoryRequirements == null { vkErrorNullPointer("VkMemoryRequirements2KHR") } @@ -3248,17 +3268,18 @@ cmd void vkGetBufferMemoryRequirements2KHR( numPNext := numberOfPNext(as!const void*(memReq.pNext)) next := MutableVoidPtr(as!void*(memReq.pNext)) for i in (0 .. numPNext) { - sType := as!const VkStructureType*(next.Ptr)[0:1][0] + sType := as!const VkStructureType*(next.Ptr)[0] switch sType { case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: { - ext := as!VkMemoryDedicatedRequirementsKHR*(next.Ptr)[0:1][0] + ext := as!VkMemoryDedicatedRequirementsKHR(?) Buffers[info.buffer].DedicatedRequirementsKHR = new!DedicatedRequirementsKHR( PrefersDedicatedAllocation: ext.prefersDedicatedAllocation, RequiresDedicatedAllocation: ext.requiresDedicatedAllocation, ) + as!VkMemoryDedicatedRequirementsKHR*(next.Ptr)[0] = ext } } - next.Ptr = as!VulkanStructHeader*(next.Ptr)[0:1][0].PNext + next.Ptr = as!VulkanStructHeader*(next.Ptr)[0].PNext } } }