Skip to content

Commit

Permalink
Merge branch 'MaikKlein:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
asnordstrand authored Dec 29, 2021
2 parents eaedadc + 8a46a15 commit daeb943
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 58 deletions.
7 changes: 5 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [Unreleased] - ReleaseDate

## [0.35.0] - 2021-12-27

### Changed

Expand Down Expand Up @@ -258,7 +260,8 @@ flags: vk::CommandPoolCreateFlags::RESET_COMMAND_BUFFER_BIT,
can write to aligned memory.


[Unreleased]: https://github.com/MaikKlein/ash/compare/0.34.0...HEAD
[Unreleased]: https://github.com/MaikKlein/ash/compare/0.35.0...HEAD
[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
Expand Down
6 changes: 3 additions & 3 deletions ash-window/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ash-window"
version = "0.8.0"
version = "0.9.0"
authors = ["msiglreith <m.siglreith@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand All @@ -14,15 +14,15 @@ exclude = [".github/*"]
workspace = ".."

[dependencies]
ash = { path = "../ash", version = "0.34", default-features = false }
ash = { path = "../ash", version = "0.35", default-features = false }
raw-window-handle = "0.3"

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
raw-window-metal = "0.1"

[dev-dependencies]
winit = "0.19.4"
ash = { path = "../ash", version = "0.34", default-features = false, features = ["linked"] }
ash = { path = "../ash", version = "0.35", default-features = false, features = ["linked"] }

[[example]]
name = "winit"
Expand Down
10 changes: 10 additions & 0 deletions ash-window/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
### Changelog

## [Unreleased] - ReleaseDate

## [0.9.0] - 2021-12-27

### Changed

- Bumped `ash` version to [`0.35`](https://github.com/MaikKlein/ash/releases/tag/0.35.0)

## [0.8.0] - 2021-12-22

### Changed
Expand Down Expand Up @@ -49,6 +57,8 @@
## Version 0.1.0
Initial release for `raw-window-handle = "0.3"` with Windows, Linux, Android, MacOS/iOS support.

[Unreleased]: https://github.com/MaikKlein/ash/compare/ash-window-0.9.0...HEAD
[0.9.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.9.0
[0.8.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.8.0
[0.7.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.7.0
[0.6.0]: https://github.com/MaikKlein/ash/releases/tag/ash-window-0.6.0
Expand Down
5 changes: 2 additions & 3 deletions ash-window/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Interoperability between [`ash`](https://github.com/MaikKlein/ash) and [`raw-win
## Usage

```toml
ash-window = "0.7"
ash-window = "0.9"
```

The library exposes two functions:
Expand All @@ -33,8 +33,7 @@ The library exposes two functions:

## Versions
```toml
ash = "0.33"
raw-window-handle = "0.3"
ash = "0.35"
```

## Support
Expand Down
2 changes: 1 addition & 1 deletion ash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ash"
version = "0.34.0+1.2.203"
version = "0.35.0+1.2.203"
authors = ["maik klein <maikklein@googlemail.com>"]
description = "Vulkan bindings for Rust"
license = "MIT"
Expand Down
68 changes: 35 additions & 33 deletions ash/src/extensions/experimental/amd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ impl AmdGpaInterfaceFn {
stringify!(create_gpa_session_amd)
))
}
let raw_name = stringify!(vkCreateGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCreateGpaSessionAMD\0");
let val = _f(cname);
if val.is_null() {
create_gpa_session_amd
} else {
Expand All @@ -429,9 +429,9 @@ impl AmdGpaInterfaceFn {
stringify!(destroy_gpa_session_amd)
))
}
let raw_name = stringify!(vkDestroyGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkDestroyGpaSessionAMD\0");
let val = _f(cname);
if val.is_null() {
destroy_gpa_session_amd
} else {
Expand All @@ -448,9 +448,10 @@ impl AmdGpaInterfaceFn {
stringify!(set_gpa_device_clock_mode_amd)
))
}
let raw_name = stringify!(vkSetGpaDeviceClockModeAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkSetGpaDeviceClockModeAMD\0",
);
let val = _f(cname);
if val.is_null() {
set_gpa_device_clock_mode_amd
} else {
Expand All @@ -467,9 +468,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_begin_gpa_session_amd)
))
}
let raw_name = stringify!(vkCmdBeginGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBeginGpaSessionAMD\0");
let val = _f(cname);
if val.is_null() {
cmd_begin_gpa_session_amd
} else {
Expand All @@ -486,9 +487,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_end_gpa_session_amd)
))
}
let raw_name = stringify!(vkCmdEndGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSessionAMD\0");
let val = _f(cname);
if val.is_null() {
cmd_end_gpa_session_amd
} else {
Expand All @@ -507,9 +508,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_begin_gpa_sample_amd)
))
}
let raw_name = stringify!(vkCmdBeginGpaSampleAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBeginGpaSampleAMD\0");
let val = _f(cname);
if val.is_null() {
cmd_begin_gpa_sample_amd
} else {
Expand All @@ -527,9 +528,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_end_gpa_sample_amd)
))
}
let raw_name = stringify!(vkCmdEndGpaSampleAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSampleAMD\0");
let val = _f(cname);
if val.is_null() {
cmd_end_gpa_sample_amd
} else {
Expand All @@ -546,9 +547,9 @@ impl AmdGpaInterfaceFn {
stringify!(get_gpa_session_status_amd)
))
}
let raw_name = stringify!(vkGetGpaSessionStatusAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetGpaSessionStatusAMD\0");
let val = _f(cname);
if val.is_null() {
get_gpa_session_status_amd
} else {
Expand All @@ -568,9 +569,9 @@ impl AmdGpaInterfaceFn {
stringify!(get_gpa_session_results_amd)
))
}
let raw_name = stringify!(vkGetGpaSessionResultsAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetGpaSessionResultsAMD\0");
let val = _f(cname);
if val.is_null() {
get_gpa_session_results_amd
} else {
Expand All @@ -587,9 +588,9 @@ impl AmdGpaInterfaceFn {
stringify!(reset_gpa_session_amd)
))
}
let raw_name = stringify!(vkCmdEndGpaSampleAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSampleAMD\0");
let val = _f(cname);
if val.is_null() {
reset_gpa_session_amd
} else {
Expand All @@ -606,9 +607,10 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_copy_gpa_session_results_amd)
))
}
let raw_name = stringify!(vkCmdCopyGpaSessionResultsAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkCmdCopyGpaSessionResultsAMD\0",
);
let val = _f(cname);
if val.is_null() {
cmd_copy_gpa_session_results_amd
} else {
Expand Down
5 changes: 5 additions & 0 deletions ash/src/vk/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ impl Packed24_8 {
(self.0 >> 24) as u8
}
}

impl super::ColorComponentFlags {
/// Contraction of [`Self::R`] | [`Self::G`] | [`Self::B`] | [`Self::A`]
pub const RGBA: Self = Self(Self::R.0 | Self::G.0 | Self::B.0 | Self::A.0);
}
9 changes: 3 additions & 6 deletions examples/src/bin/texture.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::default::Default;
use std::ffi::CString;
use std::ffi::CStr;
use std::io::Cursor;
use std::mem::{self, align_of};
use std::os::raw::c_void;
Expand Down Expand Up @@ -573,7 +573,7 @@ fn main() {
.create_pipeline_layout(&layout_create_info, None)
.unwrap();

let shader_entry_name = CString::new("main").unwrap();
let shader_entry_name = CStr::from_bytes_with_nul_unchecked(b"main\0");
let shader_stage_create_infos = [
vk::PipelineShaderStageCreateInfo {
module: vertex_shader_module,
Expand Down Expand Up @@ -666,10 +666,7 @@ fn main() {
src_alpha_blend_factor: vk::BlendFactor::ZERO,
dst_alpha_blend_factor: vk::BlendFactor::ZERO,
alpha_blend_op: vk::BlendOp::ADD,
color_write_mask: vk::ColorComponentFlags::R
| vk::ColorComponentFlags::G
| vk::ColorComponentFlags::B
| vk::ColorComponentFlags::A,
color_write_mask: vk::ColorComponentFlags::RGBA,
}];
let color_blend_state = vk::PipelineColorBlendStateCreateInfo::builder()
.logic_op(vk::LogicOp::CLEAR)
Expand Down
9 changes: 3 additions & 6 deletions examples/src/bin/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ash::util::*;
use ash::vk;
use examples::*;
use std::default::Default;
use std::ffi::CString;
use std::ffi::CStr;
use std::io::Cursor;
use std::mem;
use std::mem::align_of;
Expand Down Expand Up @@ -226,7 +226,7 @@ fn main() {
.create_pipeline_layout(&layout_create_info, None)
.unwrap();

let shader_entry_name = CString::new("main").unwrap();
let shader_entry_name = CStr::from_bytes_with_nul_unchecked(b"main\0");
let shader_stage_create_infos = [
vk::PipelineShaderStageCreateInfo {
module: vertex_shader_module,
Expand Down Expand Up @@ -319,10 +319,7 @@ fn main() {
src_alpha_blend_factor: vk::BlendFactor::ZERO,
dst_alpha_blend_factor: vk::BlendFactor::ZERO,
alpha_blend_op: vk::BlendOp::ADD,
color_write_mask: vk::ColorComponentFlags::R
| vk::ColorComponentFlags::G
| vk::ColorComponentFlags::B
| vk::ColorComponentFlags::A,
color_write_mask: vk::ColorComponentFlags::RGBA,
}];
let color_blend_state = vk::PipelineColorBlendStateCreateInfo::builder()
.logic_op(vk::LogicOp::CLEAR)
Expand Down
8 changes: 4 additions & 4 deletions examples/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub use ash::{Device, Instance};
use std::borrow::Cow;
use std::cell::RefCell;
use std::default::Default;
use std::ffi::{CStr, CString};
use std::ffi::CStr;
use std::ops::Drop;
use std::os::raw::c_char;

Expand Down Expand Up @@ -218,7 +218,7 @@ impl ExampleBase {
.build(&event_loop)
.unwrap();
let entry = Entry::linked();
let app_name = CString::new("VulkanTriangle").unwrap();
let app_name = CStr::from_bytes_with_nul_unchecked(b"VulkanTriangle\0");

let layer_names = [CStr::from_bytes_with_nul_unchecked(
b"VK_LAYER_KHRONOS_validation\0",
Expand All @@ -236,9 +236,9 @@ impl ExampleBase {
extension_names_raw.push(DebugUtils::name().as_ptr());

let appinfo = vk::ApplicationInfo::builder()
.application_name(&app_name)
.application_name(app_name)
.application_version(0)
.engine_name(&app_name)
.engine_name(app_name)
.engine_version(0)
.api_version(vk::make_api_version(0, 1, 0, 0));

Expand Down

0 comments on commit daeb943

Please sign in to comment.