(ctx context.Context, cb CommandBuilder, out transform.Writer, device VkDevice, queryPool VkQueryPool, commandPool VkCommandPool, query uint32)
| 204 | } |
| 205 | |
| 206 | func (t *queryTimestamps) generateQueryCommand(ctx context.Context, |
| 207 | cb CommandBuilder, |
| 208 | out transform.Writer, |
| 209 | device VkDevice, |
| 210 | queryPool VkQueryPool, |
| 211 | commandPool VkCommandPool, |
| 212 | query uint32) VkCommandBuffer { |
| 213 | s := out.State() |
| 214 | commandBufferAllocateInfo := NewVkCommandBufferAllocateInfo(s.Arena, |
| 215 | VkStructureType_VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // sType |
| 216 | NewVoidᶜᵖ(memory.Nullptr), // pNext |
| 217 | commandPool, // commandPool |
| 218 | VkCommandBufferLevel_VK_COMMAND_BUFFER_LEVEL_PRIMARY, // level |
| 219 | 1, // commandBufferCount |
| 220 | ) |
| 221 | commandBufferAllocateInfoData := t.mustAllocData(ctx, s, commandBufferAllocateInfo) |
| 222 | commandBufferID := VkCommandBuffer(newUnusedID(true, |
| 223 | func(x uint64) bool { |
| 224 | ok := GetState(s).CommandBuffers().Contains(VkCommandBuffer(x)) |
| 225 | return ok |
| 226 | })) |
| 227 | commandBufferData := t.mustAllocData(ctx, s, commandBufferID) |
| 228 | |
| 229 | beginCommandBufferInfo := NewVkCommandBufferBeginInfo(s.Arena, |
| 230 | VkStructureType_VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // sType |
| 231 | 0, // pNext |
| 232 | VkCommandBufferUsageFlags(VkCommandBufferUsageFlagBits_VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT), // flags |
| 233 | 0, // pInheritanceInfo |
| 234 | ) |
| 235 | beginCommandBufferInfoData := t.mustAllocData(ctx, s, beginCommandBufferInfo) |
| 236 | |
| 237 | writeEach(ctx, out, |
| 238 | cb.VkAllocateCommandBuffers( |
| 239 | device, |
| 240 | commandBufferAllocateInfoData.Ptr(), |
| 241 | commandBufferData.Ptr(), |
| 242 | VkResult_VK_SUCCESS, |
| 243 | ).AddRead( |
| 244 | commandBufferAllocateInfoData.Data(), |
| 245 | ).AddWrite( |
| 246 | commandBufferData.Data(), |
| 247 | ), |
| 248 | cb.VkBeginCommandBuffer( |
| 249 | commandBufferID, |
| 250 | beginCommandBufferInfoData.Ptr(), |
| 251 | VkResult_VK_SUCCESS, |
| 252 | ).AddRead( |
| 253 | beginCommandBufferInfoData.Data(), |
| 254 | ), |
| 255 | cb.VkCmdResetQueryPool(commandBufferID, queryPool, query, 1), |
| 256 | cb.VkCmdWriteTimestamp(commandBufferID, |
| 257 | VkPipelineStageFlagBits_VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, |
| 258 | queryPool, |
| 259 | query), |
| 260 | cb.VkEndCommandBuffer( |
| 261 | commandBufferID, |
| 262 | VkResult_VK_SUCCESS, |
| 263 | ), |
no test coverage detected