Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge latest ash changes into the nv-low-latency2 branch #1

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4180359
gitmodules: Disable `update` to prevent cloning on cargo checkout (#808)
MarijnS95 Oct 30, 2023
335251d
Enable `descriptor_count()` setter on `ash::vk::WriteDescriptorSet` (…
MarijnS95 Oct 31, 2023
6c75404
Add simple dependabot config for `cargo` and `github-actions` (#810)
MarijnS95 Nov 3, 2023
d0c5e97
build(deps): bump actions/checkout from 1 to 4 in /.github/workflows …
dependabot[bot] Nov 3, 2023
d40ab4b
Bump libloading to 0.8 (#739)
djkoloski Nov 15, 2023
c87eb53
Update repository links and crate keywords/categories (#819)
MarijnS95 Nov 17, 2023
4bbfa54
Rename `examples` to `ash-examples` (#820)
MarijnS95 Nov 17, 2023
7a73f01
build(deps): update vk-parse requirement from 0.10 to 0.12 (#825)
dependabot[bot] Nov 20, 2023
5952227
build(deps): update itertools requirement from 0.10 to 0.12 (#824)
dependabot[bot] Nov 20, 2023
c045383
build(deps): update bindgen requirement from 0.64 to 0.69 (#823)
dependabot[bot] Nov 20, 2023
7005a49
cargo: Set `resolver = "2"` and avoid warning
MarijnS95 Nov 21, 2023
b358b9d
extensions/khr/ray_tracing_pipeline: Pass indirect SBT regions as sin…
MarijnS95 Nov 25, 2023
ccf6be8
build(deps): update syn requirement from 1.0 to 2.0 (#834)
dependabot[bot] Nov 27, 2023
5938fd2
Update Vulkan-Headers to 1.3.271 (#816)
MarijnS95 Nov 28, 2023
02c7a83
Provide `CStr` getters and setters for `c_char` pointers and arrays (…
MarijnS95 Nov 28, 2023
4e99de1
Convert `mem::zeroed()` / `0` to `MaybeUninit::uninit()` (#798)
MarijnS95 Dec 1, 2023
e5b0873
generator: Work around invariance for assigning mutable pointer of li…
MarijnS95 Dec 2, 2023
befb8cd
Switch to safe `CStr::from_bytes_until_nul` on sized `c_char` array w…
MarijnS95 Dec 2, 2023
e6d80ba
generator: Apply `must_use` attributes to all Vulkan structs (#845)
MarijnS95 Dec 5, 2023
e7dab7c
Clean up unused `std::XXX::` qualifications in examples and extension…
MarijnS95 Dec 23, 2023
51080bd
Fix Rust 1.75 clippy lints (#859)
MarijnS95 Jan 10, 2024
e992225
generator: Derive slice getters/setters for runtime-bounded static ar…
MarijnS95 Jan 10, 2024
92084df
generator: Wrap `_as_c_str()` getter for possibly-pointers in `Option…
MarijnS95 Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: "/.github/workflows/"
schedule:
interval: weekly
33 changes: 13 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,26 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- run: cargo check --workspace --all-targets --all-features

check_msrv:
name: Check ash MSRV (1.60.0)
name: Check ash and ash-window MSRV (1.69.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: dtolnay/[email protected]
- run: cargo check -p ash -p ash-rewrite --all-features

check_ash_window_msrv:
name: Check ash-window MSRV (1.64.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: dtolnay/[email protected]
- run: cargo check -p ash-window -p examples --all-features
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- run: cargo check -p ash -p ash-rewrite -p ash-window -p ash-examples --all-features

# TODO: add a similar job for the rewrite once that generates code
generated:
name: Generated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- uses: actions/checkout@v4
- name: Checkout submodule
# Manually update submodules with --checkout because they are configured with update=none and will be skipped otherwise
run: git submodule update --recursive --init --force --checkout
- name: Run generator
run: cargo run -p generator
- name: Diff autogen result
Expand All @@ -45,7 +38,7 @@ jobs:
steps:
- name: Install Vulkan loader
run: sudo apt-get install libvulkan-dev
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Test all targets
run: cargo test --workspace --all-targets
- name: Test docs
Expand All @@ -55,7 +48,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- run: cargo fmt --all -- --check

clippy:
Expand All @@ -69,7 +62,7 @@ jobs:
- x86_64-apple-darwin
- aarch64-apple-ios
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Add Rust target ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: Clippy lint without features
Expand All @@ -90,7 +83,7 @@ jobs:
name: Build-test docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Document all crates
env:
RUSTDOCFLAGS: -Dwarnings
Expand Down
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "generator/Vulkan-Headers"]
path = generator/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers
update = none
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[workspace]
resolver = "2"
members = [
"examples",
"analysis",
"ash",
"ash-examples",
"ash-rewrite",
"ash-window",
"analysis",
"generator",
"generator-rewrite",
]
44 changes: 25 additions & 19 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added `Handle::is_null()` to allow checking if a handle is a `NULL` value (#694)
- Allow building `Entry`/`Instance`/`Device` from handle+fns (see their `from_parts_1_x()` associated functions) (#748)
- Update Vulkan-Headers to 1.3.269 (#760, #763, #783)
- Update Vulkan-Headers to 1.3.271 (#760, #763, #783, #816)
- Added `VK_NV_memory_decompression` device extension (#761)
- Added `VK_GOOGLE_display_timing` device extension (#765)
- Added `VK_ANDROID_external_memory_android_hardware_buffer` device extension (#769)
Expand All @@ -28,15 +28,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `VK_NV_low_latency2` device extension (#802)
- Added `VK_EXT_hdr_metadata` device extension (#804)
- Added `VK_NV_cuda_kernel_launch` device extension (#805)
- Added `descriptor_count()` setter on `ash::vk::WriteDescriptorSet` (#809)
- Added `*_as_c_str()` getters for `c_char` pointers and `c_char` arrays (#831)
- Added `#[must_use]` to Vulkan structs to make it more clear that they are moved by the builder pattern (#845)

### Changed

- Replaced builders with lifetimes/setters directly on Vulkan structs (#602)
- Inlined struct setters (#602)
- Bumped MSRV from 1.59 to 1.60 (#709)
- Bumped MSRV from 1.59 to 1.69 (#709, #746)
- Replaced `const fn name()` with associated `NAME` constants (#715)
- Generic builders now automatically set `objecttype` to `<T as Handle>::ObjectType` (#724)
- `get_calibrated_timestamps()` now returns a single value for `max_deviation` (#738)
- Bumped `libloading` from `0.7` to `0.8` (#739)
- extensions/khr: Take the remaining `p_next`-containing structs as `&mut` to allow chains (#744)
- `AccelerationStructure::get_acceleration_structure_build_sizes()`
- `ExternalMemoryFd::get_memory_fd_properties()`
Expand All @@ -46,6 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `VK_KHR_device_group_creation`: Take borrow of `Entry` in `fn new()` (#753)
- `VK_KHR_device_group_creation`: Rename `vk::Instance`-returning function from `device()` to `instance()` (#759)
- Windows `HANDLE` types (`HWND`, `HINSTANCE`, `HMONITOR`) are now defined as `isize` instead of `*const c_void` (#797)
- extensions/ext/ray_tracing_pipeline: Pass indirect SBT regions as single item reference (#829)
- Replaced `c_char` array setters with `CStr` setters (#831)

### Removed

Expand Down Expand Up @@ -434,20 +440,20 @@ flags: vk::CommandPoolCreateFlags::RESET_COMMAND_BUFFER_BIT,
- `ash::util::Align` is a helper struct that
can write to aligned memory.

[Unreleased]: https://github.com/MaikKlein/ash/compare/0.37.2...HEAD
[0.37.2]: https://github.com/MaikKlein/ash/releases/tag/0.37.2
[0.37.1]: https://github.com/MaikKlein/ash/releases/tag/0.37.1
[0.37.0]: https://github.com/MaikKlein/ash/releases/tag/0.37.0
[0.36.0]: https://github.com/MaikKlein/ash/releases/tag/0.36.0
[0.35.2]: https://github.com/MaikKlein/ash/releases/tag/0.35.2
[0.35.1]: https://github.com/MaikKlein/ash/releases/tag/0.35.1
[0.35.0]: https://github.com/MaikKlein/ash/releases/tag/0.35.0
[0.34.0]: https://github.com/MaikKlein/ash/releases/tag/0.34.0
[0.33.3]: https://github.com/MaikKlein/ash/releases/tag/0.33.3
[0.33.2]: https://github.com/MaikKlein/ash/releases/tag/0.33.2
[0.33.1]: https://github.com/MaikKlein/ash/releases/tag/0.33.1
[0.33.0]: https://github.com/MaikKlein/ash/releases/tag/0.33.0
[0.32.1]: https://github.com/MaikKlein/ash/releases/tag/0.32.1
[0.32.0]: https://github.com/MaikKlein/ash/releases/tag/0.32.0
[0.31.0]: https://github.com/MaikKlein/ash/releases/tag/0.31.0
[0.30.0]: https://github.com/MaikKlein/ash/releases/tag/0.30.0
[Unreleased]: https://github.com/ash-rs/ash/compare/0.37.2...HEAD
[0.37.2]: https://github.com/ash-rs/ash/releases/tag/0.37.2
[0.37.1]: https://github.com/ash-rs/ash/releases/tag/0.37.1
[0.37.0]: https://github.com/ash-rs/ash/releases/tag/0.37.0
[0.36.0]: https://github.com/ash-rs/ash/releases/tag/0.36.0
[0.35.2]: https://github.com/ash-rs/ash/releases/tag/0.35.2
[0.35.1]: https://github.com/ash-rs/ash/releases/tag/0.35.1
[0.35.0]: https://github.com/ash-rs/ash/releases/tag/0.35.0
[0.34.0]: https://github.com/ash-rs/ash/releases/tag/0.34.0
[0.33.3]: https://github.com/ash-rs/ash/releases/tag/0.33.3
[0.33.2]: https://github.com/ash-rs/ash/releases/tag/0.33.2
[0.33.1]: https://github.com/ash-rs/ash/releases/tag/0.33.1
[0.33.0]: https://github.com/ash-rs/ash/releases/tag/0.33.0
[0.32.1]: https://github.com/ash-rs/ash/releases/tag/0.32.1
[0.32.0]: https://github.com/ash-rs/ash/releases/tag/0.32.0
[0.31.0]: https://github.com/ash-rs/ash/releases/tag/0.31.0
[0.30.0]: https://github.com/ash-rs/ash/releases/tag/0.30.0
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ A very lightweight wrapper around Vulkan

[![Crates.io Version](https://img.shields.io/crates/v/ash.svg)](https://crates.io/crates/ash)
[![Documentation](https://docs.rs/ash/badge.svg)](https://docs.rs/ash)
[![Build Status](https://github.com/MaikKlein/ash/workflows/CI/badge.svg)](https://github.com/MaikKlein/ash/actions?workflow=CI)
[![Build Status](https://github.com/ash-rs/ash/workflows/CI/badge.svg)](https://github.com/ash-rs/ash/actions?workflow=CI)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT)
[![LICENSE](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE-APACHE)
[![Join the chat at https://gitter.im/MaikKlein/ash](https://badges.gitter.im/MaikKlein/ash.svg)](https://gitter.im/MaikKlein/ash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![MSRV](https://img.shields.io/badge/rustc-1.60.0+-ab6000.svg)](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html)
[![MSRV](https://img.shields.io/badge/rustc-1.69.0+-ab6000.svg)](https://blog.rust-lang.org/2023/04/20/Rust-1.69.0.html)

## Overview

Expand Down Expand Up @@ -145,7 +145,7 @@ Custom loaders can be implemented.

### Extension loading

Additionally, every Vulkan extension has to be loaded explicitly. You can find all extensions under [ash::extensions](https://github.com/MaikKlein/ash/tree/master/ash/src/extensions).
Additionally, every Vulkan extension has to be loaded explicitly. You can find all extensions under [`ash::extensions`](https://github.com/ash-rs/ash/tree/master/ash/src/extensions).

```rust
use ash::extensions::khr::Swapchain;
Expand Down Expand Up @@ -195,7 +195,7 @@ If, on the other hand, your application cannot handle Vulkan being missing at ru

## Example

You can find the examples [here](https://github.com/MaikKlein/ash/tree/master/examples).
You can find the examples [here](https://github.com/ash-rs/ash/tree/master/ash-examples).
All examples currently require: the LunarG Validation layers and a Vulkan library that is visible in your `PATH`. An easy way to get started is to use the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/)

#### Windows
Expand All @@ -218,24 +218,22 @@ VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d \
cargo run ...
```

### [Triangle](https://github.com/MaikKlein/ash/blob/master/examples/src/bin/triangle.rs)
### [Triangle](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/triangle.rs)

Displays a triangle with vertex colors.

```
cd examples
cargo run --bin triangle
```sh
cargo run -p ash-examples --bin triangle
```

![screenshot](http://i.imgur.com/PQZcL6w.jpg)

### [Texture](https://github.com/MaikKlein/ash/blob/master/examples/src/bin/texture.rs)
### [Texture](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/texture.rs)

Displays a texture on a quad.

```
cd examples
cargo run --bin texture
```sh
cargo run -p ash-examples --bin texture
```

![texture](http://i.imgur.com/trow00H.png)
Expand All @@ -252,7 +250,7 @@ cargo run --bin texture

- [vk-sync](https://github.com/gwihlidal/vk-sync-rs) - Simplified Vulkan synchronization logic, written in rust.
- [vk-mem-rs](https://github.com/gwihlidal/vk-mem-rs) - This crate provides an FFI layer and idiomatic rust wrappers for the excellent AMD Vulkan Memory Allocator (VMA) C/C++ library.
- [gpu-allocator](https://github.com/Traverse-Research/gpu-allocator) - Memory allocator written in pure Rust for GPU memory in Vulkan and in the future DirectX 12
- [gpu-allocator](https://github.com/Traverse-Research/gpu-allocator) - GPU Memory allocator written in pure Rust for Vulkan and DirectX 12.
- [lahar](https://github.com/Ralith/lahar) - Tools for asynchronously uploading data to a Vulkan device.

### Libraries that use ash
Expand Down
3 changes: 2 additions & 1 deletion examples/Cargo.toml → ash-examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "examples"
name = "ash-examples"
version = "0.1.0"
authors = ["maik klein <[email protected]>"]
edition = "2021"
publish = false

[dependencies]
image = "0.24"
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions examples/src/bin/texture.rs → ash-examples/src/bin/texture.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#![warn(unused_qualifications)]

use std::default::Default;
use std::ffi::CStr;
use std::io::Cursor;
use std::mem::{self, align_of};
use std::mem;
use std::os::raw::c_void;

use ash::util::*;
use ash::vk;

use examples::*;
use ash_examples::*;

#[derive(Clone, Debug, Copy)]
struct Vertex {
Expand Down Expand Up @@ -96,7 +97,7 @@ fn main() {
.collect();
let index_buffer_data = [0u32, 1, 2, 2, 3, 0];
let index_buffer_info = vk::BufferCreateInfo {
size: std::mem::size_of_val(&index_buffer_data) as u64,
size: mem::size_of_val(&index_buffer_data) as u64,
usage: vk::BufferUsageFlags::INDEX_BUFFER,
sharing_mode: vk::SharingMode::EXCLUSIVE,
..Default::default()
Expand Down Expand Up @@ -129,7 +130,7 @@ fn main() {
.unwrap();
let mut index_slice = Align::new(
index_ptr,
align_of::<u32>() as u64,
mem::align_of::<u32>() as u64,
index_buffer_memory_req.size,
);
index_slice.copy_from_slice(&index_buffer_data);
Expand Down Expand Up @@ -157,7 +158,7 @@ fn main() {
},
];
let vertex_input_buffer_info = vk::BufferCreateInfo {
size: std::mem::size_of_val(&vertices) as u64,
size: mem::size_of_val(&vertices) as u64,
usage: vk::BufferUsageFlags::VERTEX_BUFFER,
sharing_mode: vk::SharingMode::EXCLUSIVE,
..Default::default()
Expand Down Expand Up @@ -197,7 +198,7 @@ fn main() {
.unwrap();
let mut slice = Align::new(
vert_ptr,
align_of::<Vertex>() as u64,
mem::align_of::<Vertex>() as u64,
vertex_input_buffer_memory_req.size,
);
slice.copy_from_slice(&vertices);
Expand All @@ -213,7 +214,7 @@ fn main() {
_pad: 0.0,
};
let uniform_color_buffer_info = vk::BufferCreateInfo {
size: std::mem::size_of_val(&uniform_color_buffer_data) as u64,
size: mem::size_of_val(&uniform_color_buffer_data) as u64,
usage: vk::BufferUsageFlags::UNIFORM_BUFFER,
sharing_mode: vk::SharingMode::EXCLUSIVE,
..Default::default()
Expand Down Expand Up @@ -252,7 +253,7 @@ fn main() {
.unwrap();
let mut uniform_aligned_slice = Align::new(
uniform_ptr,
align_of::<Vector3>() as u64,
mem::align_of::<Vector3>() as u64,
uniform_color_buffer_memory_req.size,
);
uniform_aligned_slice.copy_from_slice(&[uniform_color_buffer_data]);
Expand All @@ -268,7 +269,7 @@ fn main() {
let image_extent = vk::Extent2D { width, height };
let image_data = image.into_raw();
let image_buffer_info = vk::BufferCreateInfo {
size: (std::mem::size_of::<u8>() * image_data.len()) as u64,
size: (mem::size_of::<u8>() * image_data.len()) as u64,
usage: vk::BufferUsageFlags::TRANSFER_SRC,
sharing_mode: vk::SharingMode::EXCLUSIVE,
..Default::default()
Expand Down Expand Up @@ -302,7 +303,7 @@ fn main() {
.unwrap();
let mut image_slice = Align::new(
image_ptr,
std::mem::align_of::<u8>() as u64,
mem::align_of::<u8>() as u64,
image_buffer_memory_req.size,
);
image_slice.copy_from_slice(&image_data);
Expand Down Expand Up @@ -769,7 +770,6 @@ fn main() {
device.cmd_end_render_pass(draw_command_buffer);
},
);
//let mut present_info_err = mem::zeroed();
let present_info = vk::PresentInfoKHR {
wait_semaphore_count: 1,
p_wait_semaphores: &base.rendering_complete_semaphore,
Expand Down
Loading
Loading