21 resources.add_image(image,
false);
22 resources.add_buffer(buffer_src);
23 resources.add_buffer(buffer_dst);
28 {image, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_ASPECT_COLOR_BIT, {}});
31 VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
69 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
70 "dst_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT" +
72 " - buffer_barrier(src_access_mask=, dst_access_mask=VK_ACCESS_TRANSFER_READ_BIT, "
73 "buffer=0x3, offset=0, size=18446744073709551615)" +
76 EXPECT_EQ(
"copy_buffer(src_buffer=0x3, dst_buffer=0x4" +
endl() +
77 " - region(src_offset=0, dst_offset=0, size=0)" +
endl() +
")",
80 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
81 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
83 " - image_barrier(src_access_mask=, "
84 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
85 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
87 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
88 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
89 "base_array_layer=0, layer_count=4294967295 )" +
92 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
93 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
94 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
95 "p_color_attachments=" +
96 endl() +
" image_view=0x2, image_layout=" + color_attachment_layout_str() +
98 "resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
99 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
100 "load_op=VK_ATTACHMENT_LOAD_OP_DONT_CARE, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
105 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
106 "dst_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT" +
108 " - image_barrier(src_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
111 color_attachment_layout_str() +
113 "new_layout=VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, image=0x1, subresource_range=" +
115 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
116 "base_array_layer=0, layer_count=4294967295 )" +
128 resources.add_image(image,
false);
129 resources.add_buffer(buffer_src);
130 resources.add_buffer(buffer_dst);
134 access_info.
images.append(
135 {image, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_ASPECT_COLOR_BIT, {}});
138 VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
155 clear_attachments.
attachments[0].aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
156 clear_attachments.
attachments[0].clearValue.color.float32[0] = 0.2;
157 clear_attachments.
attachments[0].clearValue.color.float32[1] = 0.4;
158 clear_attachments.
attachments[0].clearValue.color.float32[2] = 0.6;
159 clear_attachments.
attachments[0].clearValue.color.float32[3] = 1.0;
160 clear_attachments.
attachments[0].colorAttachment = 0;
191 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
192 "dst_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT" +
194 " - buffer_barrier(src_access_mask=, dst_access_mask=VK_ACCESS_TRANSFER_READ_BIT, "
195 "buffer=0x3, offset=0, size=18446744073709551615)" +
198 EXPECT_EQ(
"copy_buffer(src_buffer=0x3, dst_buffer=0x4" +
endl() +
199 " - region(src_offset=0, dst_offset=0, size=0)" +
endl() +
")",
202 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
203 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
205 " - image_barrier(src_access_mask=, "
206 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
207 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
209 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
210 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
211 "base_array_layer=0, layer_count=4294967295 )" +
214 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
215 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
216 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
217 "p_color_attachments=" +
218 endl() +
" image_view=0x2, image_layout=" + color_attachment_layout_str() +
220 "resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
221 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
222 "load_op=VK_ATTACHMENT_LOAD_OP_DONT_CARE, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
226 "clear_attachments( - attachment(aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, "
227 "color_attachment=0)" +
228 endl() +
" - rect(rect=" +
endl() +
" offset=" +
endl() +
229 " x=0, y=0 , extent=" +
endl() +
230 " width=1920, height=1080 , base_array_layer=0, layer_count=1)" +
endl() +
")",
234 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
235 "dst_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT" +
237 " - image_barrier(src_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
240 color_attachment_layout_str() +
242 "new_layout=VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, image=0x1, subresource_range=" +
244 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
245 "base_array_layer=0, layer_count=4294967295 )" +
257 resources.add_image(image,
false);
258 resources.add_buffer(buffer_src);
259 resources.add_buffer(buffer_dst);
263 access_info.
images.append(
264 {image, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_ASPECT_COLOR_BIT, {}});
267 VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
291 clear_attachments.
attachments[0].aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
292 clear_attachments.
attachments[0].clearValue.color.float32[0] = 0.2;
293 clear_attachments.
attachments[0].clearValue.color.float32[1] = 0.4;
294 clear_attachments.
attachments[0].clearValue.color.float32[2] = 0.6;
295 clear_attachments.
attachments[0].clearValue.color.float32[3] = 1.0;
296 clear_attachments.
attachments[0].colorAttachment = 0;
320 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
321 "dst_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT" +
323 " - buffer_barrier(src_access_mask=, dst_access_mask=VK_ACCESS_TRANSFER_READ_BIT, "
324 "buffer=0x3, offset=0, size=18446744073709551615)" +
327 EXPECT_EQ(
"copy_buffer(src_buffer=0x3, dst_buffer=0x4" +
endl() +
328 " - region(src_offset=0, dst_offset=0, size=0)" +
endl() +
")",
331 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
332 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
334 " - image_barrier(src_access_mask=, "
335 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
336 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
338 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
339 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
340 "base_array_layer=0, layer_count=4294967295 )" +
343 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
344 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
345 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
346 "p_color_attachments=" +
347 endl() +
" image_view=0x2, image_layout=" + color_attachment_layout_str() +
349 "resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
350 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
351 "load_op=VK_ATTACHMENT_LOAD_OP_DONT_CARE, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
355 "clear_attachments( - attachment(aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, "
356 "color_attachment=0)" +
357 endl() +
" - rect(rect=" +
endl() +
" offset=" +
endl() +
358 " x=0, y=0 , extent=" +
endl() +
359 " width=1920, height=1080 , base_array_layer=0, layer_count=1)" +
endl() +
")",
363 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
364 "dst_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT" +
366 " - image_barrier(src_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
369 color_attachment_layout_str() +
371 "new_layout=VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, image=0x1, subresource_range=" +
373 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
374 "base_array_layer=0, layer_count=4294967295 )" +
386 resources.add_image(image,
false);
387 resources.add_buffer(buffer_src);
388 resources.add_buffer(buffer_dst);
392 access_info.
images.append(
393 {image, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_ASPECT_COLOR_BIT, {}});
396 VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
413 clear_attachments.
attachments[0].aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
414 clear_attachments.
attachments[0].clearValue.color.float32[0] = 0.2;
415 clear_attachments.
attachments[0].clearValue.color.float32[1] = 0.4;
416 clear_attachments.
attachments[0].clearValue.color.float32[2] = 0.6;
417 clear_attachments.
attachments[0].clearValue.color.float32[3] = 1.0;
418 clear_attachments.
attachments[0].colorAttachment = 0;
436 clear_attachments.
attachments[0].aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
437 clear_attachments.
attachments[0].clearValue.color.float32[0] = 0.2;
438 clear_attachments.
attachments[0].clearValue.color.float32[1] = 0.4;
439 clear_attachments.
attachments[0].clearValue.color.float32[2] = 0.6;
440 clear_attachments.
attachments[0].clearValue.color.float32[3] = 1.0;
441 clear_attachments.
attachments[0].colorAttachment = 0;
463 ASSERT_EQ(8,
log.size());
466 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
467 "dst_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT" +
469 " - buffer_barrier(src_access_mask=, dst_access_mask=VK_ACCESS_TRANSFER_READ_BIT, "
470 "buffer=0x3, offset=0, size=18446744073709551615)" +
473 EXPECT_EQ(
"copy_buffer(src_buffer=0x3, dst_buffer=0x4" +
endl() +
474 " - region(src_offset=0, dst_offset=0, size=0)" +
endl() +
")",
477 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
478 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
480 " - image_barrier(src_access_mask=, "
481 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
482 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
484 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
485 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
486 "base_array_layer=0, layer_count=4294967295 )" +
489 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
490 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
491 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
492 "p_color_attachments=" +
493 endl() +
" image_view=0x2, image_layout=" + color_attachment_layout_str() +
495 "resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
496 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
497 "load_op=VK_ATTACHMENT_LOAD_OP_DONT_CARE, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
501 "clear_attachments( - attachment(aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, "
502 "color_attachment=0)" +
503 endl() +
" - rect(rect=" +
endl() +
" offset=" +
endl() +
504 " x=0, y=0 , extent=" +
endl() +
505 " width=1920, height=1080 , base_array_layer=0, layer_count=1)" +
endl() +
")",
508 "clear_attachments( - attachment(aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, "
509 "color_attachment=0)" +
510 endl() +
" - rect(rect=" +
endl() +
" offset=" +
endl() +
511 " x=0, y=0 , extent=" +
endl() +
512 " width=1920, height=1080 , base_array_layer=0, layer_count=1)" +
endl() +
")",
516 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
517 "dst_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT" +
519 " - image_barrier(src_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
520 "dst_access_mask=, old_layout=" +
521 color_attachment_layout_str() +
523 "new_layout=VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, image=0x1, subresource_range=" +
525 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
526 "base_array_layer=0, layer_count=4294967295 )" +
547 resources.add_image(image_attachment,
false);
548 resources.add_image(image_feedback,
false);
552 access_info.
images.append(
553 {image_attachment, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_ASPECT_COLOR_BIT, {}});
556 VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
573 draw.node_data.first_instance = 0;
574 draw.node_data.first_vertex = 0;
575 draw.node_data.instance_count = 1;
576 draw.node_data.vertex_count = 4;
577 draw.node_data.graphics.pipeline_data.push_constants_data =
nullptr;
578 draw.node_data.graphics.pipeline_data.push_constants_size = 0;
579 draw.node_data.graphics.pipeline_data.vk_descriptor_set = VK_NULL_HANDLE;
580 draw.node_data.graphics.pipeline_data.vk_pipeline = pipeline_combine;
581 draw.node_data.graphics.pipeline_data.vk_pipeline_layout = pipeline_layout_combine;
582 draw.node_data.graphics.viewport.viewports.append(VkViewport{});
583 draw.node_data.graphics.viewport.scissors.append(VkRect2D{});
595 copy_image.
node_data.
region.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
605 draw.node_data.first_instance = 0;
606 draw.node_data.first_vertex = 0;
607 draw.node_data.instance_count = 1;
608 draw.node_data.vertex_count = 4;
609 draw.node_data.graphics.pipeline_data.push_constants_data =
nullptr;
610 draw.node_data.graphics.pipeline_data.push_constants_size = 0;
611 draw.node_data.graphics.pipeline_data.vk_descriptor_set = VK_NULL_HANDLE;
612 draw.node_data.graphics.pipeline_data.vk_pipeline = pipeline_background;
613 draw.node_data.graphics.pipeline_data.vk_pipeline_layout = pipeline_layout_background;
614 draw.node_data.graphics.viewport.viewports.append(VkViewport{});
615 draw.node_data.graphics.viewport.scissors.append(VkRect2D{});
625 ASSERT_EQ(14,
log.size());
628 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
629 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
631 " - image_barrier(src_access_mask=, "
632 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
633 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
635 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
636 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
637 "base_array_layer=0, layer_count=4294967295 )" +
640 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
641 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
642 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
643 "p_color_attachments=" +
644 endl() +
" image_view=0x3, image_layout=" + color_attachment_layout_str() +
645 ", resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
646 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
647 "load_op=VK_ATTACHMENT_LOAD_OP_DONT_CARE, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
652 EXPECT_EQ(
"bind_pipeline(pipeline_bind_point=VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline=0x5)",
654 EXPECT_EQ(
"draw(vertex_count=4, instance_count=1, first_vertex=0, first_instance=0)",
log[5]);
657 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
658 "dst_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT" +
660 " - image_barrier(src_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
661 "dst_access_mask=VK_ACCESS_TRANSFER_READ_BIT, "
663 color_attachment_layout_str() +
665 "new_layout=VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, image=0x1, subresource_range=" +
667 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
668 "base_array_layer=0, layer_count=4294967295 )" +
670 " - image_barrier(src_access_mask=, dst_access_mask=VK_ACCESS_TRANSFER_WRITE_BIT, "
671 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, new_layout=VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, "
672 "image=0x2, subresource_range=" +
674 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
675 "base_array_layer=0, layer_count=4294967295 )" +
679 "copy_image(src_image=0x1, src_image_layout=VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, "
680 "dst_image=0x2, dst_image_layout=VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL" +
681 endl() +
" - region(src_subresource=" +
endl() +
682 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, mip_level=0, base_array_layer=0, "
683 "layer_count=1 , src_offset=" +
684 endl() +
" x=0, y=0, z=0 , dst_subresource=" +
endl() +
685 " aspect_mask=, mip_level=0, base_array_layer=0, layer_count=0 , dst_offset=" +
686 endl() +
" x=0, y=0, z=0 , extent=" +
endl() +
687 " width=1920, height=1080, depth=1 )" +
endl() +
")",
690 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT, "
691 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
693 " - image_barrier(src_access_mask=VK_ACCESS_TRANSFER_READ_BIT, "
694 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
695 "old_layout=VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, "
697 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
698 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
699 "base_array_layer=0, layer_count=4294967295 )" +
702 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
703 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
704 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
705 "p_color_attachments=" +
706 endl() +
" image_view=0x3, image_layout=" + color_attachment_layout_str() +
707 ", resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
708 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
709 "load_op=VK_ATTACHMENT_LOAD_OP_LOAD, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
712 EXPECT_EQ(
"bind_pipeline(pipeline_bind_point=VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline=0x7)",
714 EXPECT_EQ(
"draw(vertex_count=4, instance_count=1, first_vertex=0, first_instance=0)",
log[12]);
731 resources.add_image(image,
false);
732 resources.add_buffer(buffer_a);
733 resources.add_buffer(buffer_b);
737 access_info.
images.append(
738 {image, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_ASPECT_COLOR_BIT, {}});
741 VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
766 access_info.
buffers.append({buffer_a, VK_ACCESS_UNIFORM_READ_BIT});
768 draw.node_data.first_instance = 0;
769 draw.node_data.first_vertex = 0;
770 draw.node_data.instance_count = 1;
771 draw.node_data.vertex_count = 1;
772 draw.node_data.graphics.pipeline_data.push_constants_data =
nullptr;
773 draw.node_data.graphics.pipeline_data.push_constants_size = 0;
774 draw.node_data.graphics.pipeline_data.vk_descriptor_set = VK_NULL_HANDLE;
775 draw.node_data.graphics.pipeline_data.vk_pipeline = pipeline;
776 draw.node_data.graphics.pipeline_data.vk_pipeline_layout = pipeline_layout;
777 draw.node_data.graphics.viewport.viewports.append(VkViewport{});
778 draw.node_data.graphics.viewport.scissors.append(VkRect2D{});
793 access_info.
buffers.append({buffer_b, VK_ACCESS_UNIFORM_READ_BIT});
795 draw.node_data.first_instance = 0;
796 draw.node_data.first_vertex = 0;
797 draw.node_data.instance_count = 1;
798 draw.node_data.vertex_count = 2;
799 draw.node_data.graphics.pipeline_data.push_constants_data =
nullptr;
800 draw.node_data.graphics.pipeline_data.push_constants_size = 0;
801 draw.node_data.graphics.pipeline_data.vk_descriptor_set = VK_NULL_HANDLE;
802 draw.node_data.graphics.pipeline_data.vk_pipeline = pipeline;
803 draw.node_data.graphics.pipeline_data.vk_pipeline_layout = pipeline_layout;
804 draw.node_data.graphics.viewport.viewports.append(VkViewport{});
805 draw.node_data.graphics.viewport.scissors.append(VkRect2D{});
820 access_info.
buffers.append({buffer_a, VK_ACCESS_UNIFORM_READ_BIT});
822 draw.node_data.first_instance = 0;
823 draw.node_data.first_vertex = 0;
824 draw.node_data.instance_count = 1;
825 draw.node_data.vertex_count = 3;
826 draw.node_data.graphics.pipeline_data.push_constants_data =
nullptr;
827 draw.node_data.graphics.pipeline_data.push_constants_size = 0;
828 draw.node_data.graphics.pipeline_data.vk_descriptor_set = VK_NULL_HANDLE;
829 draw.node_data.graphics.pipeline_data.vk_pipeline = pipeline;
830 draw.node_data.graphics.pipeline_data.vk_pipeline_layout = pipeline_layout;
831 draw.node_data.graphics.viewport.viewports.append(VkViewport{});
832 draw.node_data.graphics.viewport.scissors.append(VkRect2D{});
842 ASSERT_EQ(19,
log.size());
843 EXPECT_EQ(
"update_buffer(dst_buffer=0x1, dst_offset=0, data_size=16)",
log[0]);
844 EXPECT_EQ(
"update_buffer(dst_buffer=0x2, dst_offset=0, data_size=24)",
log[1]);
846 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
847 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
849 " - image_barrier(src_access_mask=, "
850 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
851 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
853 color_attachment_layout_str() +
855 "image=0x3, subresource_range=" +
857 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, "
858 "base_mip_level=0, level_count=4294967295, base_array_layer=0, layer_count=4294967295 "
863 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT, "
864 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
867 "buffer_barrier(src_access_mask=VK_ACCESS_TRANSFER_WRITE_BIT, "
868 "dst_access_mask=VK_ACCESS_UNIFORM_READ_BIT, buffer=0x1, offset=0, "
869 "size=18446744073709551615)" +
873 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT, "
874 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
877 "buffer_barrier(src_access_mask=VK_ACCESS_TRANSFER_WRITE_BIT, "
878 "dst_access_mask=VK_ACCESS_UNIFORM_READ_BIT, buffer=0x2, offset=0, "
879 "size=18446744073709551615)" +
882 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
883 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
884 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
885 "p_color_attachments=" +
886 endl() +
" image_view=0x4, image_layout=" + color_attachment_layout_str() +
887 ", resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
888 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
889 "load_op=VK_ATTACHMENT_LOAD_OP_DONT_CARE, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
894 EXPECT_EQ(
"bind_pipeline(pipeline_bind_point=VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline=0x6)",
896 EXPECT_EQ(
"draw(vertex_count=1, instance_count=1, first_vertex=0, first_instance=0)",
log[9]);
897 EXPECT_EQ(
"draw(vertex_count=2, instance_count=1, first_vertex=0, first_instance=0)",
log[10]);
900 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
901 "dst_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT" +
903 " - buffer_barrier(src_access_mask=VK_ACCESS_UNIFORM_READ_BIT, "
904 "dst_access_mask=VK_ACCESS_TRANSFER_WRITE_BIT, buffer=0x1, offset=0, "
905 "size=18446744073709551615)" +
908 EXPECT_EQ(
"update_buffer(dst_buffer=0x1, dst_offset=0, data_size=16)",
log[13]);
910 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT, "
911 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
913 " - buffer_barrier(src_access_mask=VK_ACCESS_TRANSFER_WRITE_BIT, "
914 "dst_access_mask=VK_ACCESS_UNIFORM_READ_BIT, buffer=0x1, offset=0, "
915 "size=18446744073709551615)" +
919 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
920 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
922 " - image_barrier(src_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
923 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
925 color_attachment_layout_str() +
928 color_attachment_layout_str() +
", image=0x3, subresource_range=" +
endl() +
929 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
930 "base_array_layer=0, layer_count=4294967295 )" +
933 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
934 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
935 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
936 "p_color_attachments=" +
937 endl() +
" image_view=0x4, image_layout=" + color_attachment_layout_str() +
938 ", resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
939 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
940 "load_op=VK_ATTACHMENT_LOAD_OP_LOAD, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
943 EXPECT_EQ(
"draw(vertex_count=3, instance_count=1, first_vertex=0, first_instance=0)",
log[17]);
961 resources.add_image(image_attachment,
false);
962 resources.add_image(image_editor,
false);
966 access_info.
images.append(
967 {image_attachment, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_IMAGE_ASPECT_COLOR_BIT, {}});
970 VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
987 draw.node_data.first_instance = 0;
988 draw.node_data.first_vertex = 0;
989 draw.node_data.instance_count = 1;
990 draw.node_data.vertex_count = 4;
991 draw.node_data.graphics.pipeline_data.push_constants_data =
nullptr;
992 draw.node_data.graphics.pipeline_data.push_constants_size = 0;
993 draw.node_data.graphics.pipeline_data.vk_descriptor_set = VK_NULL_HANDLE;
994 draw.node_data.graphics.pipeline_data.vk_pipeline = pipeline;
995 draw.node_data.graphics.pipeline_data.vk_pipeline_layout = pipeline_layout;
996 draw.node_data.graphics.viewport.viewports.append(VkViewport{});
997 draw.node_data.graphics.viewport.scissors.append(VkRect2D{});
1009 copy_image.
node_data.
region.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
1019 draw.node_data.first_instance = 0;
1020 draw.node_data.first_vertex = 0;
1021 draw.node_data.instance_count = 1;
1022 draw.node_data.vertex_count = 4;
1023 draw.node_data.graphics.pipeline_data.push_constants_data =
nullptr;
1024 draw.node_data.graphics.pipeline_data.push_constants_size = 0;
1025 draw.node_data.graphics.pipeline_data.vk_descriptor_set = VK_NULL_HANDLE;
1026 draw.node_data.graphics.pipeline_data.vk_pipeline = pipeline;
1027 draw.node_data.graphics.pipeline_data.vk_pipeline_layout = pipeline_layout;
1028 draw.node_data.graphics.viewport.viewports.append(VkViewport{});
1029 draw.node_data.graphics.viewport.scissors.append(VkRect2D{});
1039 ASSERT_EQ(13,
log.size());
1041 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "
1042 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
1044 " - image_barrier(src_access_mask=, "
1045 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
1046 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
1048 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
1049 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
1050 "base_array_layer=0, layer_count=4294967295 )" +
1053 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
1054 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
1055 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
1056 "p_color_attachments=" +
1057 endl() +
" image_view=0x3, image_layout=" + color_attachment_layout_str() +
1058 ", resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
1059 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
1060 "load_op=VK_ATTACHMENT_LOAD_OP_DONT_CARE, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
1065 EXPECT_EQ(
"bind_pipeline(pipeline_bind_point=VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline=0x5)",
1067 EXPECT_EQ(
"draw(vertex_count=4, instance_count=1, first_vertex=0, first_instance=0)",
log[5]);
1070 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, "
1071 "dst_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT" +
1073 " - image_barrier(src_access_mask=, dst_access_mask=VK_ACCESS_TRANSFER_READ_BIT, "
1074 "old_layout=VK_IMAGE_LAYOUT_UNDEFINED, new_layout=VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, "
1075 "image=0x2, subresource_range=" +
1077 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
1078 "base_array_layer=0, layer_count=4294967295 )" +
1080 " - image_barrier(src_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
1081 "dst_access_mask=VK_ACCESS_TRANSFER_WRITE_BIT, "
1083 color_attachment_layout_str() +
1085 "new_layout=VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, image=0x1, subresource_range=" +
1087 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
1088 "base_array_layer=0, layer_count=4294967295 )" +
1092 "copy_image(src_image=0x2, src_image_layout=VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, "
1093 "dst_image=0x1, dst_image_layout=VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL" +
1094 endl() +
" - region(src_subresource=" +
endl() +
1095 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, mip_level=0, base_array_layer=0, "
1096 "layer_count=1 , src_offset=" +
1097 endl() +
" x=0, y=0, z=0 , dst_subresource=" +
endl() +
1098 " aspect_mask=, mip_level=0, base_array_layer=0, layer_count=0 , dst_offset=" +
1099 endl() +
" x=0, y=0, z=0 , extent=" +
endl() +
1100 " width=1920, height=1080, depth=1 )" +
endl() +
")",
1103 "pipeline_barrier(src_stage_mask=VK_PIPELINE_STAGE_TRANSFER_BIT, "
1104 "dst_stage_mask=VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT" +
1106 " - image_barrier(src_access_mask=VK_ACCESS_TRANSFER_WRITE_BIT, "
1107 "dst_access_mask=VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, "
1108 "old_layout=VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, "
1110 color_attachment_layout_str() +
", image=0x1, subresource_range=" +
endl() +
1111 " aspect_mask=VK_IMAGE_ASPECT_COLOR_BIT, base_mip_level=0, level_count=4294967295, "
1112 "base_array_layer=0, layer_count=4294967295 )" +
1115 EXPECT_EQ(
"begin_rendering(p_rendering_info=flags=, render_area=" +
endl() +
1116 " offset=" +
endl() +
" x=0, y=0 , extent=" +
endl() +
1117 " width=0, height=0 , layer_count=1, view_mask=0, color_attachment_count=1, "
1118 "p_color_attachments=" +
1119 endl() +
" image_view=0x3, image_layout=" + color_attachment_layout_str() +
1120 ", resolve_mode=VK_RESOLVE_MODE_NONE, resolve_image_view=0, "
1121 "resolve_image_layout=VK_IMAGE_LAYOUT_UNDEFINED, "
1122 "load_op=VK_ATTACHMENT_LOAD_OP_LOAD, store_op=VK_ATTACHMENT_STORE_OP_STORE" +
1125 EXPECT_EQ(
"draw(vertex_count=4, instance_count=1, first_vertex=0, first_instance=0)",
log[11]);