Backed out changeset b67fef0360d9 (bug 1762730) for causing build bustages CLOSED TREE

This commit is contained in:
Cristian Tuns 2022-04-05 17:37:32 -04:00
parent 214a6ed675
commit 0f7608c52d
236 changed files with 17397 additions and 20827 deletions

View File

@ -85,22 +85,17 @@ rev = "3484d3e3ebdc8931493aa5df4d7ee9360a90e76b"
[source."https://github.com/gfx-rs/wgpu"]
git = "https://github.com/gfx-rs/wgpu"
replace-with = "vendored-sources"
rev = "75e82afd"
rev = "6bc896f"
[source."https://github.com/gfx-rs/naga"]
git = "https://github.com/gfx-rs/naga"
replace-with = "vendored-sources"
rev = "f90e563"
rev = "c0b7ac7"
[source."https://github.com/gfx-rs/metal-rs"]
git = "https://github.com/gfx-rs/metal-rs"
replace-with = "vendored-sources"
rev = "1aaa903"
[source."https://github.com/gfx-rs/d3d12-rs.git"]
git = "https://github.com/gfx-rs/d3d12-rs.git"
replace-with = "vendored-sources"
rev = "ffe5e261da0a6cb85332b82ab310abd2a7e849f6"
rev = "140c8f4"
[source."https://github.com/chris-zen/coremidi.git"]
git = "https://github.com/chris-zen/coremidi.git"

18
Cargo.lock generated
View File

