Compare commits

..

2 commits

Author SHA1 Message Date
49b039a4d7 Update Rust crate rusqlite to 0.34.0 2025-03-08 09:02:30 +00:00
8d3b03da24 Trying to fix missing sky box 2025-03-08 08:16:32 +01:00
2 changed files with 46 additions and 13 deletions

View file

@ -305,6 +305,47 @@ where
Ok((info_buffer, descriptor_set))
}
fn copy_source_image(
&self,
buffer_recorder: &mut CommandBufferRecorder<'_>,
current_swapchain_image: &Arc<Image>,
) -> Result<()> {
// bring image into transfer destination mode
buffer_recorder.image_barrier(
&self.target_image,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT,
);
// transition swapchain image to transfer source mod
buffer_recorder.image_barrier(
current_swapchain_image,
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT,
);
buffer_recorder.blit_complete(
current_swapchain_image,
&self.target_image,
VK_FILTER_LINEAR,
);
// bring image into receive mode
buffer_recorder.image_barrier(
&self.target_image,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_IMAGE_LAYOUT_GENERAL,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
);
Ok(())
}
fn present_image(
&self,
buffer_recorder: &mut CommandBufferRecorder<'_>,
@ -322,8 +363,8 @@ where
// transition swapchain image to transfer destination
buffer_recorder.image_barrier(
current_swapchain_image,
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT,
);
@ -334,15 +375,6 @@ where
VK_FILTER_LINEAR,
);
// bring image into receive mode
buffer_recorder.image_barrier(
&self.target_image,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_IMAGE_LAYOUT_GENERAL,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
);
// transition swapchain image to present mode
buffer_recorder.image_barrier(
current_swapchain_image,
@ -645,6 +677,8 @@ where
.update(&[DescriptorWrite::storage_buffers(0, &[scene_buffer])])?;
}
self.copy_source_image(buffer_recorder, &images.mono()[index])?;
self.renderer.process(
buffer_recorder,
&[

View file

@ -59,9 +59,7 @@ void main()
pay_load_index
);
// TODO: store depth value
imageStore(output_image, ivec2(gl_LaunchIDEXT.xy), vec4(pay_load.color.xyz, 1.0));
vec3 position;
@ -69,6 +67,7 @@ void main()
position = vec3(INFINITY);
} else {
position = origin.xyz + pay_load.distance * direction.xyz;
imageStore(output_image, ivec2(gl_LaunchIDEXT.xy), vec4(pay_load.color.xyz, 1.0));
}
imageStore(depth_buffer, ivec2(gl_LaunchIDEXT.xy), vec4(position, 0.0));