Skip to content

Commit

Permalink
Vulkan: Fix BasePipeline value set in vkCreate*Pipelines
Browse files Browse the repository at this point in the history
When the `vk*PipelineCreateInfo` specifies a base pipeline by
`basePipelineHandle`, the `basePipelineIndex` is set to -1; the previous code
lost this -1 value, and later in `vk*PipelineCreateInfo`, `BasePipelineIndex`
was 0, causing `BasePipeline` to be set by index, instead of by handle.

This change ensures that `basePipelineIndex` is copied over to the
`*PipelineObject`, so that `BasePipeline` is set correctly.

Fixes #2392
  • Loading branch information
bjoeris committed Nov 23, 2018
1 parent c928b2f commit 3838a57
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions gapis/api/vulkan/api/pipeline.api
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,8 @@ cmd VkResult vkCreateGraphicsPipelines(
obj.RenderPass = RenderPasses[create_info.renderPass]
obj.Subpass = create_info.subpass
if ((as!u32(create_info.flags) & as!u32(VK_PIPELINE_CREATE_DERIVATIVE_BIT)) != 0) {
if (create_info.basePipelineIndex != -1) {
obj.BasePipelineIndex = create_info.basePipelineIndex
} else {
obj.BasePipeline = create_info.basePipelineHandle
}
obj.BasePipelineIndex = create_info.basePipelineIndex
obj.BasePipeline = create_info.basePipelineHandle
} else {
obj.BasePipelineIndex = 0
obj.BasePipeline = as!VkPipeline(0)
Expand Down Expand Up @@ -625,11 +622,8 @@ cmd VkResult vkCreateComputePipelines(
}
obj.Stage = stage_data
if ((as!u32(info.flags) & as!u32(VK_PIPELINE_CREATE_DERIVATIVE_BIT)) != 0) {
if (info.basePipelineIndex != -1) {
obj.BasePipelineIndex = info.basePipelineIndex
} else {
obj.BasePipeline = info.basePipelineHandle
}
obj.BasePipelineIndex = info.basePipelineIndex
obj.BasePipeline = info.basePipelineHandle
} else {
obj.BasePipelineIndex = 0
obj.BasePipeline = as!VkPipeline(0)
Expand Down

0 comments on commit 3838a57

Please sign in to comment.