( ctx context.Context, cb CommandBuilder, commandBuffer VkCommandBuffer, r *api.GlobalState, s *api.GlobalState, d VkCmdBeginRenderPassArgsʳ)
| 125 | } |
| 126 | |
| 127 | func rebuildVkCmdBeginRenderPass( |
| 128 | ctx context.Context, |
| 129 | cb CommandBuilder, |
| 130 | commandBuffer VkCommandBuffer, |
| 131 | r *api.GlobalState, |
| 132 | s *api.GlobalState, |
| 133 | d VkCmdBeginRenderPassArgsʳ) (func(), api.Cmd, error) { |
| 134 | |
| 135 | a := s.Arena // TODO: Should this be a seperate temporary arena? |
| 136 | |
| 137 | if !GetState(s).RenderPasses().Contains(d.RenderPass()) { |
| 138 | return nil, nil, fmt.Errorf("Cannot find Renderpass %v", d.RenderPass()) |
| 139 | } |
| 140 | if !GetState(s).Framebuffers().Contains(d.Framebuffer()) { |
| 141 | return nil, nil, fmt.Errorf("Cannot find Framebuffer %v", d.Framebuffer()) |
| 142 | } |
| 143 | |
| 144 | clearValues := make([]VkClearValue, d.ClearValues().Len()) |
| 145 | for i := range clearValues { |
| 146 | clearValues[i] = d.ClearValues().Get(uint32(i)) |
| 147 | } |
| 148 | |
| 149 | clearValuesData := s.AllocDataOrPanic(ctx, clearValues) |
| 150 | |
| 151 | begin := NewVkRenderPassBeginInfo(a, |
| 152 | VkStructureType_VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, // sType |
| 153 | 0, // pNext |
| 154 | d.RenderPass(), // renderPass |
| 155 | d.Framebuffer(), // framebuffer |
| 156 | d.RenderArea(), // renderArea |
| 157 | uint32(len(clearValues)), // clearValueCount |
| 158 | NewVkClearValueᶜᵖ(clearValuesData.Ptr()), // pClearValues |
| 159 | ) |
| 160 | beginData := s.AllocDataOrPanic(ctx, begin) |
| 161 | |
| 162 | return func() { |
| 163 | clearValuesData.Free() |
| 164 | beginData.Free() |
| 165 | }, cb.VkCmdBeginRenderPass( |
| 166 | commandBuffer, |
| 167 | beginData.Ptr(), |
| 168 | d.Contents()).AddRead(beginData.Data()).AddRead(clearValuesData.Data()), nil |
| 169 | } |
| 170 | |
| 171 | func rebuildVkCmdEndRenderPass( |
| 172 | ctx context.Context, |
no test coverage detected