(base: RenderBase)
| 677 | |
| 678 | impl RenderCtx { |
| 679 | pub fn from_base(base: RenderBase) -> Self { |
| 680 | let sync = RenderSync::new(&base); |
| 681 | |
| 682 | let (swapchain, extent) = base.create_swapchain(); |
| 683 | let image_views = base.create_image_views(swapchain); |
| 684 | let render_pass = base.create_render_pass(); |
| 685 | let framebuffers = base.create_framebuffers(&image_views, render_pass, extent); |
| 686 | let commands = RenderCommandPool::new(&base); |
| 687 | let (viewports, scissors) = { |
| 688 | ( |
| 689 | Box::new([vk::Viewport { |
| 690 | x: 0.0, |
| 691 | y: extent.height as f32, |
| 692 | width: extent.width as f32, |
| 693 | height: -(extent.height as f32), |
| 694 | min_depth: 0.0, |
| 695 | max_depth: 1.0, |
| 696 | }]), |
| 697 | Box::new([vk::Rect2D { |
| 698 | offset: vk::Offset2D { x: 0, y: 0 }, |
| 699 | extent, |
| 700 | }]), |
| 701 | ) |
| 702 | }; |
| 703 | |
| 704 | Self { |
| 705 | sync, |
| 706 | base, |
| 707 | swapchain, |
| 708 | extent, |
| 709 | image_views, |
| 710 | commands, |
| 711 | render_pass, |
| 712 | framebuffers, |
| 713 | viewports, |
| 714 | scissors, |
| 715 | pipelines: Vec::new(), |
| 716 | shader_modules: HashMap::new(), |
| 717 | shader_set: Vec::new(), |
| 718 | rendering_paused: false, |
| 719 | recompiling_shaders: false, |
| 720 | start: std::time::Instant::now(), |
| 721 | |
| 722 | sky_fs_spec_id_0x5007_sun_intensity_extra_spec_const_factor: 100, |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | pub fn create_pipeline_layout(&self) -> vk::PipelineLayout { |
| 727 | let push_constant_range = vk::PushConstantRange::builder() |
nothing calls this directly
no test coverage detected