Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in VkBeginCommandBuffer. #2441

Merged
merged 1 commit into from
Dec 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions gapis/api/vulkan/api/command_buffer_control.api
Original file line number Diff line number Diff line change
Expand Up @@ -388,35 +388,37 @@ cmd VkResult vkBeginCommandBuffer(
}
}

if info.pInheritanceInfo != null {
inheritanceInfo := info.pInheritanceInfo[0]
begin.Inherited = true
begin.InheritedRenderPass = inheritanceInfo.renderPass
begin.InheritedSubpass = inheritanceInfo.subpass
begin.InheritedFramebuffer = inheritanceInfo.framebuffer
begin.InheritedOcclusionQuery = inheritanceInfo.occlusionQueryEnable
begin.InheritedQueryFlags = inheritanceInfo.queryFlags
begin.InheritedPipelineStatsFlags = inheritanceInfo.pipelineStatistics
// handle pBeginInfo->pInheritanceInfo->pNext
if inheritanceInfo.pNext != null {
numPNext := numberOfPNext(inheritanceInfo.pNext)
next := MutableVoidPtr(as!void*(inheritanceInfo.pNext))
for i in (0 .. numPNext) {
sType := as!const VkStructureType*(next.Ptr)[0:1][0]
_ = sType
// TODO: handle extensions for VkCommandBufferInheritanceInfo
next.Ptr = as!VulkanStructHeader*(next.Ptr)[0:1][0].PNext
}
}
}
if !(commandBuffer in CommandBuffers) {
vkErrorInvalidCommandBuffer(commandBuffer)
} else {
buff := CommandBuffers[commandBuffer]
if (buff.Level == VK_COMMAND_BUFFER_LEVEL_SECONDARY) && (info.pInheritanceInfo != null) {
inheritanceInfo := info.pInheritanceInfo[0]
begin.Inherited = true
begin.InheritedRenderPass = inheritanceInfo.renderPass
begin.InheritedSubpass = inheritanceInfo.subpass
begin.InheritedFramebuffer = inheritanceInfo.framebuffer
begin.InheritedOcclusionQuery = inheritanceInfo.occlusionQueryEnable
begin.InheritedQueryFlags = inheritanceInfo.queryFlags
begin.InheritedPipelineStatsFlags = inheritanceInfo.pipelineStatistics
// handle pBeginInfo->pInheritanceInfo->pNext
if inheritanceInfo.pNext != null {
numPNext := numberOfPNext(inheritanceInfo.pNext)
next := MutableVoidPtr(as!void*(inheritanceInfo.pNext))
for i in (0 .. numPNext) {
sType := as!const VkStructureType*(next.Ptr)[0:1][0]
_ = sType
// TODO: handle extensions for VkCommandBufferInheritanceInfo
next.Ptr = as!VulkanStructHeader*(next.Ptr)[0:1][0].PNext
}
}
}

buff.BeginInfo = begin
buff.Recording = RECORDING
resetCommandBuffer(buff)
}

recordBeginCommandBuffer(commandBuffer)
return ?
}
Expand Down