@ -124,9 +124,9 @@ dependencies = [
[[package]]
name = "ash"
version = "0.37.0+1.3.209"
version = "0.35.0+1.2.203"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "006ca68e0f2b03f22d6fa9f2860f85aed430d257fec20f8879b2145e7c7ae1a6"
checksum = "5a7638ce84f8c84d6fd6faa63aa267574d345181ba591c0eeb5550d4c30cd600"
dependencies = [
"libloading 0.7.2",
]
@ -1185,7 +1185,8 @@ dependencies = [
[[package]]
name = "d3d12"
version = "0.4.1"
source = "git+https://github.com/gfx-rs/d3d12-rs.git?rev=ffe5e261da0a6cb85332b82ab310abd2a7e849f6#ffe5e261da0a6cb85332b82ab310abd2a7e849f6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c"
dependencies = [
"bitflags",
"libloading 0.7.2",
@ -2726,7 +2727,6 @@ checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3"
dependencies = [
"libc",
"libloading 0.7.2",
"pkg-config",
]
[[package]]
@ -3099,7 +3099,7 @@ dependencies = [
[[package]]
name = "metal"
version = "0.23.1"
source = "git+https://github.com/gfx-rs/metal-rs?rev=1aaa903#1aaa9033a22b2af7ff8cae2ed412a4733799c3d3"
source = "git+https://github.com/gfx-rs/metal-rs?rev=140c8f4#140c8f4e39001ae154f153ffc767da6c0c9d7f06"
dependencies = [
"bitflags",
"block",
@ -3429,7 +3429,7 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664"
[[package]]
name = "naga"
version = "0.8.0"
source = "git+https://github.com/gfx-rs/naga?rev=f90e563#f90e563c281cfc71c794e0426ebcced9e3999202"
source = "git+https://github.com/gfx-rs/naga?rev=c0b7ac7#c0b7ac7f542cc42ccac6f2ec3fc1fb01309cf4d7"
dependencies = [
"bit-set",
"bitflags",
@ -5908,7 +5908,7 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.12.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=75e82afd#75e82afd355ba56b2f3d6f6384fb40c1cb46f1a4"
source = "git+https://github.com/gfx-rs/wgpu?rev=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f"
dependencies = [
"arrayvec 0.7.2",
"bitflags",
@ -5931,7 +5931,7 @@ dependencies = [
[[package]]
name = "wgpu-hal"
version = "0.12.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=75e82afd#75e82afd355ba56b2f3d6f6384fb40c1cb46f1a4"
source = "git+https://github.com/gfx-rs/wgpu?rev=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f"
dependencies = [
"arrayvec 0.7.2",
"ash",
@ -5968,7 +5968,7 @@ dependencies = [
[[package]]
name = "wgpu-types"
version = "0.12.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=75e82afd#75e82afd355ba56b2f3d6f6384fb40c1cb46f1a4"
source = "git+https://github.com/gfx-rs/wgpu?rev=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f"
dependencies = [
"bitflags",
"bitflags_serde_shim",

View File

@ -40,7 +40,7 @@ ffi::WGPURenderBundleEncoder* CreateRenderBundleEncoder(
desc.label = label.get();
}
ffi::WGPUTextureFormat depthStencilFormat = {ffi::WGPUTextureFormat_Sentinel};
ffi::WGPUTextureFormat depthStencilFormat = ffi::WGPUTextureFormat_Sentinel;
if (aDesc.mDepthStencilFormat.WasPassed()) {
WebGPUChild::ConvertTextureFormatRef(aDesc.mDepthStencilFormat.Value(),
depthStencilFormat);
@ -49,7 +49,7 @@ ffi::WGPURenderBundleEncoder* CreateRenderBundleEncoder(
std::vector<ffi::WGPUTextureFormat> colorFormats = {};
for (const auto i : IntegerRange(aDesc.mColorFormats.Length())) {
ffi::WGPUTextureFormat format = {ffi::WGPUTextureFormat_Sentinel};
ffi::WGPUTextureFormat format = ffi::WGPUTextureFormat_Sentinel;
WebGPUChild::ConvertTextureFormatRef(aDesc.mColorFormats[i], format);
colorFormats.push_back(format);
}

View File

@ -43,174 +43,115 @@ static ffi::WGPUCompareFunction ConvertCompareFunction(
static ffi::WGPUTextureFormat ConvertTextureFormat(
const dom::GPUTextureFormat& aFormat) {
ffi::WGPUTextureFormat result = {ffi::WGPUTextureFormat_Sentinel};
switch (aFormat) {
case dom::GPUTextureFormat::R8unorm:
result.tag = ffi::WGPUTextureFormat_R8Unorm;
break;
return ffi::WGPUTextureFormat_R8Unorm;
case dom::GPUTextureFormat::R8snorm:
result.tag = ffi::WGPUTextureFormat_R8Snorm;
break;
return ffi::WGPUTextureFormat_R8Snorm;
case dom::GPUTextureFormat::R8uint:
result.tag = ffi::WGPUTextureFormat_R8Uint;
break;
return ffi::WGPUTextureFormat_R8Uint;
case dom::GPUTextureFormat::R8sint:
result.tag = ffi::WGPUTextureFormat_R8Sint;
break;
return ffi::WGPUTextureFormat_R8Sint;
case dom::GPUTextureFormat::R16uint:
result.tag = ffi::WGPUTextureFormat_R16Uint;
break;
return ffi::WGPUTextureFormat_R16Uint;
case dom::GPUTextureFormat::R16sint:
result.tag = ffi::WGPUTextureFormat_R16Sint;
break;
return ffi::WGPUTextureFormat_R16Sint;
case dom::GPUTextureFormat::R16float:
result.tag = ffi::WGPUTextureFormat_R16Float;
break;
return ffi::WGPUTextureFormat_R16Float;
case dom::GPUTextureFormat::Rg8unorm:
result.tag = ffi::WGPUTextureFormat_Rg8Unorm;
break;
return ffi::WGPUTextureFormat_Rg8Unorm;
case dom::GPUTextureFormat::Rg8snorm:
result.tag = ffi::WGPUTextureFormat_Rg8Snorm;
break;
return ffi::WGPUTextureFormat_Rg8Snorm;
case dom::GPUTextureFormat::Rg8uint:
result.tag = ffi::WGPUTextureFormat_Rg8Uint;
break;
return ffi::WGPUTextureFormat_Rg8Uint;
case dom::GPUTextureFormat::Rg8sint:
result.tag = ffi::WGPUTextureFormat_Rg8Sint;
break;
return ffi::WGPUTextureFormat_Rg8Sint;
case dom::GPUTextureFormat::R32uint:
result.tag = ffi::WGPUTextureFormat_R32Uint;
break;
return ffi::WGPUTextureFormat_R32Uint;
case dom::GPUTextureFormat::R32sint:
result.tag = ffi::WGPUTextureFormat_R32Sint;
break;
return ffi::WGPUTextureFormat_R32Sint;
case dom::GPUTextureFormat::R32float:
result.tag = ffi::WGPUTextureFormat_R32Float;
break;
return ffi::WGPUTextureFormat_R32Float;
case dom::GPUTextureFormat::Rg16uint:
result.tag = ffi::WGPUTextureFormat_Rg16Uint;
break;
return ffi::WGPUTextureFormat_Rg16Uint;
case dom::GPUTextureFormat::Rg16sint:
result.tag = ffi::WGPUTextureFormat_Rg16Sint;
break;
return ffi::WGPUTextureFormat_Rg16Sint;
case dom::GPUTextureFormat::Rg16float:
result.tag = ffi::WGPUTextureFormat_Rg16Float;
break;
return ffi::WGPUTextureFormat_Rg16Float;
case dom::GPUTextureFormat::Rgba8unorm:
result.tag = ffi::WGPUTextureFormat_Rgba8Unorm;
break;
return ffi::WGPUTextureFormat_Rgba8Unorm;
case dom::GPUTextureFormat::Rgba8unorm_srgb:
result.tag = ffi::WGPUTextureFormat_Rgba8UnormSrgb;
break;
return ffi::WGPUTextureFormat_Rgba8UnormSrgb;
case dom::GPUTextureFormat::Rgba8snorm:
result.tag = ffi::WGPUTextureFormat_Rgba8Snorm;
break;
return ffi::WGPUTextureFormat_Rgba8Snorm;
case dom::GPUTextureFormat::Rgba8uint:
result.tag = ffi::WGPUTextureFormat_Rgba8Uint;
break;
return ffi::WGPUTextureFormat_Rgba8Uint;
case dom::GPUTextureFormat::Rgba8sint:
result.tag = ffi::WGPUTextureFormat_Rgba8Sint;
break;
return ffi::WGPUTextureFormat_Rgba8Sint;
case dom::GPUTextureFormat::Bgra8unorm:
result.tag = ffi::WGPUTextureFormat_Bgra8Unorm;
break;
return ffi::WGPUTextureFormat_Bgra8Unorm;
case dom::GPUTextureFormat::Bgra8unorm_srgb:
result.tag = ffi::WGPUTextureFormat_Bgra8UnormSrgb;
break;
return ffi::WGPUTextureFormat_Bgra8UnormSrgb;
case dom::GPUTextureFormat::Rgb10a2unorm:
result.tag = ffi::WGPUTextureFormat_Rgb10a2Unorm;
break;
return ffi::WGPUTextureFormat_Rgb10a2Unorm;
case dom::GPUTextureFormat::Rg11b10float:
result.tag = ffi::WGPUTextureFormat_Rg11b10Float;
break;
return ffi::WGPUTextureFormat_Rg11b10Float;
case dom::GPUTextureFormat::Rg32uint:
result.tag = ffi::WGPUTextureFormat_Rg32Uint;
break;
return ffi::WGPUTextureFormat_Rg32Uint;
case dom::GPUTextureFormat::Rg32sint:
result.tag = ffi::WGPUTextureFormat_Rg32Sint;
break;
return ffi::WGPUTextureFormat_Rg32Sint;
case dom::GPUTextureFormat::Rg32float:
result.tag = ffi::WGPUTextureFormat_Rg32Float;
break;
return ffi::WGPUTextureFormat_Rg32Float;
case dom::GPUTextureFormat::Rgba16uint:
result.tag = ffi::WGPUTextureFormat_Rgba16Uint;
break;
return ffi::WGPUTextureFormat_Rgba16Uint;
case dom::GPUTextureFormat::Rgba16sint:
result.tag = ffi::WGPUTextureFormat_Rgba16Sint;
break;
return ffi::WGPUTextureFormat_Rgba16Sint;
case dom::GPUTextureFormat::Rgba16float:
result.tag = ffi::WGPUTextureFormat_Rgba16Float;
break;
return ffi::WGPUTextureFormat_Rgba16Float;
case dom::GPUTextureFormat::Rgba32uint:
result.tag = ffi::WGPUTextureFormat_Rgba32Uint;
break;
return ffi::WGPUTextureFormat_Rgba32Uint;
case dom::GPUTextureFormat::Rgba32sint:
result.tag = ffi::WGPUTextureFormat_Rgba32Sint;
break;
return ffi::WGPUTextureFormat_Rgba32Sint;
case dom::GPUTextureFormat::Rgba32float:
result.tag = ffi::WGPUTextureFormat_Rgba32Float;
break;
return ffi::WGPUTextureFormat_Rgba32Float;
case dom::GPUTextureFormat::Depth32float:
result.tag = ffi::WGPUTextureFormat_Depth32Float;
break;
return ffi::WGPUTextureFormat_Depth32Float;
case dom::GPUTextureFormat::Bc1_rgba_unorm:
result.tag = ffi::WGPUTextureFormat_Bc1RgbaUnorm;
break;
return ffi::WGPUTextureFormat_Bc1RgbaUnorm;
case dom::GPUTextureFormat::Bc1_rgba_unorm_srgb:
result.tag = ffi::WGPUTextureFormat_Bc1RgbaUnormSrgb;
break;
return ffi::WGPUTextureFormat_Bc1RgbaUnormSrgb;
case dom::GPUTextureFormat::Bc4_r_unorm:
result.tag = ffi::WGPUTextureFormat_Bc4RUnorm;
break;
return ffi::WGPUTextureFormat_Bc4RUnorm;
case dom::GPUTextureFormat::Bc4_r_snorm:
result.tag = ffi::WGPUTextureFormat_Bc4RSnorm;
break;
return ffi::WGPUTextureFormat_Bc4RSnorm;
case dom::GPUTextureFormat::Bc2_rgba_unorm:
result.tag = ffi::WGPUTextureFormat_Bc2RgbaUnorm;
break;
return ffi::WGPUTextureFormat_Bc2RgbaUnorm;
case dom::GPUTextureFormat::Bc2_rgba_unorm_srgb:
result.tag = ffi::WGPUTextureFormat_Bc2RgbaUnormSrgb;
break;
return ffi::WGPUTextureFormat_Bc2RgbaUnormSrgb;
case dom::GPUTextureFormat::Bc3_rgba_unorm:
result.tag = ffi::WGPUTextureFormat_Bc3RgbaUnorm;
break;
return ffi::WGPUTextureFormat_Bc3RgbaUnorm;
case dom::GPUTextureFormat::Bc3_rgba_unorm_srgb:
result.tag = ffi::WGPUTextureFormat_Bc3RgbaUnormSrgb;
break;
return ffi::WGPUTextureFormat_Bc3RgbaUnormSrgb;
case dom::GPUTextureFormat::Bc5_rg_unorm:
result.tag = ffi::WGPUTextureFormat_Bc5RgUnorm;
break;
return ffi::WGPUTextureFormat_Bc5RgUnorm;
case dom::GPUTextureFormat::Bc5_rg_snorm:
result.tag = ffi::WGPUTextureFormat_Bc5RgSnorm;
break;
return ffi::WGPUTextureFormat_Bc5RgSnorm;
case dom::GPUTextureFormat::Bc6h_rgb_ufloat:
result.tag = ffi::WGPUTextureFormat_Bc6hRgbUfloat;
break;
return ffi::WGPUTextureFormat_Bc6hRgbUfloat;
case dom::GPUTextureFormat::Bc6h_rgb_float:
result.tag = ffi::WGPUTextureFormat_Bc6hRgbSfloat;
break;
return ffi::WGPUTextureFormat_Bc6hRgbSfloat;
case dom::GPUTextureFormat::Bc7_rgba_unorm:
result.tag = ffi::WGPUTextureFormat_Bc7RgbaUnorm;
break;
return ffi::WGPUTextureFormat_Bc7RgbaUnorm;
case dom::GPUTextureFormat::Bc7_rgba_unorm_srgb:
result.tag = ffi::WGPUTextureFormat_Bc7RgbaUnormSrgb;
break;
return ffi::WGPUTextureFormat_Bc7RgbaUnormSrgb;
case dom::GPUTextureFormat::Depth24plus:
result.tag = ffi::WGPUTextureFormat_Depth24Plus;
break;
return ffi::WGPUTextureFormat_Depth24Plus;
case dom::GPUTextureFormat::Depth24plus_stencil8:
result.tag = ffi::WGPUTextureFormat_Depth24PlusStencil8;
break;
return ffi::WGPUTextureFormat_Depth24PlusStencil8;
case dom::GPUTextureFormat::EndGuard_:
MOZ_ASSERT_UNREACHABLE();
}
// Clang will check for us that the switch above is exhaustive,
// but not if we add a 'default' case. So, check this here.
MOZ_ASSERT(result.tag != ffi::WGPUTextureFormat_Sentinel,
"unexpected texture format enum");
return result;
MOZ_CRASH("unexpected texture format enum");
}
void WebGPUChild::ConvertTextureFormatRef(const dom::GPUTextureFormat& aInput,
@ -416,7 +357,7 @@ RawId WebGPUChild::TextureCreateView(
desc.label = label.get();
}
ffi::WGPUTextureFormat format = {ffi::WGPUTextureFormat_Sentinel};
ffi::WGPUTextureFormat format = ffi::WGPUTextureFormat_Sentinel;
if (aDesc.mFormat.WasPassed()) {
format = ConvertTextureFormat(aDesc.mFormat.Value());
desc.format = &format;

View File

@ -17,7 +17,7 @@ default = []
[dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "75e82afd"
rev = "6bc896f"
#Note: "replay" shouldn't ideally be needed,
# but it allows us to serialize everything across IPC.
features = ["replay", "trace", "serial-pass"]
@ -25,12 +25,12 @@ features = ["replay", "trace", "serial-pass"]
[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "75e82afd"
rev = "6bc896f"
[dependencies.wgh]
package = "wgpu-hal"
git = "https://github.com/gfx-rs/wgpu"
rev = "75e82afd"
rev = "6bc896f"
[dependencies]
bincode = "1"

View File

@ -73,4 +73,3 @@ bitflags = true
"target_os = windows" = "XP_WIN"
"target_os = macos" = "XP_MACOSX"
"target_os = android" = "ANDROID"
"feature = id32" = "WGPU_FEATURE_ID32"

View File

@ -52,7 +52,7 @@ pub struct IdentityRecyclerFactory {
impl wgc::hub::IdentityHandlerFactory<id::AdapterId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::AdapterId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_adapter,
param: self.param,
@ -62,7 +62,7 @@ impl wgc::hub::IdentityHandlerFactory<id::AdapterId> for IdentityRecyclerFactory
}
impl wgc::hub::IdentityHandlerFactory<id::DeviceId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::DeviceId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_device,
param: self.param,
@ -72,7 +72,7 @@ impl wgc::hub::IdentityHandlerFactory<id::DeviceId> for IdentityRecyclerFactory
}
impl wgc::hub::IdentityHandlerFactory<id::PipelineLayoutId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::PipelineLayoutId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_pipeline_layout,
param: self.param,
@ -82,7 +82,7 @@ impl wgc::hub::IdentityHandlerFactory<id::PipelineLayoutId> for IdentityRecycler
}
impl wgc::hub::IdentityHandlerFactory<id::ShaderModuleId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::ShaderModuleId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_shader_module,
param: self.param,
@ -92,7 +92,7 @@ impl wgc::hub::IdentityHandlerFactory<id::ShaderModuleId> for IdentityRecyclerFa
}
impl wgc::hub::IdentityHandlerFactory<id::BindGroupLayoutId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::BindGroupLayoutId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_bind_group_layout,
param: self.param,
@ -102,7 +102,7 @@ impl wgc::hub::IdentityHandlerFactory<id::BindGroupLayoutId> for IdentityRecycle
}
impl wgc::hub::IdentityHandlerFactory<id::BindGroupId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::BindGroupId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_bind_group,
param: self.param,
@ -112,7 +112,7 @@ impl wgc::hub::IdentityHandlerFactory<id::BindGroupId> for IdentityRecyclerFacto
}
impl wgc::hub::IdentityHandlerFactory<id::CommandBufferId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::CommandBufferId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_command_buffer,
param: self.param,
@ -122,7 +122,7 @@ impl wgc::hub::IdentityHandlerFactory<id::CommandBufferId> for IdentityRecyclerF
}
impl wgc::hub::IdentityHandlerFactory<id::RenderBundleId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::RenderBundleId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_render_bundle,
param: self.param,
@ -132,7 +132,7 @@ impl wgc::hub::IdentityHandlerFactory<id::RenderBundleId> for IdentityRecyclerFa
}
impl wgc::hub::IdentityHandlerFactory<id::RenderPipelineId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::RenderPipelineId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_render_pipeline,
param: self.param,
@ -142,7 +142,7 @@ impl wgc::hub::IdentityHandlerFactory<id::RenderPipelineId> for IdentityRecycler
}
impl wgc::hub::IdentityHandlerFactory<id::ComputePipelineId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::ComputePipelineId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_compute_pipeline,
param: self.param,
@ -152,7 +152,7 @@ impl wgc::hub::IdentityHandlerFactory<id::ComputePipelineId> for IdentityRecycle
}
impl wgc::hub::IdentityHandlerFactory<id::QuerySetId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::QuerySetId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_query_set,
param: self.param,
@ -162,7 +162,7 @@ impl wgc::hub::IdentityHandlerFactory<id::QuerySetId> for IdentityRecyclerFactor
}
impl wgc::hub::IdentityHandlerFactory<id::BufferId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::BufferId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_buffer,
param: self.param,
@ -172,7 +172,7 @@ impl wgc::hub::IdentityHandlerFactory<id::BufferId> for IdentityRecyclerFactory
}
impl wgc::hub::IdentityHandlerFactory<id::TextureId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::TextureId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_texture,
param: self.param,
@ -182,7 +182,7 @@ impl wgc::hub::IdentityHandlerFactory<id::TextureId> for IdentityRecyclerFactory
}
impl wgc::hub::IdentityHandlerFactory<id::TextureViewId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::TextureViewId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_texture_view,
param: self.param,
@ -192,7 +192,7 @@ impl wgc::hub::IdentityHandlerFactory<id::TextureViewId> for IdentityRecyclerFac
}
impl wgc::hub::IdentityHandlerFactory<id::SamplerId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::SamplerId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_sampler,
param: self.param,
@ -202,7 +202,7 @@ impl wgc::hub::IdentityHandlerFactory<id::SamplerId> for IdentityRecyclerFactory
}
impl wgc::hub::IdentityHandlerFactory<id::SurfaceId> for IdentityRecyclerFactory {
type Filter = IdentityRecycler<id::SurfaceId>;
fn spawn(&self) -> Self::Filter {
fn spawn(&self, _min_index: u32) -> Self::Filter {
IdentityRecycler {
fun: self.free_surface,
param: self.param,

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "ash"
version = "0.37.0+1.3.209"
version = "0.35.0+1.2.203"
authors = ["maik klein <maikklein@googlemail.com>"]
description = "Vulkan bindings for Rust"
documentation = "https://docs.rs/ash"

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,6 @@ pub struct Entry {
entry_fn_1_0: vk::EntryFnV1_0,
entry_fn_1_1: vk::EntryFnV1_1,
entry_fn_1_2: vk::EntryFnV1_2,
entry_fn_1_3: vk::EntryFnV1_3,
#[cfg(feature = "loaded")]
_lib_guard: Option<Arc<Library>>,
}
@ -143,23 +142,18 @@ impl Entry {
/// `static_fn` must contain valid function pointers that comply with the semantics specified by
/// Vulkan 1.0, which must remain valid for at least the lifetime of the returned [`Entry`].
pub unsafe fn from_static_fn(static_fn: vk::StaticFn) -> Self {
let load_fn = |name: &std::ffi::CStr| {
mem::transmute((static_fn.get_instance_proc_addr)(
vk::Instance::null(),
name.as_ptr(),
))
let load_fn = |name: &std::ffi::CStr| unsafe {
mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr()))
};
let entry_fn_1_0 = vk::EntryFnV1_0::load(load_fn);
let entry_fn_1_1 = vk::EntryFnV1_1::load(load_fn);
let entry_fn_1_2 = vk::EntryFnV1_2::load(load_fn);
let entry_fn_1_3 = vk::EntryFnV1_3::load(load_fn);
Self {
static_fn,
entry_fn_1_0,
entry_fn_1_1,
entry_fn_1_2,
entry_fn_1_3,
#[cfg(feature = "loaded")]
_lib_guard: None,
}
@ -173,7 +167,7 @@ impl Entry {
&self.static_fn
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceVersion.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html>"]
/// ```no_run
/// # use ash::{Entry, vk};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
@ -195,10 +189,10 @@ impl Entry {
let mut api_version = 0;
let enumerate_instance_version: Option<vk::PFN_vkEnumerateInstanceVersion> = {
let name = b"vkEnumerateInstanceVersion\0".as_ptr() as *const _;
mem::transmute((self.static_fn.get_instance_proc_addr)(
vk::Instance::null(),
name,
))
mem::transmute(
self.static_fn
.get_instance_proc_addr(vk::Instance::null(), name),
)
};
if let Some(enumerate_instance_version) = enumerate_instance_version {
(enumerate_instance_version)(&mut api_version)
@ -209,7 +203,7 @@ impl Entry {
}
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateInstance.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateInstance.html>"]
///
/// # Safety
/// In order for the created [`Instance`] to be valid for the duration of its
@ -221,47 +215,45 @@ impl Entry {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Instance> {
let mut instance = mem::zeroed();
(self.entry_fn_1_0.create_instance)(
create_info,
allocation_callbacks.as_raw_ptr(),
&mut instance,
)
.result()?;
self.entry_fn_1_0
.create_instance(
create_info,
allocation_callbacks.as_raw_ptr(),
&mut instance,
)
.result()?;
Ok(Instance::load(&self.static_fn, instance))
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceLayerProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceLayerProperties.html>"]
pub fn enumerate_instance_layer_properties(&self) -> VkResult<Vec<vk::LayerProperties>> {
unsafe {
read_into_uninitialized_vector(|count, data| {
(self.entry_fn_1_0.enumerate_instance_layer_properties)(count, data)
self.entry_fn_1_0
.enumerate_instance_layer_properties(count, data)
})
}
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceExtensionProperties.html>"]
pub fn enumerate_instance_extension_properties(
&self,
layer_name: Option<&CStr>,
) -> VkResult<Vec<vk::ExtensionProperties>> {
unsafe {
read_into_uninitialized_vector(|count, data| {
(self.entry_fn_1_0.enumerate_instance_extension_properties)(
layer_name.map_or(ptr::null(), |str| str.as_ptr()),
count,
data,
)
self.entry_fn_1_0
.enumerate_instance_extension_properties(ptr::null(), count, data)
})
}
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetInstanceProcAddr.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetInstanceProcAddr.html>"]
pub unsafe fn get_instance_proc_addr(
&self,
instance: vk::Instance,
p_name: *const c_char,
) -> vk::PFN_vkVoidFunction {
(self.static_fn.get_instance_proc_addr)(instance, p_name)
self.static_fn.get_instance_proc_addr(instance, p_name)
}
}
@ -272,14 +264,15 @@ impl Entry {
&self.entry_fn_1_1
}
#[deprecated = "This function is unavailable and therefore panics on Vulkan 1.0, please use `try_enumerate_instance_version()` instead"]
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceVersion.html>
#[deprecated = "This function is unavailable and therefore panics on Vulkan 1.0, please use `try_enumerate_instance_version` instead"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html>"]
///
/// Please use [`try_enumerate_instance_version()`][Self::try_enumerate_instance_version()] instead.
/// Please use [`Self::try_enumerate_instance_version`] instead.
pub fn enumerate_instance_version(&self) -> VkResult<u32> {
unsafe {
let mut api_version = 0;
(self.entry_fn_1_1.enumerate_instance_version)(&mut api_version)
self.entry_fn_1_1
.enumerate_instance_version(&mut api_version)
.result_with_success(api_version)
}
}
@ -293,14 +286,6 @@ impl Entry {
}
}
/// Vulkan core 1.3
#[allow(non_camel_case_types)]
impl Entry {
pub fn fp_v1_3(&self) -> &vk::EntryFnV1_3 {
&self.entry_fn_1_3
}
}
#[cfg(feature = "linked")]
#[cfg_attr(docsrs, doc(cfg(feature = "linked")))]
impl Default for Entry {

View File

@ -240,16 +240,11 @@ impl<'a> ::std::ops::Deref for PhysicalDeviceGpaPropertiesAmdBuilder<'a> {
}
}
impl<'a> PhysicalDeviceGpaPropertiesAmdBuilder<'a> {
pub fn push_next<T>(mut self, next: &'a mut T) -> PhysicalDeviceGpaPropertiesAmdBuilder<'a>
pub fn next<T>(mut self, next: &'a mut T) -> PhysicalDeviceGpaPropertiesAmdBuilder<'a>
where
T: ExtendsPhysicalDeviceGpaPropertiesAmd,
{
unsafe {
let next_ptr = <*const T>::cast(next);
let last_next = ptr_chain_iter(next).last().unwrap();
(*last_next).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr;
}
self.inner.p_next = next as *mut T as *mut c_void;
self
}
pub fn build(self) -> PhysicalDeviceGpaPropertiesAmd {
@ -414,9 +409,9 @@ impl AmdGpaInterfaceFn {
stringify!(create_gpa_session_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCreateGpaSessionAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkCreateGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
create_gpa_session_amd
} else {
@ -434,9 +429,9 @@ impl AmdGpaInterfaceFn {
stringify!(destroy_gpa_session_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkDestroyGpaSessionAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkDestroyGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
destroy_gpa_session_amd
} else {
@ -453,10 +448,9 @@ impl AmdGpaInterfaceFn {
stringify!(set_gpa_device_clock_mode_amd)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkSetGpaDeviceClockModeAMD\0",
);
let val = _f(cname);
let raw_name = stringify!(vkSetGpaDeviceClockModeAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
set_gpa_device_clock_mode_amd
} else {
@ -473,9 +467,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_begin_gpa_session_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBeginGpaSessionAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkCmdBeginGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
cmd_begin_gpa_session_amd
} else {
@ -492,9 +486,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_end_gpa_session_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSessionAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkCmdEndGpaSessionAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
cmd_end_gpa_session_amd
} else {
@ -513,9 +507,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_begin_gpa_sample_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBeginGpaSampleAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkCmdBeginGpaSampleAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
cmd_begin_gpa_sample_amd
} else {
@ -533,9 +527,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_end_gpa_sample_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSampleAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkCmdEndGpaSampleAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
cmd_end_gpa_sample_amd
} else {
@ -552,9 +546,9 @@ impl AmdGpaInterfaceFn {
stringify!(get_gpa_session_status_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetGpaSessionStatusAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkGetGpaSessionStatusAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
get_gpa_session_status_amd
} else {
@ -574,9 +568,9 @@ impl AmdGpaInterfaceFn {
stringify!(get_gpa_session_results_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetGpaSessionResultsAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkGetGpaSessionResultsAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
get_gpa_session_results_amd
} else {
@ -593,9 +587,9 @@ impl AmdGpaInterfaceFn {
stringify!(reset_gpa_session_amd)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSampleAMD\0");
let val = _f(cname);
let raw_name = stringify!(vkCmdEndGpaSampleAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
reset_gpa_session_amd
} else {
@ -612,10 +606,9 @@ impl AmdGpaInterfaceFn {
stringify!(cmd_copy_gpa_session_results_amd)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkCmdCopyGpaSessionResultsAMD\0",
);
let val = _f(cname);
let raw_name = stringify!(vkCmdCopyGpaSessionResultsAMD);
let cname = ::std::ffi::CString::new(raw_name).unwrap();
let val = _f(&cname);
if val.is_null() {
cmd_copy_gpa_session_results_amd
} else {
@ -699,10 +692,10 @@ impl<'a> PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> {
T: ExtendsPhysicalDeviceWaveLimitPropertiesAmd,
{
unsafe {
let next_ptr = <*const T>::cast(next);
let next_ptr = next as *mut T as *mut BaseOutStructure;
let last_next = ptr_chain_iter(next).last().unwrap();
(*last_next).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr;
self.inner.p_next = next_ptr as _;
}
self
}

View File

@ -18,15 +18,15 @@ impl BufferDeviceAddress {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferDeviceAddressEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddressEXT.html>"]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoEXT,
) -> vk::DeviceAddress {
(self.fp.get_buffer_device_address_ext)(self.handle, info)
self.fp.get_buffer_device_address_ext(self.handle, info)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtBufferDeviceAddressFn::name()
}

View File

@ -1,67 +0,0 @@
use crate::prelude::{read_into_uninitialized_vector, VkResult};
use crate::vk;
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct CalibratedTimestamps {
handle: vk::Instance,
fp: vk::ExtCalibratedTimestampsFn,
}
impl CalibratedTimestamps {
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ExtCalibratedTimestampsFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceCalibrateableTimeDomainsEXT.html>
pub unsafe fn get_physical_device_calibrateable_time_domains(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::TimeDomainEXT>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_calibrateable_time_domains_ext)(
physical_device,
count,
data,
)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetCalibratedTimestampsEXT.html>
///
/// Returns a tuple containing `(timestamps, max_deviation)`
pub unsafe fn get_calibrated_timestamps(
&self,
device: vk::Device,
info: &[vk::CalibratedTimestampInfoEXT],
) -> VkResult<(Vec<u64>, Vec<u64>)> {
let mut timestamps = vec![0u64; info.len()];
let mut max_deviation = vec![0u64; info.len()];
(self.fp.get_calibrated_timestamps_ext)(
device,
info.len() as u32,
info.as_ptr(),
timestamps.as_mut_ptr(),
max_deviation.as_mut_ptr(),
)
.result_with_success((timestamps, max_deviation))
}
pub const fn name() -> &'static CStr {
vk::ExtCalibratedTimestampsFn::name()
}
pub fn fp(&self) -> &vk::ExtCalibratedTimestampsFn {
&self.fp
}
pub fn instance(&self) -> vk::Instance {
self.handle
}
}

View File

@ -19,38 +19,42 @@ impl DebugMarker {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDebugMarkerSetObjectNameEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDebugMarkerSetObjectNameEXT.html>"]
pub unsafe fn debug_marker_set_object_name(
&self,
name_info: &vk::DebugMarkerObjectNameInfoEXT,
) -> VkResult<()> {
(self.fp.debug_marker_set_object_name_ext)(self.handle, name_info).result()
self.fp
.debug_marker_set_object_name_ext(self.handle, name_info)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerBeginEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDebugMarkerBeginEXT.html>"]
pub unsafe fn cmd_debug_marker_begin(
&self,
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT,
) {
(self.fp.cmd_debug_marker_begin_ext)(command_buffer, marker_info);
self.fp
.cmd_debug_marker_begin_ext(command_buffer, marker_info);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerEndEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDebugMarkerEndEXT.html>"]
pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_debug_marker_end_ext)(command_buffer);
self.fp.cmd_debug_marker_end_ext(command_buffer);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerInsertEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDebugMarkerInsertEXT.html>"]
pub unsafe fn cmd_debug_marker_insert(
&self,
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT,
) {
(self.fp.cmd_debug_marker_insert_ext)(command_buffer, marker_info);
self.fp
.cmd_debug_marker_insert_ext(command_buffer, marker_info);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtDebugMarkerFn::name()
}

View File

@ -20,36 +20,37 @@ impl DebugReport {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugReportCallbackEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyDebugReportCallbackEXT.html>"]
pub unsafe fn destroy_debug_report_callback(
&self,
debug: vk::DebugReportCallbackEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_debug_report_callback_ext)(
self.fp.destroy_debug_report_callback_ext(
self.handle,
debug,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDebugReportCallbackEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDebugReportCallbackEXT.html>"]
pub unsafe fn create_debug_report_callback(
&self,
create_info: &vk::DebugReportCallbackCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DebugReportCallbackEXT> {
let mut debug_cb = mem::zeroed();
(self.fp.create_debug_report_callback_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut debug_cb,
)
.result_with_success(debug_cb)
self.fp
.create_debug_report_callback_ext(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut debug_cb,
)
.result_with_success(debug_cb)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtDebugReportFn::name()
}

View File

@ -19,103 +19,111 @@ impl DebugUtils {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectNameEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSetDebugUtilsObjectNameEXT.html>"]
pub unsafe fn debug_utils_set_object_name(
&self,
device: vk::Device,
name_info: &vk::DebugUtilsObjectNameInfoEXT,
) -> VkResult<()> {
(self.fp.set_debug_utils_object_name_ext)(device, name_info).result()
self.fp
.set_debug_utils_object_name_ext(device, name_info)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html>"]
pub unsafe fn debug_utils_set_object_tag(
&self,
device: vk::Device,
tag_info: &vk::DebugUtilsObjectTagInfoEXT,
) -> VkResult<()> {
(self.fp.set_debug_utils_object_tag_ext)(device, tag_info).result()
self.fp
.set_debug_utils_object_tag_ext(device, tag_info)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html>"]
pub unsafe fn cmd_begin_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT,
) {
(self.fp.cmd_begin_debug_utils_label_ext)(command_buffer, label);
self.fp
.cmd_begin_debug_utils_label_ext(command_buffer, label);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html>"]
pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_end_debug_utils_label_ext)(command_buffer);
self.fp.cmd_end_debug_utils_label_ext(command_buffer);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html>"]
pub unsafe fn cmd_insert_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT,
) {
(self.fp.cmd_insert_debug_utils_label_ext)(command_buffer, label);
self.fp
.cmd_insert_debug_utils_label_ext(command_buffer, label);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueBeginDebugUtilsLabelEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueBeginDebugUtilsLabelEXT.html>"]
pub unsafe fn queue_begin_debug_utils_label(
&self,
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT,
) {
(self.fp.queue_begin_debug_utils_label_ext)(queue, label);
self.fp.queue_begin_debug_utils_label_ext(queue, label);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html>"]
pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) {
(self.fp.queue_end_debug_utils_label_ext)(queue);
self.fp.queue_end_debug_utils_label_ext(queue);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html>"]
pub unsafe fn queue_insert_debug_utils_label(
&self,
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT,
) {
(self.fp.queue_insert_debug_utils_label_ext)(queue, label);
self.fp.queue_insert_debug_utils_label_ext(queue, label);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html>"]
pub unsafe fn create_debug_utils_messenger(
&self,
create_info: &vk::DebugUtilsMessengerCreateInfoEXT,
allocator: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DebugUtilsMessengerEXT> {
let mut messenger = mem::zeroed();
(self.fp.create_debug_utils_messenger_ext)(
self.handle,
create_info,
allocator.as_raw_ptr(),
&mut messenger,
)
.result_with_success(messenger)
self.fp
.create_debug_utils_messenger_ext(
self.handle,
create_info,
allocator.as_raw_ptr(),
&mut messenger,
)
.result_with_success(messenger)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugUtilsMessengerEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyDebugUtilsMessengerEXT.html>"]
pub unsafe fn destroy_debug_utils_messenger(
&self,
messenger: vk::DebugUtilsMessengerEXT,
allocator: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_debug_utils_messenger_ext)(self.handle, messenger, allocator.as_raw_ptr());
self.fp
.destroy_debug_utils_messenger_ext(self.handle, messenger, allocator.as_raw_ptr());
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html>"]
pub unsafe fn submit_debug_utils_message(
&self,
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
message_types: vk::DebugUtilsMessageTypeFlagsEXT,
callback_data: &vk::DebugUtilsMessengerCallbackDataEXT,
) {
(self.fp.submit_debug_utils_message_ext)(
self.fp.submit_debug_utils_message_ext(
self.handle,
message_severity,
message_types,
@ -123,7 +131,7 @@ impl DebugUtils {
);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtDebugUtilsFn::name()
}

View File

@ -17,60 +17,61 @@ impl ExtendedDynamicState {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetCullModeEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetCullModeEXT.html>"]
pub unsafe fn cmd_set_cull_mode(
&self,
command_buffer: vk::CommandBuffer,
cull_mode: vk::CullModeFlags,
) {
(self.fp.cmd_set_cull_mode_ext)(command_buffer, cull_mode)
self.fp.cmd_set_cull_mode_ext(command_buffer, cull_mode)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetFrontFaceEXT.html>"]
pub unsafe fn cmd_set_front_face(
&self,
command_buffer: vk::CommandBuffer,
front_face: vk::FrontFace,
) {
(self.fp.cmd_set_front_face_ext)(command_buffer, front_face)
self.fp.cmd_set_front_face_ext(command_buffer, front_face)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>"]
pub unsafe fn cmd_set_primitive_topology(
&self,
command_buffer: vk::CommandBuffer,
primitive_topology: vk::PrimitiveTopology,
) {
(self.fp.cmd_set_primitive_topology_ext)(command_buffer, primitive_topology)
self.fp
.cmd_set_primitive_topology_ext(command_buffer, primitive_topology)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetViewportWithCountEXT.html>"]
pub unsafe fn cmd_set_viewport_with_count(
&self,
command_buffer: vk::CommandBuffer,
viewports: &[vk::Viewport],
) {
(self.fp.cmd_set_viewport_with_count_ext)(
self.fp.cmd_set_viewport_with_count_ext(
command_buffer,
viewports.len() as u32,
viewports.as_ptr(),
)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetScissorWithCountEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetScissorWithCountEXT.html>"]
pub unsafe fn cmd_set_scissor_with_count(
&self,
command_buffer: vk::CommandBuffer,
scissors: &[vk::Rect2D],
) {
(self.fp.cmd_set_scissor_with_count_ext)(
self.fp.cmd_set_scissor_with_count_ext(
command_buffer,
scissors.len() as u32,
scissors.as_ptr(),
)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBindVertexBuffers2EXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBindVertexBuffers2EXT.html>"]
pub unsafe fn cmd_bind_vertex_buffers2(
&self,
command_buffer: vk::CommandBuffer,
@ -93,7 +94,7 @@ impl ExtendedDynamicState {
} else {
ptr::null()
};
(self.fp.cmd_bind_vertex_buffers2_ext)(
self.fp.cmd_bind_vertex_buffers2_ext(
command_buffer,
first_binding,
buffers.len() as u32,
@ -104,55 +105,57 @@ impl ExtendedDynamicState {
)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthTestEnableEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetDepthTestEnableEXT.html>"]
pub unsafe fn cmd_set_depth_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_test_enable: bool,
) {
(self.fp.cmd_set_depth_test_enable_ext)(command_buffer, depth_test_enable.into())
self.fp
.cmd_set_depth_test_enable_ext(command_buffer, depth_test_enable.into())
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>"]
pub unsafe fn cmd_set_depth_write_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_write_enable: bool,
) {
(self.fp.cmd_set_depth_write_enable_ext)(command_buffer, depth_write_enable.into())
self.fp
.cmd_set_depth_write_enable_ext(command_buffer, depth_write_enable.into())
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>"]
pub unsafe fn cmd_set_depth_compare_op(
&self,
command_buffer: vk::CommandBuffer,
depth_compare_op: vk::CompareOp,
) {
(self.fp.cmd_set_depth_compare_op_ext)(command_buffer, depth_compare_op)
self.fp
.cmd_set_depth_compare_op_ext(command_buffer, depth_compare_op)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>"]
pub unsafe fn cmd_set_depth_bounds_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_bounds_test_enable: bool,
) {
(self.fp.cmd_set_depth_bounds_test_enable_ext)(
command_buffer,
depth_bounds_test_enable.into(),
)
self.fp
.cmd_set_depth_bounds_test_enable_ext(command_buffer, depth_bounds_test_enable.into())
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>"]
pub unsafe fn cmd_set_stencil_test_enable(
&self,
command_buffer: vk::CommandBuffer,
stencil_test_enable: bool,
) {
(self.fp.cmd_set_stencil_test_enable_ext)(command_buffer, stencil_test_enable.into())
self.fp
.cmd_set_stencil_test_enable_ext(command_buffer, stencil_test_enable.into())
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetStencilOpEXT.html>"]
pub unsafe fn cmd_set_stencil_op(
&self,
command_buffer: vk::CommandBuffer,
@ -162,7 +165,7 @@ impl ExtendedDynamicState {
depth_fail_op: vk::StencilOp,
compare_op: vk::CompareOp,
) {
(self.fp.cmd_set_stencil_op_ext)(
self.fp.cmd_set_stencil_op_ext(
command_buffer,
face_mask,
fail_op,
@ -172,7 +175,7 @@ impl ExtendedDynamicState {
)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtExtendedDynamicStateFn::name()
}

View File

@ -1,78 +0,0 @@
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state2.html>
#[derive(Clone)]
pub struct ExtendedDynamicState2 {
fp: vk::ExtExtendedDynamicState2Fn,
}
impl ExtendedDynamicState2 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let fp = vk::ExtExtendedDynamicState2Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPatchControlPointsEXT.html>
pub unsafe fn cmd_set_patch_control_points(
&self,
command_buffer: vk::CommandBuffer,
patch_control_points: u32,
) {
(self.fp.cmd_set_patch_control_points_ext)(command_buffer, patch_control_points)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizerDiscardEnableEXT.html>
pub unsafe fn cmd_set_rasterizer_discard_enable(
&self,
command_buffer: vk::CommandBuffer,
rasterizer_discard_enable: bool,
) {
(self.fp.cmd_set_rasterizer_discard_enable_ext)(
command_buffer,
rasterizer_discard_enable.into(),
)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBiasEnableEXT.html>
pub unsafe fn cmd_set_depth_bias_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_bias_enable: bool,
) {
(self.fp.cmd_set_depth_bias_enable_ext)(command_buffer, depth_bias_enable.into())
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEXT.html>
pub unsafe fn cmd_set_logic_op(
&self,
command_buffer: vk::CommandBuffer,
logic_op: vk::LogicOp,
) {
(self.fp.cmd_set_logic_op_ext)(command_buffer, logic_op)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveRestartEnableEXT.html>
pub unsafe fn cmd_set_primitive_restart_enable(
&self,
command_buffer: vk::CommandBuffer,
primitive_restart_enable: bool,
) {
(self.fp.cmd_set_primitive_restart_enable_ext)(
command_buffer,
primitive_restart_enable.into(),
)
}
pub const fn name() -> &'static CStr {
vk::ExtExtendedDynamicState2Fn::name()
}
pub fn fp(&self) -> &vk::ExtExtendedDynamicState2Fn {
&self.fp
}
}

View File

@ -19,22 +19,24 @@ impl FullScreenExclusive {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAcquireFullScreenExclusiveModeEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkAcquireFullScreenExclusiveModeEXT.html>"]
pub unsafe fn acquire_full_screen_exclusive_mode(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<()> {
(self.fp.acquire_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
self.fp
.acquire_full_screen_exclusive_mode_ext(self.handle, swapchain)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html>"]
pub unsafe fn get_physical_device_surface_present_modes2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_surface_present_modes2_ext)(
self.fp.get_physical_device_surface_present_modes2_ext(
physical_device,
surface_info,
count,
@ -43,29 +45,32 @@ impl FullScreenExclusive {
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkReleaseFullScreenExclusiveModeEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkReleaseFullScreenExclusiveModeEXT.html>"]
pub unsafe fn release_full_screen_exclusive_mode(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<()> {
(self.fp.release_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
self.fp
.release_full_screen_exclusive_mode_ext(self.handle, swapchain)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html>"]
pub unsafe fn get_device_group_surface_present_modes2(
&self,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
let mut present_modes = mem::zeroed();
(self.fp.get_device_group_surface_present_modes2_ext)(
self.handle,
surface_info,
&mut present_modes,
)
.result_with_success(present_modes)
self.fp
.get_device_group_surface_present_modes2_ext(
self.handle,
surface_info,
&mut present_modes,
)
.result_with_success(present_modes)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtFullScreenExclusiveFn::name()
}

View File

@ -1,51 +0,0 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_headless_surface.html>
#[derive(Clone)]
pub struct HeadlessSurface {
handle: vk::Instance,
fp: vk::ExtHeadlessSurfaceFn,
}
impl HeadlessSurface {
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ExtHeadlessSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateHeadlessSurfaceEXT.html>
pub unsafe fn create_headless_surface(
&self,
create_info: &vk::HeadlessSurfaceCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_headless_surface_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
pub const fn name() -> &'static CStr {
vk::ExtHeadlessSurfaceFn::name()
}
pub fn fp(&self) -> &vk::ExtHeadlessSurfaceFn {
&self.fp
}
pub fn instance(&self) -> vk::Instance {
self.handle
}
}

View File

@ -20,23 +20,24 @@ impl MetalSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateMetalSurfaceEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateMetalSurfaceEXT.html>"]
pub unsafe fn create_metal_surface(
&self,
create_info: &vk::MetalSurfaceCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_metal_surface_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_metal_surface_ext(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtMetalSurfaceFn::name()
}

View File

@ -1,31 +1,23 @@
pub use self::buffer_device_address::BufferDeviceAddress;
pub use self::calibrated_timestamps::CalibratedTimestamps;
#[allow(deprecated)]
pub use self::debug_marker::DebugMarker;
#[allow(deprecated)]
pub use self::debug_report::DebugReport;
pub use self::debug_utils::DebugUtils;
pub use self::extended_dynamic_state::ExtendedDynamicState;
pub use self::extended_dynamic_state2::ExtendedDynamicState2;
pub use self::full_screen_exclusive::FullScreenExclusive;
pub use self::headless_surface::HeadlessSurface;
pub use self::metal_surface::MetalSurface;
pub use self::physical_device_drm::PhysicalDeviceDrm;
pub use self::private_data::PrivateData;
pub use self::tooling_info::ToolingInfo;
mod buffer_device_address;
mod calibrated_timestamps;
#[deprecated(note = "Please use the [DebugUtils](struct.DebugUtils.html) extension instead.")]
mod debug_marker;
#[deprecated(note = "Please use the [DebugUtils](struct.DebugUtils.html) extension instead.")]
mod debug_report;
mod debug_utils;
mod extended_dynamic_state;
mod extended_dynamic_state2;
mod full_screen_exclusive;
mod headless_surface;
mod metal_surface;
mod physical_device_drm;
mod private_data;
mod tooling_info;

View File

@ -18,7 +18,7 @@ impl PhysicalDeviceDrm {
props_drm
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtPhysicalDeviceDrmFn::name()
}
}

View File

@ -1,98 +0,0 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_private_data.html>
#[derive(Clone)]
pub struct PrivateData {
handle: vk::Device,
fp: vk::ExtPrivateDataFn,
}
impl PrivateData {
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::ExtPrivateDataFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreatePrivateDataSlotEXT.html>
pub unsafe fn create_private_data_slot(
&self,
create_info: &vk::PrivateDataSlotCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::PrivateDataSlotEXT> {
let mut private_data_slot = mem::zeroed();
(self.fp.create_private_data_slot_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut private_data_slot,
)
.result_with_success(private_data_slot)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyPrivateDataSlotEXT.html>
pub unsafe fn destroy_private_data_slot(
&self,
private_data_slot: vk::PrivateDataSlotEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_private_data_slot_ext)(
self.handle,
private_data_slot,
allocation_callbacks.as_raw_ptr(),
)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetPrivateDataEXT.html>
pub unsafe fn set_private_data<T: vk::Handle>(
&self,
object: T,
private_data_slot: vk::PrivateDataSlotEXT,
data: u64,
) -> VkResult<()> {
(self.fp.set_private_data_ext)(
self.handle,
T::TYPE,
object.as_raw(),
private_data_slot,
data,
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPrivateDataEXT.html>
pub unsafe fn get_private_data<T: vk::Handle>(
&self,
object: T,
private_data_slot: vk::PrivateDataSlotEXT,
) -> u64 {
let mut data = mem::zeroed();
(self.fp.get_private_data_ext)(
self.handle,
T::TYPE,
object.as_raw(),
private_data_slot,
&mut data,
);
data
}
pub const fn name() -> &'static CStr {
vk::ExtPrivateDataFn::name()
}
pub fn fp(&self) -> &vk::ExtPrivateDataFn {
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

View File

@ -17,17 +17,18 @@ impl ToolingInfo {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceToolPropertiesEXT.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceToolPropertiesEXT.html>"]
pub unsafe fn get_physical_device_tool_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_physical_device_tool_properties_ext)(physical_device, count, data)
self.fp
.get_physical_device_tool_properties_ext(physical_device, count, data)
})
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::ExtToolingInfoFn::name()
}

View File

@ -32,36 +32,37 @@ impl AccelerationStructure {
props_rt
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateAccelerationStructureKHR.html>"]
pub unsafe fn create_acceleration_structure(
&self,
create_info: &vk::AccelerationStructureCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::AccelerationStructureKHR> {
let mut accel_struct = mem::zeroed();
(self.fp.create_acceleration_structure_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut accel_struct,
)
.result_with_success(accel_struct)
self.fp
.create_acceleration_structure_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut accel_struct,
)
.result_with_success(accel_struct)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyAccelerationStructureKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyAccelerationStructureKHR.html>"]
pub unsafe fn destroy_acceleration_structure(
&self,
accel_struct: vk::AccelerationStructureKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_acceleration_structure_khr)(
self.fp.destroy_acceleration_structure_khr(
self.handle,
accel_struct,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBuildAccelerationStructuresKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBuildAccelerationStructuresKHR.html>"]
pub unsafe fn cmd_build_acceleration_structures(
&self,
command_buffer: vk::CommandBuffer,
@ -79,7 +80,7 @@ impl AccelerationStructure {
})
.collect::<Vec<_>>();
(self.fp.cmd_build_acceleration_structures_khr)(
self.fp.cmd_build_acceleration_structures_khr(
command_buffer,
infos.len() as _,
infos.as_ptr(),
@ -87,7 +88,7 @@ impl AccelerationStructure {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBuildAccelerationStructuresIndirectKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBuildAccelerationStructuresIndirectKHR.html>"]
pub unsafe fn cmd_build_acceleration_structures_indirect(
&self,
command_buffer: vk::CommandBuffer,
@ -109,7 +110,7 @@ impl AccelerationStructure {
})
.collect::<Vec<_>>();
(self.fp.cmd_build_acceleration_structures_indirect_khr)(
self.fp.cmd_build_acceleration_structures_indirect_khr(
command_buffer,
infos.len() as _,
infos.as_ptr(),
@ -119,7 +120,7 @@ impl AccelerationStructure {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBuildAccelerationStructuresKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkBuildAccelerationStructuresKHR.html>"]
pub unsafe fn build_acceleration_structures(
&self,
deferred_operation: vk::DeferredOperationKHR,
@ -137,46 +138,59 @@ impl AccelerationStructure {
})
.collect::<Vec<_>>();
(self.fp.build_acceleration_structures_khr)(
self.handle,
deferred_operation,
infos.len() as _,
infos.as_ptr(),
build_range_infos.as_ptr(),
)
.result()
self.fp
.build_acceleration_structures_khr(
self.handle,
deferred_operation,
infos.len() as _,
infos.as_ptr(),
build_range_infos.as_ptr(),
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureKHR.html>"]
pub unsafe fn copy_acceleration_structure(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureInfoKHR,
) -> VkResult<()> {
(self.fp.copy_acceleration_structure_khr)(self.handle, deferred_operation, info).result()
self.fp
.copy_acceleration_structure_khr(self.handle, deferred_operation, info as *const _)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>"]
pub unsafe fn copy_acceleration_structure_to_memory(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
) -> VkResult<()> {
(self.fp.copy_acceleration_structure_to_memory_khr)(self.handle, deferred_operation, info)
self.fp
.copy_acceleration_structure_to_memory_khr(
self.handle,
deferred_operation,
info as *const _,
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCopyMemoryToAccelerationStructureKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyMemoryToAccelerationStructureKHR.html>"]
pub unsafe fn copy_memory_to_acceleration_structure(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
) -> VkResult<()> {
(self.fp.copy_memory_to_acceleration_structure_khr)(self.handle, deferred_operation, info)
self.fp
.copy_memory_to_acceleration_structure_khr(
self.handle,
deferred_operation,
info as *const _,
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkWriteAccelerationStructuresPropertiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWriteAccelerationStructuresPropertiesKHR.html>"]
pub unsafe fn write_acceleration_structures_properties(
&self,
acceleration_structures: &[vk::AccelerationStructureKHR],
@ -184,54 +198,59 @@ impl AccelerationStructure {
data: &mut [u8],
stride: usize,
) -> VkResult<()> {
(self.fp.write_acceleration_structures_properties_khr)(
self.handle,
acceleration_structures.len() as _,
acceleration_structures.as_ptr(),
query_type,
data.len(),
data.as_mut_ptr() as *mut std::ffi::c_void,
stride,
)
.result()
self.fp
.write_acceleration_structures_properties_khr(
self.handle,
acceleration_structures.len() as _,
acceleration_structures.as_ptr(),
query_type,
data.len(),
data.as_mut_ptr() as *mut std::ffi::c_void,
stride,
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdCopyAccelerationStructureKHR.html>"]
pub unsafe fn cmd_copy_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureInfoKHR,
) {
(self.fp.cmd_copy_acceleration_structure_khr)(command_buffer, info);
self.fp
.cmd_copy_acceleration_structure_khr(command_buffer, info);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html>"]
pub unsafe fn cmd_copy_acceleration_structure_to_memory(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
) {
(self.fp.cmd_copy_acceleration_structure_to_memory_khr)(command_buffer, info);
self.fp
.cmd_copy_acceleration_structure_to_memory_khr(command_buffer, info as *const _);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html>"]
pub unsafe fn cmd_copy_memory_to_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
) {
(self.fp.cmd_copy_memory_to_acceleration_structure_khr)(command_buffer, info);
self.fp
.cmd_copy_memory_to_acceleration_structure_khr(command_buffer, info as *const _);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureHandleKHR.html>"]
pub unsafe fn get_acceleration_structure_device_address(
&self,
info: &vk::AccelerationStructureDeviceAddressInfoKHR,
) -> vk::DeviceAddress {
(self.fp.get_acceleration_structure_device_address_khr)(self.handle, info)
self.fp
.get_acceleration_structure_device_address_khr(self.handle, info as *const _)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html>"]
pub unsafe fn cmd_write_acceleration_structures_properties(
&self,
command_buffer: vk::CommandBuffer,
@ -240,7 +259,7 @@ impl AccelerationStructure {
query_pool: vk::QueryPool,
first_query: u32,
) {
(self.fp.cmd_write_acceleration_structures_properties_khr)(
self.fp.cmd_write_acceleration_structures_properties_khr(
command_buffer,
structures.len() as _,
structures.as_ptr(),
@ -250,23 +269,23 @@ impl AccelerationStructure {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html>"]
pub unsafe fn get_device_acceleration_structure_compatibility(
&self,
version: &vk::AccelerationStructureVersionInfoKHR,
) -> vk::AccelerationStructureCompatibilityKHR {
let mut compatibility = vk::AccelerationStructureCompatibilityKHR::default();
(self.fp.get_device_acceleration_structure_compatibility_khr)(
self.fp.get_device_acceleration_structure_compatibility_khr(
self.handle,
version,
&mut compatibility,
&mut compatibility as *mut _,
);
compatibility
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureBuildSizesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureBuildSizesKHR.html>"]
pub unsafe fn get_acceleration_structure_build_sizes(
&self,
build_type: vk::AccelerationStructureBuildTypeKHR,
@ -277,18 +296,18 @@ impl AccelerationStructure {
let mut size_info = vk::AccelerationStructureBuildSizesInfoKHR::default();
(self.fp.get_acceleration_structure_build_sizes_khr)(
self.fp.get_acceleration_structure_build_sizes_khr(
self.handle,
build_type,
build_info,
build_info as *const _,
max_primitive_counts.as_ptr(),
&mut size_info,
&mut size_info as *mut _,
);
size_info
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrAccelerationStructureFn::name()
}

View File

@ -20,23 +20,24 @@ impl AndroidSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateAndroidSurfaceKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateAndroidSurfaceKHR.html>"]
pub unsafe fn create_android_surface(
&self,
create_info: &vk::AndroidSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_android_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_android_surface_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrAndroidSurfaceFn::name()
}

View File

@ -18,31 +18,33 @@ impl BufferDeviceAddress {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferDeviceAddressKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddressKHR.html>"]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR,
) -> vk::DeviceAddress {
(self.fp.get_buffer_device_address_khr)(self.handle, info)
self.fp.get_buffer_device_address_khr(self.handle, info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html>"]
pub unsafe fn get_buffer_opaque_capture_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR,
) -> u64 {
(self.fp.get_buffer_opaque_capture_address_khr)(self.handle, info)
self.fp
.get_buffer_opaque_capture_address_khr(self.handle, info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddressKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddressKHR.html>"]
pub unsafe fn get_device_memory_opaque_capture_address(
&self,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR,
) -> u64 {
(self.fp.get_device_memory_opaque_capture_address_khr)(self.handle, info)
self.fp
.get_device_memory_opaque_capture_address_khr(self.handle, info)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrBufferDeviceAddressFn::name()
}

View File

@ -1,76 +0,0 @@
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_copy_commands2.html>
#[derive(Clone)]
pub struct CopyCommands2 {
fp: vk::KhrCopyCommands2Fn,
}
impl CopyCommands2 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let fp = vk::KhrCopyCommands2Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBuffer2KHR.html>
pub unsafe fn cmd_copy_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_info: &vk::CopyBufferInfo2KHR,
) {
(self.fp.cmd_copy_buffer2_khr)(command_buffer, copy_buffer_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImage2KHR.html>
pub unsafe fn cmd_copy_image2(
&self,
command_buffer: vk::CommandBuffer,
copy_image_info: &vk::CopyImageInfo2KHR,
) {
(self.fp.cmd_copy_image2_khr)(command_buffer, copy_image_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBufferToImage2KHR.html>
pub unsafe fn cmd_copy_buffer_to_image2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2KHR,
) {
(self.fp.cmd_copy_buffer_to_image2_khr)(command_buffer, copy_buffer_to_image_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer2KHR.html>
pub unsafe fn cmd_copy_image_to_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2KHR,
) {
(self.fp.cmd_copy_image_to_buffer2_khr)(command_buffer, copy_image_to_buffer_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBlitImage2KHR.html>
pub unsafe fn cmd_blit_image2(
&self,
command_buffer: vk::CommandBuffer,
blit_image_info: &vk::BlitImageInfo2KHR,
) {
(self.fp.cmd_blit_image2_khr)(command_buffer, blit_image_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResolveImage2KHR.html>
pub unsafe fn cmd_resolve_image2(
&self,
command_buffer: vk::CommandBuffer,
resolve_image_info: &vk::ResolveImageInfo2KHR,
) {
(self.fp.cmd_resolve_image2_khr)(command_buffer, resolve_image_info)
}
pub const fn name() -> &'static CStr {
vk::KhrCopyCommands2Fn::name()
}
pub fn fp(&self) -> &vk::KhrCopyCommands2Fn {
&self.fp
}
}

View File

@ -20,56 +20,59 @@ impl CreateRenderPass2 {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateRenderPass2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateRenderPass2.html>"]
pub unsafe fn create_render_pass2(
&self,
create_info: &vk::RenderPassCreateInfo2,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::RenderPass> {
let mut renderpass = mem::zeroed();
(self.fp.create_render_pass2_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut renderpass,
)
.result_with_success(renderpass)
self.fp
.create_render_pass2_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut renderpass,
)
.result_with_success(renderpass)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderPass2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBeginRenderPass2.html>"]
pub unsafe fn cmd_begin_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
render_pass_begin_info: &vk::RenderPassBeginInfo,
subpass_begin_info: &vk::SubpassBeginInfo,
) {
(self.fp.cmd_begin_render_pass2_khr)(
self.fp.cmd_begin_render_pass2_khr(
command_buffer,
render_pass_begin_info,
subpass_begin_info,
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdNextSubpass2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdNextSubpass2.html>"]
pub unsafe fn cmd_next_subpass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_begin_info: &vk::SubpassBeginInfo,
subpass_end_info: &vk::SubpassEndInfo,
) {
(self.fp.cmd_next_subpass2_khr)(command_buffer, subpass_begin_info, subpass_end_info);
self.fp
.cmd_next_subpass2_khr(command_buffer, subpass_begin_info, subpass_end_info);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderPass2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdEndRenderPass2.html>"]
pub unsafe fn cmd_end_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_end_info: &vk::SubpassEndInfo,
) {
(self.fp.cmd_end_render_pass2_khr)(command_buffer, subpass_end_info);
self.fp
.cmd_end_render_pass2_khr(command_buffer, subpass_end_info);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrCreateRenderpass2Fn::name()
}

View File

@ -20,58 +20,64 @@ impl DeferredHostOperations {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDeferredOperationKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDeferredOperationKHR.html>"]
pub unsafe fn create_deferred_operation(
&self,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DeferredOperationKHR> {
let mut operation = mem::zeroed();
(self.fp.create_deferred_operation_khr)(
self.handle,
allocation_callbacks.as_raw_ptr(),
&mut operation,
)
.result_with_success(operation)
self.fp
.create_deferred_operation_khr(
self.handle,
allocation_callbacks.as_raw_ptr(),
&mut operation,
)
.result_with_success(operation)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDeferredOperationJoinKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDeferredOperationJoinKHR.html>"]
pub unsafe fn deferred_operation_join(
&self,
operation: vk::DeferredOperationKHR,
) -> VkResult<()> {
(self.fp.deferred_operation_join_khr)(self.handle, operation).result()
self.fp
.deferred_operation_join_khr(self.handle, operation)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDeferredOperationKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyDeferredOperationKHR.html>"]
pub unsafe fn destroy_deferred_operation(
&self,
operation: vk::DeferredOperationKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_deferred_operation_khr)(
self.fp.destroy_deferred_operation_khr(
self.handle,
operation,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeferredOperationMaxConcurrencyKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeferredOperationMaxConcurrencyKHR.html>"]
pub unsafe fn get_deferred_operation_max_concurrency(
&self,
operation: vk::DeferredOperationKHR,
) -> u32 {
(self.fp.get_deferred_operation_max_concurrency_khr)(self.handle, operation)
self.fp
.get_deferred_operation_max_concurrency_khr(self.handle, operation)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeferredOperationResultKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeferredOperationResultKHR.html>"]
pub unsafe fn get_deferred_operation_result(
&self,
operation: vk::DeferredOperationKHR,
) -> VkResult<()> {
(self.fp.get_deferred_operation_result_khr)(self.handle, operation).result()
self.fp
.get_deferred_operation_result_khr(self.handle, operation)
.result()
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrDeferredHostOperationsFn::name()
}

View File

@ -20,34 +20,36 @@ impl Display {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceDisplayPropertiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceDisplayPropertiesKHR.html>"]
pub unsafe fn get_physical_device_display_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_display_properties_khr)(physical_device, count, data)
self.fp
.get_physical_device_display_properties_khr(physical_device, count, data)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceDisplayPlanePropertiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceDisplayPlanePropertiesKHR.html>"]
pub unsafe fn get_physical_device_display_plane_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPlanePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_display_plane_properties_khr)(physical_device, count, data)
self.fp
.get_physical_device_display_plane_properties_khr(physical_device, count, data)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDisplayPlaneSupportedDisplaysKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDisplayPlaneSupportedDisplaysKHR.html>"]
pub unsafe fn get_display_plane_supported_displays(
&self,
physical_device: vk::PhysicalDevice,
plane_index: u32,
) -> VkResult<Vec<vk::DisplayKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_display_plane_supported_displays_khr)(
self.fp.get_display_plane_supported_displays_khr(
physical_device,
plane_index,
count,
@ -56,18 +58,19 @@ impl Display {
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDisplayModePropertiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDisplayModePropertiesKHR.html>"]
pub unsafe fn get_display_mode_properties(
&self,
physical_device: vk::PhysicalDevice,
display: vk::DisplayKHR,
) -> VkResult<Vec<vk::DisplayModePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_display_mode_properties_khr)(physical_device, display, count, data)
self.fp
.get_display_mode_properties_khr(physical_device, display, count, data)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDisplayModeKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDisplayModeKHR.html>"]
pub unsafe fn create_display_mode(
&self,
physical_device: vk::PhysicalDevice,
@ -76,17 +79,18 @@ impl Display {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DisplayModeKHR> {
let mut display_mode = mem::MaybeUninit::zeroed();
(self.fp.create_display_mode_khr)(
physical_device,
display,
create_info,
allocation_callbacks.as_raw_ptr(),
display_mode.as_mut_ptr(),
)
.result_with_success(display_mode.assume_init())
self.fp
.create_display_mode_khr(
physical_device,
display,
create_info,
allocation_callbacks.as_raw_ptr(),
display_mode.as_mut_ptr(),
)
.result_with_success(display_mode.assume_init())
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDisplayPlaneCapabilitiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDisplayPlaneCapabilitiesKHR.html>"]
pub unsafe fn get_display_plane_capabilities(
&self,
physical_device: vk::PhysicalDevice,
@ -94,32 +98,34 @@ impl Display {
plane_index: u32,
) -> VkResult<vk::DisplayPlaneCapabilitiesKHR> {
let mut display_plane_capabilities = mem::MaybeUninit::zeroed();
(self.fp.get_display_plane_capabilities_khr)(
physical_device,
mode,
plane_index,
display_plane_capabilities.as_mut_ptr(),
)
.result_with_success(display_plane_capabilities.assume_init())
self.fp
.get_display_plane_capabilities_khr(
physical_device,
mode,
plane_index,
display_plane_capabilities.as_mut_ptr(),
)
.result_with_success(display_plane_capabilities.assume_init())
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDisplayPlaneSurfaceKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDisplayPlaneSurfaceKHR.html>"]
pub unsafe fn create_display_plane_surface(
&self,
create_info: &vk::DisplaySurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::zeroed();
(self.fp.create_display_plane_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.result_with_success(surface.assume_init())
self.fp
.create_display_plane_surface_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.result_with_success(surface.assume_init())
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrDisplayFn::name()
}

View File

@ -20,14 +20,14 @@ impl DisplaySwapchain {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateSharedSwapchainsKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateSharedSwapchainsKHR.html>"]
pub unsafe fn create_shared_swapchains(
&self,
create_infos: &[vk::SwapchainCreateInfoKHR],
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::SwapchainKHR>> {
let mut swapchains = Vec::with_capacity(create_infos.len());
let err_code = (self.fp.create_shared_swapchains_khr)(
let err_code = self.fp.create_shared_swapchains_khr(
self.handle,
create_infos.len() as u32,
create_infos.as_ptr(),
@ -38,7 +38,7 @@ impl DisplaySwapchain {
err_code.result_with_success(swapchains)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrDisplaySwapchainFn::name()
}

View File

@ -16,7 +16,7 @@ impl DrawIndirectCount {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndexedIndirectCountKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDrawIndexedIndirectCountKHR.html>"]
pub unsafe fn cmd_draw_indexed_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
@ -27,7 +27,7 @@ impl DrawIndirectCount {
max_draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_indexed_indirect_count_khr)(
self.fp.cmd_draw_indexed_indirect_count_khr(
command_buffer,
buffer,
offset,
@ -38,7 +38,7 @@ impl DrawIndirectCount {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndirectCountKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDrawIndirectCountKHR.html>"]
pub unsafe fn cmd_draw_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
@ -49,7 +49,7 @@ impl DrawIndirectCount {
max_draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_indexed_indirect_count_khr)(
self.fp.cmd_draw_indexed_indirect_count_khr(
command_buffer,
buffer,
offset,
@ -60,7 +60,7 @@ impl DrawIndirectCount {
);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrDrawIndirectCountFn::name()
}

View File

@ -16,21 +16,22 @@ impl DynamicRendering {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderingKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBeginRenderingKHR.html>"]
pub unsafe fn cmd_begin_rendering(
&self,
command_buffer: vk::CommandBuffer,
rendering_info: &vk::RenderingInfoKHR,
) {
(self.fp.cmd_begin_rendering_khr)(command_buffer, rendering_info)
self.fp
.cmd_begin_rendering_khr(command_buffer, rendering_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderingKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdEndRenderingKHR.html>"]
pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_end_rendering_khr)(command_buffer)
self.fp.cmd_end_rendering_khr(command_buffer)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrDynamicRenderingFn::name()
}

View File

@ -19,18 +19,22 @@ impl ExternalFenceFd {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportFenceFdKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkImportFenceFdKHR.html>"]
pub unsafe fn import_fence_fd(&self, import_info: &vk::ImportFenceFdInfoKHR) -> VkResult<()> {
(self.fp.import_fence_fd_khr)(self.handle, import_info).result()
self.fp
.import_fence_fd_khr(self.handle, import_info)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceFdKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetFenceFdKHR.html>"]
pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1;
(self.fp.get_fence_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
self.fp
.get_fence_fd_khr(self.handle, get_info, &mut fd)
.result_with_success(fd)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrExternalFenceFdFn::name()
}

View File

@ -1,53 +0,0 @@
use crate::prelude::*;
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
use std::ptr;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence_win32.html>
#[derive(Clone)]
pub struct ExternalFenceWin32 {
handle: vk::Device,
fp: vk::KhrExternalFenceWin32Fn,
}
impl ExternalFenceWin32 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::KhrExternalFenceWin32Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportFenceWin32HandleKHR.html>
pub unsafe fn import_fence_win32_handle(
&self,
import_info: &vk::ImportFenceWin32HandleInfoKHR,
) -> VkResult<()> {
(self.fp.import_fence_win32_handle_khr)(self.handle, import_info).result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceWin32HandleKHR.html>
pub unsafe fn get_fence_win32_handle(
&self,
get_info: &vk::FenceGetWin32HandleInfoKHR,
) -> VkResult<vk::HANDLE> {
let mut handle = ptr::null_mut();
(self.fp.get_fence_win32_handle_khr)(self.handle, get_info, &mut handle)
.result_with_success(handle)
}
pub const fn name() -> &'static CStr {
vk::KhrExternalFenceWin32Fn::name()
}
pub fn fp(&self) -> &vk::KhrExternalFenceWin32Fn {
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

View File

@ -19,29 +19,27 @@ impl ExternalMemoryFd {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetMemoryFdKHR.html>"]
pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1;
(self.fp.get_memory_fd_khr)(self.handle, create_info, &mut fd).result_with_success(fd)
self.fp
.get_memory_fd_khr(self.handle, create_info, &mut fd)
.result_with_success(fd)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdPropertiesKHR.html>
pub unsafe fn get_memory_fd_properties(
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetMemoryFdPropertiesKHR.html>"]
pub unsafe fn get_memory_fd_properties_khr(
&self,
handle_type: vk::ExternalMemoryHandleTypeFlags,
fd: i32,
) -> VkResult<vk::MemoryFdPropertiesKHR> {
let mut memory_fd_properties = Default::default();
(self.fp.get_memory_fd_properties_khr)(
self.handle,
handle_type,
fd,
&mut memory_fd_properties,
)
.result_with_success(memory_fd_properties)
self.fp
.get_memory_fd_properties_khr(self.handle, handle_type, fd, &mut memory_fd_properties)
.result_with_success(memory_fd_properties)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrExternalMemoryFdFn::name()
}

View File

@ -1,61 +0,0 @@
use crate::prelude::*;
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
use std::ptr;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_memory_win32.html>
#[derive(Clone)]
pub struct ExternalMemoryWin32 {
handle: vk::Device,
fp: vk::KhrExternalMemoryWin32Fn,
}
impl ExternalMemoryWin32 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::KhrExternalMemoryWin32Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryWin32HandleKHR.html>
pub unsafe fn get_memory_win32_handle(
&self,
create_info: &vk::MemoryGetWin32HandleInfoKHR,
) -> VkResult<vk::HANDLE> {
let mut handle = ptr::null_mut();
(self.fp.get_memory_win32_handle_khr)(self.handle, create_info, &mut handle)
.result_with_success(handle)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryWin32HandlePropertiesKHR.html>
pub unsafe fn get_memory_win32_handle_properties(
&self,
handle_type: vk::ExternalMemoryHandleTypeFlags,
handle: vk::HANDLE,
) -> VkResult<vk::MemoryWin32HandlePropertiesKHR> {
let mut memory_win32_handle_properties = Default::default();
(self.fp.get_memory_win32_handle_properties_khr)(
self.handle,
handle_type,
handle,
&mut memory_win32_handle_properties,
)
.result_with_success(memory_win32_handle_properties)
}
pub const fn name() -> &'static CStr {
vk::KhrExternalMemoryWin32Fn::name()
}
pub fn fp(&self) -> &vk::KhrExternalMemoryWin32Fn {
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

View File

@ -19,21 +19,25 @@ impl ExternalSemaphoreFd {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportSemaphoreFdKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkImportSemaphoreFdKHR.html>"]
pub unsafe fn import_semaphore_fd(
&self,
import_info: &vk::ImportSemaphoreFdInfoKHR,
) -> VkResult<()> {
(self.fp.import_semaphore_fd_khr)(self.handle, import_info).result()
self.fp
.import_semaphore_fd_khr(self.handle, import_info)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreFdKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSemaphoreFdKHR.html>"]
pub unsafe fn get_semaphore_fd(&self, get_info: &vk::SemaphoreGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1;
(self.fp.get_semaphore_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
self.fp
.get_semaphore_fd_khr(self.handle, get_info, &mut fd)
.result_with_success(fd)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrExternalSemaphoreFdFn::name()
}

View File

@ -1,53 +0,0 @@
use crate::prelude::*;
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
use std::ptr;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore_win32.html>
#[derive(Clone)]
pub struct ExternalSemaphoreWin32 {
handle: vk::Device,
fp: vk::KhrExternalSemaphoreWin32Fn,
}
impl ExternalSemaphoreWin32 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::KhrExternalSemaphoreWin32Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportSemaphoreWin32HandleKHR.html>
pub unsafe fn import_semaphore_win32_handle(
&self,
import_info: &vk::ImportSemaphoreWin32HandleInfoKHR,
) -> VkResult<()> {
(self.fp.import_semaphore_win32_handle_khr)(self.handle, import_info).result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreWin32HandleKHR.html>
pub unsafe fn get_semaphore_win32_handle(
&self,
get_info: &vk::SemaphoreGetWin32HandleInfoKHR,
) -> VkResult<vk::HANDLE> {
let mut handle = ptr::null_mut();
(self.fp.get_semaphore_win32_handle_khr)(self.handle, get_info, &mut handle)
.result_with_success(handle)
}
pub const fn name() -> &'static CStr {
vk::KhrExternalSemaphoreWin32Fn::name()
}
pub fn fp(&self) -> &vk::KhrExternalSemaphoreWin32Fn {
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

View File

@ -19,31 +19,33 @@ impl GetMemoryRequirements2 {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferMemoryRequirements2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferMemoryRequirements2KHR.html>"]
pub unsafe fn get_buffer_memory_requirements2(
&self,
info: &vk::BufferMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
) {
(self.fp.get_buffer_memory_requirements2_khr)(self.handle, info, memory_requirements);
self.fp
.get_buffer_memory_requirements2_khr(self.handle, info, memory_requirements);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageMemoryRequirements2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageMemoryRequirements2KHR.html>"]
pub unsafe fn get_image_memory_requirements2(
&self,
info: &vk::ImageMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
) {
(self.fp.get_image_memory_requirements2_khr)(self.handle, info, memory_requirements);
self.fp
.get_image_memory_requirements2_khr(self.handle, info, memory_requirements);
}
/// Retrieve the number of elements to pass to [`get_image_sparse_memory_requirements2()`][Self::get_image_sparse_memory_requirements2()]
/// Retrieve the number of elements to pass to [`Self::get_image_sparse_memory_requirements2()`]
pub unsafe fn get_image_sparse_memory_requirements2_len(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
) -> usize {
let mut count = 0;
(self.fp.get_image_sparse_memory_requirements2_khr)(
self.fp.get_image_sparse_memory_requirements2_khr(
self.handle,
info,
&mut count,
@ -52,9 +54,9 @@ impl GetMemoryRequirements2 {
count as usize
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageSparseMemoryRequirements2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2KHR.html>"]
///
/// Call [`get_image_sparse_memory_requirements2_len()`][Self::get_image_sparse_memory_requirements2_len()] to query the number of elements to pass to `out`.
/// Call [`Self::get_image_sparse_memory_requirements2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_image_sparse_memory_requirements2(
&self,
@ -62,16 +64,15 @@ impl GetMemoryRequirements2 {
out: &mut [vk::SparseImageMemoryRequirements2KHR],
) {
let mut count = out.len() as u32;
(self.fp.get_image_sparse_memory_requirements2_khr)(
self.fp.get_image_sparse_memory_requirements2_khr(
self.handle,
info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrGetMemoryRequirements2Fn::name()
}

View File

@ -18,69 +18,73 @@ impl GetPhysicalDeviceProperties2 {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFeatures2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFeatures2KHR.html>"]
pub unsafe fn get_physical_device_features2(
&self,
physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2KHR,
) {
(self.fp.get_physical_device_features2_khr)(physical_device, features);
self.fp
.get_physical_device_features2_khr(physical_device, features);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFormatProperties2KHR.html>"]
pub unsafe fn get_physical_device_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format: vk::Format,
format_properties: &mut vk::FormatProperties2KHR,
) {
(self.fp.get_physical_device_format_properties2_khr)(
self.fp.get_physical_device_format_properties2_khr(
physical_device,
format,
format_properties,
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2KHR.html>"]
pub unsafe fn get_physical_device_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR,
image_format_properties: &mut vk::ImageFormatProperties2KHR,
) -> VkResult<()> {
(self.fp.get_physical_device_image_format_properties2_khr)(
physical_device,
image_format_info,
image_format_properties,
)
.result()
self.fp
.get_physical_device_image_format_properties2_khr(
physical_device,
image_format_info,
image_format_properties,
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2KHR.html>"]
pub unsafe fn get_physical_device_memory_properties2(
&self,
physical_device: vk::PhysicalDevice,
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR,
) {
(self.fp.get_physical_device_memory_properties2_khr)(physical_device, memory_properties);
self.fp
.get_physical_device_memory_properties2_khr(physical_device, memory_properties);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceProperties2KHR.html>"]
pub unsafe fn get_physical_device_properties2(
&self,
physical_device: vk::PhysicalDevice,
properties: &mut vk::PhysicalDeviceProperties2KHR,
) {
(self.fp.get_physical_device_properties2_khr)(physical_device, properties);
self.fp
.get_physical_device_properties2_khr(physical_device, properties);
}
/// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][Self::get_physical_device_queue_family_properties2()]
/// Retrieve the number of elements to pass to [`Self::get_physical_device_queue_family_properties2()`]
pub unsafe fn get_physical_device_queue_family_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
) -> usize {
let mut count = 0;
(self.fp.get_physical_device_queue_family_properties2_khr)(
self.fp.get_physical_device_queue_family_properties2_khr(
physical_device,
&mut count,
ptr::null_mut(),
@ -88,9 +92,9 @@ impl GetPhysicalDeviceProperties2 {
count as usize
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2KHR.html>"]
///
/// Call [`get_physical_device_queue_family_properties2_len()`][Self::get_physical_device_queue_family_properties2_len()] to query the number of elements to pass to `out`.
/// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
@ -98,35 +102,33 @@ impl GetPhysicalDeviceProperties2 {
out: &mut [vk::QueueFamilyProperties2KHR],
) {
let mut count = out.len() as u32;
(self.fp.get_physical_device_queue_family_properties2_khr)(
self.fp.get_physical_device_queue_family_properties2_khr(
physical_device,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
}
/// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][Self::get_physical_device_sparse_image_format_properties2()]
/// Retrieve the number of elements to pass to [`Self::get_physical_device_sparse_image_format_properties2()`]
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
) -> usize {
let mut count = 0;
(self
.fp
.get_physical_device_sparse_image_format_properties2_khr)(
physical_device,
format_info,
&mut count,
ptr::null_mut(),
);
self.fp
.get_physical_device_sparse_image_format_properties2_khr(
physical_device,
format_info,
&mut count,
ptr::null_mut(),
);
count as usize
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2KHR.html>"]
///
/// Call [`get_physical_device_sparse_image_format_properties2_len()`][Self::get_physical_device_sparse_image_format_properties2_len()] to query the number of elements to pass to `out`.
/// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
@ -135,18 +137,16 @@ impl GetPhysicalDeviceProperties2 {
out: &mut [vk::SparseImageFormatProperties2KHR],
) {
let mut count = out.len() as u32;
(self
.fp
.get_physical_device_sparse_image_format_properties2_khr)(
physical_device,
format_info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
self.fp
.get_physical_device_sparse_image_format_properties2_khr(
physical_device,
format_info,
&mut count,
out.as_mut_ptr(),
);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrGetPhysicalDeviceProperties2Fn::name()
}

View File

@ -1,79 +0,0 @@
use crate::prelude::*;
use crate::vk;
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct GetSurfaceCapabilities2 {
fp: vk::KhrGetSurfaceCapabilities2Fn,
}
impl GetSurfaceCapabilities2 {
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let fp = vk::KhrGetSurfaceCapabilities2Fn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
});
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceCapabilities2KHR.html>
pub unsafe fn get_physical_device_surface_capabilities2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<vk::SurfaceCapabilities2KHR> {
let mut surface_capabilities = Default::default();
(self.fp.get_physical_device_surface_capabilities2_khr)(
physical_device,
surface_info,
&mut surface_capabilities,
)
.result_with_success(surface_capabilities)
}
/// Retrieve the number of elements to pass to [`get_physical_device_surface_formats2()`][Self::get_physical_device_surface_formats2()]
pub unsafe fn get_physical_device_surface_formats2_len(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<usize> {
let mut count = 0;
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
physical_device,
surface_info,
&mut count,
std::ptr::null_mut(),
);
err_code.result_with_success(count as usize)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceFormats2KHR.html>
///
/// Call [`get_physical_device_surface_formats2_len()`][Self::get_physical_device_surface_formats2_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_surface_formats2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
out: &mut [vk::SurfaceFormat2KHR],
) -> VkResult<()> {
let mut count = out.len() as u32;
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
physical_device,
surface_info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
err_code.result()
}
pub const fn name() -> &'static CStr {
vk::KhrGetSurfaceCapabilities2Fn::name()
}
pub fn fp(&self) -> &vk::KhrGetSurfaceCapabilities2Fn {
&self.fp
}
}

View File

@ -18,16 +18,17 @@ impl Maintenance1 {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkTrimCommandPoolKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkTrimCommandPoolKHR.html>"]
pub unsafe fn trim_command_pool(
&self,
command_pool: vk::CommandPool,
flags: vk::CommandPoolTrimFlagsKHR,
) {
(self.fp.trim_command_pool_khr)(self.handle, command_pool, flags);
self.fp
.trim_command_pool_khr(self.handle, command_pool, flags);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrMaintenance1Fn::name()
}

View File

@ -18,16 +18,17 @@ impl Maintenance3 {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDescriptorSetLayoutSupportKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDescriptorSetLayoutSupportKHR.html>"]
pub unsafe fn get_descriptor_set_layout_support(
&self,
create_info: &vk::DescriptorSetLayoutCreateInfo,
out: &mut vk::DescriptorSetLayoutSupportKHR,
) {
(self.fp.get_descriptor_set_layout_support_khr)(self.handle, create_info, out);
self.fp
.get_descriptor_set_layout_support_khr(self.handle, create_info, out);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrMaintenance3Fn::name()
}

View File

@ -18,31 +18,33 @@ impl Maintenance4 {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceBufferMemoryRequirementsKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceBufferMemoryRequirementsKHR.html>"]
pub unsafe fn get_device_buffer_memory_requirements(
&self,
create_info: &vk::DeviceBufferMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2,
) {
(self.fp.get_device_buffer_memory_requirements_khr)(self.handle, create_info, out)
self.fp
.get_device_buffer_memory_requirements_khr(self.handle, create_info, out)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html>"]
pub unsafe fn get_device_image_memory_requirements(
&self,
create_info: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2,
) {
(self.fp.get_device_image_memory_requirements_khr)(self.handle, create_info, out)
self.fp
.get_device_image_memory_requirements_khr(self.handle, create_info, out)
}
/// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()]
/// Retrieve the number of elements to pass to [`Self::get_device_image_sparse_memory_requirements()`]
pub unsafe fn get_device_image_sparse_memory_requirements_len(
&self,
create_info: &vk::DeviceImageMemoryRequirementsKHR,
) -> usize {
let mut count = 0;
(self.fp.get_device_image_sparse_memory_requirements_khr)(
self.fp.get_device_image_sparse_memory_requirements_khr(
self.handle,
create_info,
&mut count,
@ -51,9 +53,9 @@ impl Maintenance4 {
count as usize
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageSparseMemoryRequirementsKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceImageSparseMemoryRequirementsKHR.html>"]
///
/// Call [`get_device_image_sparse_memory_requirements_len()`][Self::get_device_image_sparse_memory_requirements_len()] to query the number of elements to pass to `out`.
/// Call [`Self::get_device_image_sparse_memory_requirements_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_device_image_sparse_memory_requirements(
&self,
@ -61,16 +63,16 @@ impl Maintenance4 {
out: &mut [vk::SparseImageMemoryRequirements2],
) {
let mut count = out.len() as u32;
(self.fp.get_device_image_sparse_memory_requirements_khr)(
self.fp.get_device_image_sparse_memory_requirements_khr(
self.handle,
create_info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
assert_eq!(count, out.len() as u32);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrMaintenance4Fn::name()
}

View File

@ -1,7 +1,6 @@
pub use self::acceleration_structure::AccelerationStructure;
pub use self::android_surface::AndroidSurface;
pub use self::buffer_device_address::BufferDeviceAddress;
pub use self::copy_commands2::CopyCommands2;
pub use self::create_render_pass2::CreateRenderPass2;
pub use self::deferred_host_operations::DeferredHostOperations;
pub use self::display::Display;
@ -9,14 +8,10 @@ pub use self::display_swapchain::DisplaySwapchain;
pub use self::draw_indirect_count::DrawIndirectCount;
pub use self::dynamic_rendering::DynamicRendering;
pub use self::external_fence_fd::ExternalFenceFd;
pub use self::external_fence_win32::ExternalFenceWin32;
pub use self::external_memory_fd::ExternalMemoryFd;
pub use self::external_memory_win32::ExternalMemoryWin32;
pub use self::external_semaphore_fd::ExternalSemaphoreFd;
pub use self::external_semaphore_win32::ExternalSemaphoreWin32;
pub use self::get_memory_requirements2::GetMemoryRequirements2;
pub use self::get_physical_device_properties2::GetPhysicalDeviceProperties2;
pub use self::get_surface_capabilities2::GetSurfaceCapabilities2;
pub use self::maintenance1::Maintenance1;
pub use self::maintenance3::Maintenance3;
pub use self::maintenance4::Maintenance4;
@ -36,7 +31,6 @@ pub use self::xlib_surface::XlibSurface;
mod acceleration_structure;
mod android_surface;
mod buffer_device_address;
mod copy_commands2;
mod create_render_pass2;
mod deferred_host_operations;
mod display;
@ -44,14 +38,10 @@ mod display_swapchain;
mod draw_indirect_count;
mod dynamic_rendering;
mod external_fence_fd;
mod external_fence_win32;
mod external_memory_fd;
mod external_memory_win32;
mod external_semaphore_fd;
mod external_semaphore_win32;
mod get_memory_requirements2;
mod get_physical_device_properties2;
mod get_surface_capabilities2;
mod maintenance1;
mod maintenance3;
mod maintenance4;

View File

@ -19,43 +19,40 @@ impl PipelineExecutableProperties {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html>"]
pub unsafe fn get_pipeline_executable_internal_representations(
&self,
executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_internal_representations_khr)(
self.handle,
executable_info,
count,
data,
)
self.fp
.get_pipeline_executable_internal_representations_khr(
self.handle,
executable_info,
count,
data,
)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPipelineExecutablePropertiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutablePropertiesKHR.html>"]
pub unsafe fn get_pipeline_executable_properties(
&self,
pipeline_info: &vk::PipelineInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_properties_khr)(
self.handle,
pipeline_info,
count,
data,
)
self.fp
.get_pipeline_executable_properties_khr(self.handle, pipeline_info, count, data)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPipelineExecutableStatisticsKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutableStatisticsKHR.html>"]
pub unsafe fn get_pipeline_executable_statistics(
&self,
executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_statistics_khr)(
self.fp.get_pipeline_executable_statistics_khr(
self.handle,
executable_info,
count,
@ -64,7 +61,7 @@ impl PipelineExecutableProperties {
})
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrPipelineExecutablePropertiesFn::name()
}

View File

@ -19,17 +19,19 @@ impl PresentWait {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkWaitForPresentKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWaitForPresentKHR.html>"]
pub unsafe fn wait_for_present(
&self,
swapchain: vk::SwapchainKHR,
present_id: u64,
timeout: u64,
) -> VkResult<()> {
(self.fp.wait_for_present_khr)(self.handle, swapchain, present_id, timeout).result()
self.fp
.wait_for_present_khr(self.handle, swapchain, present_id, timeout)
.result()
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrPresentWaitFn::name()
}

View File

@ -17,7 +17,7 @@ impl PushDescriptor {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSetKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdPushDescriptorSetKHR.html>"]
pub unsafe fn cmd_push_descriptor_set(
&self,
command_buffer: vk::CommandBuffer,
@ -26,7 +26,7 @@ impl PushDescriptor {
set: u32,
descriptor_writes: &[vk::WriteDescriptorSet],
) {
(self.fp.cmd_push_descriptor_set_khr)(
self.fp.cmd_push_descriptor_set_khr(
command_buffer,
pipeline_bind_point,
layout,
@ -36,7 +36,7 @@ impl PushDescriptor {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSetWithTemplateKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdPushDescriptorSetWithTemplateKHR.html>"]
pub unsafe fn cmd_push_descriptor_set_with_template(
&self,
command_buffer: vk::CommandBuffer,
@ -45,7 +45,7 @@ impl PushDescriptor {
set: u32,
p_data: *const c_void,
) {
(self.fp.cmd_push_descriptor_set_with_template_khr)(
self.fp.cmd_push_descriptor_set_with_template_khr(
command_buffer,
descriptor_update_template,
layout,
@ -54,7 +54,7 @@ impl PushDescriptor {
);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrPushDescriptorFn::name()
}

View File

@ -32,7 +32,7 @@ impl RayTracingPipeline {
props_rt
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdTraceRaysKHR.html>"]
pub unsafe fn cmd_trace_rays(
&self,
command_buffer: vk::CommandBuffer,
@ -44,19 +44,19 @@ impl RayTracingPipeline {
height: u32,
depth: u32,
) {
(self.fp.cmd_trace_rays_khr)(
self.fp.cmd_trace_rays_khr(
command_buffer,
raygen_shader_binding_tables,
miss_shader_binding_tables,
hit_shader_binding_tables,
callable_shader_binding_tables,
raygen_shader_binding_tables as *const _,
miss_shader_binding_tables as *const _,
hit_shader_binding_tables as *const _,
callable_shader_binding_tables as *const _,
width,
height,
depth,
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateRayTracingPipelinesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateRayTracingPipelinesKHR.html>"]
pub unsafe fn create_ray_tracing_pipelines(
&self,
deferred_operation: vk::DeferredOperationKHR,
@ -65,19 +65,20 @@ impl RayTracingPipeline {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()];
(self.fp.create_ray_tracing_pipelines_khr)(
self.handle,
deferred_operation,
pipeline_cache,
create_info.len() as u32,
create_info.as_ptr(),
allocation_callbacks.as_raw_ptr(),
pipelines.as_mut_ptr(),
)
.result_with_success(pipelines)
self.fp
.create_ray_tracing_pipelines_khr(
self.handle,
deferred_operation,
pipeline_cache,
create_info.len() as u32,
create_info.as_ptr(),
allocation_callbacks.as_raw_ptr(),
pipelines.as_mut_ptr(),
)
.result_with_success(pipelines)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupHandlesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingShaderGroupHandlesKHR.html>"]
pub unsafe fn get_ray_tracing_shader_group_handles(
&self,
pipeline: vk::Pipeline,
@ -86,7 +87,7 @@ impl RayTracingPipeline {
data_size: usize,
) -> VkResult<Vec<u8>> {
let mut data = Vec::<u8>::with_capacity(data_size);
let err_code = (self.fp.get_ray_tracing_shader_group_handles_khr)(
let err_code = self.fp.get_ray_tracing_shader_group_handles_khr(
self.handle,
pipeline,
first_group,
@ -98,7 +99,7 @@ impl RayTracingPipeline {
err_code.result_with_success(data)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html>"]
pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles(
&self,
pipeline: vk::Pipeline,
@ -108,20 +109,19 @@ impl RayTracingPipeline {
) -> VkResult<Vec<u8>> {
let mut data: Vec<u8> = Vec::with_capacity(data_size);
(self
.fp
.get_ray_tracing_capture_replay_shader_group_handles_khr)(
self.handle,
pipeline,
first_group,
group_count,
data_size,
data.as_mut_ptr() as *mut _,
)
.result_with_success(data)
self.fp
.get_ray_tracing_capture_replay_shader_group_handles_khr(
self.handle,
pipeline,
first_group,
group_count,
data_size,
data.as_mut_ptr() as *mut _,
)
.result_with_success(data)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysIndirectKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdTraceRaysIndirectKHR.html>"]
pub unsafe fn cmd_trace_rays_indirect(
&self,
command_buffer: vk::CommandBuffer,
@ -131,7 +131,7 @@ impl RayTracingPipeline {
callable_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR],
indirect_device_address: vk::DeviceAddress,
) {
(self.fp.cmd_trace_rays_indirect_khr)(
self.fp.cmd_trace_rays_indirect_khr(
command_buffer,
raygen_shader_binding_table.as_ptr(),
miss_shader_binding_table.as_ptr(),
@ -141,14 +141,14 @@ impl RayTracingPipeline {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html>"]
pub unsafe fn get_ray_tracing_shader_group_stack_size(
&self,
pipeline: vk::Pipeline,
group: u32,
group_shader: vk::ShaderGroupShaderKHR,
) -> vk::DeviceSize {
(self.fp.get_ray_tracing_shader_group_stack_size_khr)(
self.fp.get_ray_tracing_shader_group_stack_size_khr(
self.handle,
pipeline,
group,
@ -156,16 +156,17 @@ impl RayTracingPipeline {
)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html>"]
pub unsafe fn cmd_set_ray_tracing_pipeline_stack_size(
&self,
command_buffer: vk::CommandBuffer,
pipeline_stack_size: u32,
) {
(self.fp.cmd_set_ray_tracing_pipeline_stack_size_khr)(command_buffer, pipeline_stack_size);
self.fp
.cmd_set_ray_tracing_pipeline_stack_size_khr(command_buffer, pipeline_stack_size);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrRayTracingPipelineFn::name()
}

View File

@ -20,7 +20,7 @@ impl Surface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceSupportKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceSupportKHR.html>"]
pub unsafe fn get_physical_device_surface_support(
&self,
physical_device: vk::PhysicalDevice,
@ -28,23 +28,24 @@ impl Surface {
surface: vk::SurfaceKHR,
) -> VkResult<bool> {
let mut b = 0;
(self.fp.get_physical_device_surface_support_khr)(
physical_device,
queue_family_index,
surface,
&mut b,
)
.result_with_success(b > 0)
self.fp
.get_physical_device_surface_support_khr(
physical_device,
queue_family_index,
surface,
&mut b,
)
.result_with_success(b > 0)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModesKHR.html>"]
pub unsafe fn get_physical_device_surface_present_modes(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_surface_present_modes_khr)(
self.fp.get_physical_device_surface_present_modes_khr(
physical_device,
surface,
count,
@ -53,42 +54,45 @@ impl Surface {
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceCapabilitiesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceCapabilitiesKHR.html>"]
pub unsafe fn get_physical_device_surface_capabilities(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<vk::SurfaceCapabilitiesKHR> {
let mut surface_capabilities = mem::zeroed();
(self.fp.get_physical_device_surface_capabilities_khr)(
physical_device,
surface,
&mut surface_capabilities,
)
.result_with_success(surface_capabilities)
self.fp
.get_physical_device_surface_capabilities_khr(
physical_device,
surface,
&mut surface_capabilities,
)
.result_with_success(surface_capabilities)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceFormatsKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceFormatsKHR.html>"]
pub unsafe fn get_physical_device_surface_formats(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::SurfaceFormatKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_surface_formats_khr)(physical_device, surface, count, data)
self.fp
.get_physical_device_surface_formats_khr(physical_device, surface, count, data)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroySurfaceKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroySurfaceKHR.html>"]
pub unsafe fn destroy_surface(
&self,
surface: vk::SurfaceKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_surface_khr)(self.handle, surface, allocation_callbacks.as_raw_ptr());
self.fp
.destroy_surface_khr(self.handle, surface, allocation_callbacks.as_raw_ptr());
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrSurfaceFn::name()
}

View File

@ -20,17 +20,18 @@ impl Swapchain {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroySwapchainKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroySwapchainKHR.html>"]
pub unsafe fn destroy_swapchain(
&self,
swapchain: vk::SwapchainKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_swapchain_khr)(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
self.fp
.destroy_swapchain_khr(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
}
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImageKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkAcquireNextImageKHR.html>"]
pub unsafe fn acquire_next_image(
&self,
swapchain: vk::SwapchainKHR,
@ -39,7 +40,7 @@ impl Swapchain {
fence: vk::Fence,
) -> VkResult<(u32, bool)> {
let mut index = 0;
let err_code = (self.fp.acquire_next_image_khr)(
let err_code = self.fp.acquire_next_image_khr(
self.handle,
swapchain,
timeout,
@ -54,30 +55,31 @@ impl Swapchain {
}
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateSwapchainKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateSwapchainKHR.html>"]
pub unsafe fn create_swapchain(
&self,
create_info: &vk::SwapchainCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SwapchainKHR> {
let mut swapchain = mem::zeroed();
(self.fp.create_swapchain_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut swapchain,
)
.result_with_success(swapchain)
self.fp
.create_swapchain_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut swapchain,
)
.result_with_success(swapchain)
}
/// On success, returns whether the swapchain is suboptimal for the surface.
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueuePresentKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueuePresentKHR.html>"]
pub unsafe fn queue_present(
&self,
queue: vk::Queue,
present_info: &vk::PresentInfoKHR,
) -> VkResult<bool> {
let err_code = (self.fp.queue_present_khr)(queue, present_info);
let err_code = self.fp.queue_present_khr(queue, present_info);
match err_code {
vk::Result::SUCCESS => Ok(false),
vk::Result::SUBOPTIMAL_KHR => Ok(true),
@ -85,17 +87,18 @@ impl Swapchain {
}
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSwapchainImagesKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSwapchainImagesKHR.html>"]
pub unsafe fn get_swapchain_images(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<Vec<vk::Image>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_swapchain_images_khr)(self.handle, swapchain, count, data)
self.fp
.get_swapchain_images_khr(self.handle, swapchain, count, data)
})
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrSwapchainFn::name()
}

View File

@ -17,36 +17,39 @@ impl Synchronization2 {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdPipelineBarrier2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdPipelineBarrier2KHR.html>"]
pub unsafe fn cmd_pipeline_barrier2(
&self,
command_buffer: vk::CommandBuffer,
dependency_info: &vk::DependencyInfoKHR,
) {
(self.fp.cmd_pipeline_barrier2_khr)(command_buffer, dependency_info)
self.fp
.cmd_pipeline_barrier2_khr(command_buffer, dependency_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResetEvent2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdResetEvent2KHR.html>"]
pub unsafe fn cmd_reset_event2(
&self,
command_buffer: vk::CommandBuffer,
event: vk::Event,
stage_mask: vk::PipelineStageFlags2KHR,
) {
(self.fp.cmd_reset_event2_khr)(command_buffer, event, stage_mask)
self.fp
.cmd_reset_event2_khr(command_buffer, event, stage_mask)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetEvent2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetEvent2KHR.html>"]
pub unsafe fn cmd_set_event2(
&self,
command_buffer: vk::CommandBuffer,
event: vk::Event,
dependency_info: &vk::DependencyInfoKHR,
) {
(self.fp.cmd_set_event2_khr)(command_buffer, event, dependency_info)
self.fp
.cmd_set_event2_khr(command_buffer, event, dependency_info)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWaitEvents2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdWaitEvents2KHR.html>"]
pub unsafe fn cmd_wait_events2(
&self,
command_buffer: vk::CommandBuffer,
@ -54,7 +57,7 @@ impl Synchronization2 {
dependency_infos: &[vk::DependencyInfoKHR],
) {
assert_eq!(events.len(), dependency_infos.len());
(self.fp.cmd_wait_events2_khr)(
self.fp.cmd_wait_events2_khr(
command_buffer,
events.len() as u32,
events.as_ptr(),
@ -62,7 +65,7 @@ impl Synchronization2 {
)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteTimestamp2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdWriteTimestamp2KHR.html>"]
pub unsafe fn cmd_write_timestamp2(
&self,
command_buffer: vk::CommandBuffer,
@ -70,20 +73,23 @@ impl Synchronization2 {
query_pool: vk::QueryPool,
query: u32,
) {
(self.fp.cmd_write_timestamp2_khr)(command_buffer, stage, query_pool, query)
self.fp
.cmd_write_timestamp2_khr(command_buffer, stage, query_pool, query)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueSubmit2KHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueSubmit2KHR.html>"]
pub unsafe fn queue_submit2(
&self,
queue: vk::Queue,
submits: &[vk::SubmitInfo2KHR],
fence: vk::Fence,
) -> VkResult<()> {
(self.fp.queue_submit2_khr)(queue, submits.len() as u32, submits.as_ptr(), fence).result()
self.fp
.queue_submit2_khr(queue, submits.len() as u32, submits.as_ptr(), fence)
.result()
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrSynchronization2Fn::name()
}

View File

@ -19,28 +19,33 @@ impl TimelineSemaphore {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreCounterValue.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSemaphoreCounterValue.html>"]
pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> {
let mut value = 0;
(self.fp.get_semaphore_counter_value_khr)(self.handle, semaphore, &mut value)
self.fp
.get_semaphore_counter_value_khr(self.handle, semaphore, &mut value)
.result_with_success(value)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkWaitSemaphores.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWaitSemaphores.html>"]
pub unsafe fn wait_semaphores(
&self,
wait_info: &vk::SemaphoreWaitInfo,
timeout: u64,
) -> VkResult<()> {
(self.fp.wait_semaphores_khr)(self.handle, wait_info, timeout).result()
self.fp
.wait_semaphores_khr(self.handle, wait_info, timeout)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSignalSemaphore.html>"]
pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
(self.fp.signal_semaphore_khr)(self.handle, signal_info).result()
self.fp
.signal_semaphore_khr(self.handle, signal_info)
.result()
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrTimelineSemaphoreFn::name()
}

View File

@ -20,39 +20,42 @@ impl WaylandSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateWaylandSurfaceKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateWaylandSurfaceKHR.html>"]
pub unsafe fn create_wayland_surface(
&self,
create_info: &vk::WaylandSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_wayland_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_wayland_surface_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceWaylandPresentationSupportKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceWaylandPresentationSupportKHR.html>"]
pub unsafe fn get_physical_device_wayland_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
wl_display: &mut vk::wl_display,
) -> bool {
let b = (self.fp.get_physical_device_wayland_presentation_support_khr)(
physical_device,
queue_family_index,
wl_display,
);
let b = self
.fp
.get_physical_device_wayland_presentation_support_khr(
physical_device,
queue_family_index,
wl_display,
);
b > 0
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrWaylandSurfaceFn::name()
}

View File

@ -20,29 +20,30 @@ impl Win32Surface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateWin32SurfaceKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateWin32SurfaceKHR.html>"]
pub unsafe fn create_win32_surface(
&self,
create_info: &vk::Win32SurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_win32_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_win32_surface_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceWin32PresentationSupportKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceWin32PresentationSupportKHR.html>"]
pub unsafe fn get_physical_device_win32_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
) -> bool {
let b = (self.fp.get_physical_device_win32_presentation_support_khr)(
let b = self.fp.get_physical_device_win32_presentation_support_khr(
physical_device,
queue_family_index,
);
@ -50,7 +51,7 @@ impl Win32Surface {
b > 0
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrWin32SurfaceFn::name()
}

View File

@ -20,23 +20,24 @@ impl XcbSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateXcbSurfaceKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateXcbSurfaceKHR.html>"]
pub unsafe fn create_xcb_surface(
&self,
create_info: &vk::XcbSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_xcb_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_xcb_surface_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceXcbPresentationSupportKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceXcbPresentationSupportKHR.html>"]
pub unsafe fn get_physical_device_xcb_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
@ -44,7 +45,7 @@ impl XcbSurface {
connection: &mut vk::xcb_connection_t,
visual_id: vk::xcb_visualid_t,
) -> bool {
let b = (self.fp.get_physical_device_xcb_presentation_support_khr)(
let b = self.fp.get_physical_device_xcb_presentation_support_khr(
physical_device,
queue_family_index,
connection,
@ -54,7 +55,7 @@ impl XcbSurface {
b > 0
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrXcbSurfaceFn::name()
}

View File

@ -20,23 +20,24 @@ impl XlibSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateXlibSurfaceKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateXlibSurfaceKHR.html>"]
pub unsafe fn create_xlib_surface(
&self,
create_info: &vk::XlibSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_xlib_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_xlib_surface_khr(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceXlibPresentationSupportKHR.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceXlibPresentationSupportKHR.html>"]
pub unsafe fn get_physical_device_xlib_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
@ -44,7 +45,7 @@ impl XlibSurface {
display: &mut vk::Display,
visual_id: vk::VisualID,
) -> bool {
let b = (self.fp.get_physical_device_xlib_presentation_support_khr)(
let b = self.fp.get_physical_device_xlib_presentation_support_khr(
physical_device,
queue_family_index,
display,
@ -54,7 +55,7 @@ impl XlibSurface {
b > 0
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::KhrXlibSurfaceFn::name()
}

View File

@ -20,23 +20,24 @@ impl IOSSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateIOSSurfaceMVK.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateIOSSurfaceMVK.html>"]
pub unsafe fn create_ios_surface(
&self,
create_info: &vk::IOSSurfaceCreateInfoMVK,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_ios_surface_mvk)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_ios_surface_mvk(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::MvkIosSurfaceFn::name()
}

View File

@ -20,23 +20,24 @@ impl MacOSSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateMacOSSurfaceMVK.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateMacOSSurfaceMVK.html>"]
pub unsafe fn create_mac_os_surface(
&self,
create_info: &vk::MacOSSurfaceCreateInfoMVK,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_mac_os_surface_mvk)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_mac_os_surface_mvk(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::MvkMacosSurfaceFn::name()
}

View File

@ -20,23 +20,24 @@ impl ViSurface {
Self { handle, fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateViSurfaceNN.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateViSurfaceNN.html>"]
pub unsafe fn create_vi_surface(
&self,
create_info: &vk::ViSurfaceCreateInfoNN,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_vi_surface_nn)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
self.fp
.create_vi_surface_nn(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut surface,
)
.result_with_success(surface)
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::NnViSurfaceFn::name()
}

View File

@ -4,7 +4,6 @@ use std::ffi::CStr;
use std::mem;
use std::os::raw::c_void;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_NV_device_diagnostic_checkpoints.html>
#[derive(Clone)]
pub struct DeviceDiagnosticCheckpoints {
fp: vk::NvDeviceDiagnosticCheckpointsFn,
@ -18,37 +17,35 @@ impl DeviceDiagnosticCheckpoints {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetCheckpointNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetCheckpointNV.html>"]
pub unsafe fn cmd_set_checkpoint(
&self,
command_buffer: vk::CommandBuffer,
p_checkpoint_marker: *const c_void,
) {
(self.fp.cmd_set_checkpoint_nv)(command_buffer, p_checkpoint_marker);
self.fp
.cmd_set_checkpoint_nv(command_buffer, p_checkpoint_marker);
}
/// Retrieve the number of elements to pass to [`get_queue_checkpoint_data()`][Self::get_queue_checkpoint_data()]
pub unsafe fn get_queue_checkpoint_data_len(&self, queue: vk::Queue) -> usize {
let mut count = 0;
(self.fp.get_queue_checkpoint_data_nv)(queue, &mut count, std::ptr::null_mut());
count as usize
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetQueueCheckpointDataNV.html>"]
pub unsafe fn get_queue_checkpoint_data(&self, queue: vk::Queue) -> Vec<vk::CheckpointDataNV> {
let mut checkpoint_data_count: u32 = 0;
self.fp.get_queue_checkpoint_data_nv(
queue,
&mut checkpoint_data_count,
std::ptr::null_mut(),
);
let mut checkpoint_data: Vec<vk::CheckpointDataNV> =
vec![vk::CheckpointDataNV::default(); checkpoint_data_count as _];
self.fp.get_queue_checkpoint_data_nv(
queue,
&mut checkpoint_data_count,
checkpoint_data.as_mut_ptr(),
);
checkpoint_data
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetQueueCheckpointDataNV.html>
///
/// Call [`get_queue_checkpoint_data_len()`][Self::get_queue_checkpoint_data_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_queue_checkpoint_data(
&self,
queue: vk::Queue,
out: &mut [vk::CheckpointDataNV],
) {
let mut count = out.len() as u32;
(self.fp.get_queue_checkpoint_data_nv)(queue, &mut count, out.as_mut_ptr());
assert_eq!(count as usize, out.len());
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::NvDeviceDiagnosticCheckpointsFn::name()
}

View File

@ -16,17 +16,18 @@ impl MeshShader {
Self { fp }
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDrawMeshTasksNV.html>"]
pub unsafe fn cmd_draw_mesh_tasks(
&self,
command_buffer: vk::CommandBuffer,
task_count: u32,
first_task: u32,
) {
(self.fp.cmd_draw_mesh_tasks_nv)(command_buffer, task_count, first_task);
self.fp
.cmd_draw_mesh_tasks_nv(command_buffer, task_count, first_task);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDrawMeshTasksIndirectNV.html>"]
pub unsafe fn cmd_draw_mesh_tasks_indirect(
&self,
command_buffer: vk::CommandBuffer,
@ -35,16 +36,11 @@ impl MeshShader {
draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_mesh_tasks_indirect_nv)(
command_buffer,
buffer,
offset,
draw_count,
stride,
);
self.fp
.cmd_draw_mesh_tasks_indirect_nv(command_buffer, buffer, offset, draw_count, stride);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectCountNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDrawMeshTasksIndirectCountNV.html>"]
pub unsafe fn cmd_draw_mesh_tasks_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
@ -55,7 +51,7 @@ impl MeshShader {
max_draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_mesh_tasks_indirect_count_nv)(
self.fp.cmd_draw_mesh_tasks_indirect_count_nv(
command_buffer,
buffer,
offset,
@ -66,7 +62,7 @@ impl MeshShader {
);
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::NvMeshShaderFn::name()
}

View File

@ -32,42 +32,43 @@ impl RayTracing {
props_rt
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateAccelerationStructureNV.html>"]
pub unsafe fn create_acceleration_structure(
&self,
create_info: &vk::AccelerationStructureCreateInfoNV,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::AccelerationStructureNV> {
let mut accel_struct = mem::zeroed();
(self.fp.create_acceleration_structure_nv)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut accel_struct,
)
.result_with_success(accel_struct)
self.fp
.create_acceleration_structure_nv(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut accel_struct,
)
.result_with_success(accel_struct)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyAccelerationStructureNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyAccelerationStructureNV.html>"]
pub unsafe fn destroy_acceleration_structure(
&self,
accel_struct: vk::AccelerationStructureNV,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
(self.fp.destroy_acceleration_structure_nv)(
self.fp.destroy_acceleration_structure_nv(
self.handle,
accel_struct,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureMemoryRequirementsNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureMemoryRequirementsNV.html>"]
pub unsafe fn get_acceleration_structure_memory_requirements(
&self,
info: &vk::AccelerationStructureMemoryRequirementsInfoNV,
) -> vk::MemoryRequirements2KHR {
let mut requirements = mem::zeroed();
(self.fp.get_acceleration_structure_memory_requirements_nv)(
self.fp.get_acceleration_structure_memory_requirements_nv(
self.handle,
info,
&mut requirements,
@ -75,20 +76,21 @@ impl RayTracing {
requirements
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBindAccelerationStructureMemoryNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkBindAccelerationStructureMemoryNV.html>"]
pub unsafe fn bind_acceleration_structure_memory(
&self,
bind_info: &[vk::BindAccelerationStructureMemoryInfoNV],
) -> VkResult<()> {
(self.fp.bind_acceleration_structure_memory_nv)(
self.handle,
bind_info.len() as u32,
bind_info.as_ptr(),
)
.result()
self.fp
.bind_acceleration_structure_memory_nv(
self.handle,
bind_info.len() as u32,
bind_info.as_ptr(),
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBuildAccelerationStructureNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBuildAccelerationStructureNV.html>"]
pub unsafe fn cmd_build_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
@ -101,7 +103,7 @@ impl RayTracing {
scratch: vk::Buffer,
scratch_offset: vk::DeviceSize,
) {
(self.fp.cmd_build_acceleration_structure_nv)(
self.fp.cmd_build_acceleration_structure_nv(
command_buffer,
info,
instance_data,
@ -114,7 +116,7 @@ impl RayTracing {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdCopyAccelerationStructureNV.html>"]
pub unsafe fn cmd_copy_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
@ -122,10 +124,11 @@ impl RayTracing {
src: vk::AccelerationStructureNV,
mode: vk::CopyAccelerationStructureModeNV,
) {
(self.fp.cmd_copy_acceleration_structure_nv)(command_buffer, dst, src, mode);
self.fp
.cmd_copy_acceleration_structure_nv(command_buffer, dst, src, mode);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdTraceRaysNV.html>"]
pub unsafe fn cmd_trace_rays(
&self,
command_buffer: vk::CommandBuffer,
@ -144,7 +147,7 @@ impl RayTracing {
height: u32,
depth: u32,
) {
(self.fp.cmd_trace_rays_nv)(
self.fp.cmd_trace_rays_nv(
command_buffer,
raygen_shader_binding_table_buffer,
raygen_shader_binding_offset,
@ -163,7 +166,7 @@ impl RayTracing {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateRayTracingPipelinesNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateRayTracingPipelinesNV.html>"]
pub unsafe fn create_ray_tracing_pipelines(
&self,
pipeline_cache: vk::PipelineCache,
@ -171,18 +174,19 @@ impl RayTracing {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()];
(self.fp.create_ray_tracing_pipelines_nv)(
self.handle,
pipeline_cache,
create_info.len() as u32,
create_info.as_ptr(),
allocation_callbacks.as_raw_ptr(),
pipelines.as_mut_ptr(),
)
.result_with_success(pipelines)
self.fp
.create_ray_tracing_pipelines_nv(
self.handle,
pipeline_cache,
create_info.len() as u32,
create_info.as_ptr(),
allocation_callbacks.as_raw_ptr(),
pipelines.as_mut_ptr(),
)
.result_with_success(pipelines)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupHandlesNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingShaderGroupHandlesNV.html>"]
pub unsafe fn get_ray_tracing_shader_group_handles(
&self,
pipeline: vk::Pipeline,
@ -190,34 +194,36 @@ impl RayTracing {
group_count: u32,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_ray_tracing_shader_group_handles_nv)(
self.handle,
pipeline,
first_group,
group_count,
data.len(),
data.as_mut_ptr() as *mut std::ffi::c_void,
)
.result()
self.fp
.get_ray_tracing_shader_group_handles_nv(
self.handle,
pipeline,
first_group,
group_count,
data.len(),
data.as_mut_ptr() as *mut std::ffi::c_void,
)
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureHandleNV.html>"]
pub unsafe fn get_acceleration_structure_handle(
&self,
accel_struct: vk::AccelerationStructureNV,
) -> VkResult<u64> {
let mut handle: u64 = 0;
let handle_ptr: *mut u64 = &mut handle;
(self.fp.get_acceleration_structure_handle_nv)(
self.handle,
accel_struct,
std::mem::size_of::<u64>(),
handle_ptr as *mut std::ffi::c_void,
)
.result_with_success(handle)
self.fp
.get_acceleration_structure_handle_nv(
self.handle,
accel_struct,
std::mem::size_of::<u64>(),
handle_ptr as *mut std::ffi::c_void,
)
.result_with_success(handle)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesNV.html>"]
pub unsafe fn cmd_write_acceleration_structures_properties(
&self,
command_buffer: vk::CommandBuffer,
@ -226,7 +232,7 @@ impl RayTracing {
query_pool: vk::QueryPool,
first_query: u32,
) {
(self.fp.cmd_write_acceleration_structures_properties_nv)(
self.fp.cmd_write_acceleration_structures_properties_nv(
command_buffer,
structures.len() as u32,
structures.as_ptr(),
@ -236,12 +242,14 @@ impl RayTracing {
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCompileDeferredNV.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCompileDeferredNV.html>"]
pub unsafe fn compile_deferred(&self, pipeline: vk::Pipeline, shader: u32) -> VkResult<()> {
(self.fp.compile_deferred_nv)(self.handle, pipeline, shader).result()
self.fp
.compile_deferred_nv(self.handle, pipeline, shader)
.result()
}
pub const fn name() -> &'static CStr {
pub fn name() -> &'static CStr {
vk::NvRayTracingFn::name()
}

View File

@ -6,7 +6,7 @@ use std::mem;
use std::os::raw::c_char;
use std::ptr;
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkInstance.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkInstance.html>"]
#[derive(Clone)]
pub struct Instance {
pub(crate) handle: vk::Instance,
@ -14,13 +14,12 @@ pub struct Instance {
pub(crate) instance_fn_1_0: vk::InstanceFnV1_0,
pub(crate) instance_fn_1_1: vk::InstanceFnV1_1,
pub(crate) instance_fn_1_2: vk::InstanceFnV1_2,
pub(crate) instance_fn_1_3: vk::InstanceFnV1_3,
}
impl Instance {
pub unsafe fn load(static_fn: &vk::StaticFn, instance: vk::Instance) -> Self {
let load_fn = |name: &std::ffi::CStr| {
mem::transmute((static_fn.get_instance_proc_addr)(instance, name.as_ptr()))
mem::transmute(static_fn.get_instance_proc_addr(instance, name.as_ptr()))
};
Self {
@ -29,7 +28,6 @@ impl Instance {
instance_fn_1_0: vk::InstanceFnV1_0::load(load_fn),
instance_fn_1_1: vk::InstanceFnV1_1::load(load_fn),
instance_fn_1_2: vk::InstanceFnV1_2::load(load_fn),
instance_fn_1_3: vk::InstanceFnV1_3::load(load_fn),
}
}
@ -38,48 +36,6 @@ impl Instance {
}
}
/// Vulkan core 1.3
#[allow(non_camel_case_types)]
impl Instance {
pub fn fp_v1_3(&self) -> &vk::InstanceFnV1_3 {
&self.instance_fn_1_3
}
/// Retrieve the number of elements to pass to [`get_physical_device_tool_properties()`][Self::get_physical_device_tool_properties()]
pub unsafe fn get_physical_device_tool_properties_len(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<usize> {
let mut count = 0;
(self.instance_fn_1_3.get_physical_device_tool_properties)(
physical_device,
&mut count,
ptr::null_mut(),
)
.result_with_success(count as usize)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceToolProperties.html>
///
/// Call [`get_physical_device_tool_properties_len()`][Self::get_physical_device_tool_properties_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_tool_properties(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::PhysicalDeviceToolProperties],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self.instance_fn_1_3.get_physical_device_tool_properties)(
physical_device,
&mut count,
out.as_mut_ptr(),
)
.result()?;
assert_eq!(count as usize, out.len());
Ok(())
}
}
/// Vulkan core 1.2
#[allow(non_camel_case_types)]
impl Instance {
@ -95,147 +51,138 @@ impl Instance {
&self.instance_fn_1_1
}
/// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()]
/// Retrieve the number of elements to pass to [`Self::enumerate_physical_device_groups()`]
pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> {
let mut group_count = 0;
(self.instance_fn_1_1.enumerate_physical_device_groups)(
self.handle(),
&mut group_count,
ptr::null_mut(),
)
.result_with_success(group_count as usize)
self.instance_fn_1_1
.enumerate_physical_device_groups(self.handle(), &mut group_count, ptr::null_mut())
.result_with_success(group_count as usize)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDeviceGroups.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumeratePhysicalDeviceGroups.html>"]
///
/// Call [`enumerate_physical_device_groups_len()`][Self::enumerate_physical_device_groups_len()] to query the number of elements to pass to `out`.
/// Call [`Self::enumerate_physical_device_groups_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn enumerate_physical_device_groups(
&self,
out: &mut [vk::PhysicalDeviceGroupProperties],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self.instance_fn_1_1.enumerate_physical_device_groups)(
self.handle(),
&mut count,
out.as_mut_ptr(),
)
.result()?;
assert_eq!(count as usize, out.len());
Ok(())
let mut group_count = out.len() as u32;
self.instance_fn_1_1
.enumerate_physical_device_groups(self.handle(), &mut group_count, out.as_mut_ptr())
.result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFeatures2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFeatures2.html>"]
pub unsafe fn get_physical_device_features2(
&self,
physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2,
) {
(self.instance_fn_1_1.get_physical_device_features2)(physical_device, features);
self.instance_fn_1_1
.get_physical_device_features2(physical_device, features);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceProperties2.html>"]
pub unsafe fn get_physical_device_properties2(
&self,
physical_device: vk::PhysicalDevice,
prop: &mut vk::PhysicalDeviceProperties2,
) {
(self.instance_fn_1_1.get_physical_device_properties2)(physical_device, prop);
self.instance_fn_1_1
.get_physical_device_properties2(physical_device, prop);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFormatProperties2.html>"]
pub unsafe fn get_physical_device_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format: vk::Format,
out: &mut vk::FormatProperties2,
) {
(self.instance_fn_1_1.get_physical_device_format_properties2)(physical_device, format, out);
self.instance_fn_1_1
.get_physical_device_format_properties2(physical_device, format, out);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2.html>"]
pub unsafe fn get_physical_device_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceImageFormatInfo2,
image_format_prop: &mut vk::ImageFormatProperties2,
) -> VkResult<()> {
(self
.instance_fn_1_1
.get_physical_device_image_format_properties2)(
physical_device,
format_info,
image_format_prop,
)
.result()
self.instance_fn_1_1
.get_physical_device_image_format_properties2(
physical_device,
format_info,
image_format_prop,
)
.result()
}
/// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][Self::get_physical_device_queue_family_properties2()]
/// Retrieve the number of elements to pass to [`Self::get_physical_device_queue_family_properties2()`]
pub unsafe fn get_physical_device_queue_family_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
) -> usize {
let mut queue_count = 0;
(self
.instance_fn_1_1
.get_physical_device_queue_family_properties2)(
physical_device,
&mut queue_count,
ptr::null_mut(),
);
self.instance_fn_1_1
.get_physical_device_queue_family_properties2(
physical_device,
&mut queue_count,
ptr::null_mut(),
);
queue_count as usize
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2.html>"]
///
/// Call [`get_physical_device_queue_family_properties2_len()`][Self::get_physical_device_queue_family_properties2_len()] to query the number of elements to pass to `out`.
/// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::QueueFamilyProperties2],
) {
let mut count = out.len() as u32;
(self
.instance_fn_1_1
.get_physical_device_queue_family_properties2)(
physical_device,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
let mut queue_count = out.len() as u32;
self.instance_fn_1_1
.get_physical_device_queue_family_properties2(
physical_device,
&mut queue_count,
out.as_mut_ptr(),
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2.html>"]
pub unsafe fn get_physical_device_memory_properties2(
&self,
physical_device: vk::PhysicalDevice,
out: &mut vk::PhysicalDeviceMemoryProperties2,
) {
(self.instance_fn_1_1.get_physical_device_memory_properties2)(physical_device, out);
self.instance_fn_1_1
.get_physical_device_memory_properties2(physical_device, out);
}
/// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][Self::get_physical_device_sparse_image_format_properties2()]
/// Retrieve the number of elements to pass to [`Self::get_physical_device_sparse_image_format_properties2()`]
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2,
) -> usize {
let mut format_count = 0;
(self
.instance_fn_1_1
.get_physical_device_sparse_image_format_properties2)(
physical_device,
format_info,
&mut format_count,
ptr::null_mut(),
);
self.instance_fn_1_1
.get_physical_device_sparse_image_format_properties2(
physical_device,
format_info,
&mut format_count,
ptr::null_mut(),
);
format_count as usize
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2.html>"]
///
/// Call [`get_physical_device_sparse_image_format_properties2_len()`][Self::get_physical_device_sparse_image_format_properties2_len()] to query the number of elements to pass to `out`.
/// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
@ -243,64 +190,59 @@ impl Instance {
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2,
out: &mut [vk::SparseImageFormatProperties2],
) {
let mut count = out.len() as u32;
(self
.instance_fn_1_1
.get_physical_device_sparse_image_format_properties2)(
physical_device,
format_info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
let mut format_count = out.len() as u32;
self.instance_fn_1_1
.get_physical_device_sparse_image_format_properties2(
physical_device,
format_info,
&mut format_count,
out.as_mut_ptr(),
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceExternalBufferProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceExternalBufferProperties.html>"]
pub unsafe fn get_physical_device_external_buffer_properties(
&self,
physical_device: vk::PhysicalDevice,
external_buffer_info: &vk::PhysicalDeviceExternalBufferInfo,
out: &mut vk::ExternalBufferProperties,
) {
(self
.instance_fn_1_1
.get_physical_device_external_buffer_properties)(
physical_device,
external_buffer_info,
out,
);
self.instance_fn_1_1
.get_physical_device_external_buffer_properties(
physical_device,
external_buffer_info,
out,
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceExternalFenceProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceExternalFenceProperties.html>"]
pub unsafe fn get_physical_device_external_fence_properties(
&self,
physical_device: vk::PhysicalDevice,
external_fence_info: &vk::PhysicalDeviceExternalFenceInfo,
out: &mut vk::ExternalFenceProperties,
) {
(self
.instance_fn_1_1
.get_physical_device_external_fence_properties)(
physical_device,
external_fence_info,
out,
);
self.instance_fn_1_1
.get_physical_device_external_fence_properties(
physical_device,
external_fence_info,
out,
);
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceExternalSemaphoreProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceExternalSemaphoreProperties.html>"]
pub unsafe fn get_physical_device_external_semaphore_properties(
&self,
physical_device: vk::PhysicalDevice,
external_semaphore_info: &vk::PhysicalDeviceExternalSemaphoreInfo,
out: &mut vk::ExternalSemaphoreProperties,
) {
(self
.instance_fn_1_1
.get_physical_device_external_semaphore_properties)(
physical_device,
external_semaphore_info,
out,
);
self.instance_fn_1_1
.get_physical_device_external_semaphore_properties(
physical_device,
external_semaphore_info,
out,
);
}
}
@ -311,7 +253,7 @@ impl Instance {
&self.instance_fn_1_0
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDevice.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDevice.html>"]
///
/// # Safety
/// In order for the created [`Device`] to be valid for the duration of its
@ -324,38 +266,40 @@ impl Instance {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Device> {
let mut device = mem::zeroed();
(self.instance_fn_1_0.create_device)(
physical_device,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut device,
)
.result()?;
self.instance_fn_1_0
.create_device(
physical_device,
create_info,
allocation_callbacks.as_raw_ptr(),
&mut device,
)
.result()?;
Ok(Device::load(&self.instance_fn_1_0, device))
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceProcAddr.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceProcAddr.html>"]
pub unsafe fn get_device_proc_addr(
&self,
device: vk::Device,
p_name: *const c_char,
) -> vk::PFN_vkVoidFunction {
(self.instance_fn_1_0.get_device_proc_addr)(device, p_name)
self.instance_fn_1_0.get_device_proc_addr(device, p_name)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyInstance.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyInstance.html>"]
pub unsafe fn destroy_instance(&self, allocation_callbacks: Option<&vk::AllocationCallbacks>) {
(self.instance_fn_1_0.destroy_instance)(self.handle(), allocation_callbacks.as_raw_ptr());
self.instance_fn_1_0
.destroy_instance(self.handle(), allocation_callbacks.as_raw_ptr());
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFormatProperties.html>"]
pub unsafe fn get_physical_device_format_properties(
&self,
physical_device: vk::PhysicalDevice,
format: vk::Format,
) -> vk::FormatProperties {
let mut format_prop = mem::zeroed();
(self.instance_fn_1_0.get_physical_device_format_properties)(
self.instance_fn_1_0.get_physical_device_format_properties(
physical_device,
format,
&mut format_prop,
@ -363,7 +307,7 @@ impl Instance {
format_prop
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties.html>"]
pub unsafe fn get_physical_device_image_format_properties(
&self,
physical_device: vk::PhysicalDevice,
@ -374,84 +318,81 @@ impl Instance {
flags: vk::ImageCreateFlags,
) -> VkResult<vk::ImageFormatProperties> {
let mut image_format_prop = mem::zeroed();
(self
.instance_fn_1_0
.get_physical_device_image_format_properties)(
physical_device,
format,
typ,
tiling,
usage,
flags,
&mut image_format_prop,
)
.result_with_success(image_format_prop)
self.instance_fn_1_0
.get_physical_device_image_format_properties(
physical_device,
format,
typ,
tiling,
usage,
flags,
&mut image_format_prop,
)
.result_with_success(image_format_prop)
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceMemoryProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceMemoryProperties.html>"]
pub unsafe fn get_physical_device_memory_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> vk::PhysicalDeviceMemoryProperties {
let mut memory_prop = mem::zeroed();
(self.instance_fn_1_0.get_physical_device_memory_properties)(
physical_device,
&mut memory_prop,
);
self.instance_fn_1_0
.get_physical_device_memory_properties(physical_device, &mut memory_prop);
memory_prop
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceProperties.html>"]
pub unsafe fn get_physical_device_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> vk::PhysicalDeviceProperties {
let mut prop = mem::zeroed();
(self.instance_fn_1_0.get_physical_device_properties)(physical_device, &mut prop);
self.instance_fn_1_0
.get_physical_device_properties(physical_device, &mut prop);
prop
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties.html>"]
pub unsafe fn get_physical_device_queue_family_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> Vec<vk::QueueFamilyProperties> {
read_into_uninitialized_vector(|count, data| {
(self
.instance_fn_1_0
.get_physical_device_queue_family_properties)(
physical_device, count, data
);
self.instance_fn_1_0
.get_physical_device_queue_family_properties(physical_device, count, data);
vk::Result::SUCCESS
})
// The closure always returns SUCCESS
.unwrap()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFeatures.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFeatures.html>"]
pub unsafe fn get_physical_device_features(
&self,
physical_device: vk::PhysicalDevice,
) -> vk::PhysicalDeviceFeatures {
let mut prop = mem::zeroed();
(self.instance_fn_1_0.get_physical_device_features)(physical_device, &mut prop);
self.instance_fn_1_0
.get_physical_device_features(physical_device, &mut prop);
prop
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDevices.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumeratePhysicalDevices.html>"]
pub unsafe fn enumerate_physical_devices(&self) -> VkResult<Vec<vk::PhysicalDevice>> {
read_into_uninitialized_vector(|count, data| {
(self.instance_fn_1_0.enumerate_physical_devices)(self.handle(), count, data)
self.instance_fn_1_0
.enumerate_physical_devices(self.handle(), count, data)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateDeviceExtensionProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateDeviceExtensionProperties.html>"]
pub unsafe fn enumerate_device_extension_properties(
&self,
device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::ExtensionProperties>> {
read_into_uninitialized_vector(|count, data| {
(self.instance_fn_1_0.enumerate_device_extension_properties)(
self.instance_fn_1_0.enumerate_device_extension_properties(
device,
ptr::null(),
count,
@ -460,17 +401,18 @@ impl Instance {
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateDeviceLayerProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateDeviceLayerProperties.html>"]
pub unsafe fn enumerate_device_layer_properties(
&self,
device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::LayerProperties>> {
read_into_uninitialized_vector(|count, data| {
(self.instance_fn_1_0.enumerate_device_layer_properties)(device, count, data)
self.instance_fn_1_0
.enumerate_device_layer_properties(device, count, data)
})
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties.html>
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties.html>"]
pub unsafe fn get_physical_device_sparse_image_format_properties(
&self,
physical_device: vk::PhysicalDevice,
@ -481,18 +423,17 @@ impl Instance {
tiling: vk::ImageTiling,
) -> Vec<vk::SparseImageFormatProperties> {
read_into_uninitialized_vector(|count, data| {
(self
.instance_fn_1_0
.get_physical_device_sparse_image_format_properties)(
physical_device,
format,
typ,
samples,
usage,
tiling,
count,
data,
);
self.instance_fn_1_0
.get_physical_device_sparse_image_format_properties(
physical_device,
format,
typ,
samples,
usage,
tiling,
count,
data,
);
vk::Result::SUCCESS
})
// The closure always returns SUCCESS

View File

@ -1,5 +1,4 @@
#![deny(clippy::use_self)]
#![warn(trivial_casts, trivial_numeric_casts)]
#![allow(
clippy::too_many_arguments,
clippy::missing_safety_doc,
@ -8,7 +7,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
//! # Vulkan API
//!
//! <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/index.html>
//! <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/index.html>
//!
//! ## Examples
//!
@ -60,7 +59,8 @@ pub trait RawPtr<T> {
impl<'r, T> RawPtr<T> for Option<&'r T> {
fn as_raw_ptr(&self) -> *const T {
match *self {
Some(inner) => inner,
Some(inner) => inner as *const T,
_ => ::std::ptr::null(),
}
}
@ -74,15 +74,16 @@ mod tests {
let mut variable_pointers = vk::PhysicalDeviceVariablePointerFeatures::builder();
let mut corner = vk::PhysicalDeviceCornerSampledImageFeaturesNV::builder();
let chain = vec![
<*mut _>::cast(&mut variable_pointers),
<*mut _>::cast(&mut corner),
&variable_pointers as *const _ as usize,
&corner as *const _ as usize,
];
let mut device_create_info = vk::DeviceCreateInfo::builder()
.push_next(&mut corner)
.push_next(&mut variable_pointers);
let chain2: Vec<*mut vk::BaseOutStructure> = unsafe {
let chain2: Vec<usize> = unsafe {
vk::ptr_chain_iter(&mut device_create_info)
.skip(1)
.map(|ptr| ptr as usize)
.collect()
};
assert_eq!(chain, chain2);

View File

@ -26,7 +26,7 @@ impl vk::Result {
/// increased (and the vector is not large enough after querying the initial size),
/// requiring Ash to try again.
///
/// [`vkEnumerateInstanceExtensionProperties`]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html
/// [`vkEnumerateInstanceExtensionProperties`]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceExtensionProperties.html
pub(crate) unsafe fn read_into_uninitialized_vector<N: Copy + Default + TryInto<usize>, T>(
f: impl Fn(&mut N, *mut T) -> vk::Result,
) -> VkResult<Vec<T>>
@ -60,7 +60,7 @@ where
/// increased (and the vector is not large enough after querying the initial size),
/// requiring Ash to try again.
///
/// [`vkEnumerateInstanceExtensionProperties`]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html
/// [`vkEnumerateInstanceExtensionProperties`]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceExtensionProperties.html
pub(crate) unsafe fn read_into_defaulted_vector<
N: Copy + Default + TryInto<usize>,
T: Default + Clone,

View File

@ -29,19 +29,18 @@ pub use prelude::*;
/// Native bindings from Vulkan headers, generated by bindgen
#[allow(nonstandard_style)]
#[allow(deref_nullptr)]
#[allow(trivial_casts, trivial_numeric_casts)]
pub mod native;
mod platform_types;
pub use platform_types::*;
/// Iterates through the pointer chain. Includes the item that is passed into the function.
/// Stops at the last [`BaseOutStructure`] that has a null [`BaseOutStructure::p_next`] field.
pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut BaseOutStructure> {
let ptr = <*mut T>::cast::<BaseOutStructure>(ptr);
let ptr: *mut BaseOutStructure = ptr as *mut T as _;
(0..).scan(ptr, |p_ptr, _| {
if p_ptr.is_null() {
return None;
}
let n_ptr = (**p_ptr).p_next;
let n_ptr = (**p_ptr).p_next as *mut BaseOutStructure;
let old = *p_ptr;
*p_ptr = n_ptr;
Some(old)

View File

@ -4,14 +4,8 @@ use crate::vk::enums::*;
pub type GeometryFlagsNV = GeometryFlagsKHR;
pub type GeometryInstanceFlagsNV = GeometryInstanceFlagsKHR;
pub type BuildAccelerationStructureFlagsNV = BuildAccelerationStructureFlagsKHR;
pub type PrivateDataSlotCreateFlagsEXT = PrivateDataSlotCreateFlags;
pub type DescriptorUpdateTemplateCreateFlagsKHR = DescriptorUpdateTemplateCreateFlags;
pub type PipelineCreationFeedbackFlagsEXT = PipelineCreationFeedbackFlags;
pub type SemaphoreWaitFlagsKHR = SemaphoreWaitFlags;
pub type AccessFlags2KHR = AccessFlags2;
pub type PipelineStageFlags2KHR = PipelineStageFlags2;
pub type FormatFeatureFlags2KHR = FormatFeatureFlags2;
pub type RenderingFlagsKHR = RenderingFlags;
pub type PeerMemoryFeatureFlagsKHR = PeerMemoryFeatureFlags;
pub type MemoryAllocateFlagsKHR = MemoryAllocateFlags;
pub type CommandPoolTrimFlagsKHR = CommandPoolTrimFlags;
@ -25,14 +19,10 @@ pub type ExternalFenceFeatureFlagsKHR = ExternalFenceFeatureFlags;
pub type FenceImportFlagsKHR = FenceImportFlags;
pub type DescriptorBindingFlagsEXT = DescriptorBindingFlags;
pub type ResolveModeFlagsKHR = ResolveModeFlags;
pub type ToolPurposeFlagsEXT = ToolPurposeFlags;
pub type SubmitFlagsKHR = SubmitFlags;
pub type DescriptorUpdateTemplateKHR = DescriptorUpdateTemplate;
pub type SamplerYcbcrConversionKHR = SamplerYcbcrConversion;
pub type PrivateDataSlotEXT = PrivateDataSlot;
pub type DescriptorUpdateTemplateTypeKHR = DescriptorUpdateTemplateType;
pub type PointClippingBehaviorKHR = PointClippingBehavior;
pub type QueueGlobalPriorityEXT = QueueGlobalPriorityKHR;
pub type SemaphoreTypeKHR = SemaphoreType;
pub type CopyAccelerationStructureModeNV = CopyAccelerationStructureModeKHR;
pub type AccelerationStructureTypeNV = AccelerationStructureTypeKHR;
@ -45,9 +35,6 @@ pub type ChromaLocationKHR = ChromaLocation;
pub type SamplerReductionModeEXT = SamplerReductionMode;
pub type ShaderFloatControlsIndependenceKHR = ShaderFloatControlsIndependence;
pub type DriverIdKHR = DriverId;
pub type DevicePrivateDataCreateInfoEXT = DevicePrivateDataCreateInfo;
pub type PrivateDataSlotCreateInfoEXT = PrivateDataSlotCreateInfo;
pub type PhysicalDevicePrivateDataFeaturesEXT = PhysicalDevicePrivateDataFeatures;
pub type PhysicalDeviceFeatures2KHR = PhysicalDeviceFeatures2;
pub type PhysicalDeviceProperties2KHR = PhysicalDeviceProperties2;
pub type FormatProperties2KHR = FormatProperties2;
@ -99,10 +86,8 @@ pub type PhysicalDevice16BitStorageFeaturesKHR = PhysicalDevice16BitStorageFeatu
pub type PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR =
PhysicalDeviceShaderSubgroupExtendedTypesFeatures;
pub type BufferMemoryRequirementsInfo2KHR = BufferMemoryRequirementsInfo2;
pub type DeviceBufferMemoryRequirementsKHR = DeviceBufferMemoryRequirements;
pub type ImageMemoryRequirementsInfo2KHR = ImageMemoryRequirementsInfo2;
pub type ImageSparseMemoryRequirementsInfo2KHR = ImageSparseMemoryRequirementsInfo2;
pub type DeviceImageMemoryRequirementsKHR = DeviceImageMemoryRequirements;
pub type MemoryRequirements2KHR = MemoryRequirements2;
pub type SparseImageMemoryRequirements2KHR = SparseImageMemoryRequirements2;
pub type PhysicalDevicePointClippingPropertiesKHR = PhysicalDevicePointClippingProperties;
@ -122,24 +107,14 @@ pub type SamplerYcbcrConversionImageFormatPropertiesKHR =
pub type PhysicalDeviceSamplerFilterMinmaxPropertiesEXT =
PhysicalDeviceSamplerFilterMinmaxProperties;
pub type SamplerReductionModeCreateInfoEXT = SamplerReductionModeCreateInfo;
pub type PhysicalDeviceInlineUniformBlockFeaturesEXT = PhysicalDeviceInlineUniformBlockFeatures;
pub type PhysicalDeviceInlineUniformBlockPropertiesEXT = PhysicalDeviceInlineUniformBlockProperties;
pub type WriteDescriptorSetInlineUniformBlockEXT = WriteDescriptorSetInlineUniformBlock;
pub type DescriptorPoolInlineUniformBlockCreateInfoEXT = DescriptorPoolInlineUniformBlockCreateInfo;
pub type ImageFormatListCreateInfoKHR = ImageFormatListCreateInfo;
pub type PhysicalDeviceMaintenance3PropertiesKHR = PhysicalDeviceMaintenance3Properties;
pub type PhysicalDeviceMaintenance4FeaturesKHR = PhysicalDeviceMaintenance4Features;
pub type PhysicalDeviceMaintenance4PropertiesKHR = PhysicalDeviceMaintenance4Properties;
pub type DescriptorSetLayoutSupportKHR = DescriptorSetLayoutSupport;
pub type PhysicalDeviceShaderDrawParameterFeatures = PhysicalDeviceShaderDrawParametersFeatures;
pub type PhysicalDeviceShaderFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features;
pub type PhysicalDeviceFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features;
pub type PhysicalDeviceFloatControlsPropertiesKHR = PhysicalDeviceFloatControlsProperties;
pub type PhysicalDeviceHostQueryResetFeaturesEXT = PhysicalDeviceHostQueryResetFeatures;
pub type DeviceQueueGlobalPriorityCreateInfoEXT = DeviceQueueGlobalPriorityCreateInfoKHR;
pub type PhysicalDeviceGlobalPriorityQueryFeaturesEXT =
PhysicalDeviceGlobalPriorityQueryFeaturesKHR;
pub type QueueFamilyGlobalPriorityPropertiesEXT = QueueFamilyGlobalPriorityPropertiesKHR;
pub type PhysicalDeviceDescriptorIndexingFeaturesEXT = PhysicalDeviceDescriptorIndexingFeatures;
pub type PhysicalDeviceDescriptorIndexingPropertiesEXT = PhysicalDeviceDescriptorIndexingProperties;
pub type DescriptorSetLayoutBindingFlagsCreateInfoEXT = DescriptorSetLayoutBindingFlagsCreateInfo;
@ -179,64 +154,14 @@ pub type PhysicalDeviceImagelessFramebufferFeaturesKHR = PhysicalDeviceImageless
pub type FramebufferAttachmentsCreateInfoKHR = FramebufferAttachmentsCreateInfo;
pub type FramebufferAttachmentImageInfoKHR = FramebufferAttachmentImageInfo;
pub type RenderPassAttachmentBeginInfoKHR = RenderPassAttachmentBeginInfo;
pub type PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT =
PhysicalDeviceTextureCompressionASTCHDRFeatures;
pub type PipelineCreationFeedbackEXT = PipelineCreationFeedback;
pub type PipelineCreationFeedbackCreateInfoEXT = PipelineCreationFeedbackCreateInfo;
pub type QueryPoolCreateInfoINTEL = QueryPoolPerformanceQueryCreateInfoINTEL;
pub type PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR =
PhysicalDeviceSeparateDepthStencilLayoutsFeatures;
pub type AttachmentReferenceStencilLayoutKHR = AttachmentReferenceStencilLayout;
pub type AttachmentDescriptionStencilLayoutKHR = AttachmentDescriptionStencilLayout;
pub type PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT =
PhysicalDeviceShaderDemoteToHelperInvocationFeatures;
pub type PhysicalDeviceTexelBufferAlignmentPropertiesEXT =
PhysicalDeviceTexelBufferAlignmentProperties;
pub type PhysicalDeviceSubgroupSizeControlFeaturesEXT = PhysicalDeviceSubgroupSizeControlFeatures;
pub type PhysicalDeviceSubgroupSizeControlPropertiesEXT =
PhysicalDeviceSubgroupSizeControlProperties;
pub type PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT =
PipelineShaderStageRequiredSubgroupSizeCreateInfo;
pub type MemoryOpaqueCaptureAddressAllocateInfoKHR = MemoryOpaqueCaptureAddressAllocateInfo;
pub type DeviceMemoryOpaqueCaptureAddressInfoKHR = DeviceMemoryOpaqueCaptureAddressInfo;
pub type PhysicalDevicePipelineCreationCacheControlFeaturesEXT =
PhysicalDevicePipelineCreationCacheControlFeatures;
pub type PhysicalDeviceToolPropertiesEXT = PhysicalDeviceToolProperties;
pub type AabbPositionsNV = AabbPositionsKHR;
pub type TransformMatrixNV = TransformMatrixKHR;
pub type AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR;
pub type PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR =
PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures;
pub type PhysicalDeviceImageRobustnessFeaturesEXT = PhysicalDeviceImageRobustnessFeatures;
pub type BufferCopy2KHR = BufferCopy2;
pub type ImageCopy2KHR = ImageCopy2;
pub type ImageBlit2KHR = ImageBlit2;
pub type BufferImageCopy2KHR = BufferImageCopy2;
pub type ImageResolve2KHR = ImageResolve2;
pub type CopyBufferInfo2KHR = CopyBufferInfo2;
pub type CopyImageInfo2KHR = CopyImageInfo2;
pub type BlitImageInfo2KHR = BlitImageInfo2;
pub type CopyBufferToImageInfo2KHR = CopyBufferToImageInfo2;
pub type CopyImageToBufferInfo2KHR = CopyImageToBufferInfo2;
pub type ResolveImageInfo2KHR = ResolveImageInfo2;
pub type PhysicalDeviceShaderTerminateInvocationFeaturesKHR =
PhysicalDeviceShaderTerminateInvocationFeatures;
pub type MemoryBarrier2KHR = MemoryBarrier2;
pub type ImageMemoryBarrier2KHR = ImageMemoryBarrier2;
pub type BufferMemoryBarrier2KHR = BufferMemoryBarrier2;
pub type DependencyInfoKHR = DependencyInfo;
pub type SemaphoreSubmitInfoKHR = SemaphoreSubmitInfo;
pub type CommandBufferSubmitInfoKHR = CommandBufferSubmitInfo;
pub type SubmitInfo2KHR = SubmitInfo2;
pub type PhysicalDeviceSynchronization2FeaturesKHR = PhysicalDeviceSynchronization2Features;
pub type PhysicalDeviceShaderIntegerDotProductFeaturesKHR =
PhysicalDeviceShaderIntegerDotProductFeatures;
pub type PhysicalDeviceShaderIntegerDotProductPropertiesKHR =
PhysicalDeviceShaderIntegerDotProductProperties;
pub type FormatProperties3KHR = FormatProperties3;
pub type PipelineRenderingCreateInfoKHR = PipelineRenderingCreateInfo;
pub type RenderingInfoKHR = RenderingInfo;
pub type RenderingAttachmentInfoKHR = RenderingAttachmentInfo;
pub type PhysicalDeviceDynamicRenderingFeaturesKHR = PhysicalDeviceDynamicRenderingFeatures;
pub type CommandBufferInheritanceRenderingInfoKHR = CommandBufferInheritanceRenderingInfo;
pub type AttachmentSampleCountInfoNV = AttachmentSampleCountInfoAMD;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,5 +22,5 @@ pub const MAX_DEVICE_GROUP_SIZE: usize = 32;
pub const MAX_DRIVER_NAME_SIZE: usize = 256;
pub const MAX_DRIVER_INFO_SIZE: usize = 256;
pub const SHADER_UNUSED_KHR: u32 = !0;
pub const MAX_GLOBAL_PRIORITY_SIZE_KHR: usize = 16;
pub const MAX_GLOBAL_PRIORITY_SIZE_EXT: usize = 16;
pub const SHADER_UNUSED_NV: u32 = SHADER_UNUSED_KHR;

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
use std::fmt;
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkImageLayout.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageLayout.html>"]
pub struct ImageLayout(pub(crate) i32);
impl ImageLayout {
pub const fn from_raw(x: i32) -> Self {
@ -33,7 +33,7 @@ impl ImageLayout {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAttachmentLoadOp.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAttachmentLoadOp.html>"]
pub struct AttachmentLoadOp(pub(crate) i32);
impl AttachmentLoadOp {
pub const fn from_raw(x: i32) -> Self {
@ -50,7 +50,7 @@ impl AttachmentLoadOp {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAttachmentStoreOp.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAttachmentStoreOp.html>"]
pub struct AttachmentStoreOp(pub(crate) i32);
impl AttachmentStoreOp {
pub const fn from_raw(x: i32) -> Self {
@ -66,7 +66,7 @@ impl AttachmentStoreOp {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkImageType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageType.html>"]
pub struct ImageType(pub(crate) i32);
impl ImageType {
pub const fn from_raw(x: i32) -> Self {
@ -83,7 +83,7 @@ impl ImageType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkImageTiling.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageTiling.html>"]
pub struct ImageTiling(pub(crate) i32);
impl ImageTiling {
pub const fn from_raw(x: i32) -> Self {
@ -99,7 +99,7 @@ impl ImageTiling {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkImageViewType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageViewType.html>"]
pub struct ImageViewType(pub(crate) i32);
impl ImageViewType {
pub const fn from_raw(x: i32) -> Self {
@ -120,7 +120,7 @@ impl ImageViewType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkCommandBufferLevel.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandBufferLevel.html>"]
pub struct CommandBufferLevel(pub(crate) i32);
impl CommandBufferLevel {
pub const fn from_raw(x: i32) -> Self {
@ -136,7 +136,7 @@ impl CommandBufferLevel {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkComponentSwizzle.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkComponentSwizzle.html>"]
pub struct ComponentSwizzle(pub(crate) i32);
impl ComponentSwizzle {
pub const fn from_raw(x: i32) -> Self {
@ -157,7 +157,7 @@ impl ComponentSwizzle {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDescriptorType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorType.html>"]
pub struct DescriptorType(pub(crate) i32);
impl DescriptorType {
pub const fn from_raw(x: i32) -> Self {
@ -182,7 +182,7 @@ impl DescriptorType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkQueryType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryType.html>"]
pub struct QueryType(pub(crate) i32);
impl QueryType {
pub const fn from_raw(x: i32) -> Self {
@ -200,7 +200,7 @@ impl QueryType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkBorderColor.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBorderColor.html>"]
pub struct BorderColor(pub(crate) i32);
impl BorderColor {
pub const fn from_raw(x: i32) -> Self {
@ -220,7 +220,7 @@ impl BorderColor {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPipelineBindPoint.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineBindPoint.html>"]
pub struct PipelineBindPoint(pub(crate) i32);
impl PipelineBindPoint {
pub const fn from_raw(x: i32) -> Self {
@ -236,7 +236,7 @@ impl PipelineBindPoint {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPipelineCacheHeaderVersion.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCacheHeaderVersion.html>"]
pub struct PipelineCacheHeaderVersion(pub(crate) i32);
impl PipelineCacheHeaderVersion {
pub const fn from_raw(x: i32) -> Self {
@ -251,7 +251,7 @@ impl PipelineCacheHeaderVersion {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPrimitiveTopology.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPrimitiveTopology.html>"]
pub struct PrimitiveTopology(pub(crate) i32);
impl PrimitiveTopology {
pub const fn from_raw(x: i32) -> Self {
@ -276,7 +276,7 @@ impl PrimitiveTopology {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSharingMode.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSharingMode.html>"]
pub struct SharingMode(pub(crate) i32);
impl SharingMode {
pub const fn from_raw(x: i32) -> Self {
@ -292,7 +292,7 @@ impl SharingMode {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkIndexType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkIndexType.html>"]
pub struct IndexType(pub(crate) i32);
impl IndexType {
pub const fn from_raw(x: i32) -> Self {
@ -308,7 +308,7 @@ impl IndexType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkFilter.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFilter.html>"]
pub struct Filter(pub(crate) i32);
impl Filter {
pub const fn from_raw(x: i32) -> Self {
@ -324,7 +324,7 @@ impl Filter {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSamplerMipmapMode.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSamplerMipmapMode.html>"]
pub struct SamplerMipmapMode(pub(crate) i32);
impl SamplerMipmapMode {
pub const fn from_raw(x: i32) -> Self {
@ -342,7 +342,7 @@ impl SamplerMipmapMode {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSamplerAddressMode.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSamplerAddressMode.html>"]
pub struct SamplerAddressMode(pub(crate) i32);
impl SamplerAddressMode {
pub const fn from_raw(x: i32) -> Self {
@ -360,7 +360,7 @@ impl SamplerAddressMode {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkCompareOp.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCompareOp.html>"]
pub struct CompareOp(pub(crate) i32);
impl CompareOp {
pub const fn from_raw(x: i32) -> Self {
@ -382,7 +382,7 @@ impl CompareOp {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPolygonMode.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPolygonMode.html>"]
pub struct PolygonMode(pub(crate) i32);
impl PolygonMode {
pub const fn from_raw(x: i32) -> Self {
@ -399,7 +399,7 @@ impl PolygonMode {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkFrontFace.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFrontFace.html>"]
pub struct FrontFace(pub(crate) i32);
impl FrontFace {
pub const fn from_raw(x: i32) -> Self {
@ -415,7 +415,7 @@ impl FrontFace {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkBlendFactor.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBlendFactor.html>"]
pub struct BlendFactor(pub(crate) i32);
impl BlendFactor {
pub const fn from_raw(x: i32) -> Self {
@ -448,7 +448,7 @@ impl BlendFactor {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkBlendOp.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBlendOp.html>"]
pub struct BlendOp(pub(crate) i32);
impl BlendOp {
pub const fn from_raw(x: i32) -> Self {
@ -467,7 +467,7 @@ impl BlendOp {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkStencilOp.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkStencilOp.html>"]
pub struct StencilOp(pub(crate) i32);
impl StencilOp {
pub const fn from_raw(x: i32) -> Self {
@ -489,7 +489,7 @@ impl StencilOp {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkLogicOp.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkLogicOp.html>"]
pub struct LogicOp(pub(crate) i32);
impl LogicOp {
pub const fn from_raw(x: i32) -> Self {
@ -519,7 +519,7 @@ impl LogicOp {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkInternalAllocationType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkInternalAllocationType.html>"]
pub struct InternalAllocationType(pub(crate) i32);
impl InternalAllocationType {
pub const fn from_raw(x: i32) -> Self {
@ -534,7 +534,7 @@ impl InternalAllocationType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSystemAllocationScope.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSystemAllocationScope.html>"]
pub struct SystemAllocationScope(pub(crate) i32);
impl SystemAllocationScope {
pub const fn from_raw(x: i32) -> Self {
@ -553,7 +553,7 @@ impl SystemAllocationScope {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceType.html>"]
pub struct PhysicalDeviceType(pub(crate) i32);
impl PhysicalDeviceType {
pub const fn from_raw(x: i32) -> Self {
@ -572,7 +572,7 @@ impl PhysicalDeviceType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVertexInputRate.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVertexInputRate.html>"]
pub struct VertexInputRate(pub(crate) i32);
impl VertexInputRate {
pub const fn from_raw(x: i32) -> Self {
@ -588,7 +588,7 @@ impl VertexInputRate {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkFormat.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFormat.html>"]
pub struct Format(pub(crate) i32);
impl Format {
pub const fn from_raw(x: i32) -> Self {
@ -787,7 +787,7 @@ impl Format {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkStructureType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkStructureType.html>"]
pub struct StructureType(pub(crate) i32);
impl StructureType {
pub const fn from_raw(x: i32) -> Self {
@ -852,7 +852,7 @@ impl StructureType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSubpassContents.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSubpassContents.html>"]
pub struct SubpassContents(pub(crate) i32);
impl SubpassContents {
pub const fn from_raw(x: i32) -> Self {
@ -868,7 +868,7 @@ impl SubpassContents {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkResult.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkResult.html>"]
#[must_use]
pub struct Result(pub(crate) i32);
impl Result {
@ -965,7 +965,7 @@ impl fmt::Display for Result {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDynamicState.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDynamicState.html>"]
pub struct DynamicState(pub(crate) i32);
impl DynamicState {
pub const fn from_raw(x: i32) -> Self {
@ -988,7 +988,7 @@ impl DynamicState {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDescriptorUpdateTemplateType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorUpdateTemplateType.html>"]
pub struct DescriptorUpdateTemplateType(pub(crate) i32);
impl DescriptorUpdateTemplateType {
pub const fn from_raw(x: i32) -> Self {
@ -1004,7 +1004,7 @@ impl DescriptorUpdateTemplateType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkObjectType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkObjectType.html>"]
pub struct ObjectType(pub(crate) i32);
impl ObjectType {
pub const fn from_raw(x: i32) -> Self {
@ -1044,7 +1044,7 @@ impl ObjectType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSemaphoreType.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphoreType.html>"]
pub struct SemaphoreType(pub(crate) i32);
impl SemaphoreType {
pub const fn from_raw(x: i32) -> Self {
@ -1060,7 +1060,7 @@ impl SemaphoreType {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPresentModeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPresentModeKHR.html>"]
pub struct PresentModeKHR(pub(crate) i32);
impl PresentModeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1078,7 +1078,7 @@ impl PresentModeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkColorSpaceKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkColorSpaceKHR.html>"]
pub struct ColorSpaceKHR(pub(crate) i32);
impl ColorSpaceKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1093,7 +1093,7 @@ impl ColorSpaceKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkTimeDomainEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkTimeDomainEXT.html>"]
pub struct TimeDomainEXT(pub(crate) i32);
impl TimeDomainEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1111,7 +1111,7 @@ impl TimeDomainEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDebugReportObjectTypeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugReportObjectTypeEXT.html>"]
pub struct DebugReportObjectTypeEXT(pub(crate) i32);
impl DebugReportObjectTypeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1157,7 +1157,7 @@ impl DebugReportObjectTypeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDeviceMemoryReportEventTypeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceMemoryReportEventTypeEXT.html>"]
pub struct DeviceMemoryReportEventTypeEXT(pub(crate) i32);
impl DeviceMemoryReportEventTypeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1176,7 +1176,7 @@ impl DeviceMemoryReportEventTypeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkRasterizationOrderAMD.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkRasterizationOrderAMD.html>"]
pub struct RasterizationOrderAMD(pub(crate) i32);
impl RasterizationOrderAMD {
pub const fn from_raw(x: i32) -> Self {
@ -1192,7 +1192,7 @@ impl RasterizationOrderAMD {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkValidationCheckEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkValidationCheckEXT.html>"]
pub struct ValidationCheckEXT(pub(crate) i32);
impl ValidationCheckEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1208,7 +1208,7 @@ impl ValidationCheckEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkValidationFeatureEnableEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkValidationFeatureEnableEXT.html>"]
pub struct ValidationFeatureEnableEXT(pub(crate) i32);
impl ValidationFeatureEnableEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1227,7 +1227,7 @@ impl ValidationFeatureEnableEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkValidationFeatureDisableEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkValidationFeatureDisableEXT.html>"]
pub struct ValidationFeatureDisableEXT(pub(crate) i32);
impl ValidationFeatureDisableEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1249,7 +1249,7 @@ impl ValidationFeatureDisableEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkIndirectCommandsTokenTypeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkIndirectCommandsTokenTypeNV.html>"]
pub struct IndirectCommandsTokenTypeNV(pub(crate) i32);
impl IndirectCommandsTokenTypeNV {
pub const fn from_raw(x: i32) -> Self {
@ -1271,7 +1271,7 @@ impl IndirectCommandsTokenTypeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDisplayPowerStateEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplayPowerStateEXT.html>"]
pub struct DisplayPowerStateEXT(pub(crate) i32);
impl DisplayPowerStateEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1288,7 +1288,7 @@ impl DisplayPowerStateEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDeviceEventTypeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceEventTypeEXT.html>"]
pub struct DeviceEventTypeEXT(pub(crate) i32);
impl DeviceEventTypeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1303,7 +1303,7 @@ impl DeviceEventTypeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDisplayEventTypeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplayEventTypeEXT.html>"]
pub struct DisplayEventTypeEXT(pub(crate) i32);
impl DisplayEventTypeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1318,7 +1318,7 @@ impl DisplayEventTypeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkViewportCoordinateSwizzleNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkViewportCoordinateSwizzleNV.html>"]
pub struct ViewportCoordinateSwizzleNV(pub(crate) i32);
impl ViewportCoordinateSwizzleNV {
pub const fn from_raw(x: i32) -> Self {
@ -1340,7 +1340,7 @@ impl ViewportCoordinateSwizzleNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDiscardRectangleModeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDiscardRectangleModeEXT.html>"]
pub struct DiscardRectangleModeEXT(pub(crate) i32);
impl DiscardRectangleModeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1356,7 +1356,7 @@ impl DiscardRectangleModeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPointClippingBehavior.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPointClippingBehavior.html>"]
pub struct PointClippingBehavior(pub(crate) i32);
impl PointClippingBehavior {
pub const fn from_raw(x: i32) -> Self {
@ -1372,7 +1372,7 @@ impl PointClippingBehavior {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSamplerReductionMode.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSamplerReductionMode.html>"]
pub struct SamplerReductionMode(pub(crate) i32);
impl SamplerReductionMode {
pub const fn from_raw(x: i32) -> Self {
@ -1389,7 +1389,7 @@ impl SamplerReductionMode {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkTessellationDomainOrigin.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkTessellationDomainOrigin.html>"]
pub struct TessellationDomainOrigin(pub(crate) i32);
impl TessellationDomainOrigin {
pub const fn from_raw(x: i32) -> Self {
@ -1405,7 +1405,7 @@ impl TessellationDomainOrigin {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSamplerYcbcrModelConversion.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSamplerYcbcrModelConversion.html>"]
pub struct SamplerYcbcrModelConversion(pub(crate) i32);
impl SamplerYcbcrModelConversion {
pub const fn from_raw(x: i32) -> Self {
@ -1428,7 +1428,7 @@ impl SamplerYcbcrModelConversion {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkSamplerYcbcrRange.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSamplerYcbcrRange.html>"]
pub struct SamplerYcbcrRange(pub(crate) i32);
impl SamplerYcbcrRange {
pub const fn from_raw(x: i32) -> Self {
@ -1446,7 +1446,7 @@ impl SamplerYcbcrRange {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkChromaLocation.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkChromaLocation.html>"]
pub struct ChromaLocation(pub(crate) i32);
impl ChromaLocation {
pub const fn from_raw(x: i32) -> Self {
@ -1462,7 +1462,7 @@ impl ChromaLocation {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkBlendOverlapEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBlendOverlapEXT.html>"]
pub struct BlendOverlapEXT(pub(crate) i32);
impl BlendOverlapEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1479,7 +1479,7 @@ impl BlendOverlapEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkCoverageModulationModeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCoverageModulationModeNV.html>"]
pub struct CoverageModulationModeNV(pub(crate) i32);
impl CoverageModulationModeNV {
pub const fn from_raw(x: i32) -> Self {
@ -1497,7 +1497,7 @@ impl CoverageModulationModeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkCoverageReductionModeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCoverageReductionModeNV.html>"]
pub struct CoverageReductionModeNV(pub(crate) i32);
impl CoverageReductionModeNV {
pub const fn from_raw(x: i32) -> Self {
@ -1513,7 +1513,7 @@ impl CoverageReductionModeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkValidationCacheHeaderVersionEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkValidationCacheHeaderVersionEXT.html>"]
pub struct ValidationCacheHeaderVersionEXT(pub(crate) i32);
impl ValidationCacheHeaderVersionEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1528,7 +1528,7 @@ impl ValidationCacheHeaderVersionEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkShaderInfoTypeAMD.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderInfoTypeAMD.html>"]
pub struct ShaderInfoTypeAMD(pub(crate) i32);
impl ShaderInfoTypeAMD {
pub const fn from_raw(x: i32) -> Self {
@ -1545,9 +1545,9 @@ impl ShaderInfoTypeAMD {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkQueueGlobalPriorityKHR.html>"]
pub struct QueueGlobalPriorityKHR(pub(crate) i32);
impl QueueGlobalPriorityKHR {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueueGlobalPriorityEXT.html>"]
pub struct QueueGlobalPriorityEXT(pub(crate) i32);
impl QueueGlobalPriorityEXT {
pub const fn from_raw(x: i32) -> Self {
Self(x)
}
@ -1555,19 +1555,15 @@ impl QueueGlobalPriorityKHR {
self.0
}
}
impl QueueGlobalPriorityKHR {
impl QueueGlobalPriorityEXT {
pub const LOW: Self = Self(128);
pub const MEDIUM: Self = Self(256);
pub const HIGH: Self = Self(512);
pub const REALTIME: Self = Self(1_024);
pub const LOW_EXT: Self = Self::LOW;
pub const MEDIUM_EXT: Self = Self::MEDIUM;
pub const HIGH_EXT: Self = Self::HIGH;
pub const REALTIME_EXT: Self = Self::REALTIME;
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkConservativeRasterizationModeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkConservativeRasterizationModeEXT.html>"]
pub struct ConservativeRasterizationModeEXT(pub(crate) i32);
impl ConservativeRasterizationModeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1584,7 +1580,7 @@ impl ConservativeRasterizationModeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVendorId.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVendorId.html>"]
pub struct VendorId(pub(crate) i32);
impl VendorId {
pub const fn from_raw(x: i32) -> Self {
@ -1610,7 +1606,7 @@ impl VendorId {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDriverId.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDriverId.html>"]
pub struct DriverId(pub(crate) i32);
impl DriverId {
pub const fn from_raw(x: i32) -> Self {
@ -1663,12 +1659,10 @@ impl DriverId {
pub const MESA_PANVK: Self = Self(20);
#[doc = "Samsung Electronics Co., Ltd."]
pub const SAMSUNG_PROPRIETARY: Self = Self(21);
#[doc = "Mesa open source project"]
pub const MESA_VENUS: Self = Self(22);
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkShadingRatePaletteEntryNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShadingRatePaletteEntryNV.html>"]
pub struct ShadingRatePaletteEntryNV(pub(crate) i32);
impl ShadingRatePaletteEntryNV {
pub const fn from_raw(x: i32) -> Self {
@ -1694,7 +1688,7 @@ impl ShadingRatePaletteEntryNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkCoarseSampleOrderTypeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCoarseSampleOrderTypeNV.html>"]
pub struct CoarseSampleOrderTypeNV(pub(crate) i32);
impl CoarseSampleOrderTypeNV {
pub const fn from_raw(x: i32) -> Self {
@ -1712,7 +1706,7 @@ impl CoarseSampleOrderTypeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkCopyAccelerationStructureModeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCopyAccelerationStructureModeKHR.html>"]
pub struct CopyAccelerationStructureModeKHR(pub(crate) i32);
impl CopyAccelerationStructureModeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1730,7 +1724,7 @@ impl CopyAccelerationStructureModeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkBuildAccelerationStructureModeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBuildAccelerationStructureModeKHR.html>"]
pub struct BuildAccelerationStructureModeKHR(pub(crate) i32);
impl BuildAccelerationStructureModeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1746,7 +1740,7 @@ impl BuildAccelerationStructureModeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAccelerationStructureTypeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureTypeKHR.html>"]
pub struct AccelerationStructureTypeKHR(pub(crate) i32);
impl AccelerationStructureTypeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1763,7 +1757,7 @@ impl AccelerationStructureTypeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkGeometryTypeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkGeometryTypeKHR.html>"]
pub struct GeometryTypeKHR(pub(crate) i32);
impl GeometryTypeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1780,7 +1774,7 @@ impl GeometryTypeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAccelerationStructureMemoryRequirementsTypeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureMemoryRequirementsTypeNV.html>"]
pub struct AccelerationStructureMemoryRequirementsTypeNV(pub(crate) i32);
impl AccelerationStructureMemoryRequirementsTypeNV {
pub const fn from_raw(x: i32) -> Self {
@ -1797,7 +1791,7 @@ impl AccelerationStructureMemoryRequirementsTypeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAccelerationStructureBuildTypeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureBuildTypeKHR.html>"]
pub struct AccelerationStructureBuildTypeKHR(pub(crate) i32);
impl AccelerationStructureBuildTypeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1814,7 +1808,7 @@ impl AccelerationStructureBuildTypeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkRayTracingShaderGroupTypeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkRayTracingShaderGroupTypeKHR.html>"]
pub struct RayTracingShaderGroupTypeKHR(pub(crate) i32);
impl RayTracingShaderGroupTypeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1831,7 +1825,7 @@ impl RayTracingShaderGroupTypeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAccelerationStructureCompatibilityKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureCompatibilityKHR.html>"]
pub struct AccelerationStructureCompatibilityKHR(pub(crate) i32);
impl AccelerationStructureCompatibilityKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1847,7 +1841,7 @@ impl AccelerationStructureCompatibilityKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkShaderGroupShaderKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderGroupShaderKHR.html>"]
pub struct ShaderGroupShaderKHR(pub(crate) i32);
impl ShaderGroupShaderKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1865,7 +1859,7 @@ impl ShaderGroupShaderKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkMemoryOverallocationBehaviorAMD.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryOverallocationBehaviorAMD.html>"]
pub struct MemoryOverallocationBehaviorAMD(pub(crate) i32);
impl MemoryOverallocationBehaviorAMD {
pub const fn from_raw(x: i32) -> Self {
@ -1882,7 +1876,7 @@ impl MemoryOverallocationBehaviorAMD {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkScopeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkScopeNV.html>"]
pub struct ScopeNV(pub(crate) i32);
impl ScopeNV {
pub const fn from_raw(x: i32) -> Self {
@ -1900,7 +1894,7 @@ impl ScopeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkComponentTypeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkComponentTypeNV.html>"]
pub struct ComponentTypeNV(pub(crate) i32);
impl ComponentTypeNV {
pub const fn from_raw(x: i32) -> Self {
@ -1925,7 +1919,7 @@ impl ComponentTypeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkFullScreenExclusiveEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFullScreenExclusiveEXT.html>"]
pub struct FullScreenExclusiveEXT(pub(crate) i32);
impl FullScreenExclusiveEXT {
pub const fn from_raw(x: i32) -> Self {
@ -1943,7 +1937,7 @@ impl FullScreenExclusiveEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPerformanceCounterScopeKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceCounterScopeKHR.html>"]
pub struct PerformanceCounterScopeKHR(pub(crate) i32);
impl PerformanceCounterScopeKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1960,7 +1954,7 @@ impl PerformanceCounterScopeKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPerformanceCounterUnitKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceCounterUnitKHR.html>"]
pub struct PerformanceCounterUnitKHR(pub(crate) i32);
impl PerformanceCounterUnitKHR {
pub const fn from_raw(x: i32) -> Self {
@ -1985,7 +1979,7 @@ impl PerformanceCounterUnitKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPerformanceCounterStorageKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceCounterStorageKHR.html>"]
pub struct PerformanceCounterStorageKHR(pub(crate) i32);
impl PerformanceCounterStorageKHR {
pub const fn from_raw(x: i32) -> Self {
@ -2005,7 +1999,7 @@ impl PerformanceCounterStorageKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPerformanceConfigurationTypeINTEL.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceConfigurationTypeINTEL.html>"]
pub struct PerformanceConfigurationTypeINTEL(pub(crate) i32);
impl PerformanceConfigurationTypeINTEL {
pub const fn from_raw(x: i32) -> Self {
@ -2020,7 +2014,7 @@ impl PerformanceConfigurationTypeINTEL {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkQueryPoolSamplingModeINTEL.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryPoolSamplingModeINTEL.html>"]
pub struct QueryPoolSamplingModeINTEL(pub(crate) i32);
impl QueryPoolSamplingModeINTEL {
pub const fn from_raw(x: i32) -> Self {
@ -2035,7 +2029,7 @@ impl QueryPoolSamplingModeINTEL {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPerformanceOverrideTypeINTEL.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceOverrideTypeINTEL.html>"]
pub struct PerformanceOverrideTypeINTEL(pub(crate) i32);
impl PerformanceOverrideTypeINTEL {
pub const fn from_raw(x: i32) -> Self {
@ -2051,7 +2045,7 @@ impl PerformanceOverrideTypeINTEL {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPerformanceParameterTypeINTEL.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceParameterTypeINTEL.html>"]
pub struct PerformanceParameterTypeINTEL(pub(crate) i32);
impl PerformanceParameterTypeINTEL {
pub const fn from_raw(x: i32) -> Self {
@ -2067,7 +2061,7 @@ impl PerformanceParameterTypeINTEL {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPerformanceValueTypeINTEL.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceValueTypeINTEL.html>"]
pub struct PerformanceValueTypeINTEL(pub(crate) i32);
impl PerformanceValueTypeINTEL {
pub const fn from_raw(x: i32) -> Self {
@ -2086,7 +2080,7 @@ impl PerformanceValueTypeINTEL {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkShaderFloatControlsIndependence.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderFloatControlsIndependence.html>"]
pub struct ShaderFloatControlsIndependence(pub(crate) i32);
impl ShaderFloatControlsIndependence {
pub const fn from_raw(x: i32) -> Self {
@ -2103,7 +2097,7 @@ impl ShaderFloatControlsIndependence {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPipelineExecutableStatisticFormatKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineExecutableStatisticFormatKHR.html>"]
pub struct PipelineExecutableStatisticFormatKHR(pub(crate) i32);
impl PipelineExecutableStatisticFormatKHR {
pub const fn from_raw(x: i32) -> Self {
@ -2121,7 +2115,7 @@ impl PipelineExecutableStatisticFormatKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkLineRasterizationModeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkLineRasterizationModeEXT.html>"]
pub struct LineRasterizationModeEXT(pub(crate) i32);
impl LineRasterizationModeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -2139,7 +2133,7 @@ impl LineRasterizationModeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkFragmentShadingRateCombinerOpKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFragmentShadingRateCombinerOpKHR.html>"]
pub struct FragmentShadingRateCombinerOpKHR(pub(crate) i32);
impl FragmentShadingRateCombinerOpKHR {
pub const fn from_raw(x: i32) -> Self {
@ -2158,7 +2152,7 @@ impl FragmentShadingRateCombinerOpKHR {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkFragmentShadingRateNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFragmentShadingRateNV.html>"]
pub struct FragmentShadingRateNV(pub(crate) i32);
impl FragmentShadingRateNV {
pub const fn from_raw(x: i32) -> Self {
@ -2184,7 +2178,7 @@ impl FragmentShadingRateNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkFragmentShadingRateTypeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFragmentShadingRateTypeNV.html>"]
pub struct FragmentShadingRateTypeNV(pub(crate) i32);
impl FragmentShadingRateTypeNV {
pub const fn from_raw(x: i32) -> Self {
@ -2200,7 +2194,7 @@ impl FragmentShadingRateTypeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkProvokingVertexModeEXT.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkProvokingVertexModeEXT.html>"]
pub struct ProvokingVertexModeEXT(pub(crate) i32);
impl ProvokingVertexModeEXT {
pub const fn from_raw(x: i32) -> Self {
@ -2216,7 +2210,7 @@ impl ProvokingVertexModeEXT {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAccelerationStructureMotionInstanceTypeNV.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureMotionInstanceTypeNV.html>"]
pub struct AccelerationStructureMotionInstanceTypeNV(pub(crate) i32);
impl AccelerationStructureMotionInstanceTypeNV {
pub const fn from_raw(x: i32) -> Self {
@ -2233,7 +2227,7 @@ impl AccelerationStructureMotionInstanceTypeNV {
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkQueryResultStatusKHR.html>"]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryResultStatusKHR.html>"]
pub struct QueryResultStatusKHR(pub(crate) i32);
impl QueryResultStatusKHR {
pub const fn from_raw(x: i32) -> Self {
@ -2293,10 +2287,10 @@ impl fmt::Debug for ObjectType {
Self::PERFORMANCE_CONFIGURATION_INTEL => Some("PERFORMANCE_CONFIGURATION_INTEL"),
Self::DEFERRED_OPERATION_KHR => Some("DEFERRED_OPERATION_KHR"),
Self::INDIRECT_COMMANDS_LAYOUT_NV => Some("INDIRECT_COMMANDS_LAYOUT_NV"),
Self::PRIVATE_DATA_SLOT_EXT => Some("PRIVATE_DATA_SLOT_EXT"),
Self::BUFFER_COLLECTION_FUCHSIA => Some("BUFFER_COLLECTION_FUCHSIA"),
Self::SAMPLER_YCBCR_CONVERSION => Some("SAMPLER_YCBCR_CONVERSION"),
Self::DESCRIPTOR_UPDATE_TEMPLATE => Some("DESCRIPTOR_UPDATE_TEMPLATE"),
Self::PRIVATE_DATA_SLOT => Some("PRIVATE_DATA_SLOT"),
_ => None,
};
if let Some(x) = name {
@ -2338,7 +2332,7 @@ impl fmt::Debug for Result {
Self::ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT => {
Some("ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT")
}
Self::ERROR_NOT_PERMITTED_KHR => Some("ERROR_NOT_PERMITTED_KHR"),
Self::ERROR_NOT_PERMITTED_EXT => Some("ERROR_NOT_PERMITTED_EXT"),
Self::ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT => {
Some("ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT")
}
@ -2346,13 +2340,13 @@ impl fmt::Debug for Result {
Self::THREAD_DONE_KHR => Some("THREAD_DONE_KHR"),
Self::OPERATION_DEFERRED_KHR => Some("OPERATION_DEFERRED_KHR"),
Self::OPERATION_NOT_DEFERRED_KHR => Some("OPERATION_NOT_DEFERRED_KHR"),
Self::PIPELINE_COMPILE_REQUIRED_EXT => Some("PIPELINE_COMPILE_REQUIRED_EXT"),
Self::ERROR_OUT_OF_POOL_MEMORY => Some("ERROR_OUT_OF_POOL_MEMORY"),
Self::ERROR_INVALID_EXTERNAL_HANDLE => Some("ERROR_INVALID_EXTERNAL_HANDLE"),
Self::ERROR_FRAGMENTATION => Some("ERROR_FRAGMENTATION"),
Self::ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS => {
Some("ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS")
}
Self::PIPELINE_COMPILE_REQUIRED => Some("PIPELINE_COMPILE_REQUIRED"),
_ => None,
};
if let Some(x) = name {

File diff suppressed because it is too large Load Diff

View File

@ -301,151 +301,3 @@ impl StructureType {
pub const MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: Self = Self(1_000_257_003);
pub const DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO: Self = Self(1_000_257_004);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl AccessFlags {
pub const NONE: Self = Self(0);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl AttachmentStoreOp {
pub const NONE: Self = Self(1_000_301_000);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl DescriptorType {
pub const INLINE_UNIFORM_BLOCK: Self = Self(1_000_138_000);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl DynamicState {
pub const CULL_MODE: Self = Self(1_000_267_000);
pub const FRONT_FACE: Self = Self(1_000_267_001);
pub const PRIMITIVE_TOPOLOGY: Self = Self(1_000_267_002);
pub const VIEWPORT_WITH_COUNT: Self = Self(1_000_267_003);
pub const SCISSOR_WITH_COUNT: Self = Self(1_000_267_004);
pub const VERTEX_INPUT_BINDING_STRIDE: Self = Self(1_000_267_005);
pub const DEPTH_TEST_ENABLE: Self = Self(1_000_267_006);
pub const DEPTH_WRITE_ENABLE: Self = Self(1_000_267_007);
pub const DEPTH_COMPARE_OP: Self = Self(1_000_267_008);
pub const DEPTH_BOUNDS_TEST_ENABLE: Self = Self(1_000_267_009);
pub const STENCIL_TEST_ENABLE: Self = Self(1_000_267_010);
pub const STENCIL_OP: Self = Self(1_000_267_011);
pub const RASTERIZER_DISCARD_ENABLE: Self = Self(1_000_377_001);
pub const DEPTH_BIAS_ENABLE: Self = Self(1_000_377_002);
pub const PRIMITIVE_RESTART_ENABLE: Self = Self(1_000_377_004);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl EventCreateFlags {
pub const DEVICE_ONLY: Self = Self(0b1);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl Format {
pub const G8_B8R8_2PLANE_444_UNORM: Self = Self(1_000_330_000);
pub const G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16: Self = Self(1_000_330_001);
pub const G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16: Self = Self(1_000_330_002);
pub const G16_B16R16_2PLANE_444_UNORM: Self = Self(1_000_330_003);
pub const A4R4G4B4_UNORM_PACK16: Self = Self(1_000_340_000);
pub const A4B4G4R4_UNORM_PACK16: Self = Self(1_000_340_001);
pub const ASTC_4X4_SFLOAT_BLOCK: Self = Self(1_000_066_000);
pub const ASTC_5X4_SFLOAT_BLOCK: Self = Self(1_000_066_001);
pub const ASTC_5X5_SFLOAT_BLOCK: Self = Self(1_000_066_002);
pub const ASTC_6X5_SFLOAT_BLOCK: Self = Self(1_000_066_003);
pub const ASTC_6X6_SFLOAT_BLOCK: Self = Self(1_000_066_004);
pub const ASTC_8X5_SFLOAT_BLOCK: Self = Self(1_000_066_005);
pub const ASTC_8X6_SFLOAT_BLOCK: Self = Self(1_000_066_006);
pub const ASTC_8X8_SFLOAT_BLOCK: Self = Self(1_000_066_007);
pub const ASTC_10X5_SFLOAT_BLOCK: Self = Self(1_000_066_008);
pub const ASTC_10X6_SFLOAT_BLOCK: Self = Self(1_000_066_009);
pub const ASTC_10X8_SFLOAT_BLOCK: Self = Self(1_000_066_010);
pub const ASTC_10X10_SFLOAT_BLOCK: Self = Self(1_000_066_011);
pub const ASTC_12X10_SFLOAT_BLOCK: Self = Self(1_000_066_012);
pub const ASTC_12X12_SFLOAT_BLOCK: Self = Self(1_000_066_013);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl ImageAspectFlags {
pub const NONE: Self = Self(0);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl ImageLayout {
pub const READ_ONLY_OPTIMAL: Self = Self(1_000_314_000);
pub const ATTACHMENT_OPTIMAL: Self = Self(1_000_314_001);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl ObjectType {
pub const PRIVATE_DATA_SLOT: Self = Self(1_000_295_000);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl PipelineCacheCreateFlags {
pub const EXTERNALLY_SYNCHRONIZED: Self = Self(0b1);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl PipelineCreateFlags {
pub const FAIL_ON_PIPELINE_COMPILE_REQUIRED: Self = Self(0b1_0000_0000);
pub const EARLY_RETURN_ON_FAILURE: Self = Self(0b10_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl PipelineShaderStageCreateFlags {
pub const ALLOW_VARYING_SUBGROUP_SIZE: Self = Self(0b1);
pub const REQUIRE_FULL_SUBGROUPS: Self = Self(0b10);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl PipelineStageFlags {
pub const NONE: Self = Self(0);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl Result {
pub const PIPELINE_COMPILE_REQUIRED: Self = Self(1_000_297_000);
}
#[doc = "Generated from 'VK_VERSION_1_3'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: Self = Self(53);
pub const PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES: Self = Self(54);
pub const PIPELINE_CREATION_FEEDBACK_CREATE_INFO: Self = Self(1_000_192_000);
pub const PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: Self = Self(1_000_215_000);
pub const PHYSICAL_DEVICE_TOOL_PROPERTIES: Self = Self(1_000_245_000);
pub const PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: Self =
Self(1_000_276_000);
pub const PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: Self = Self(1_000_295_000);
pub const DEVICE_PRIVATE_DATA_CREATE_INFO: Self = Self(1_000_295_001);
pub const PRIVATE_DATA_SLOT_CREATE_INFO: Self = Self(1_000_295_002);
pub const PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: Self = Self(1_000_297_000);
pub const MEMORY_BARRIER_2: Self = Self(1_000_314_000);
pub const BUFFER_MEMORY_BARRIER_2: Self = Self(1_000_314_001);
pub const IMAGE_MEMORY_BARRIER_2: Self = Self(1_000_314_002);
pub const DEPENDENCY_INFO: Self = Self(1_000_314_003);
pub const SUBMIT_INFO_2: Self = Self(1_000_314_004);
pub const SEMAPHORE_SUBMIT_INFO: Self = Self(1_000_314_005);
pub const COMMAND_BUFFER_SUBMIT_INFO: Self = Self(1_000_314_006);
pub const PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: Self = Self(1_000_314_007);
pub const PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: Self = Self(1_000_325_000);
pub const PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: Self = Self(1_000_335_000);
pub const COPY_BUFFER_INFO_2: Self = Self(1_000_337_000);
pub const COPY_IMAGE_INFO_2: Self = Self(1_000_337_001);
pub const COPY_BUFFER_TO_IMAGE_INFO_2: Self = Self(1_000_337_002);
pub const COPY_IMAGE_TO_BUFFER_INFO_2: Self = Self(1_000_337_003);
pub const BLIT_IMAGE_INFO_2: Self = Self(1_000_337_004);
pub const RESOLVE_IMAGE_INFO_2: Self = Self(1_000_337_005);
pub const BUFFER_COPY_2: Self = Self(1_000_337_006);
pub const IMAGE_COPY_2: Self = Self(1_000_337_007);
pub const IMAGE_BLIT_2: Self = Self(1_000_337_008);
pub const BUFFER_IMAGE_COPY_2: Self = Self(1_000_337_009);
pub const IMAGE_RESOLVE_2: Self = Self(1_000_337_010);
pub const PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES: Self = Self(1_000_225_000);
pub const PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: Self = Self(1_000_225_001);
pub const PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: Self = Self(1_000_225_002);
pub const PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: Self = Self(1_000_138_000);
pub const PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: Self = Self(1_000_138_001);
pub const WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK: Self = Self(1_000_138_002);
pub const DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO: Self = Self(1_000_138_003);
pub const PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: Self = Self(1_000_066_000);
pub const RENDERING_INFO: Self = Self(1_000_044_000);
pub const RENDERING_ATTACHMENT_INFO: Self = Self(1_000_044_001);
pub const PIPELINE_RENDERING_CREATE_INFO: Self = Self(1_000_044_002);
pub const PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: Self = Self(1_000_044_003);
pub const COMMAND_BUFFER_INHERITANCE_RENDERING_INFO: Self = Self(1_000_044_004);
pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: Self = Self(1_000_280_000);
pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: Self = Self(1_000_280_001);
pub const PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES: Self = Self(1_000_281_001);
pub const FORMAT_PROPERTIES_3: Self = Self(1_000_360_000);
pub const PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: Self = Self(1_000_413_000);
pub const PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES: Self = Self(1_000_413_001);
pub const DEVICE_BUFFER_MEMORY_REQUIREMENTS: Self = Self(1_000_413_002);
pub const DEVICE_IMAGE_MEMORY_REQUIREMENTS: Self = Self(1_000_413_003);
}

File diff suppressed because it is too large Load Diff

View File

@ -20,17 +20,17 @@ macro_rules! vk_bitflags_wrapped {
self.0
}
#[inline]
pub const fn is_empty(self) -> bool {
self.0 == Self::empty().0
pub fn is_empty(self) -> bool {
self == Self::empty()
}
#[inline]
pub const fn intersects(self, other: Self) -> bool {
!Self(self.0 & other.0).is_empty()
pub fn intersects(self, other: Self) -> bool {
self & other != Self::empty()
}
#[doc = r" Returns whether `other` is a subset of `self`"]
#[inline]
pub const fn contains(self, other: Self) -> bool {
self.0 & other.0 == other.0
pub fn contains(self, other: Self) -> bool {
self & other == other
}
}
impl ::std::ops::BitOr for $name {
@ -94,10 +94,10 @@ macro_rules! handle_nondispatchable {
impl Handle for $name {
const TYPE: ObjectType = ObjectType::$ty;
fn as_raw(self) -> u64 {
self.0
self.0 as u64
}
fn from_raw(x: u64) -> Self {
Self(x)
Self(x as _)
}
}
impl $name {

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,12 @@
use crate::vk;
/// Holds 24 bits in the least significant bits of memory,
/// and 8 bytes in the most significant bits of that memory,
/// occupying a single [`u32`] in total. This is commonly used in
/// [acceleration structure instances] such as
/// [`vk::AccelerationStructureInstanceKHR`],
/// [`vk::AccelerationStructureSRTMotionInstanceNV`] and
/// [`vk::AccelerationStructureMatrixMotionInstanceNV`].
/// [`vk::AccelerationStructureInstanceKHR`][super::AccelerationStructureInstanceKHR],
/// [`vk::AccelerationStructureSRTMotionInstanceNV`][super::AccelerationStructureSRTMotionInstanceNV] and
/// [`vk::AccelerationStructureMatrixMotionInstanceNV`][super::AccelerationStructureMatrixMotionInstanceNV].
///
/// [acceleration structure instances]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAccelerationStructureInstanceKHR.html#_description
/// [acceleration structure instances]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureInstanceKHR.html#_description
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[repr(transparent)]
pub struct Packed24_8(u32);
@ -28,31 +26,3 @@ impl Packed24_8 {
(self.0 >> 24) as u8
}
}
// Intradoc `Self::` links refuse to resolve if `ColorComponentFlags`
// isn't directly in scope: https://github.com/rust-lang/rust/issues/93205
use vk::ColorComponentFlags;
impl ColorComponentFlags {
/// Contraction of [`R`][Self::R] | [`G`][Self::G] | [`B`][Self::B] | [`A`][Self::A]
pub const RGBA: Self = Self(Self::R.0 | Self::G.0 | Self::B.0 | Self::A.0);
}
impl From<vk::Extent2D> for vk::Extent3D {
fn from(value: vk::Extent2D) -> Self {
Self {
width: value.width,
height: value.height,
depth: 1,
}
}
}
impl From<vk::Extent2D> for vk::Rect2D {
fn from(extent: vk::Extent2D) -> Self {
Self {
offset: Default::default(),
extent,
}
}
}

View File

@ -1 +1 @@
{"files":{"CHANGELOG.md":"c0ed28ff370cd6fdb2d83b135e4bb0249b1fe5c708c82118cf76aedf301c6e90","Cargo.toml":"e7b2b9d65289ece78f25a1f71badd0fc05eac4ed9000251e7f1e0519eb397fd4","README.md":"71f2c62c9f9a892b436adf130dab47348744ea05c98af95599d2e79b54fb25a5","appveyor.yml":"69e6279a533b60e4f7ba70e645a9c6b7aba1654105a1e1362e67ed14deca5368","bors.toml":"366ea95cdc64dae238edd4fe70a3d5f698b4dd22064abeb8d91550c81c8ccc67","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/com.rs":"8efc4f759c841d0be7b6fbd7ba77f9fc7e0e486a06bab68093812232713a2deb","src/command_allocator.rs":"b430fa99c7c541f5e592d6e9b8c83265b44f3f1b70205f9d44b4519e2d161cea","src/command_list.rs":"95ee2e40b6af96f3ac7471f4455e4121b4e13618d2d36f4ca7fa58887cbacdb6","src/debug.rs":"6d04c96fa2073ca8e3a4c29088c4f654c9bbd4944021196a209166ecf21520f9","src/descriptor.rs":"2951a15d14eda4a9d5a522d0d82cb69dfeb3ff4ef8656da1774800fe0ec79aa1","src/device.rs":"b4ac053d9a85d070d049eac7f243edae7afceb5c9f6d75ae1faddc2ec2875ca9","src/dxgi.rs":"89be1b4af66e3536283988bd990afa2bb8c99eae8610b8483fe5665a3595ef81","src/heap.rs":"bb4c0996c63da3dc14366aaa23068e7a3d2fb43d617f8645a5aef74767a463d6","src/lib.rs":"37d4705b9bd75a5816229e4933421deccf7e6df5fa6bd0cdba7752b063e69ad5","src/pso.rs":"1dcf102f061a3cadfc0de3fd75e2414f06c1bf9ac5727be1cbdd2204883093e4","src/query.rs":"53f64ef6f2212a1367f248191e4ab93a3facb18c37709f05f850c30bdc7be8cf","src/queue.rs":"3cd807b1df00ef9dd6ba5a28dcee883033ea174d3715b6de754c6f890159302a","src/resource.rs":"9a0f53f8f23fd671ae44370413274606ce62942bb16fc7370e6f32a2410b4255","src/sync.rs":"dcce20cfd2a408ad43ad6765a91d65dfe1998615cb56a3cfb60306094f2365a8"},"package":null}
{"files":{"CHANGELOG.md":"c0ed28ff370cd6fdb2d83b135e4bb0249b1fe5c708c82118cf76aedf301c6e90","Cargo.toml":"a28c00d11cfe7a3164b1eafb5c5c93b97533f51b498ce666e3c8932da42d310a","README.md":"71f2c62c9f9a892b436adf130dab47348744ea05c98af95599d2e79b54fb25a5","appveyor.yml":"69e6279a533b60e4f7ba70e645a9c6b7aba1654105a1e1362e67ed14deca5368","bors.toml":"366ea95cdc64dae238edd4fe70a3d5f698b4dd22064abeb8d91550c81c8ccc67","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/com.rs":"1610750dcf9bd9b4ca469d37675ddbad286880e2b187952df4af0b83641bf4c7","src/command_allocator.rs":"b430fa99c7c541f5e592d6e9b8c83265b44f3f1b70205f9d44b4519e2d161cea","src/command_list.rs":"95ee2e40b6af96f3ac7471f4455e4121b4e13618d2d36f4ca7fa58887cbacdb6","src/debug.rs":"6d04c96fa2073ca8e3a4c29088c4f654c9bbd4944021196a209166ecf21520f9","src/descriptor.rs":"45a4fd8a2d5b870b9754c54032d920774cbfcb5a6e29ac644117ffa1ad5b3eff","src/device.rs":"b4ac053d9a85d070d049eac7f243edae7afceb5c9f6d75ae1faddc2ec2875ca9","src/dxgi.rs":"36251ec2d55009796070df53591b3129e1eccadeeb0442818bc5d81065305050","src/heap.rs":"bb4c0996c63da3dc14366aaa23068e7a3d2fb43d617f8645a5aef74767a463d6","src/lib.rs":"21b72a9ef5ee0f4ad1fb1879e6e117568804de7ed01933739274e48a1c0d324d","src/pso.rs":"1dcf102f061a3cadfc0de3fd75e2414f06c1bf9ac5727be1cbdd2204883093e4","src/query.rs":"53f64ef6f2212a1367f248191e4ab93a3facb18c37709f05f850c30bdc7be8cf","src/queue.rs":"3cd807b1df00ef9dd6ba5a28dcee883033ea174d3715b6de754c6f890159302a","src/resource.rs":"9a0f53f8f23fd671ae44370413274606ce62942bb16fc7370e6f32a2410b4255","src/sync.rs":"dcce20cfd2a408ad43ad6765a91d65dfe1998615cb56a3cfb60306094f2365a8"},"package":"2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c"}

View File

@ -1,28 +1,38 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
[package]
edition = "2018"
name = "d3d12"
version = "0.4.1"
authors = [
"msiglreith <m.siglreith@gmail.com>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]
authors = ["msiglreith <m.siglreith@gmail.com>", "Dzmitry Malyshau <kvarkus@gmail.com>"]
description = "Low level D3D12 API wrapper"
repository = "https://github.com/gfx-rs/d3d12-rs"
keywords = ["windows", "graphics"]
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/d3d12"
keywords = ["windows", "graphics"]
categories = ["api-bindings", "graphics", "memory-management", "os::windows-apis"]
edition = "2018"
license = "MIT OR Apache-2.0"
repository = "https://github.com/gfx-rs/d3d12-rs"
[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
[dependencies.bitflags]
version = "1"
[features]
implicit-link = []
[dependencies]
bitflags = "1"
libloading = { version = "0.7", optional = true }
[dependencies.libloading]
version = "0.7"
optional = true
[dependencies.winapi]
version = "0.3"
features = ["dxgi1_2","dxgi1_3","dxgi1_4","dxgi1_5","dxgi1_6","dxgidebug","d3d12","d3d12sdklayers","d3dcommon","d3dcompiler","dxgiformat","synchapi","winerror"]
features = ["dxgi1_2", "dxgi1_3", "dxgi1_4", "dxgidebug", "d3d12", "d3d12sdklayers", "d3dcommon", "d3dcompiler", "dxgiformat", "synchapi", "winerror"]
[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
[features]
implicit-link = []

View File

@ -31,13 +31,9 @@ impl<T> WeakPtr<T> {
self.0
}
pub fn mut_void(&mut self) -> *mut *mut c_void {
pub unsafe fn mut_void(&mut self) -> *mut *mut c_void {
&mut self.0 as *mut *mut _ as *mut *mut _
}
pub fn mut_self(&mut self) -> *mut *mut T {
&mut self.0 as *mut *mut _
}
}
impl<T: Interface> WeakPtr<T> {
@ -104,160 +100,3 @@ impl<T> Hash for WeakPtr<T> {
self.0.hash(state);
}
}
/// Macro that allows generation of an easy to use enum for dealing with many different possible versions of a COM object.
///
/// Give the variants so that parents come before children. This often manifests as going up in order (1 -> 2 -> 3). This is vital for safety.
///
/// Three function names need to be attached to each variant. The examples are given for the MyComObject1 variant below:
/// - the from function (`WeakPtr<actual::ComObject1> -> Self`)
/// - the as function (`&self -> Option<WeakPtr<actual::ComObject1>>`)
/// - the unwrap function (`&self -> WeakPtr<actual::ComObject1>` panicing on failure to cast)
///
/// ```rust
/// # pub use d3d12::weak_com_inheritance_chain;
/// # mod actual {
/// # pub struct ComObject; impl winapi::Interface for ComObject { fn uuidof() -> winapi::shared::guiddef::GUID { todo!() } }
/// # pub struct ComObject1; impl winapi::Interface for ComObject1 { fn uuidof() -> winapi::shared::guiddef::GUID { todo!() } }
/// # pub struct ComObject2; impl winapi::Interface for ComObject2 { fn uuidof() -> winapi::shared::guiddef::GUID { todo!() } }
/// # }
/// weak_com_inheritance_chain! {
/// pub enum MyComObject {
/// MyComObject(actual::ComObject), from_my_com_object, as_my_com_object, my_com_object; // First variant doesn't use "unwrap" as it can never fail
/// MyComObject1(actual::ComObject1), from_my_com_object1, as_my_com_object1, unwrap_my_com_object1;
/// MyComObject2(actual::ComObject2), from_my_com_object2, as_my_com_object2, unwrap_my_com_object2;
/// }
/// }
/// ```
#[macro_export]
macro_rules! weak_com_inheritance_chain {
// We first match a human readable enum style, before going into the recursive section.
//
// Internal calls to the macro have either the prefix
// - @recursion_logic for the recursion and termination
// - @render_members for the actual call to fill in the members.
(
$(#[$meta:meta])*
$vis:vis enum $name:ident {
$first_variant:ident($first_type:ty), $first_from_name:ident, $first_as_name:ident, $first_unwrap_name:ident $(;)?
$($variant:ident($type:ty), $from_name:ident, $as_name:ident, $unwrap_name:ident);* $(;)?
}
) => {
$(#[$meta])*
$vis enum $name {
$first_variant($crate::WeakPtr<$first_type>),
$(
$variant($crate::WeakPtr<$type>)
),+
}
impl $name {
$vis unsafe fn destroy(&self) {
match *self {
Self::$first_variant(v) => v.destroy(),
$(
Self::$variant(v) => v.destroy(),
)*
}
}
$crate::weak_com_inheritance_chain! {
@recursion_logic,
$vis,
;
$first_variant($first_type), $first_from_name, $first_as_name, $first_unwrap_name;
$($variant($type), $from_name, $as_name, $unwrap_name);*
}
}
impl std::ops::Deref for $name {
type Target = $crate::WeakPtr<$first_type>;
fn deref(&self) -> &Self::Target {
self.$first_unwrap_name()
}
}
};
// This is the iteration case of the recursion. We instantiate the member functions for the variant we
// are currently at, recursing on ourself for the next variant. Note we only keep track of the previous
// variant name, not the functions names, as those are not needed.
(
@recursion_logic,
$vis:vis,
$(,)? $($prev_variant:ident),* $(,)?;
$this_variant:ident($this_type:ty), $this_from_name:ident, $this_as_name:ident, $this_unwrap_name:ident $(;)?
$($next_variant:ident($next_type:ty), $next_from_name:ident, $next_as_name:ident, $next_unwrap_name:ident);*
) => {
// Actually generate the members for this variant. Needs the previous and future variant names.
$crate::weak_com_inheritance_chain! {
@render_members,
$vis,
$this_from_name, $this_as_name, $this_unwrap_name;
$($prev_variant),*;
$this_variant($this_type);
$($next_variant),*;
}
// Recurse on ourselves. If there is no future variants left, we'll hit the base case as the final expansion returns no tokens.
$crate::weak_com_inheritance_chain! {
@recursion_logic,
$vis,
$($prev_variant),* , $this_variant;
$($next_variant($next_type), $next_from_name, $next_as_name, $next_unwrap_name);*
}
};
// Base case for recursion. There are no more variants left
(
@recursion_logic,
$vis:vis,
$($prev_variant:ident),*;
) => {};
// This is where we generate the members using the given names.
(
@render_members,
$vis:vis,
$from_name:ident, $as_name:ident, $unwrap_name:ident;
$($prev_variant:ident),*;
$variant:ident($type:ty);
$($next_variant:ident),*;
) => {
// Construct this enum from weak pointer to this interface. For best usability, always use the highest constructor you can. This doesn't try to upcast.
$vis unsafe fn $from_name(value: $crate::WeakPtr<$type>) -> Self {
Self::$variant(value)
}
// Returns Some if the value implements the interface otherwise returns None.
$vis fn $as_name(&self) -> Option<&$crate::WeakPtr<$type>> {
match *self {
$(
Self::$prev_variant(_) => None,
)*
Self::$variant(ref v) => Some(v),
$(
Self::$next_variant(ref v) => {
// v is &WeakPtr<NextType> and se cast to &WeakPtr<Type>
Some(unsafe { std::mem::transmute(v) })
}
)*
}
}
// Returns the interface if the value implements it, otherwise panics.
#[track_caller]
$vis fn $unwrap_name(&self) -> &$crate::WeakPtr<$type> {
match *self {
$(
Self::$prev_variant(_) => panic!(concat!("Tried to unwrap a ", stringify!($prev_variant), " as a ", stringify!($variant))),
)*
Self::$variant(ref v) => &*v,
$(
Self::$next_variant(ref v) => {
// v is &WeakPtr<NextType> and se cast to &WeakPtr<Type>
unsafe { std::mem::transmute(v) }
}
)*
}
}
};
}

View File

@ -156,7 +156,6 @@ impl RootParameter {
impl fmt::Debug for RootParameter {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
#[derive(Debug)]
#[allow(dead_code)] // False-positive
enum Inner<'a> {
Table(&'a [DescriptorRange]),
Constants { binding: Binding, num: u32 },

View File

@ -1,11 +1,8 @@
use crate::{com::WeakPtr, D3DResult, Resource, SampleDesc, HRESULT};
use crate::{com::WeakPtr, CommandQueue, D3DResult, Resource, SampleDesc, HRESULT};
use std::ptr;
use winapi::{
shared::{
dxgi, dxgi1_2, dxgi1_3, dxgi1_4, dxgi1_5, dxgi1_6, dxgiformat, dxgitype, minwindef::TRUE,
windef::HWND,
},
um::{d3d12, dxgidebug, unknwnbase::IUnknown},
shared::{dxgi, dxgi1_2, dxgi1_3, dxgi1_4, dxgiformat, dxgitype, windef::HWND},
um::{d3d12, dxgidebug},
Interface,
};
@ -42,53 +39,13 @@ pub enum AlphaMode {
ForceDword = dxgi1_2::DXGI_ALPHA_MODE_FORCE_DWORD,
}
pub type InfoQueue = WeakPtr<dxgidebug::IDXGIInfoQueue>;
pub type Adapter1 = WeakPtr<dxgi::IDXGIAdapter1>;
pub type Adapter2 = WeakPtr<dxgi1_2::IDXGIAdapter2>;
pub type Adapter3 = WeakPtr<dxgi1_4::IDXGIAdapter3>;
pub type Adapter4 = WeakPtr<dxgi1_6::IDXGIAdapter4>;
crate::weak_com_inheritance_chain! {
#[derive(Debug, Copy, Clone, PartialEq, Hash)]
pub enum DxgiAdapter {
Adapter1(dxgi::IDXGIAdapter1), from_adapter1, as_adapter1, adapter1;
Adapter2(dxgi1_2::IDXGIAdapter2), from_adapter2, as_adapter2, unwrap_adapter2;
Adapter3(dxgi1_4::IDXGIAdapter3), from_adapter3, as_adapter3, unwrap_adapter3;
Adapter4(dxgi1_6::IDXGIAdapter4), from_adapter4, as_adapter4, unwrap_adapter4;
}
}
pub type Factory1 = WeakPtr<dxgi::IDXGIFactory1>;
pub type Factory2 = WeakPtr<dxgi1_2::IDXGIFactory2>;
pub type Factory3 = WeakPtr<dxgi1_3::IDXGIFactory3>;
pub type Factory4 = WeakPtr<dxgi1_4::IDXGIFactory4>;
pub type Factory5 = WeakPtr<dxgi1_5::IDXGIFactory5>;
pub type Factory6 = WeakPtr<dxgi1_6::IDXGIFactory6>;
crate::weak_com_inheritance_chain! {
#[derive(Debug, Copy, Clone, PartialEq, Hash)]
pub enum DxgiFactory {
Factory1(dxgi::IDXGIFactory1), from_factory1, as_factory1, factory1;
Factory2(dxgi1_2::IDXGIFactory2), from_factory2, as_factory2, unwrap_factory2;
Factory3(dxgi1_3::IDXGIFactory3), from_factory3, as_factory3, unwrap_factory3;
Factory4(dxgi1_4::IDXGIFactory4), from_factory4, as_factory4, unwrap_factory4;
Factory5(dxgi1_5::IDXGIFactory5), from_factory5, as_factory5, unwrap_factory5;
Factory6(dxgi1_6::IDXGIFactory6), from_factory6, as_factory6, unwrap_factory6;
}
}
pub type InfoQueue = WeakPtr<dxgidebug::IDXGIInfoQueue>;
pub type SwapChain = WeakPtr<dxgi::IDXGISwapChain>;
pub type SwapChain1 = WeakPtr<dxgi1_2::IDXGISwapChain1>;
pub type SwapChain2 = WeakPtr<dxgi1_3::IDXGISwapChain2>;
pub type SwapChain3 = WeakPtr<dxgi1_4::IDXGISwapChain3>;
crate::weak_com_inheritance_chain! {
#[derive(Debug, Copy, Clone, PartialEq, Hash)]
pub enum DxgiSwapchain {
SwapChain(dxgi::IDXGISwapChain), from_swap_chain, as_swap_chain, swap_chain;
SwapChain1(dxgi1_2::IDXGISwapChain1), from_swap_chain1, as_swap_chain1, unwrap_swap_chain1;
SwapChain2(dxgi1_3::IDXGISwapChain2), from_swap_chain2, as_swap_chain2, unwrap_swap_chain2;
SwapChain3(dxgi1_4::IDXGISwapChain3), from_swap_chain3, as_swap_chain3, unwrap_swap_chain3;
}
}
#[cfg(feature = "libloading")]
#[derive(Debug)]
@ -125,21 +82,6 @@ impl DxgiLib {
Ok((factory, hr))
}
pub fn create_factory1(&self) -> Result<D3DResult<Factory1>, libloading::Error> {
type Fun = extern "system" fn(
winapi::shared::guiddef::REFIID,
*mut *mut winapi::ctypes::c_void,
) -> HRESULT;
let mut factory = Factory1::null();
let hr = unsafe {
let func: libloading::Symbol<Fun> = self.lib.get(b"CreateDXGIFactory1")?;
func(&dxgi::IDXGIFactory1::uuidof(), factory.mut_void())
};
Ok((factory, hr))
}
pub fn get_debug_interface1(&self) -> Result<D3DResult<InfoQueue>, libloading::Error> {
type Fun = extern "system" fn(
winapi::shared::minwindef::UINT,
@ -170,80 +112,38 @@ pub struct SwapchainDesc {
pub alpha_mode: AlphaMode,
pub flags: u32,
}
impl SwapchainDesc {
pub fn to_desc1(&self) -> dxgi1_2::DXGI_SWAP_CHAIN_DESC1 {
dxgi1_2::DXGI_SWAP_CHAIN_DESC1 {
AlphaMode: self.alpha_mode as _,
BufferCount: self.buffer_count,
Width: self.width,
Height: self.height,
Format: self.format,
Flags: self.flags,
BufferUsage: self.buffer_usage,
SampleDesc: dxgitype::DXGI_SAMPLE_DESC {
Count: self.sample.count,
Quality: self.sample.quality,
},
Scaling: self.scaling as _,
Stereo: self.stereo as _,
SwapEffect: self.swap_effect as _,
}
}
}
impl Factory1 {
pub fn create_swapchain(
&self,
queue: *mut IUnknown,
hwnd: HWND,
desc: &SwapchainDesc,
) -> D3DResult<SwapChain> {
let mut desc = dxgi::DXGI_SWAP_CHAIN_DESC {
BufferDesc: dxgitype::DXGI_MODE_DESC {
Width: desc.width,
Height: desc.width,
RefreshRate: dxgitype::DXGI_RATIONAL {
Numerator: 1,
Denominator: 60,
},
Format: desc.format,
ScanlineOrdering: dxgitype::DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED,
Scaling: dxgitype::DXGI_MODE_SCALING_UNSPECIFIED,
},
SampleDesc: dxgitype::DXGI_SAMPLE_DESC {
Count: desc.sample.count,
Quality: desc.sample.quality,
},
BufferUsage: desc.buffer_usage,
BufferCount: desc.buffer_count,
OutputWindow: hwnd,
Windowed: TRUE,
SwapEffect: desc.swap_effect as _,
Flags: desc.flags,
};
let mut swapchain = SwapChain::null();
let hr =
unsafe { self.CreateSwapChain(queue, &mut desc, swapchain.mut_void() as *mut *mut _) };
(swapchain, hr)
}
}
impl Factory2 {
// TODO: interface not complete
pub fn create_swapchain_for_hwnd(
&self,
queue: *mut IUnknown,
queue: CommandQueue,
hwnd: HWND,
desc: &SwapchainDesc,
) -> D3DResult<SwapChain1> {
let desc = dxgi1_2::DXGI_SWAP_CHAIN_DESC1 {
AlphaMode: desc.alpha_mode as _,
BufferCount: desc.buffer_count,
Width: desc.width,
Height: desc.height,
Format: desc.format,
Flags: desc.flags,
BufferUsage: desc.buffer_usage,
SampleDesc: dxgitype::DXGI_SAMPLE_DESC {
Count: desc.sample.count,
Quality: desc.sample.quality,
},
Scaling: desc.scaling as _,
Stereo: desc.stereo as _,
SwapEffect: desc.swap_effect as _,
};
let mut swap_chain = SwapChain1::null();
let hr = unsafe {
self.CreateSwapChainForHwnd(
queue,
queue.as_mut_ptr() as *mut _,
hwnd,
&desc.to_desc1(),
&desc,
ptr::null(),
ptr::null_mut(),
swap_chain.mut_void() as *mut *mut _,
@ -252,24 +152,6 @@ impl Factory2 {
(swap_chain, hr)
}
pub fn create_swapchain_for_composition(
&self,
queue: *mut IUnknown,
desc: &SwapchainDesc,
) -> D3DResult<SwapChain1> {
let mut swap_chain = SwapChain1::null();
let hr = unsafe {
self.CreateSwapChainForComposition(
queue,
&desc.to_desc1(),
ptr::null_mut(),
swap_chain.mut_void() as *mut *mut _,
)
};
(swap_chain, hr)
}
}
impl Factory4 {
@ -287,6 +169,10 @@ impl Factory4 {
(factory, hr)
}
pub fn as_factory2(&self) -> Factory2 {
unsafe { Factory2::from_raw(self.as_mut_ptr() as *mut _) }
}
pub fn enumerate_adapters(&self, id: u32) -> D3DResult<Adapter1> {
let mut adapter = Adapter1::null();
let hr = unsafe { self.EnumAdapters1(id, adapter.mut_void() as *mut *mut _) };
@ -328,7 +214,17 @@ impl SwapChain {
}
}
impl SwapChain1 {
pub fn as_swapchain0(&self) -> SwapChain {
unsafe { SwapChain::from_raw(self.as_mut_ptr() as *mut _) }
}
}
impl SwapChain3 {
pub fn as_swapchain0(&self) -> SwapChain {
unsafe { SwapChain::from_raw(self.as_mut_ptr() as *mut _) }
}
pub fn get_current_back_buffer_index(&self) -> u32 {
unsafe { self.GetCurrentBackBufferIndex() }
}

View File

@ -1,7 +1,7 @@
#[macro_use]
extern crate bitflags;
use std::{convert::TryFrom, ffi::CStr};
use std::ffi::CStr;
use winapi::{
shared::dxgiformat,
um::{d3d12, d3dcommon},
@ -64,7 +64,6 @@ pub struct SampleDesc {
}
#[repr(u32)]
#[non_exhaustive]
pub enum FeatureLevel {
L9_1 = d3dcommon::D3D_FEATURE_LEVEL_9_1,
L9_2 = d3dcommon::D3D_FEATURE_LEVEL_9_2,
@ -77,25 +76,6 @@ pub enum FeatureLevel {
L12_1 = d3dcommon::D3D_FEATURE_LEVEL_12_1,
}
impl TryFrom<u32> for FeatureLevel {
type Error = ();
fn try_from(value: u32) -> Result<Self, Self::Error> {
Ok(match value {
d3dcommon::D3D_FEATURE_LEVEL_9_1 => Self::L9_1,
d3dcommon::D3D_FEATURE_LEVEL_9_2 => Self::L9_2,
d3dcommon::D3D_FEATURE_LEVEL_9_3 => Self::L9_3,
d3dcommon::D3D_FEATURE_LEVEL_10_0 => Self::L10_0,
d3dcommon::D3D_FEATURE_LEVEL_10_1 => Self::L10_1,
d3dcommon::D3D_FEATURE_LEVEL_11_0 => Self::L11_0,
d3dcommon::D3D_FEATURE_LEVEL_11_1 => Self::L11_1,
d3dcommon::D3D_FEATURE_LEVEL_12_0 => Self::L12_0,
d3dcommon::D3D_FEATURE_LEVEL_12_1 => Self::L12_1,
_ => return Err(()),
})
}
}
pub type Blob = WeakPtr<d3dcommon::ID3DBlob>;
pub type Error = WeakPtr<d3dcommon::ID3DBlob>;

File diff suppressed because one or more lines are too long

View File

@ -57,9 +57,6 @@ name = "caps"
[[example]]
name = "argument-buffer"
[[example]]
name = "bindless"
[[example]]
name = "circle"
path = "examples/circle/main.rs"

View File

@ -12,77 +12,24 @@ fn main() {
autoreleasepool(|| {
let device = Device::system_default().expect("no device found");
/*
// Build encoder for the following MSL argument buffer:
struct ArgumentBuffer {
texture2d<float> texture [[id(0)]];
sampler sampler [[id(1)]];
array<device float *, 2> buffers [[id(2)]];
}
*/
let desc1 = ArgumentDescriptor::new();
desc1.set_index(0);
desc1.set_data_type(MTLDataType::Texture);
desc1.set_texture_type(MTLTextureType::D2);
let desc2 = ArgumentDescriptor::new();
desc2.set_index(1);
desc2.set_data_type(MTLDataType::Sampler);
desc2.set_index(1);
let desc3 = ArgumentDescriptor::new();
desc3.set_index(2);
desc3.set_data_type(MTLDataType::Pointer);
desc3.set_array_length(2);
let encoder = device.new_argument_encoder(&Array::from_slice(&[desc1, desc2]));
println!("{:?}", encoder);
let encoder = device.new_argument_encoder(Array::from_slice(&[desc1, desc2, desc3]));
println!("Encoder: {:?}", encoder);
let argument_buffer =
device.new_buffer(encoder.encoded_length(), MTLResourceOptions::empty());
encoder.set_argument_buffer(&argument_buffer, 0);
let buffer = device.new_buffer(encoder.encoded_length(), MTLResourceOptions::empty());
encoder.set_argument_buffer(&buffer, 0);
let sampler = {
let descriptor = SamplerDescriptor::new();
descriptor.set_support_argument_buffers(true);
device.new_sampler(&descriptor)
};
println!("{:?}", sampler);
let buffer1 = device.new_buffer(1024, MTLResourceOptions::empty());
println!("Buffer1: {:?}", buffer1);
let buffer2 = device.new_buffer(1024, MTLResourceOptions::empty());
println!("Buffer2: {:?}", buffer2);
encoder.set_sampler_state(1, &sampler);
encoder.set_buffer(2, &buffer1, 0);
encoder.set_buffer(3, &buffer2, 0);
// How to use argument buffer with render encoder.
let queue = device.new_command_queue();
let command_buffer = queue.new_command_buffer();
let render_pass_descriptor = RenderPassDescriptor::new();
let encoder = command_buffer.new_render_command_encoder(render_pass_descriptor);
// This method makes the array of resources resident for the selected stages of the render pass.
// Call this method before issuing any draw calls that may access the array of resources.
encoder.use_resources(
&[&buffer1, &buffer2],
MTLResourceUsage::Read,
MTLRenderStages::Vertex,
);
// Bind argument buffer to vertex stage.
encoder.set_vertex_buffer(0, Some(&argument_buffer), 0);
// Render pass here...
encoder.end_encoding();
println!("Encoder: {:?}", encoder);
command_buffer.commit();
println!("{:?}", sampler);
});
}

View File

@ -1,149 +0,0 @@
// Copyright 2017 GFX developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use metal::*;
use objc::rc::autoreleasepool;
const BINDLESS_TEXTURE_COUNT: NSUInteger = 100_000; // ~25Mb
/// This example demonstrates:
/// - How to create a heap
/// - How to allocate textures from heap.
/// - How to create bindless resources via Metal's argument buffers.
/// - How to bind argument buffer to render encoder
fn main() {
autoreleasepool(|| {
let device = Device::system_default().expect("no device found");
/*
MSL
struct Textures {
texture2d<float> texture;
};
struct BindlessTextures {
device Textures *textures;
};
*/
// Tier 2 argument buffers are supported by macOS devices with a discrete GPU and by the A13 GPU.
// The maximum per-app resources available at any given time are:
// - 500,000 buffers or textures
// - 2048 unique samplers
let tier = device.argument_buffers_support();
println!("Argument buffer support: {:?}", tier);
assert_eq!(MTLArgumentBuffersTier::Tier2, tier);
let texture_descriptor = TextureDescriptor::new();
texture_descriptor.set_width(1);
texture_descriptor.set_height(1);
texture_descriptor.set_depth(1);
texture_descriptor.set_texture_type(MTLTextureType::D2);
texture_descriptor.set_pixel_format(MTLPixelFormat::R8Uint);
texture_descriptor.set_storage_mode(MTLStorageMode::Private); // GPU only.
println!("Texture descriptor: {:?}", texture_descriptor);
// Determine the size required for the heap for the given descriptor
let size_and_align = device.heap_texture_size_and_align(&texture_descriptor);
// Align the size so that more resources will fit in the heap after this texture
// See https://developer.apple.com/documentation/metal/buffers/using_argument_buffers_with_resource_heaps
let texture_size =
(size_and_align.size & (size_and_align.align - 1)) + size_and_align.align;
let heap_size = texture_size * BINDLESS_TEXTURE_COUNT;
let heap_descriptor = HeapDescriptor::new();
heap_descriptor.set_storage_mode(texture_descriptor.storage_mode()); // Must be compatible
heap_descriptor.set_size(heap_size);
println!("Heap descriptor: {:?}", heap_descriptor);
let heap = device.new_heap(&heap_descriptor);
println!("Heap: {:?}", heap);
// Allocate textures from heap
let textures = (0..BINDLESS_TEXTURE_COUNT)
.map(|i| {
heap.new_texture(&texture_descriptor)
.expect(&format!("Failed to allocate texture {}", i))
})
.collect::<Vec<_>>();
// Crate argument encoder that knows how to encode single texture
let descriptor = ArgumentDescriptor::new();
descriptor.set_index(0);
descriptor.set_data_type(MTLDataType::Texture);
descriptor.set_texture_type(MTLTextureType::D2);
descriptor.set_access(MTLArgumentAccess::ReadOnly);
println!("Argument descriptor: {:?}", descriptor);
let encoder = device.new_argument_encoder(Array::from_slice(&[descriptor]));
println!("Encoder: {:?}", encoder);
// Determinate argument buffer size to allocate.
// Size needed to encode one texture * total number of bindless textures.
let argument_buffer_size = encoder.encoded_length() * BINDLESS_TEXTURE_COUNT;
let argument_buffer = device.new_buffer(argument_buffer_size, MTLResourceOptions::empty());
// Encode textures to the argument buffer.
textures.iter().enumerate().for_each(|(index, texture)| {
// Offset encoder to a proper texture slot
let offset = index as NSUInteger * encoder.encoded_length();
encoder.set_argument_buffer(&argument_buffer, offset);
encoder.set_texture(0, texture);
});
// How to use bindless argument buffer when drawing
let queue = device.new_command_queue();
let command_buffer = queue.new_command_buffer();
let render_pass_descriptor = RenderPassDescriptor::new();
let encoder = command_buffer.new_render_command_encoder(render_pass_descriptor);
// Bind argument buffer.
encoder.set_fragment_buffer(0, Some(&argument_buffer), 0);
// Make sure all textures are available to the pass.
encoder.use_heap_at(&heap, MTLRenderStages::Fragment);
// Bind material buffer at index 1
// Draw
/*
// Now instead of binding individual textures each draw call,
// you can just bind material information instead:
MSL
struct Material {
int diffuse_texture_index;
int normal_texture_index;
// ...
}
fragment float4 pixel(
VertexOut v [[stage_in]],
constant const BindlessTextures * textures [[buffer(0)]],
constant Material * material [[buffer(1)]]
) {
if (material->base_color_texture_index != -1) {
textures[material->diffuse_texture_index].texture.sampler(...)
}
if (material->normal_texture_index != -1) {
...
}
...
}
*/
encoder.end_encoding();
command_buffer.commit();
});
}

View File

@ -144,15 +144,4 @@ impl CommandBufferRef {
]
}
}
pub fn push_debug_group(&self, name: &str) {
unsafe {
let nslabel = crate::nsstring_from_str(name);
msg_send![self, pushDebugGroup: nslabel]
}
}
pub fn pop_debug_group(&self) {
unsafe { msg_send![self, popDebugGroup] }
}
}

View File

@ -121,20 +121,6 @@ pub enum MTLPixelFormat {
ASTC_10x10_LDR = 216,
ASTC_12x10_LDR = 217,
ASTC_12x12_LDR = 218,
ASTC_4x4_HDR = 222,
ASTC_5x4_HDR = 223,
ASTC_5x5_HDR = 224,
ASTC_6x5_HDR = 225,
ASTC_6x6_HDR = 226,
ASTC_8x5_HDR = 228,
ASTC_8x6_HDR = 229,
ASTC_8x8_HDR = 230,
ASTC_10x5_HDR = 231,
ASTC_10x6_HDR = 232,
ASTC_10x8_HDR = 233,
ASTC_10x10_HDR = 234,
ASTC_12x10_HDR = 235,
ASTC_12x12_HDR = 236,
GBGR422 = 240,
BGRG422 = 241,
Depth16Unorm = 250,

View File

@ -13,7 +13,6 @@ use objc::runtime::{Object, NO, YES};
use std::{ffi::CStr, os::raw::c_char, path::Path, ptr};
// Available on macOS 10.11+, iOS 8.0+, tvOS 9.0+
#[allow(non_camel_case_types)]
#[repr(u64)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
@ -45,14 +44,12 @@ pub enum MTLFeatureSet {
macOS_GPUFamily1_v1 = 10000,
macOS_GPUFamily1_v2 = 10001,
// Available on macOS 10.12+
macOS_ReadWriteTextureTier2 = 10002,
//macOS_ReadWriteTextureTier2 = 10002, TODO: Uncomment when feature tables updated
macOS_GPUFamily1_v3 = 10003,
macOS_GPUFamily1_v4 = 10004,
macOS_GPUFamily2_v1 = 10005,
}
// Available on macOS 10.15+, iOS 13.0+
#[repr(i64)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[non_exhaustive]
@ -136,7 +133,7 @@ impl MTLFeatureSet {
tvOS_GPUFamily1_v3 | tvOS_GPUFamily2_v1 => 11,
tvOS_GPUFamily1_v4 | tvOS_GPUFamily2_v2 => 12,
macOS_GPUFamily1_v1 => 11,
macOS_GPUFamily1_v2 | macOS_ReadWriteTextureTier2 => 12,
macOS_GPUFamily1_v2 => 12,
macOS_GPUFamily1_v3 => 13,
macOS_GPUFamily1_v4 | macOS_GPUFamily2_v1 => 14,
}
@ -145,20 +142,10 @@ impl MTLFeatureSet {
fn gpu_family(&self) -> u32 {
use MTLFeatureSet::*;
match self {
iOS_GPUFamily1_v1
| iOS_GPUFamily1_v2
| iOS_GPUFamily1_v3
| iOS_GPUFamily1_v4
| iOS_GPUFamily1_v5
| tvOS_GPUFamily1_v1
| tvOS_GPUFamily1_v2
| tvOS_GPUFamily1_v3
| tvOS_GPUFamily1_v4
| macOS_GPUFamily1_v1
| macOS_GPUFamily1_v2
| macOS_ReadWriteTextureTier2
| macOS_GPUFamily1_v3
| macOS_GPUFamily1_v4 => 1,
iOS_GPUFamily1_v1 | iOS_GPUFamily1_v2 | iOS_GPUFamily1_v3 | iOS_GPUFamily1_v4
| iOS_GPUFamily1_v5 | tvOS_GPUFamily1_v1 | tvOS_GPUFamily1_v2 | tvOS_GPUFamily1_v3
| tvOS_GPUFamily1_v4 | macOS_GPUFamily1_v1 | macOS_GPUFamily1_v2
| macOS_GPUFamily1_v3 | macOS_GPUFamily1_v4 => 1,
iOS_GPUFamily2_v1 | iOS_GPUFamily2_v2 | iOS_GPUFamily2_v3 | iOS_GPUFamily2_v4
| iOS_GPUFamily2_v5 | tvOS_GPUFamily2_v1 | tvOS_GPUFamily2_v2 | macOS_GPUFamily2_v1 => {
2
@ -172,16 +159,9 @@ impl MTLFeatureSet {
fn version(&self) -> u32 {
use MTLFeatureSet::*;
match self {
iOS_GPUFamily1_v1
| iOS_GPUFamily2_v1
| iOS_GPUFamily3_v1
| iOS_GPUFamily4_v1
| iOS_GPUFamily5_v1
| macOS_GPUFamily1_v1
| macOS_GPUFamily2_v1
| macOS_ReadWriteTextureTier2
| tvOS_GPUFamily1_v1
| tvOS_GPUFamily2_v1 => 1,
iOS_GPUFamily1_v1 | iOS_GPUFamily2_v1 | iOS_GPUFamily3_v1 | iOS_GPUFamily4_v1
| iOS_GPUFamily5_v1 | macOS_GPUFamily1_v1 | macOS_GPUFamily2_v1
| tvOS_GPUFamily1_v1 | tvOS_GPUFamily2_v1 => 1,
iOS_GPUFamily1_v2 | iOS_GPUFamily2_v2 | iOS_GPUFamily3_v2 | iOS_GPUFamily4_v2
| macOS_GPUFamily1_v2 | tvOS_GPUFamily1_v2 | tvOS_GPUFamily2_v2 => 2,
iOS_GPUFamily1_v3 | iOS_GPUFamily2_v3 | iOS_GPUFamily3_v3 | macOS_GPUFamily1_v3

View File

@ -674,124 +674,17 @@ impl RenderCommandEncoderRef {
// fn setVertexBuffers_offsets_withRange(self, buffers: *const id, offsets: *const NSUInteger, range: NSRange);
// fn setVertexSamplerStates_lodMinClamps_lodMaxClamps_withRange(self, samplers: *const id, lodMinClamps: *const f32, lodMaxClamps: *const f32, range: NSRange);
/// Adds an untracked resource to the render pass.
///
/// Availability: iOS 11.0+, macOS 10.13+
///
/// # Arguments
/// * `resource`: A resource within an argument buffer.
/// * `usage`: Options for describing how a graphics function uses the resource.
///
/// See <https://developer.apple.com/documentation/metal/mtlrendercommandencoder/2866168-useresource?language=objc>
#[deprecated(note = "Use use_resource_at instead")]
pub fn use_resource(&self, resource: &ResourceRef, usage: MTLResourceUsage) {
unsafe {
msg_send![self,
useResource:resource
usage:usage
]
msg_send![self, useResource:resource
usage:usage]
}
}
/// Adds an untracked resource to the render pass, specifying which render stages need it.
///
/// Availability: iOS 13.0+, macOS 10.15+
///
/// # Arguments
/// * `resource`: A resource within an argument buffer.
/// * `usage`: Options for describing how a graphics function uses the resource.
/// * `stages`: The render stages where the resource must be resident.
///
/// See <https://developer.apple.com/documentation/metal/mtlrendercommandencoder/3043404-useresource>
pub fn use_resource_at(
&self,
resource: &ResourceRef,
usage: MTLResourceUsage,
stages: MTLRenderStages,
) {
unsafe {
msg_send![self,
useResource: resource
usage: usage
stages: stages
]
}
}
/// Adds an array of untracked resources to the render pass, specifying which stages need them.
///
/// When working with color render targets, call this method as late as possible to improve performance.
///
/// Availability: iOS 13.0+, macOS 10.15+
///
/// # Arguments
/// * `resources`: A slice of resources within an argument buffer.
/// * `usage`: Options for describing how a graphics function uses the resources.
/// * `stages`: The render stages where the resources must be resident.
pub fn use_resources(
&self,
resources: &[&ResourceRef],
usage: MTLResourceUsage,
stages: MTLRenderStages,
) {
unsafe {
msg_send![self,
useResources: resources.as_ptr()
count: resources.len() as NSUInteger
usage: usage
stages: stages
]
}
}
/// Adds the resources in a heap to the render pass.
///
/// Availability: iOS 11.0+, macOS 10.13+
///
/// # Arguments:
/// * `heap`: A heap that contains resources within an argument buffer.
///
/// See <https://developer.apple.com/documentation/metal/mtlrendercommandencoder/2866163-useheap?language=objc>
#[deprecated(note = "Use use_heap_at instead")]
pub fn use_heap(&self, heap: &HeapRef) {
unsafe { msg_send![self, useHeap: heap] }
}
/// Adds the resources in a heap to the render pass, specifying which render stages need them.
///
/// Availability: iOS 13.0+, macOS 10.15+
///
/// # Arguments
/// * `heap`: A heap that contains resources within an argument buffer.
/// * `stages`: The render stages where the resources must be resident.
///
pub fn use_heap_at(&self, heap: &HeapRef, stages: MTLRenderStages) {
unsafe {
msg_send![self,
useHeap: heap
stages: stages
]
}
}
/// Adds the resources in an array of heaps to the render pass, specifying which render stages need them.
///
/// Availability: iOS 13.0+, macOS 10.15+
///
/// # Arguments
///
/// * `heaps`: A slice of heaps that contains resources within an argument buffer.
/// * `stages`: The render stages where the resources must be resident.
pub fn use_heaps(&self, heaps: &[&HeapRef], stages: MTLRenderStages) {
unsafe {
msg_send![self,
useHeaps: heaps.as_ptr()
count: heaps.len() as NSUInteger
stages: stages
]
}
}
pub fn update_fence(&self, fence: &FenceRef, after_stages: MTLRenderStages) {
unsafe {
msg_send![self,
@ -1142,69 +1035,19 @@ impl ComputeCommandEncoderRef {
}
}
/// Specifies that a resource in an argument buffer can be safely used by a compute pass.
///
/// Availability: iOS 11.0+, macOS 10.13+
///
/// # Arguments
/// * `resource`: A specific resource within an argument buffer.
/// * `usage`: The options that describe how the resource will be used by a compute function.
pub fn use_resource(&self, resource: &ResourceRef, usage: MTLResourceUsage) {
unsafe {
msg_send![self,
useResource: resource
usage: usage
useResource:resource
usage:usage
]
}
}
/// Specifies that an array of resources in an argument buffer can be safely used by a compute pass.
///
/// Availability: iOS 11.0+, macOS 10.13+
///
/// See <https://developer.apple.com/documentation/metal/mtlcomputecommandencoder/2866561-useresources>
///
/// # Arguments
/// * `resources`: A slice of resources within an argument buffer.
/// * `usage`: The options that describe how the array of resources will be used by a compute function.
pub fn use_resources(&self, resources: &[&ResourceRef], usage: MTLResourceUsage) {
unsafe {
msg_send![self,
useResources: resources.as_ptr()
count: resources.len() as NSUInteger
usage: usage
]
}
}
/// Specifies that a heap containing resources in an argument buffer can be safely used by a compute pass.
///
/// Availability: iOS 11.0+, macOS 10.13+
///
/// See <https://developer.apple.com/documentation/metal/mtlcomputecommandencoder/2866530-useheap>
///
/// # Arguments
/// * `heap`: A heap that contains resources within an argument buffer.
pub fn use_heap(&self, heap: &HeapRef) {
unsafe { msg_send![self, useHeap: heap] }
}
/// Specifies that an array of heaps containing resources in an argument buffer can be safely
/// used by a compute pass.
///
/// Availability: iOS 11.0+, macOS 10.13+
///
/// # Arguments
/// * `heaps`: A slice of heaps that contains resources within an argument buffer.
pub fn use_heaps(&self, heaps: &[&HeapRef]) {
unsafe {
msg_send![self,
useHeaps: heaps.as_ptr()
count: heaps.len() as NSUInteger
]
}
}
pub fn update_fence(&self, fence: &FenceRef) {
unsafe { msg_send![self, updateFence: fence] }
}

View File

@ -391,10 +391,6 @@ impl MetalLayerRef {
unsafe { msg_send![self, nextDrawable] }
}
pub fn contents_scale(&self) -> CGFloat {
unsafe { msg_send![self, contentsScale] }
}
pub fn set_contents_scale(&self, scale: CGFloat) {
unsafe { msg_send![self, setContentsScale: scale] }
}

View File

@ -387,10 +387,8 @@ pub enum MTLLanguageVersion {
V2_0 = 0x20000,
V2_1 = 0x20001,
V2_2 = 0x20002,
/// available on macOS 11.0+, iOS 14.0+
/// Only available on (macos(11.0), ios(14.0))
V2_3 = 0x20003,
/// available on macOS 12.0+, iOS 15.0+
V2_4 = 0x20004,
}
pub enum MTLFunctionConstantValues {}

View File

@ -71,18 +71,9 @@ bitflags! {
}
bitflags! {
/// Options that describe how a graphics or compute function uses an argument buffers resource.
///
/// Enabling certain options for certain resources determines whether the Metal driver should
/// convert the resource to another format (for example, whether to decompress a color render target).
pub struct MTLResourceUsage: NSUInteger {
/// An option that enables reading from the resource.
const Read = 1 << 0;
/// An option that enables writing to the resource.
const Write = 1 << 1;
/// An option that enables sampling from the resource.
///
/// Specify this option only if the resource is a texture.
const Sample = 1 << 2;
}
}

Some files were not shown because too many files have changed in this diff Show More