vulkano/examples
Katt 9a35fb0221
Make image_index and final_views accessible, and add new example. (#2473)
* Make image_index and final_views accessible, and new example.

The first 2 changes should make creating frame buffers easier.
The new example should make it easier to learn vulkano-util.

* Remove unnecessary imports, and run clippy.

* Run fmt.

* .acquire() no longer returns image_index

* rename final_views() to swapchain_image_views()

The name change makes it more consistent with swapchain_image_view().

Personally I don't understand why the field name is final_views, yet we externally in function names refer to it as swapchain image views and such like.

* Fractal example no longer creates framebuffer every frame.

* Game of life example no longer creates framebuffer every frame.

(Also removed a piece of code I had commented out, but had forgotten to remove from the fractal example.)

* Rename if_recreate_swapchain to on_recreate_swapchain and update acquire() documentation. to on_recreate_swapchain

* on_recreate_swapchain is now impl FnOnce instead of generics based FnMut

Thanks marc0246!

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Replace empty comment with an actual comment.

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2024-02-21 09:08:50 +01:00
..
async-update Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
basic-compute-shader Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
buffer-allocator Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
clear-attachments Merge PrimaryAutoCommandBuffer and SecondaryAutoCommandBuffer into CommandBuffer (#2425) 2023-12-20 13:04:01 +01:00
debug Remove license notices from source files (#2401) 2023-11-08 13:49:49 +01:00
deferred Fix Rust 1.76 clippy warnings (#2462) 2024-02-15 16:39:02 +01:00
dynamic-buffers Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
dynamic-local-size Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
gl-interop Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
image Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
image-self-copy-blit Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
immutable-sampler Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
indirect Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
instancing Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
interactive-fractal Make image_index and final_views accessible, and add new example. (#2473) 2024-02-21 09:08:50 +01:00
mesh-shader Enforce a consistent comment width (#2444) 2024-01-05 02:14:49 -06:00
msaa-renderpass Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
multi-window Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
multi-window-game-of-life Make image_index and final_views accessible, and add new example. (#2473) 2024-02-21 09:08:50 +01:00
multiview Enforce a consistent comment width (#2444) 2024-01-05 02:14:49 -06:00
occlusion-query Merge PrimaryAutoCommandBuffer and SecondaryAutoCommandBuffer into CommandBuffer (#2425) 2023-12-20 13:04:01 +01:00
offscreen Add Minimal Offscreen Rendering Example (#2451) 2024-01-11 01:37:17 +01:00
pipeline-caching Add vulkano macros feature to examples that needs it (#2408) 2023-11-16 17:07:28 +01:00
push-constants Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
push-descriptors Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
runtime-array Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
runtime-shader Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
self-copy-buffer Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
shader-include Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
shader-types-derive Add vulkano macros feature to examples that needs it (#2408) 2023-11-16 17:07:28 +01:00
shader-types-sharing Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
simple-particles Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
specialization-constants Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
teapot Enforce a consistent comment width (#2444) 2024-01-05 02:14:49 -06:00
tessellation Document shader safety requirements, make draw/dispatch unsafe (#2429) 2023-12-25 04:01:16 +01:00
texture-array Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
triangle Enforce a consistent comment width (#2444) 2024-01-05 02:14:49 -06:00
triangle-util Make image_index and final_views accessible, and add new example. (#2473) 2024-02-21 09:08:50 +01:00
triangle-v1_3 Enforce a consistent comment width (#2444) 2024-01-05 02:14:49 -06:00
README.md Improve the examples' directory structure (#2375) 2023-10-29 18:46:14 +01:00
run_all.sh Improve the examples' directory structure (#2375) 2023-10-29 18:46:14 +01:00

Examples

The examples shown here will not necessarily work for the latest stable release of Vulkano. By default, Github shows the most recent unstable revision, rather than the last stable release. You can switch Github to show the examples for stable releases as follows.

Selecting the version tag:

1. Find the branch/tag selection box and click it. change_tag_1
2. Select click on the tags tab. change_tag_2
3. Click on the desired version. change_tag_3
4. After selecting it should look like this. change_tag_4

Running the examples:

cargo run --bin <example>

Example:

cargo run --bin triangle

If you want to compare performances with other libraries, you should pass the --release flag as well. Rust is pretty slow in debug mode.