diff --git a/.cargo/config.in b/.cargo/config.in index 722991211c8ba..fdf3b46b9ef75 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -85,17 +85,22 @@ rev = "3484d3e3ebdc8931493aa5df4d7ee9360a90e76b" [source."https://github.com/gfx-rs/wgpu"] git = "https://github.com/gfx-rs/wgpu" replace-with = "vendored-sources" -rev = "6bc896f" +rev = "75e82afd" [source."https://github.com/gfx-rs/naga"] git = "https://github.com/gfx-rs/naga" replace-with = "vendored-sources" -rev = "c0b7ac7" +rev = "f90e563" [source."https://github.com/gfx-rs/metal-rs"] git = "https://github.com/gfx-rs/metal-rs" replace-with = "vendored-sources" -rev = "140c8f4" +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" [source."https://github.com/chris-zen/coremidi.git"] git = "https://github.com/chris-zen/coremidi.git" diff --git a/Cargo.lock b/Cargo.lock index c92deddac4a46..5cafea3f1d2cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,9 +124,9 @@ dependencies = [ [[package]] name = "ash" -version = "0.35.0+1.2.203" +version = "0.37.0+1.3.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7638ce84f8c84d6fd6faa63aa267574d345181ba591c0eeb5550d4c30cd600" +checksum = "006ca68e0f2b03f22d6fa9f2860f85aed430d257fec20f8879b2145e7c7ae1a6" dependencies = [ "libloading 0.7.2", ] @@ -1185,8 +1185,7 @@ dependencies = [ [[package]] name = "d3d12" version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" +source = "git+https://github.com/gfx-rs/d3d12-rs.git?rev=ffe5e261da0a6cb85332b82ab310abd2a7e849f6#ffe5e261da0a6cb85332b82ab310abd2a7e849f6" dependencies = [ "bitflags", "libloading 0.7.2", @@ -2727,6 +2726,7 @@ 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=140c8f4#140c8f4e39001ae154f153ffc767da6c0c9d7f06" +source = "git+https://github.com/gfx-rs/metal-rs?rev=1aaa903#1aaa9033a22b2af7ff8cae2ed412a4733799c3d3" 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=c0b7ac7#c0b7ac7f542cc42ccac6f2ec3fc1fb01309cf4d7" +source = "git+https://github.com/gfx-rs/naga?rev=f90e563#f90e563c281cfc71c794e0426ebcced9e3999202" 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=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f" +source = "git+https://github.com/gfx-rs/wgpu?rev=75e82afd#75e82afd355ba56b2f3d6f6384fb40c1cb46f1a4" 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=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f" +source = "git+https://github.com/gfx-rs/wgpu?rev=75e82afd#75e82afd355ba56b2f3d6f6384fb40c1cb46f1a4" 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=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f" +source = "git+https://github.com/gfx-rs/wgpu?rev=75e82afd#75e82afd355ba56b2f3d6f6384fb40c1cb46f1a4" dependencies = [ "bitflags", "bitflags_serde_shim", diff --git a/dom/webgpu/RenderBundleEncoder.cpp b/dom/webgpu/RenderBundleEncoder.cpp index 1d8d41dc4a476..c7c0d8bd1cff5 100644 --- a/dom/webgpu/RenderBundleEncoder.cpp +++ b/dom/webgpu/RenderBundleEncoder.cpp @@ -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 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); } diff --git a/dom/webgpu/ipc/WebGPUChild.cpp b/dom/webgpu/ipc/WebGPUChild.cpp index ec7ba5a993246..5a8f1f5937381 100644 --- a/dom/webgpu/ipc/WebGPUChild.cpp +++ b/dom/webgpu/ipc/WebGPUChild.cpp @@ -43,115 +43,174 @@ static ffi::WGPUCompareFunction ConvertCompareFunction( static ffi::WGPUTextureFormat ConvertTextureFormat( const dom::GPUTextureFormat& aFormat) { + ffi::WGPUTextureFormat result = {ffi::WGPUTextureFormat_Sentinel}; switch (aFormat) { case dom::GPUTextureFormat::R8unorm: - return ffi::WGPUTextureFormat_R8Unorm; + result.tag = ffi::WGPUTextureFormat_R8Unorm; + break; case dom::GPUTextureFormat::R8snorm: - return ffi::WGPUTextureFormat_R8Snorm; + result.tag = ffi::WGPUTextureFormat_R8Snorm; + break; case dom::GPUTextureFormat::R8uint: - return ffi::WGPUTextureFormat_R8Uint; + result.tag = ffi::WGPUTextureFormat_R8Uint; + break; case dom::GPUTextureFormat::R8sint: - return ffi::WGPUTextureFormat_R8Sint; + result.tag = ffi::WGPUTextureFormat_R8Sint; + break; case dom::GPUTextureFormat::R16uint: - return ffi::WGPUTextureFormat_R16Uint; + result.tag = ffi::WGPUTextureFormat_R16Uint; + break; case dom::GPUTextureFormat::R16sint: - return ffi::WGPUTextureFormat_R16Sint; + result.tag = ffi::WGPUTextureFormat_R16Sint; + break; case dom::GPUTextureFormat::R16float: - return ffi::WGPUTextureFormat_R16Float; + result.tag = ffi::WGPUTextureFormat_R16Float; + break; case dom::GPUTextureFormat::Rg8unorm: - return ffi::WGPUTextureFormat_Rg8Unorm; + result.tag = ffi::WGPUTextureFormat_Rg8Unorm; + break; case dom::GPUTextureFormat::Rg8snorm: - return ffi::WGPUTextureFormat_Rg8Snorm; + result.tag = ffi::WGPUTextureFormat_Rg8Snorm; + break; case dom::GPUTextureFormat::Rg8uint: - return ffi::WGPUTextureFormat_Rg8Uint; + result.tag = ffi::WGPUTextureFormat_Rg8Uint; + break; case dom::GPUTextureFormat::Rg8sint: - return ffi::WGPUTextureFormat_Rg8Sint; + result.tag = ffi::WGPUTextureFormat_Rg8Sint; + break; case dom::GPUTextureFormat::R32uint: - return ffi::WGPUTextureFormat_R32Uint; + result.tag = ffi::WGPUTextureFormat_R32Uint; + break; case dom::GPUTextureFormat::R32sint: - return ffi::WGPUTextureFormat_R32Sint; + result.tag = ffi::WGPUTextureFormat_R32Sint; + break; case dom::GPUTextureFormat::R32float: - return ffi::WGPUTextureFormat_R32Float; + result.tag = ffi::WGPUTextureFormat_R32Float; + break; case dom::GPUTextureFormat::Rg16uint: - return ffi::WGPUTextureFormat_Rg16Uint; + result.tag = ffi::WGPUTextureFormat_Rg16Uint; + break; case dom::GPUTextureFormat::Rg16sint: - return ffi::WGPUTextureFormat_Rg16Sint; + result.tag = ffi::WGPUTextureFormat_Rg16Sint; + break; case dom::GPUTextureFormat::Rg16float: - return ffi::WGPUTextureFormat_Rg16Float; + result.tag = ffi::WGPUTextureFormat_Rg16Float; + break; case dom::GPUTextureFormat::Rgba8unorm: - return ffi::WGPUTextureFormat_Rgba8Unorm; + result.tag = ffi::WGPUTextureFormat_Rgba8Unorm; + break; case dom::GPUTextureFormat::Rgba8unorm_srgb: - return ffi::WGPUTextureFormat_Rgba8UnormSrgb; + result.tag = ffi::WGPUTextureFormat_Rgba8UnormSrgb; + break; case dom::GPUTextureFormat::Rgba8snorm: - return ffi::WGPUTextureFormat_Rgba8Snorm; + result.tag = ffi::WGPUTextureFormat_Rgba8Snorm; + break; case dom::GPUTextureFormat::Rgba8uint: - return ffi::WGPUTextureFormat_Rgba8Uint; + result.tag = ffi::WGPUTextureFormat_Rgba8Uint; + break; case dom::GPUTextureFormat::Rgba8sint: - return ffi::WGPUTextureFormat_Rgba8Sint; + result.tag = ffi::WGPUTextureFormat_Rgba8Sint; + break; case dom::GPUTextureFormat::Bgra8unorm: - return ffi::WGPUTextureFormat_Bgra8Unorm; + result.tag = ffi::WGPUTextureFormat_Bgra8Unorm; + break; case dom::GPUTextureFormat::Bgra8unorm_srgb: - return ffi::WGPUTextureFormat_Bgra8UnormSrgb; + result.tag = ffi::WGPUTextureFormat_Bgra8UnormSrgb; + break; case dom::GPUTextureFormat::Rgb10a2unorm: - return ffi::WGPUTextureFormat_Rgb10a2Unorm; + result.tag = ffi::WGPUTextureFormat_Rgb10a2Unorm; + break; case dom::GPUTextureFormat::Rg11b10float: - return ffi::WGPUTextureFormat_Rg11b10Float; + result.tag = ffi::WGPUTextureFormat_Rg11b10Float; + break; case dom::GPUTextureFormat::Rg32uint: - return ffi::WGPUTextureFormat_Rg32Uint; + result.tag = ffi::WGPUTextureFormat_Rg32Uint; + break; case dom::GPUTextureFormat::Rg32sint: - return ffi::WGPUTextureFormat_Rg32Sint; + result.tag = ffi::WGPUTextureFormat_Rg32Sint; + break; case dom::GPUTextureFormat::Rg32float: - return ffi::WGPUTextureFormat_Rg32Float; + result.tag = ffi::WGPUTextureFormat_Rg32Float; + break; case dom::GPUTextureFormat::Rgba16uint: - return ffi::WGPUTextureFormat_Rgba16Uint; + result.tag = ffi::WGPUTextureFormat_Rgba16Uint; + break; case dom::GPUTextureFormat::Rgba16sint: - return ffi::WGPUTextureFormat_Rgba16Sint; + result.tag = ffi::WGPUTextureFormat_Rgba16Sint; + break; case dom::GPUTextureFormat::Rgba16float: - return ffi::WGPUTextureFormat_Rgba16Float; + result.tag = ffi::WGPUTextureFormat_Rgba16Float; + break; case dom::GPUTextureFormat::Rgba32uint: - return ffi::WGPUTextureFormat_Rgba32Uint; + result.tag = ffi::WGPUTextureFormat_Rgba32Uint; + break; case dom::GPUTextureFormat::Rgba32sint: - return ffi::WGPUTextureFormat_Rgba32Sint; + result.tag = ffi::WGPUTextureFormat_Rgba32Sint; + break; case dom::GPUTextureFormat::Rgba32float: - return ffi::WGPUTextureFormat_Rgba32Float; + result.tag = ffi::WGPUTextureFormat_Rgba32Float; + break; case dom::GPUTextureFormat::Depth32float: - return ffi::WGPUTextureFormat_Depth32Float; + result.tag = ffi::WGPUTextureFormat_Depth32Float; + break; case dom::GPUTextureFormat::Bc1_rgba_unorm: - return ffi::WGPUTextureFormat_Bc1RgbaUnorm; + result.tag = ffi::WGPUTextureFormat_Bc1RgbaUnorm; + break; case dom::GPUTextureFormat::Bc1_rgba_unorm_srgb: - return ffi::WGPUTextureFormat_Bc1RgbaUnormSrgb; + result.tag = ffi::WGPUTextureFormat_Bc1RgbaUnormSrgb; + break; case dom::GPUTextureFormat::Bc4_r_unorm: - return ffi::WGPUTextureFormat_Bc4RUnorm; + result.tag = ffi::WGPUTextureFormat_Bc4RUnorm; + break; case dom::GPUTextureFormat::Bc4_r_snorm: - return ffi::WGPUTextureFormat_Bc4RSnorm; + result.tag = ffi::WGPUTextureFormat_Bc4RSnorm; + break; case dom::GPUTextureFormat::Bc2_rgba_unorm: - return ffi::WGPUTextureFormat_Bc2RgbaUnorm; + result.tag = ffi::WGPUTextureFormat_Bc2RgbaUnorm; + break; case dom::GPUTextureFormat::Bc2_rgba_unorm_srgb: - return ffi::WGPUTextureFormat_Bc2RgbaUnormSrgb; + result.tag = ffi::WGPUTextureFormat_Bc2RgbaUnormSrgb; + break; case dom::GPUTextureFormat::Bc3_rgba_unorm: - return ffi::WGPUTextureFormat_Bc3RgbaUnorm; + result.tag = ffi::WGPUTextureFormat_Bc3RgbaUnorm; + break; case dom::GPUTextureFormat::Bc3_rgba_unorm_srgb: - return ffi::WGPUTextureFormat_Bc3RgbaUnormSrgb; + result.tag = ffi::WGPUTextureFormat_Bc3RgbaUnormSrgb; + break; case dom::GPUTextureFormat::Bc5_rg_unorm: - return ffi::WGPUTextureFormat_Bc5RgUnorm; + result.tag = ffi::WGPUTextureFormat_Bc5RgUnorm; + break; case dom::GPUTextureFormat::Bc5_rg_snorm: - return ffi::WGPUTextureFormat_Bc5RgSnorm; + result.tag = ffi::WGPUTextureFormat_Bc5RgSnorm; + break; case dom::GPUTextureFormat::Bc6h_rgb_ufloat: - return ffi::WGPUTextureFormat_Bc6hRgbUfloat; + result.tag = ffi::WGPUTextureFormat_Bc6hRgbUfloat; + break; case dom::GPUTextureFormat::Bc6h_rgb_float: - return ffi::WGPUTextureFormat_Bc6hRgbSfloat; + result.tag = ffi::WGPUTextureFormat_Bc6hRgbSfloat; + break; case dom::GPUTextureFormat::Bc7_rgba_unorm: - return ffi::WGPUTextureFormat_Bc7RgbaUnorm; + result.tag = ffi::WGPUTextureFormat_Bc7RgbaUnorm; + break; case dom::GPUTextureFormat::Bc7_rgba_unorm_srgb: - return ffi::WGPUTextureFormat_Bc7RgbaUnormSrgb; + result.tag = ffi::WGPUTextureFormat_Bc7RgbaUnormSrgb; + break; case dom::GPUTextureFormat::Depth24plus: - return ffi::WGPUTextureFormat_Depth24Plus; + result.tag = ffi::WGPUTextureFormat_Depth24Plus; + break; case dom::GPUTextureFormat::Depth24plus_stencil8: - return ffi::WGPUTextureFormat_Depth24PlusStencil8; + result.tag = ffi::WGPUTextureFormat_Depth24PlusStencil8; + break; case dom::GPUTextureFormat::EndGuard_: MOZ_ASSERT_UNREACHABLE(); } - MOZ_CRASH("unexpected texture format enum"); + + // 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; } void WebGPUChild::ConvertTextureFormatRef(const dom::GPUTextureFormat& aInput, @@ -357,7 +416,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; diff --git a/gfx/wgpu_bindings/Cargo.toml b/gfx/wgpu_bindings/Cargo.toml index 17dd5490850f8..9030972427205 100644 --- a/gfx/wgpu_bindings/Cargo.toml +++ b/gfx/wgpu_bindings/Cargo.toml @@ -17,7 +17,7 @@ default = [] [dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "6bc896f" +rev = "75e82afd" #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 = "6bc896f" +rev = "75e82afd" [dependencies.wgh] package = "wgpu-hal" git = "https://github.com/gfx-rs/wgpu" -rev = "6bc896f" +rev = "75e82afd" [dependencies] bincode = "1" diff --git a/gfx/wgpu_bindings/cbindgen.toml b/gfx/wgpu_bindings/cbindgen.toml index e41f7ed711830..2262bedba6ade 100644 --- a/gfx/wgpu_bindings/cbindgen.toml +++ b/gfx/wgpu_bindings/cbindgen.toml @@ -73,3 +73,4 @@ bitflags = true "target_os = windows" = "XP_WIN" "target_os = macos" = "XP_MACOSX" "target_os = android" = "ANDROID" +"feature = id32" = "WGPU_FEATURE_ID32" diff --git a/gfx/wgpu_bindings/src/identity.rs b/gfx/wgpu_bindings/src/identity.rs index c50dbc7fe7bd0..53c68ddf630ea 100644 --- a/gfx/wgpu_bindings/src/identity.rs +++ b/gfx/wgpu_bindings/src/identity.rs @@ -52,7 +52,7 @@ pub struct IdentityRecyclerFactory { impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_adapter, param: self.param, @@ -62,7 +62,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_device, param: self.param, @@ -72,7 +72,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_pipeline_layout, param: self.param, @@ -82,7 +82,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecycler } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_shader_module, param: self.param, @@ -92,7 +92,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFa } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_bind_group_layout, param: self.param, @@ -102,7 +102,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecycle } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_bind_group, param: self.param, @@ -112,7 +112,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFacto } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_command_buffer, param: self.param, @@ -122,7 +122,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerF } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_render_bundle, param: self.param, @@ -132,7 +132,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFa } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_render_pipeline, param: self.param, @@ -142,7 +142,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecycler } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_compute_pipeline, param: self.param, @@ -152,7 +152,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecycle } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_query_set, param: self.param, @@ -162,7 +162,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactor } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_buffer, param: self.param, @@ -172,7 +172,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_texture, param: self.param, @@ -182,7 +182,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_texture_view, param: self.param, @@ -192,7 +192,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFac } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_sampler, param: self.param, @@ -202,7 +202,7 @@ impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory } impl wgc::hub::IdentityHandlerFactory for IdentityRecyclerFactory { type Filter = IdentityRecycler; - fn spawn(&self, _min_index: u32) -> Self::Filter { + fn spawn(&self) -> Self::Filter { IdentityRecycler { fun: self.free_surface, param: self.param, diff --git a/third_party/rust/ash/.cargo-checksum.json b/third_party/rust/ash/.cargo-checksum.json index 3881a89059638..ce661155a782f 100644 --- a/third_party/rust/ash/.cargo-checksum.json +++ b/third_party/rust/ash/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"f31b1f935d0ad451865f6e8e3557c8ac7416fc86c6d9dec50a69f3f4c8fbb759","LICENSE-APACHE":"0e8a410375e1ee5c75c6198b08b534fec6e5edef766cf971bab4a404542636ab","LICENSE-MIT":"c733ccf8ab25df175a63d9d844677b98e3a5ab8f8de1c1616087e6868a7f948e","build.rs":"616f1c2f1a0dd883d57690b767691750c1762fb01ab4aeb662825ceecf869e7b","src/device.rs":"c6a399f6ce1d47c8b498f41705f8d65ea921fb72255fc17604d196e8bded049a","src/entry.rs":"4238b868edfeced27b9b6552788c71561040fe8450685ae5e343fb101b3412d1","src/extensions/experimental/amd.rs":"f0cf870ae00253f8149e9770d39dbc246368de92607e6ded5fcd06c8e3d9ee18","src/extensions/experimental/mod.rs":"41a5366e1c8bd0e1fa47e9cf6fddc8111ed0a6946813be4eefca81da969d1ee9","src/extensions/ext/buffer_device_address.rs":"47d872699a6df369d87e98897f2cddc722acb2badd5ab8fc4b28adbcd791707c","src/extensions/ext/debug_marker.rs":"1e6ab4a7749326d33711f4f730943b5f696a697680eb9b843dcd3d5aa7767e23","src/extensions/ext/debug_report.rs":"ece077299b292ff2f754fa6663dccb559b256faacf6535308cecaf5357a7d8fd","src/extensions/ext/debug_utils.rs":"a2221e62ce68fc216acc1841c4cae5b927a531f95a2415b31ed83b3bc1d7cf82","src/extensions/ext/extended_dynamic_state.rs":"d616092ba23708dbc4b2ee368284113fe6202b14583b47d5d0d76862c77a687e","src/extensions/ext/full_screen_exclusive.rs":"e44c997fac938b17158c7df914ef145cc8bbc4c42fb1139498138818a1dfde35","src/extensions/ext/metal_surface.rs":"13eed5ecf1d9702d933f4e63897237280b315d23897b2e3f7136733a72fc1c40","src/extensions/ext/mod.rs":"2aa5bbadff62334017e9553bf5141e4543dd452473e1d8f6d61e3cd464731288","src/extensions/ext/physical_device_drm.rs":"a13378c8d1abb6efe692e05b8eb588b696ef4e056c5e2c09e8f01f0d88bfe85f","src/extensions/ext/tooling_info.rs":"7e72f38aca1aaece4db8aafd017956eb08ece68229ab1365ab76b5017f8f7109","src/extensions/khr/acceleration_structure.rs":"6d88c8f9f68314cfb7c7ae649eeaeca25ef24e337115f8816b8ceffa1c34da14","src/extensions/khr/android_surface.rs":"43416ec5a02ef502211c20047d1a684eb9ae5a36159e9c506ccc8b5cbf805e79","src/extensions/khr/buffer_device_address.rs":"568735d28b905607634f014d93d162bc304a654b167501160458cad9404c4789","src/extensions/khr/create_render_pass2.rs":"e6731d62c93193c16329a20f7186fb48656fe6d7659e7a9dc1306f345ad7f7ec","src/extensions/khr/deferred_host_operations.rs":"1bef60d78838f100bf5ba67aa43c60a1ea0218cee9481e7ae28e57a42418b299","src/extensions/khr/display.rs":"8f90617be4f66dc39cea51aa80f9e8e222b7c885fd0decfbc20acd45786ab1d3","src/extensions/khr/display_swapchain.rs":"f750a099c6d24c2c020f1aa4b11d42305fd6120e55c7fbece5885fb7001888c6","src/extensions/khr/draw_indirect_count.rs":"b68e71fd2796af49db25abbed20f1f5bf49b51517471f3d055dd8ffd705edb3c","src/extensions/khr/dynamic_rendering.rs":"266bc361b2f8203af9774aa5fb70e597d96c242ed8369c9c89ff4ef89e04a7f1","src/extensions/khr/external_fence_fd.rs":"12f2d5239bb54e144115478ad0d94539c7a8107641006d0842d5dba63ddf290c","src/extensions/khr/external_memory_fd.rs":"729252d6bf84abfdfdc2890de11577bb413d92d2adb64da21610189ed16163c6","src/extensions/khr/external_semaphore_fd.rs":"e00f28d4a4c44601d68f8679c48f627e18ba1df8d86f3602c543c3370132526e","src/extensions/khr/get_memory_requirements2.rs":"e0dc940592478338c6c0864103e2af4d5bd9394ce892bb902bee32adccbeba5e","src/extensions/khr/get_physical_device_properties2.rs":"5f1ee91569b0daae298f4d849486743a49e76cdbbcda37d2cc3cda333ac17a26","src/extensions/khr/maintenance1.rs":"cfee8123d9db4ae9d32870c4dc064337bad9a82071d4b469895aa9d7864d080e","src/extensions/khr/maintenance3.rs":"8c9e5310fe25fc50abb028b45ec15513333cbd0f35395937587d39e3be56fb72","src/extensions/khr/maintenance4.rs":"23b5719ec1df9977b898df97b6291f6dd10131e66619ef635be3a7bf1433a330","src/extensions/khr/mod.rs":"8fed61b8605f874bfdd23f39af7c48e542f6dd9ba40b7942f1b3b8f5339b2c76","src/extensions/khr/pipeline_executable_properties.rs":"ddfff12f4bec1e81573f700dc21b8873704d12d88cfc756915cba79994d3e077","src/extensions/khr/present_wait.rs":"985c80d42803daa07e7239f086857b5edd220618221627f8978727bdacb02210","src/extensions/khr/push_descriptor.rs":"d08329c3ec24cdcbdc2e384d71b0ba5b3f4d4fd244f5f0f7fa280a281a4ab867","src/extensions/khr/ray_tracing_pipeline.rs":"1f18406573fdd6d3f2101640017ddd3f563b018d0d0de557046d299b4651e8cf","src/extensions/khr/surface.rs":"df0723543dfb8522b7c282f059490ca252dfd5172d9af30f0165d5725add237e","src/extensions/khr/swapchain.rs":"f936d1685c91c24159f5141cadd7d72748effe2150fbd4f88b10163c8539bacb","src/extensions/khr/synchronization2.rs":"fab5fd14639d56e075ab0a8b4c98d13d777fbd6b519f836a5464081de331b4a8","src/extensions/khr/timeline_semaphore.rs":"635af9994886fd839d7227e74fd8cd2a322e4ce3ab997eb6d6ef248c0c1f4f1a","src/extensions/khr/wayland_surface.rs":"99fe02bbf8920b9eae2fae93fbedf91cdea9ef625496433d01c31b9b63df51a3","src/extensions/khr/win32_surface.rs":"48e7c3aef59e2d4e95196c33513ec2ff91c7b376f99f618d8ae52d7f220b0098","src/extensions/khr/xcb_surface.rs":"ca744505e92ae56adb0fcc52c37bd1f03d45b1a8d9cdcd46f9facb079135ec4e","src/extensions/khr/xlib_surface.rs":"dbfb64d08a66f2d827cf7221960fafbd0fb9e50aacd992a3e7288beb2381e439","src/extensions/mod.rs":"717bc2155a3d311ddc485dbf6313a0996e1906d15bd09be0aab776e33368eaa7","src/extensions/mvk/ios_surface.rs":"c96be1503741804fd1ddf3950773c868580f045319db05be31ebc2ebc35edba3","src/extensions/mvk/macos_surface.rs":"38aea57ac94c97afffd508cb8429a433372c9363aba2adc39a978efbb435ae1e","src/extensions/mvk/mod.rs":"d03ac1a0144d1aca9ed1d0ce0c14b099f1fedb03b8108028b780a34f64de604c","src/extensions/nn/mod.rs":"b32935320aa2af18b129868d52d4042596b3c22046cd650a4e9e75c5f3973eb3","src/extensions/nn/vi_surface.rs":"6cfa24973257d22a321f1a7edb5fea8ae3340d797772def368f92a54dab95db7","src/extensions/nv/device_diagnostic_checkpoints.rs":"a925955a2c431ec9ab97d5d864a51a9d2ec982773872a164cd11dac533a1173d","src/extensions/nv/mesh_shader.rs":"e2e707fcf1205cccf06ecacadb8b3e6f1cf035d62e9cef60ec476a831ebded9e","src/extensions/nv/mod.rs":"b32f7e5a3a70bc148c443be2d051e43d8782380c416fab40a69535f1529571dc","src/extensions/nv/ray_tracing.rs":"16fd7e7b8bfc0b7a3daa7169ae830bfa1b15c6ae7e3db28e855d737c38f9a52f","src/instance.rs":"2fd84d6289fb0deb01f5df662267fd30c0ecad4e9ac4290a7a10c1d834d94c78","src/lib.rs":"bfaaa1f94ce2d9030b44be9f328e691e988a742c69618b2b15ecba422fba6bd1","src/prelude.rs":"367874553a339dc9ee65ee25008b3c0aafee123d85784134b905f625f12cf709","src/util.rs":"2301879f77c455bd2e2717e1eed60f4fd934e7cdf95a950de1ddd1667cd278b1","src/version.rs":"2d46dc6a5cc2358f70e1561bf17fffeccf11649e67011b816b9e114d8ecebffb","src/vk.rs":"25b1a2e67931ed231d5d194d31d42fd918daa39c858ac1d4786db4072e554ddd","src/vk/aliases.rs":"f0dc48f2c95ee06b1571fb65a79fb1c9aa1566a9eac1b92b4df6de2784deb86a","src/vk/bitflags.rs":"40ccd3033367306db8b837e460cc5a99d7974e979d880c81e0ee0fe79f51fd7a","src/vk/const_debugs.rs":"a33a57ec6648ec2fe970ecd9b5616584b11ac4bd855533f3d02be2143d864941","src/vk/constants.rs":"d8a1c70658f2ea3ef04fdaba223c055407be9018c4c4536eeed9cc5d19d3c0f6","src/vk/definitions.rs":"8f80d04d38e8c1e40012c271a8cde26e6970459850a968da5eccf8469d0d3537","src/vk/enums.rs":"ae6e0760fa4076687b304e4cce117925bb1a4abc0e9e6de7f796832c6c5b8b11","src/vk/extensions.rs":"5f15ab0c98f80f7ecd9abceb956d9f22404ba91d226437071fcbbf25f8505469","src/vk/feature_extensions.rs":"d9617c257ac5f1ce9afe22ba182608f77d9edc3a9c122fcff9c972bc7d7aca32","src/vk/features.rs":"ee9a320e29995af0980092fee714b25b80ce33b3d692d5eac537b0408b017ba8","src/vk/macros.rs":"7ff6c6ea8d99a4573cd35ecf8c42975df060db5cc4271b1721908707032b903a","src/vk/native.rs":"b03e51b3907084607fb068497fc7d29987aa91e2a54d6524e83627816dc66f0a","src/vk/platform_types.rs":"6932fc33f443e1312bdc1e693c209ec68d1d808be1b02e3e48474233a5fd06d1","src/vk/prelude.rs":"05679ad49670a98f13c23ce3b755f11edf36727cf685a4de3a665f1257ce3774","tests/constant_size_arrays.rs":"fdd726fcebc3b05900a0d24a05826f4a19e99bc71f8f35bacc958a1e10de1013","tests/display.rs":"d294396bb5b2210432724cccc0a56e105bab8743e180d4ad7cc675a200c09539"},"package":"5a7638ce84f8c84d6fd6faa63aa267574d345181ba591c0eeb5550d4c30cd600"} \ No newline at end of file +{"files":{"Cargo.toml":"d96dd6e66dcfc1b4f09f1f5636974cb427f9550378729b3b99a1182baaf681f3","LICENSE-APACHE":"0e8a410375e1ee5c75c6198b08b534fec6e5edef766cf971bab4a404542636ab","LICENSE-MIT":"c733ccf8ab25df175a63d9d844677b98e3a5ab8f8de1c1616087e6868a7f948e","build.rs":"616f1c2f1a0dd883d57690b767691750c1762fb01ab4aeb662825ceecf869e7b","src/device.rs":"33718ebb9a929ee82b3c13c22602c50ce4e9e805a772bc6f6ad1e2697c450833","src/entry.rs":"6176ce4da3d29b8da4100c9f896763cbf41772af4639863b0bca86d28651a4df","src/extensions/experimental/amd.rs":"e89f7cf4d4b9335ae74391fddc85d03106b121b6d964ea8fad35593e9918f4e6","src/extensions/experimental/mod.rs":"41a5366e1c8bd0e1fa47e9cf6fddc8111ed0a6946813be4eefca81da969d1ee9","src/extensions/ext/buffer_device_address.rs":"506eb5f8a2d9048612fbb7ebd772550b22c36bc8b28a87e159070eba918e5ce3","src/extensions/ext/calibrated_timestamps.rs":"8ddc1dcce91f7f4ff3352afb2a055fabdee09d4bac5ec2b229d702240a828426","src/extensions/ext/debug_marker.rs":"ef7a7e9ca4d3f08e134252dae5da480721c73ea236b2a917f86e8ca143539f76","src/extensions/ext/debug_report.rs":"eec832a5d30c9f002695d4d76c6c30507d96075b8e735f388bb94fc64a328507","src/extensions/ext/debug_utils.rs":"a5ea4a92a67bb904895d338fad258466efb0e93ac573a5ae31876ecba388daf1","src/extensions/ext/extended_dynamic_state.rs":"be1da9d4ce1f5cd53eed0f34f9211eacb3a470ce5f91f2e403972b4c73293ec1","src/extensions/ext/extended_dynamic_state2.rs":"8b1b69a1d374b3af4bbe1616fb81177a9c7b7f9a84c3696c0064929d65a68e58","src/extensions/ext/full_screen_exclusive.rs":"ee2723c7485061673318f34bce8538ec11b07096dc457591cc99f6f6ad57ddd0","src/extensions/ext/headless_surface.rs":"6f99b2c2edbc4b10530749a876cff8b98b5ddaa351ac7895b49a7a675bc55036","src/extensions/ext/metal_surface.rs":"de86bc1682f825b92443d22140b8c6b8b4db7003323c169cbab598f2b3cdfc74","src/extensions/ext/mod.rs":"0f5ac52c09fe54dd8197c94979b9318bc03a38e71029edc08e0185a58187872d","src/extensions/ext/physical_device_drm.rs":"b45b2394d72a92aed5dba686bbfce862732bf2166bf63abea7de67804f4a7204","src/extensions/ext/private_data.rs":"bd52ee5acbe39ef7cd58cb7a339137dc2482f6917cba63c606e944813a86c726","src/extensions/ext/tooling_info.rs":"feacc66a702b447bdf120143500f60a0209f6d3f4d04735fb0a5b93d01826157","src/extensions/khr/acceleration_structure.rs":"19aafb4e278b15e54567d33c6b19435526e0a5679277c0ebb2cd8b632ffd88e6","src/extensions/khr/android_surface.rs":"31b7fba6dd135b9a1d669f49dc4bdb5563b5200e881feff8ddfc6cda572f1c5c","src/extensions/khr/buffer_device_address.rs":"0ca77c89d4f2c56f771c8210dd157ab171aeae4f0251658da35db14a04e00845","src/extensions/khr/copy_commands2.rs":"ed2b54692038eaedf88ff9ffe693eb959c4e7bfcc4c2f54d3c27e8bb523e3c22","src/extensions/khr/create_render_pass2.rs":"f4b65aaf54618542666bf5428d26ce784537c2f58a2dbe60326394390ba63b9f","src/extensions/khr/deferred_host_operations.rs":"d0675118426e91a9489cb82b196713d295426f6a0b15dafc906437e0dc32973f","src/extensions/khr/display.rs":"0f3dceb3b7fc7642095eebd9c2b29740b4067cfc723c3b90e5b6c0acdf3964fe","src/extensions/khr/display_swapchain.rs":"910741ba6b8119ef63a1842615655844e61c7775f1701892f127679cda1faff8","src/extensions/khr/draw_indirect_count.rs":"bba09bd63c884b8a536e912df89826da418ead531904110d231c4315996e0be5","src/extensions/khr/dynamic_rendering.rs":"ab17847b73debdc10b2a1e14a524858ceffa2855016478f408fcc782b579c9d9","src/extensions/khr/external_fence_fd.rs":"22bee32fa722deb521ed698ffa0b188de77391159b235d53b8cccb1619001a10","src/extensions/khr/external_fence_win32.rs":"af3dbfee753bead37025a04fd5212005f71ebf26c2d92a0a1f7576b8fba04630","src/extensions/khr/external_memory_fd.rs":"6c584446136e710336c407423f02440f343a530709821cff839430089afa519b","src/extensions/khr/external_memory_win32.rs":"69f7836efe6847f88efd54414c9d2391f22d22c94ac7a479cc886474a16ce703","src/extensions/khr/external_semaphore_fd.rs":"56941e32e36f05b6ffe4b99162c3b9ff26ba02c6aee79e05781427e356c4ca69","src/extensions/khr/external_semaphore_win32.rs":"ac1f15ff7d39ba6c91e2eb9888670ad26173d77d6b38acdb77ac0fddcc912aa4","src/extensions/khr/get_memory_requirements2.rs":"c1c843cf93b07bd984468d7b4777ec783b17a69da175ce8a7aefe20ff5c839dc","src/extensions/khr/get_physical_device_properties2.rs":"c5df133e26517cb3185509063d41b86831f12cb3934185a0fc0f38ffc85d7e0d","src/extensions/khr/get_surface_capabilities2.rs":"22c8ef54a4fd2960436dce32da8ee039aa7e4311c73f98579e692413a9b770fc","src/extensions/khr/maintenance1.rs":"f2c2806b4228118e4b2a08aef97f12ab4eec6c4f8f548dbc19a1c023ad6b4bfa","src/extensions/khr/maintenance3.rs":"1447aedabefbf1415f86b7095cec1b534da4dc928e49b2f5841c15459f0f9df6","src/extensions/khr/maintenance4.rs":"c2c5667d8d23528e3744e02bafc347a9a0c97bc36f5492b0dd18ad23eafa3fdb","src/extensions/khr/mod.rs":"b63a0b88ace27d9f8ee6ed566573371ca4724c60c6de02b4d6e79e8d748e21cb","src/extensions/khr/pipeline_executable_properties.rs":"f040fbf5e32b454d8e777c260986e709c43c8c78d681f6000236d1703af198a4","src/extensions/khr/present_wait.rs":"88fa4e66f8c3c98b2df353ca1ef342addb55974c3359eea907726e35ec7a8beb","src/extensions/khr/push_descriptor.rs":"bc8712e1944ddb91f4144eb58a7c653e6cffb67cb13b42a09c2b3b3dd40f9e8d","src/extensions/khr/ray_tracing_pipeline.rs":"d538fad634b679496f7f2989df09e5a6afc271fbcb68a56850b26904f5d51014","src/extensions/khr/surface.rs":"2c3a7d69ccb8e1112714fa2710723256b73cee491c85ce45422fe7ea0db0ac13","src/extensions/khr/swapchain.rs":"0c10e965a3eaabb696d2b1a54f9c2f8c4fcd4f2f0b7a62693e0ebf9e9407ffe9","src/extensions/khr/synchronization2.rs":"3582d4ed6a953bb0f18c4e64a721ede907254b6e386a53cd15d983609a294636","src/extensions/khr/timeline_semaphore.rs":"2e604ab670e5f6608c61c865df0250af7db4bad4522efba55d27cdfec8e0101b","src/extensions/khr/wayland_surface.rs":"4d55b3ca4cca6e9b7ed969fb37f1d8822d378afd9d140a792ff3de263b0ca75e","src/extensions/khr/win32_surface.rs":"6ec21d6b89075513d84109b63a1082ec6d0776a0ced013b7f7ee6eb338a22985","src/extensions/khr/xcb_surface.rs":"9b5155285502bb50cef5284e97e8a6fb9402ab50950d44245760956f34d705c3","src/extensions/khr/xlib_surface.rs":"252a0d2c40d4362736375c439d40cc831897e63c0fcb29544a6b21857a38b8fd","src/extensions/mod.rs":"717bc2155a3d311ddc485dbf6313a0996e1906d15bd09be0aab776e33368eaa7","src/extensions/mvk/ios_surface.rs":"766ce128a7506e9c1fea77276d70f39166d33f7ed9e18a567f13dfb64cdcd2be","src/extensions/mvk/macos_surface.rs":"426736e549277d30d45ace72f9dc75b6163e5a0099a0668180f7a4597fb557f6","src/extensions/mvk/mod.rs":"d03ac1a0144d1aca9ed1d0ce0c14b099f1fedb03b8108028b780a34f64de604c","src/extensions/nn/mod.rs":"b32935320aa2af18b129868d52d4042596b3c22046cd650a4e9e75c5f3973eb3","src/extensions/nn/vi_surface.rs":"c1aebc174c89e938e957d581460e06b82d5a85c26000129248bb3344a99f5462","src/extensions/nv/device_diagnostic_checkpoints.rs":"84bed9e6a0878ff31411ddc0adcfc1a9df7dd765e4a0569b392d558eb2effa4d","src/extensions/nv/mesh_shader.rs":"3f631538e70b2e0fdc38bb8c9ca0365d0c4efac1170d326f1ed9720d1708f026","src/extensions/nv/mod.rs":"b32f7e5a3a70bc148c443be2d051e43d8782380c416fab40a69535f1529571dc","src/extensions/nv/ray_tracing.rs":"8c8fbde81673384538a9beadad96d440ec9126c14d50aab76431a89330d8494b","src/instance.rs":"52daf52a8309e026cd4026d214dde16691d378e7a1e7eab0a79556a471d84ff6","src/lib.rs":"2989b219c7b44786228eb5bc2353226062e5e466cc46618bda556d0fc57d7071","src/prelude.rs":"e331f936dc36d6b7ac9ceb07c83b6109d0e874980e94904510b59a948217bf3e","src/util.rs":"2301879f77c455bd2e2717e1eed60f4fd934e7cdf95a950de1ddd1667cd278b1","src/version.rs":"2d46dc6a5cc2358f70e1561bf17fffeccf11649e67011b816b9e114d8ecebffb","src/vk.rs":"5fa2780853bc301bc02c5c54fe4cf8f325b6159abc78911922f07ecbf972bc9a","src/vk/aliases.rs":"db27dd1e35a4e10ec0dccdc601bbb6980611d66ce13f5ee1bde839cdf89004c4","src/vk/bitflags.rs":"ca74be010a92bb7aa1ad35b5313fc3731527317e6cb8ababe27dd279f0bbf2ee","src/vk/const_debugs.rs":"9324b1bfc75e343ef1f2b165bfb522f53f9b2a435f2107a781e03eb79d86ef18","src/vk/constants.rs":"25963e5fbcb7c52321ac7103bcef7d5c76254bfa73e9e911e4e2faf28142b140","src/vk/definitions.rs":"e0d9d17629273d05214b6c89ef30ad73727dbb4ff389cd087c37d3407d1f17f3","src/vk/enums.rs":"a55188e94dfa38f2a5cd40204f0d0c0629991e1d18e356afa2944cac0936c3fa","src/vk/extensions.rs":"983fa53393f17eddcbe178562aa883b9a918b72b869a52af7c39fe1739cde6d2","src/vk/feature_extensions.rs":"c875cf2a7b02a8a8fa31f3bc8794ec526c0870b470e7a308b5b256402dc8125e","src/vk/features.rs":"46633698d0275ae55d4372403d76b09763e762e8db9fec0688f40d8204ce221b","src/vk/macros.rs":"5fde17e47d5a102bfc74dfd9ad024938d676950afae7fe932dc697cb95a9f5e4","src/vk/native.rs":"aba97127acd571c339b72d6e7045c265f9d40f7fa7b48b37eb6a4a6ed68e9c12","src/vk/platform_types.rs":"6932fc33f443e1312bdc1e693c209ec68d1d808be1b02e3e48474233a5fd06d1","src/vk/prelude.rs":"a199b9d9f5d512d55c1858acf570acc891c05d0d1c76766d7bbf042312f4a7e9","tests/constant_size_arrays.rs":"fdd726fcebc3b05900a0d24a05826f4a19e99bc71f8f35bacc958a1e10de1013","tests/display.rs":"d294396bb5b2210432724cccc0a56e105bab8743e180d4ad7cc675a200c09539"},"package":"006ca68e0f2b03f22d6fa9f2860f85aed430d257fec20f8879b2145e7c7ae1a6"} \ No newline at end of file diff --git a/third_party/rust/ash/Cargo.toml b/third_party/rust/ash/Cargo.toml index 1b62cd0000a64..90902e709fd43 100644 --- a/third_party/rust/ash/Cargo.toml +++ b/third_party/rust/ash/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "ash" -version = "0.35.0+1.2.203" +version = "0.37.0+1.3.209" authors = ["maik klein "] description = "Vulkan bindings for Rust" documentation = "https://docs.rs/ash" diff --git a/third_party/rust/ash/src/device.rs b/third_party/rust/ash/src/device.rs index 426fa1607fe3a..27802e176ef47 100644 --- a/third_party/rust/ash/src/device.rs +++ b/third_party/rust/ash/src/device.rs @@ -6,7 +6,7 @@ use std::mem; use std::os::raw::c_void; use std::ptr; -#[doc = ""] +/// #[derive(Clone)] pub struct Device { pub(crate) handle: vk::Device, @@ -14,12 +14,13 @@ pub struct Device { pub(crate) device_fn_1_0: vk::DeviceFnV1_0, pub(crate) device_fn_1_1: vk::DeviceFnV1_1, pub(crate) device_fn_1_2: vk::DeviceFnV1_2, + pub(crate) device_fn_1_3: vk::DeviceFnV1_3, } impl Device { pub unsafe fn load(instance_fn: &vk::InstanceFnV1_0, device: vk::Device) -> Self { let load_fn = |name: &std::ffi::CStr| { - mem::transmute(instance_fn.get_device_proc_addr(device, name.as_ptr())) + mem::transmute((instance_fn.get_device_proc_addr)(device, name.as_ptr())) }; Self { @@ -28,6 +29,7 @@ impl Device { device_fn_1_0: vk::DeviceFnV1_0::load(load_fn), device_fn_1_1: vk::DeviceFnV1_1::load(load_fn), device_fn_1_2: vk::DeviceFnV1_2::load(load_fn), + device_fn_1_3: vk::DeviceFnV1_3::load(load_fn), } } @@ -36,6 +38,451 @@ impl Device { } } +/// Vulkan core 1.3 +#[allow(non_camel_case_types)] +impl Device { + pub fn fp_v1_3(&self) -> &vk::DeviceFnV1_3 { + &self.device_fn_1_3 + } + + /// + pub unsafe fn create_private_data_slot( + &self, + create_info: &vk::PrivateDataSlotCreateInfo, + allocation_callbacks: Option<&vk::AllocationCallbacks>, + ) -> VkResult { + let mut private_data_slot = mem::zeroed(); + (self.device_fn_1_3.create_private_data_slot)( + self.handle, + create_info, + allocation_callbacks.as_raw_ptr(), + &mut private_data_slot, + ) + .result_with_success(private_data_slot) + } + + /// + pub unsafe fn destroy_private_data_slot( + &self, + private_data_slot: vk::PrivateDataSlot, + allocation_callbacks: Option<&vk::AllocationCallbacks>, + ) { + (self.device_fn_1_3.destroy_private_data_slot)( + self.handle, + private_data_slot, + allocation_callbacks.as_raw_ptr(), + ) + } + + /// + pub unsafe fn set_private_data( + &self, + object: T, + private_data_slot: vk::PrivateDataSlot, + data: u64, + ) -> VkResult<()> { + (self.device_fn_1_3.set_private_data)( + self.handle, + T::TYPE, + object.as_raw(), + private_data_slot, + data, + ) + .result() + } + + /// + pub unsafe fn get_private_data( + &self, + object: T, + private_data_slot: vk::PrivateDataSlot, + ) -> u64 { + let mut data = mem::zeroed(); + (self.device_fn_1_3.get_private_data)( + self.handle, + T::TYPE, + object.as_raw(), + private_data_slot, + &mut data, + ); + data + } + + /// + pub unsafe fn cmd_pipeline_barrier2( + &self, + command_buffer: vk::CommandBuffer, + dependency_info: &vk::DependencyInfo, + ) { + (self.device_fn_1_3.cmd_pipeline_barrier2)(command_buffer, dependency_info) + } + + /// + pub unsafe fn cmd_reset_event2( + &self, + command_buffer: vk::CommandBuffer, + event: vk::Event, + stage_mask: vk::PipelineStageFlags2, + ) { + (self.device_fn_1_3.cmd_reset_event2)(command_buffer, event, stage_mask) + } + + /// + pub unsafe fn cmd_set_event2( + &self, + command_buffer: vk::CommandBuffer, + event: vk::Event, + dependency_info: &vk::DependencyInfo, + ) { + (self.device_fn_1_3.cmd_set_event2)(command_buffer, event, dependency_info) + } + + /// + pub unsafe fn cmd_wait_events2( + &self, + command_buffer: vk::CommandBuffer, + events: &[vk::Event], + dependency_infos: &[vk::DependencyInfo], + ) { + assert_eq!(events.len(), dependency_infos.len()); + (self.device_fn_1_3.cmd_wait_events2)( + command_buffer, + events.len() as u32, + events.as_ptr(), + dependency_infos.as_ptr(), + ) + } + + /// + pub unsafe fn cmd_write_timestamp2( + &self, + command_buffer: vk::CommandBuffer, + stage: vk::PipelineStageFlags2, + query_pool: vk::QueryPool, + query: u32, + ) { + (self.device_fn_1_3.cmd_write_timestamp2)(command_buffer, stage, query_pool, query) + } + + /// + pub unsafe fn queue_submit2( + &self, + queue: vk::Queue, + submits: &[vk::SubmitInfo2], + fence: vk::Fence, + ) -> VkResult<()> { + (self.device_fn_1_3.queue_submit2)(queue, submits.len() as u32, submits.as_ptr(), fence) + .result() + } + + /// + pub unsafe fn cmd_copy_buffer2( + &self, + command_buffer: vk::CommandBuffer, + copy_buffer_info: &vk::CopyBufferInfo2, + ) { + (self.device_fn_1_3.cmd_copy_buffer2)(command_buffer, copy_buffer_info) + } + /// + pub unsafe fn cmd_copy_image2( + &self, + command_buffer: vk::CommandBuffer, + copy_image_info: &vk::CopyImageInfo2, + ) { + (self.device_fn_1_3.cmd_copy_image2)(command_buffer, copy_image_info) + } + /// + pub unsafe fn cmd_copy_buffer_to_image2( + &self, + command_buffer: vk::CommandBuffer, + copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2, + ) { + (self.device_fn_1_3.cmd_copy_buffer_to_image2)(command_buffer, copy_buffer_to_image_info) + } + /// + pub unsafe fn cmd_copy_image_to_buffer2( + &self, + command_buffer: vk::CommandBuffer, + copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2, + ) { + (self.device_fn_1_3.cmd_copy_image_to_buffer2)(command_buffer, copy_image_to_buffer_info) + } + /// + pub unsafe fn cmd_blit_image2( + &self, + command_buffer: vk::CommandBuffer, + blit_image_info: &vk::BlitImageInfo2, + ) { + (self.device_fn_1_3.cmd_blit_image2)(command_buffer, blit_image_info) + } + /// + pub unsafe fn cmd_resolve_image2( + &self, + command_buffer: vk::CommandBuffer, + resolve_image_info: &vk::ResolveImageInfo2, + ) { + (self.device_fn_1_3.cmd_resolve_image2)(command_buffer, resolve_image_info) + } + + /// + pub unsafe fn cmd_begin_rendering( + &self, + command_buffer: vk::CommandBuffer, + rendering_info: &vk::RenderingInfo, + ) { + (self.device_fn_1_3.cmd_begin_rendering)(command_buffer, rendering_info) + } + + /// + pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) { + (self.device_fn_1_3.cmd_end_rendering)(command_buffer) + } + + /// + pub unsafe fn cmd_set_cull_mode( + &self, + command_buffer: vk::CommandBuffer, + cull_mode: vk::CullModeFlags, + ) { + (self.device_fn_1_3.cmd_set_cull_mode)(command_buffer, cull_mode) + } + + /// + pub unsafe fn cmd_set_front_face( + &self, + command_buffer: vk::CommandBuffer, + front_face: vk::FrontFace, + ) { + (self.device_fn_1_3.cmd_set_front_face)(command_buffer, front_face) + } + + /// + pub unsafe fn cmd_set_primitive_topology( + &self, + command_buffer: vk::CommandBuffer, + primitive_topology: vk::PrimitiveTopology, + ) { + (self.device_fn_1_3.cmd_set_primitive_topology)(command_buffer, primitive_topology) + } + + /// + pub unsafe fn cmd_set_viewport_with_count( + &self, + command_buffer: vk::CommandBuffer, + viewports: &[vk::Viewport], + ) { + (self.device_fn_1_3.cmd_set_viewport_with_count)( + command_buffer, + viewports.len() as u32, + viewports.as_ptr(), + ) + } + + /// + pub unsafe fn cmd_set_scissor_with_count( + &self, + command_buffer: vk::CommandBuffer, + scissors: &[vk::Rect2D], + ) { + (self.device_fn_1_3.cmd_set_scissor_with_count)( + command_buffer, + scissors.len() as u32, + scissors.as_ptr(), + ) + } + + /// + pub unsafe fn cmd_bind_vertex_buffers2( + &self, + command_buffer: vk::CommandBuffer, + first_binding: u32, + buffers: &[vk::Buffer], + offsets: &[vk::DeviceSize], + sizes: Option<&[vk::DeviceSize]>, + strides: Option<&[vk::DeviceSize]>, + ) { + assert_eq!(offsets.len(), buffers.len()); + let p_sizes = if let Some(sizes) = sizes { + assert_eq!(sizes.len(), buffers.len()); + sizes.as_ptr() + } else { + ptr::null() + }; + let p_strides = if let Some(strides) = strides { + assert_eq!(strides.len(), buffers.len()); + strides.as_ptr() + } else { + ptr::null() + }; + (self.device_fn_1_3.cmd_bind_vertex_buffers2)( + command_buffer, + first_binding, + buffers.len() as u32, + buffers.as_ptr(), + offsets.as_ptr(), + p_sizes, + p_strides, + ) + } + + /// + pub unsafe fn cmd_set_depth_test_enable( + &self, + command_buffer: vk::CommandBuffer, + depth_test_enable: bool, + ) { + (self.device_fn_1_3.cmd_set_depth_test_enable)(command_buffer, depth_test_enable.into()) + } + + /// + pub unsafe fn cmd_set_depth_write_enable( + &self, + command_buffer: vk::CommandBuffer, + depth_write_enable: bool, + ) { + (self.device_fn_1_3.cmd_set_depth_write_enable)(command_buffer, depth_write_enable.into()) + } + + /// + pub unsafe fn cmd_set_depth_compare_op( + &self, + command_buffer: vk::CommandBuffer, + depth_compare_op: vk::CompareOp, + ) { + (self.device_fn_1_3.cmd_set_depth_compare_op)(command_buffer, depth_compare_op) + } + + /// + pub unsafe fn cmd_set_depth_bounds_test_enable( + &self, + command_buffer: vk::CommandBuffer, + depth_bounds_test_enable: bool, + ) { + (self.device_fn_1_3.cmd_set_depth_bounds_test_enable)( + command_buffer, + depth_bounds_test_enable.into(), + ) + } + + /// + pub unsafe fn cmd_set_stencil_test_enable( + &self, + command_buffer: vk::CommandBuffer, + stencil_test_enable: bool, + ) { + (self.device_fn_1_3.cmd_set_stencil_test_enable)(command_buffer, stencil_test_enable.into()) + } + + /// + pub unsafe fn cmd_set_stencil_op( + &self, + command_buffer: vk::CommandBuffer, + face_mask: vk::StencilFaceFlags, + fail_op: vk::StencilOp, + pass_op: vk::StencilOp, + depth_fail_op: vk::StencilOp, + compare_op: vk::CompareOp, + ) { + (self.device_fn_1_3.cmd_set_stencil_op)( + command_buffer, + face_mask, + fail_op, + pass_op, + depth_fail_op, + compare_op, + ) + } + + /// + pub unsafe fn cmd_set_rasterizer_discard_enable( + &self, + command_buffer: vk::CommandBuffer, + rasterizer_discard_enable: bool, + ) { + (self.device_fn_1_3.cmd_set_rasterizer_discard_enable)( + command_buffer, + rasterizer_discard_enable.into(), + ) + } + + /// + pub unsafe fn cmd_set_depth_bias_enable( + &self, + command_buffer: vk::CommandBuffer, + depth_bias_enable: bool, + ) { + (self.device_fn_1_3.cmd_set_depth_bias_enable)(command_buffer, depth_bias_enable.into()) + } + + /// + pub unsafe fn cmd_set_primitive_restart_enable( + &self, + command_buffer: vk::CommandBuffer, + primitive_restart_enable: bool, + ) { + (self.device_fn_1_3.cmd_set_primitive_restart_enable)( + command_buffer, + primitive_restart_enable.into(), + ) + } + + /// + pub unsafe fn get_device_buffer_memory_requirements( + &self, + create_info: &vk::DeviceBufferMemoryRequirements, + out: &mut vk::MemoryRequirements2, + ) { + (self.device_fn_1_3.get_device_buffer_memory_requirements)(self.handle, create_info, out) + } + + /// + pub unsafe fn get_device_image_memory_requirements( + &self, + create_info: &vk::DeviceImageMemoryRequirements, + out: &mut vk::MemoryRequirements2, + ) { + (self.device_fn_1_3.get_device_image_memory_requirements)(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()] + pub unsafe fn get_device_image_sparse_memory_requirements_len( + &self, + create_info: &vk::DeviceImageMemoryRequirements, + ) -> usize { + let mut count = 0; + (self + .device_fn_1_3 + .get_device_image_sparse_memory_requirements)( + self.handle, + create_info, + &mut count, + std::ptr::null_mut(), + ); + count as usize + } + + /// + /// + /// 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`. + /// 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, + create_info: &vk::DeviceImageMemoryRequirements, + out: &mut [vk::SparseImageMemoryRequirements2], + ) { + let mut count = out.len() as u32; + (self + .device_fn_1_3 + .get_device_image_sparse_memory_requirements)( + self.handle, + create_info, + &mut count, + out.as_mut_ptr(), + ); + assert_eq!(count as usize, out.len()); + } +} + /// Vulkan core 1.2 #[allow(non_camel_case_types)] impl Device { @@ -43,7 +490,7 @@ impl Device { &self.device_fn_1_2 } - #[doc = ""] + /// pub unsafe fn cmd_draw_indirect_count( &self, command_buffer: vk::CommandBuffer, @@ -54,7 +501,7 @@ impl Device { max_draw_count: u32, stride: u32, ) { - self.device_fn_1_2.cmd_draw_indirect_count( + (self.device_fn_1_2.cmd_draw_indirect_count)( command_buffer, buffer, offset, @@ -65,7 +512,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_draw_indexed_indirect_count( &self, command_buffer: vk::CommandBuffer, @@ -76,7 +523,7 @@ impl Device { max_draw_count: u32, stride: u32, ) { - self.device_fn_1_2.cmd_draw_indexed_indirect_count( + (self.device_fn_1_2.cmd_draw_indexed_indirect_count)( command_buffer, buffer, offset, @@ -87,120 +534,112 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn create_render_pass2( &self, create_info: &vk::RenderPassCreateInfo2, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut renderpass = mem::zeroed(); - self.device_fn_1_2 - .create_render_pass2( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut renderpass, - ) - .result_with_success(renderpass) + (self.device_fn_1_2.create_render_pass2)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut renderpass, + ) + .result_with_success(renderpass) } - #[doc = ""] + /// pub unsafe fn cmd_begin_render_pass2( &self, command_buffer: vk::CommandBuffer, render_pass_begin_info: &vk::RenderPassBeginInfo, subpass_begin_info: &vk::SubpassBeginInfo, ) { - self.device_fn_1_2.cmd_begin_render_pass2( + (self.device_fn_1_2.cmd_begin_render_pass2)( command_buffer, render_pass_begin_info, subpass_begin_info, ); } - #[doc = ""] + /// pub unsafe fn cmd_next_subpass2( &self, command_buffer: vk::CommandBuffer, subpass_begin_info: &vk::SubpassBeginInfo, subpass_end_info: &vk::SubpassEndInfo, ) { - self.device_fn_1_2 - .cmd_next_subpass2(command_buffer, subpass_begin_info, subpass_end_info); + (self.device_fn_1_2.cmd_next_subpass2)( + command_buffer, + subpass_begin_info, + subpass_end_info, + ); } - #[doc = ""] + /// pub unsafe fn cmd_end_render_pass2( &self, command_buffer: vk::CommandBuffer, subpass_end_info: &vk::SubpassEndInfo, ) { - self.device_fn_1_2 - .cmd_end_render_pass2(command_buffer, subpass_end_info); + (self.device_fn_1_2.cmd_end_render_pass2)(command_buffer, subpass_end_info); } - #[doc = ""] + /// pub unsafe fn reset_query_pool( &self, query_pool: vk::QueryPool, first_query: u32, query_count: u32, ) { - self.device_fn_1_2 - .reset_query_pool(self.handle(), query_pool, first_query, query_count); + (self.device_fn_1_2.reset_query_pool)(self.handle(), query_pool, first_query, query_count); } - #[doc = ""] + /// pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { let mut value = 0; - self.device_fn_1_2 - .get_semaphore_counter_value(self.handle(), semaphore, &mut value) + (self.device_fn_1_2.get_semaphore_counter_value)(self.handle(), semaphore, &mut value) .result_with_success(value) } - #[doc = ""] + /// pub unsafe fn wait_semaphores( &self, wait_info: &vk::SemaphoreWaitInfo, timeout: u64, ) -> VkResult<()> { - self.device_fn_1_2 - .wait_semaphores(self.handle(), wait_info, timeout) - .result() + (self.device_fn_1_2.wait_semaphores)(self.handle(), wait_info, timeout).result() } - #[doc = ""] + /// pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> { - self.device_fn_1_2 - .signal_semaphore(self.handle(), signal_info) - .result() + (self.device_fn_1_2.signal_semaphore)(self.handle(), signal_info).result() } - #[doc = ""] + /// pub unsafe fn get_buffer_device_address( &self, info: &vk::BufferDeviceAddressInfo, ) -> vk::DeviceAddress { - self.device_fn_1_2 - .get_buffer_device_address(self.handle(), info) + (self.device_fn_1_2.get_buffer_device_address)(self.handle(), info) } - #[doc = ""] + /// pub unsafe fn get_buffer_opaque_capture_address( &self, info: &vk::BufferDeviceAddressInfo, ) -> u64 { - self.device_fn_1_2 - .get_buffer_opaque_capture_address(self.handle(), info) + (self.device_fn_1_2.get_buffer_opaque_capture_address)(self.handle(), info) } - #[doc = ""] + /// pub unsafe fn get_device_memory_opaque_capture_address( &self, info: &vk::DeviceMemoryOpaqueCaptureAddressInfo, ) -> u64 { - self.device_fn_1_2 - .get_device_memory_opaque_capture_address(self.handle(), info) + (self.device_fn_1_2.get_device_memory_opaque_capture_address)(self.handle(), info) } } @@ -211,27 +650,33 @@ impl Device { &self.device_fn_1_1 } - #[doc = ""] + /// pub unsafe fn bind_buffer_memory2( &self, bind_infos: &[vk::BindBufferMemoryInfo], ) -> VkResult<()> { - self.device_fn_1_1 - .bind_buffer_memory2(self.handle(), bind_infos.len() as _, bind_infos.as_ptr()) - .result() + (self.device_fn_1_1.bind_buffer_memory2)( + self.handle(), + bind_infos.len() as _, + bind_infos.as_ptr(), + ) + .result() } - #[doc = ""] + /// pub unsafe fn bind_image_memory2( &self, bind_infos: &[vk::BindImageMemoryInfo], ) -> VkResult<()> { - self.device_fn_1_1 - .bind_image_memory2(self.handle(), bind_infos.len() as _, bind_infos.as_ptr()) - .result() + (self.device_fn_1_1.bind_image_memory2)( + self.handle(), + bind_infos.len() as _, + bind_infos.as_ptr(), + ) + .result() } - #[doc = ""] + /// pub unsafe fn get_device_group_peer_memory_features( &self, heap_index: u32, @@ -239,7 +684,7 @@ impl Device { remote_device_index: u32, ) -> vk::PeerMemoryFeatureFlags { let mut peer_memory_features = mem::zeroed(); - self.device_fn_1_1.get_device_group_peer_memory_features( + (self.device_fn_1_1.get_device_group_peer_memory_features)( self.handle(), heap_index, local_device_index, @@ -249,13 +694,12 @@ impl Device { peer_memory_features } - #[doc = ""] + /// pub unsafe fn cmd_set_device_mask(&self, command_buffer: vk::CommandBuffer, device_mask: u32) { - self.device_fn_1_1 - .cmd_set_device_mask(command_buffer, device_mask); + (self.device_fn_1_1.cmd_set_device_mask)(command_buffer, device_mask); } - #[doc = ""] + /// pub unsafe fn cmd_dispatch_base( &self, command_buffer: vk::CommandBuffer, @@ -266,7 +710,7 @@ impl Device { group_count_y: u32, group_count_z: u32, ) { - self.device_fn_1_1.cmd_dispatch_base( + (self.device_fn_1_1.cmd_dispatch_base)( command_buffer, base_group_x, base_group_y, @@ -277,33 +721,31 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn get_image_memory_requirements2( &self, info: &vk::ImageMemoryRequirementsInfo2, out: &mut vk::MemoryRequirements2, ) { - self.device_fn_1_1 - .get_image_memory_requirements2(self.handle(), info, out); + (self.device_fn_1_1.get_image_memory_requirements2)(self.handle(), info, out); } - #[doc = ""] + /// pub unsafe fn get_buffer_memory_requirements2( &self, info: &vk::BufferMemoryRequirementsInfo2, out: &mut vk::MemoryRequirements2, ) { - self.device_fn_1_1 - .get_buffer_memory_requirements2(self.handle(), info, out); + (self.device_fn_1_1.get_buffer_memory_requirements2)(self.handle(), info, out); } - /// Retrieve the number of elements to pass to [`Self::get_image_sparse_memory_requirements2()`] + /// Retrieve the number of elements to pass to [`get_image_sparse_memory_requirements2()`][Self::get_image_sparse_memory_requirements2()] pub unsafe fn get_image_sparse_memory_requirements2_len( &self, info: &vk::ImageSparseMemoryRequirementsInfo2, ) -> usize { let mut count = 0; - self.device_fn_1_1.get_image_sparse_memory_requirements2( + (self.device_fn_1_1.get_image_sparse_memory_requirements2)( self.handle(), info, &mut count, @@ -312,9 +754,9 @@ impl Device { count as usize } - #[doc = ""] + /// /// - /// Call [`Self::get_image_sparse_memory_requirements2_len()`] to query the number of elements to pass to `out`. + /// Call [`get_image_sparse_memory_requirements2_len()`][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, @@ -322,92 +764,90 @@ impl Device { out: &mut [vk::SparseImageMemoryRequirements2], ) { let mut count = out.len() as u32; - self.device_fn_1_1.get_image_sparse_memory_requirements2( + (self.device_fn_1_1.get_image_sparse_memory_requirements2)( self.handle(), info, &mut count, out.as_mut_ptr(), ); + assert_eq!(count as usize, out.len()); } - #[doc = ""] + /// pub unsafe fn trim_command_pool( &self, command_pool: vk::CommandPool, flags: vk::CommandPoolTrimFlags, ) { - self.device_fn_1_1 - .trim_command_pool(self.handle(), command_pool, flags); + (self.device_fn_1_1.trim_command_pool)(self.handle(), command_pool, flags); } - #[doc = ""] + /// pub unsafe fn create_sampler_ycbcr_conversion( &self, create_info: &vk::SamplerYcbcrConversionCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut ycbcr_conversion = mem::zeroed(); - self.device_fn_1_1 - .create_sampler_ycbcr_conversion( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut ycbcr_conversion, - ) - .result_with_success(ycbcr_conversion) + (self.device_fn_1_1.create_sampler_ycbcr_conversion)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut ycbcr_conversion, + ) + .result_with_success(ycbcr_conversion) } - #[doc = ""] + /// pub unsafe fn destroy_sampler_ycbcr_conversion( &self, ycbcr_conversion: vk::SamplerYcbcrConversion, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_1.destroy_sampler_ycbcr_conversion( + (self.device_fn_1_1.destroy_sampler_ycbcr_conversion)( self.handle(), ycbcr_conversion, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn create_descriptor_update_template( &self, create_info: &vk::DescriptorUpdateTemplateCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut descriptor_update_template = mem::zeroed(); - self.device_fn_1_1 - .create_descriptor_update_template( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut descriptor_update_template, - ) - .result_with_success(descriptor_update_template) + (self.device_fn_1_1.create_descriptor_update_template)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut descriptor_update_template, + ) + .result_with_success(descriptor_update_template) } - #[doc = ""] + /// pub unsafe fn destroy_descriptor_update_template( &self, descriptor_update_template: vk::DescriptorUpdateTemplate, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_1.destroy_descriptor_update_template( + (self.device_fn_1_1.destroy_descriptor_update_template)( self.handle(), descriptor_update_template, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn update_descriptor_set_with_template( &self, descriptor_set: vk::DescriptorSet, descriptor_update_template: vk::DescriptorUpdateTemplate, data: *const c_void, ) { - self.device_fn_1_1.update_descriptor_set_with_template( + (self.device_fn_1_1.update_descriptor_set_with_template)( self.handle(), descriptor_set, descriptor_update_template, @@ -415,14 +855,13 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn get_descriptor_set_layout_support( &self, create_info: &vk::DescriptorSetLayoutCreateInfo, out: &mut vk::DescriptorSetLayoutSupport, ) { - self.device_fn_1_1 - .get_descriptor_set_layout_support(self.handle(), create_info, out); + (self.device_fn_1_1.get_descriptor_set_layout_support)(self.handle(), create_info, out); } } @@ -433,42 +872,40 @@ impl Device { &self.device_fn_1_0 } - #[doc = ""] + /// pub unsafe fn destroy_device(&self, allocation_callbacks: Option<&vk::AllocationCallbacks>) { - self.device_fn_1_0 - .destroy_device(self.handle(), allocation_callbacks.as_raw_ptr()); + (self.device_fn_1_0.destroy_device)(self.handle(), allocation_callbacks.as_raw_ptr()); } - #[doc = ""] + /// pub unsafe fn destroy_sampler( &self, sampler: vk::Sampler, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_sampler( + (self.device_fn_1_0.destroy_sampler)( self.handle(), sampler, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn free_memory( &self, memory: vk::DeviceMemory, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0 - .free_memory(self.handle(), memory, allocation_callbacks.as_raw_ptr()); + (self.device_fn_1_0.free_memory)(self.handle(), memory, allocation_callbacks.as_raw_ptr()); } - #[doc = ""] + /// pub unsafe fn free_command_buffers( &self, command_pool: vk::CommandPool, command_buffers: &[vk::CommandBuffer], ) { - self.device_fn_1_0.free_command_buffers( + (self.device_fn_1_0.free_command_buffers)( self.handle(), command_pool, command_buffers.len() as u32, @@ -476,28 +913,27 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn create_event( &self, create_info: &vk::EventCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut event = mem::zeroed(); - self.device_fn_1_0 - .create_event( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut event, - ) - .result_with_success(event) + (self.device_fn_1_0.create_event)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut event, + ) + .result_with_success(event) } /// Returns [`true`] if the event was set, and [`false`] if the event was reset, otherwise it will /// return the error code. - #[doc = ""] + /// pub unsafe fn get_event_status(&self, event: vk::Event) -> VkResult { - let err_code = self.device_fn_1_0.get_event_status(self.handle(), event); + let err_code = (self.device_fn_1_0.get_event_status)(self.handle(), event); match err_code { vk::Result::EVENT_SET => Ok(true), vk::Result::EVENT_RESET => Ok(false), @@ -505,39 +941,35 @@ impl Device { } } - #[doc = ""] + /// pub unsafe fn set_event(&self, event: vk::Event) -> VkResult<()> { - self.device_fn_1_0.set_event(self.handle(), event).result() + (self.device_fn_1_0.set_event)(self.handle(), event).result() } - #[doc = ""] + /// pub unsafe fn reset_event(&self, event: vk::Event) -> VkResult<()> { - self.device_fn_1_0 - .reset_event(self.handle(), event) - .result() + (self.device_fn_1_0.reset_event)(self.handle(), event).result() } - #[doc = ""] + /// pub unsafe fn cmd_set_event( &self, command_buffer: vk::CommandBuffer, event: vk::Event, stage_mask: vk::PipelineStageFlags, ) { - self.device_fn_1_0 - .cmd_set_event(command_buffer, event, stage_mask); + (self.device_fn_1_0.cmd_set_event)(command_buffer, event, stage_mask); } - #[doc = ""] + /// pub unsafe fn cmd_reset_event( &self, command_buffer: vk::CommandBuffer, event: vk::Event, stage_mask: vk::PipelineStageFlags, ) { - self.device_fn_1_0 - .cmd_reset_event(command_buffer, event, stage_mask); + (self.device_fn_1_0.cmd_reset_event)(command_buffer, event, stage_mask); } - #[doc = ""] + /// pub unsafe fn cmd_wait_events( &self, command_buffer: vk::CommandBuffer, @@ -548,7 +980,7 @@ impl Device { buffer_memory_barriers: &[vk::BufferMemoryBarrier], image_memory_barriers: &[vk::ImageMemoryBarrier], ) { - self.device_fn_1_0.cmd_wait_events( + (self.device_fn_1_0.cmd_wait_events)( command_buffer, events.len() as _, events.as_ptr(), @@ -563,225 +995,224 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn destroy_fence( &self, fence: vk::Fence, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0 - .destroy_fence(self.handle(), fence, allocation_callbacks.as_raw_ptr()); + (self.device_fn_1_0.destroy_fence)(self.handle(), fence, allocation_callbacks.as_raw_ptr()); } - #[doc = ""] + /// pub unsafe fn destroy_event( &self, event: vk::Event, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0 - .destroy_event(self.handle(), event, allocation_callbacks.as_raw_ptr()); + (self.device_fn_1_0.destroy_event)(self.handle(), event, allocation_callbacks.as_raw_ptr()); } - #[doc = ""] + /// pub unsafe fn destroy_image( &self, image: vk::Image, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0 - .destroy_image(self.handle(), image, allocation_callbacks.as_raw_ptr()); + (self.device_fn_1_0.destroy_image)(self.handle(), image, allocation_callbacks.as_raw_ptr()); } - #[doc = ""] + /// pub unsafe fn destroy_command_pool( &self, pool: vk::CommandPool, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_command_pool( + (self.device_fn_1_0.destroy_command_pool)( self.handle(), pool, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_image_view( &self, image_view: vk::ImageView, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_image_view( + (self.device_fn_1_0.destroy_image_view)( self.handle(), image_view, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_render_pass( &self, renderpass: vk::RenderPass, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_render_pass( + (self.device_fn_1_0.destroy_render_pass)( self.handle(), renderpass, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_framebuffer( &self, framebuffer: vk::Framebuffer, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_framebuffer( + (self.device_fn_1_0.destroy_framebuffer)( self.handle(), framebuffer, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_pipeline_layout( &self, pipeline_layout: vk::PipelineLayout, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_pipeline_layout( + (self.device_fn_1_0.destroy_pipeline_layout)( self.handle(), pipeline_layout, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_pipeline_cache( &self, pipeline_cache: vk::PipelineCache, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_pipeline_cache( + (self.device_fn_1_0.destroy_pipeline_cache)( self.handle(), pipeline_cache, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_buffer( &self, buffer: vk::Buffer, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0 - .destroy_buffer(self.handle(), buffer, allocation_callbacks.as_raw_ptr()); + (self.device_fn_1_0.destroy_buffer)( + self.handle(), + buffer, + allocation_callbacks.as_raw_ptr(), + ); } - #[doc = ""] + /// pub unsafe fn destroy_shader_module( &self, shader: vk::ShaderModule, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_shader_module( + (self.device_fn_1_0.destroy_shader_module)( self.handle(), shader, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_pipeline( &self, pipeline: vk::Pipeline, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_pipeline( + (self.device_fn_1_0.destroy_pipeline)( self.handle(), pipeline, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_semaphore( &self, semaphore: vk::Semaphore, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_semaphore( + (self.device_fn_1_0.destroy_semaphore)( self.handle(), semaphore, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_descriptor_pool( &self, pool: vk::DescriptorPool, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_descriptor_pool( + (self.device_fn_1_0.destroy_descriptor_pool)( self.handle(), pool, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_query_pool( &self, pool: vk::QueryPool, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_query_pool( + (self.device_fn_1_0.destroy_query_pool)( self.handle(), pool, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn destroy_descriptor_set_layout( &self, layout: vk::DescriptorSetLayout, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_descriptor_set_layout( + (self.device_fn_1_0.destroy_descriptor_set_layout)( self.handle(), layout, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn free_descriptor_sets( &self, pool: vk::DescriptorPool, descriptor_sets: &[vk::DescriptorSet], ) -> VkResult<()> { - self.device_fn_1_0 - .free_descriptor_sets( - self.handle(), - pool, - descriptor_sets.len() as u32, - descriptor_sets.as_ptr(), - ) - .result() + (self.device_fn_1_0.free_descriptor_sets)( + self.handle(), + pool, + descriptor_sets.len() as u32, + descriptor_sets.as_ptr(), + ) + .result() } - #[doc = ""] + /// pub unsafe fn update_descriptor_sets( &self, descriptor_writes: &[vk::WriteDescriptorSet], descriptor_copies: &[vk::CopyDescriptorSet], ) { - self.device_fn_1_0.update_descriptor_sets( + (self.device_fn_1_0.update_descriptor_sets)( self.handle(), descriptor_writes.len() as u32, descriptor_writes.as_ptr(), @@ -790,24 +1221,23 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn create_sampler( &self, create_info: &vk::SamplerCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut sampler = mem::zeroed(); - self.device_fn_1_0 - .create_sampler( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut sampler, - ) - .result_with_success(sampler) + (self.device_fn_1_0.create_sampler)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut sampler, + ) + .result_with_success(sampler) } - #[doc = ""] + /// pub unsafe fn cmd_blit_image( &self, command_buffer: vk::CommandBuffer, @@ -818,7 +1248,7 @@ impl Device { regions: &[vk::ImageBlit], filter: vk::Filter, ) { - self.device_fn_1_0.cmd_blit_image( + (self.device_fn_1_0.cmd_blit_image)( command_buffer, src_image, src_image_layout, @@ -830,7 +1260,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_resolve_image( &self, command_buffer: vk::CommandBuffer, @@ -840,7 +1270,7 @@ impl Device { dst_image_layout: vk::ImageLayout, regions: &[vk::ImageResolve], ) { - self.device_fn_1_0.cmd_resolve_image( + (self.device_fn_1_0.cmd_resolve_image)( command_buffer, src_image, src_image_layout, @@ -851,7 +1281,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_fill_buffer( &self, command_buffer: vk::CommandBuffer, @@ -860,11 +1290,10 @@ impl Device { size: vk::DeviceSize, data: u32, ) { - self.device_fn_1_0 - .cmd_fill_buffer(command_buffer, buffer, offset, size, data); + (self.device_fn_1_0.cmd_fill_buffer)(command_buffer, buffer, offset, size, data); } - #[doc = ""] + /// pub unsafe fn cmd_update_buffer( &self, command_buffer: vk::CommandBuffer, @@ -872,7 +1301,7 @@ impl Device { offset: vk::DeviceSize, data: &[u8], ) { - self.device_fn_1_0.cmd_update_buffer( + (self.device_fn_1_0.cmd_update_buffer)( command_buffer, buffer, offset, @@ -881,7 +1310,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_copy_buffer( &self, command_buffer: vk::CommandBuffer, @@ -889,7 +1318,7 @@ impl Device { dst_buffer: vk::Buffer, regions: &[vk::BufferCopy], ) { - self.device_fn_1_0.cmd_copy_buffer( + (self.device_fn_1_0.cmd_copy_buffer)( command_buffer, src_buffer, dst_buffer, @@ -898,7 +1327,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_copy_image_to_buffer( &self, command_buffer: vk::CommandBuffer, @@ -907,7 +1336,7 @@ impl Device { dst_buffer: vk::Buffer, regions: &[vk::BufferImageCopy], ) { - self.device_fn_1_0.cmd_copy_image_to_buffer( + (self.device_fn_1_0.cmd_copy_image_to_buffer)( command_buffer, src_image, src_image_layout, @@ -917,7 +1346,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_copy_buffer_to_image( &self, command_buffer: vk::CommandBuffer, @@ -926,7 +1355,7 @@ impl Device { dst_image_layout: vk::ImageLayout, regions: &[vk::BufferImageCopy], ) { - self.device_fn_1_0.cmd_copy_buffer_to_image( + (self.device_fn_1_0.cmd_copy_buffer_to_image)( command_buffer, src_buffer, dst_image, @@ -936,7 +1365,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_copy_image( &self, command_buffer: vk::CommandBuffer, @@ -946,7 +1375,7 @@ impl Device { dst_image_layout: vk::ImageLayout, regions: &[vk::ImageCopy], ) { - self.device_fn_1_0.cmd_copy_image( + (self.device_fn_1_0.cmd_copy_image)( command_buffer, src_image, src_image_layout, @@ -957,13 +1386,13 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn allocate_descriptor_sets( &self, create_info: &vk::DescriptorSetAllocateInfo, ) -> VkResult> { let mut desc_set = Vec::with_capacity(create_info.descriptor_set_count as usize); - let err_code = self.device_fn_1_0.allocate_descriptor_sets( + let err_code = (self.device_fn_1_0.allocate_descriptor_sets)( self.handle(), create_info, desc_set.as_mut_ptr(), @@ -973,86 +1402,77 @@ impl Device { err_code.result_with_success(desc_set) } - #[doc = ""] + /// pub unsafe fn create_descriptor_set_layout( &self, create_info: &vk::DescriptorSetLayoutCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut layout = mem::zeroed(); - self.device_fn_1_0 - .create_descriptor_set_layout( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut layout, - ) - .result_with_success(layout) + (self.device_fn_1_0.create_descriptor_set_layout)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut layout, + ) + .result_with_success(layout) } - #[doc = ""] + /// pub unsafe fn device_wait_idle(&self) -> VkResult<()> { - self.device_fn_1_0.device_wait_idle(self.handle()).result() + (self.device_fn_1_0.device_wait_idle)(self.handle()).result() } - #[doc = ""] + /// pub unsafe fn create_descriptor_pool( &self, create_info: &vk::DescriptorPoolCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut pool = mem::zeroed(); - self.device_fn_1_0 - .create_descriptor_pool( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut pool, - ) - .result_with_success(pool) + (self.device_fn_1_0.create_descriptor_pool)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut pool, + ) + .result_with_success(pool) } - #[doc = ""] + /// pub unsafe fn reset_descriptor_pool( &self, pool: vk::DescriptorPool, flags: vk::DescriptorPoolResetFlags, ) -> VkResult<()> { - self.device_fn_1_0 - .reset_descriptor_pool(self.handle(), pool, flags) - .result() + (self.device_fn_1_0.reset_descriptor_pool)(self.handle(), pool, flags).result() } - #[doc = ""] + /// pub unsafe fn reset_command_pool( &self, command_pool: vk::CommandPool, flags: vk::CommandPoolResetFlags, ) -> VkResult<()> { - self.device_fn_1_0 - .reset_command_pool(self.handle(), command_pool, flags) - .result() + (self.device_fn_1_0.reset_command_pool)(self.handle(), command_pool, flags).result() } - #[doc = ""] + /// pub unsafe fn reset_command_buffer( &self, command_buffer: vk::CommandBuffer, flags: vk::CommandBufferResetFlags, ) -> VkResult<()> { - self.device_fn_1_0 - .reset_command_buffer(command_buffer, flags) - .result() + (self.device_fn_1_0.reset_command_buffer)(command_buffer, flags).result() } - #[doc = ""] + /// pub unsafe fn reset_fences(&self, fences: &[vk::Fence]) -> VkResult<()> { - self.device_fn_1_0 - .reset_fences(self.handle(), fences.len() as u32, fences.as_ptr()) + (self.device_fn_1_0.reset_fences)(self.handle(), fences.len() as u32, fences.as_ptr()) .result() } - #[doc = ""] + /// pub unsafe fn cmd_bind_index_buffer( &self, command_buffer: vk::CommandBuffer, @@ -1060,11 +1480,10 @@ impl Device { offset: vk::DeviceSize, index_type: vk::IndexType, ) { - self.device_fn_1_0 - .cmd_bind_index_buffer(command_buffer, buffer, offset, index_type); + (self.device_fn_1_0.cmd_bind_index_buffer)(command_buffer, buffer, offset, index_type); } - #[doc = ""] + /// pub unsafe fn cmd_clear_color_image( &self, command_buffer: vk::CommandBuffer, @@ -1073,7 +1492,7 @@ impl Device { clear_color_value: &vk::ClearColorValue, ranges: &[vk::ImageSubresourceRange], ) { - self.device_fn_1_0.cmd_clear_color_image( + (self.device_fn_1_0.cmd_clear_color_image)( command_buffer, image, image_layout, @@ -1083,7 +1502,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_clear_depth_stencil_image( &self, command_buffer: vk::CommandBuffer, @@ -1092,7 +1511,7 @@ impl Device { clear_depth_stencil_value: &vk::ClearDepthStencilValue, ranges: &[vk::ImageSubresourceRange], ) { - self.device_fn_1_0.cmd_clear_depth_stencil_image( + (self.device_fn_1_0.cmd_clear_depth_stencil_image)( command_buffer, image, image_layout, @@ -1102,14 +1521,14 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_clear_attachments( &self, command_buffer: vk::CommandBuffer, attachments: &[vk::ClearAttachment], rects: &[vk::ClearRect], ) { - self.device_fn_1_0.cmd_clear_attachments( + (self.device_fn_1_0.cmd_clear_attachments)( command_buffer, attachments.len() as u32, attachments.as_ptr(), @@ -1118,7 +1537,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_draw_indexed( &self, command_buffer: vk::CommandBuffer, @@ -1128,7 +1547,7 @@ impl Device { vertex_offset: i32, first_instance: u32, ) { - self.device_fn_1_0.cmd_draw_indexed( + (self.device_fn_1_0.cmd_draw_indexed)( command_buffer, index_count, instance_count, @@ -1138,7 +1557,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_draw_indexed_indirect( &self, command_buffer: vk::CommandBuffer, @@ -1147,7 +1566,7 @@ impl Device { draw_count: u32, stride: u32, ) { - self.device_fn_1_0.cmd_draw_indexed_indirect( + (self.device_fn_1_0.cmd_draw_indexed_indirect)( command_buffer, buffer, offset, @@ -1156,20 +1575,20 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_execute_commands( &self, primary_command_buffer: vk::CommandBuffer, secondary_command_buffers: &[vk::CommandBuffer], ) { - self.device_fn_1_0.cmd_execute_commands( + (self.device_fn_1_0.cmd_execute_commands)( primary_command_buffer, secondary_command_buffers.len() as u32, secondary_command_buffers.as_ptr(), ); } - #[doc = ""] + /// pub unsafe fn cmd_bind_descriptor_sets( &self, command_buffer: vk::CommandBuffer, @@ -1179,7 +1598,7 @@ impl Device { descriptor_sets: &[vk::DescriptorSet], dynamic_offsets: &[u32], ) { - self.device_fn_1_0.cmd_bind_descriptor_sets( + (self.device_fn_1_0.cmd_bind_descriptor_sets)( command_buffer, pipeline_bind_point, layout, @@ -1191,7 +1610,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_copy_query_pool_results( &self, command_buffer: vk::CommandBuffer, @@ -1203,7 +1622,7 @@ impl Device { stride: vk::DeviceSize, flags: vk::QueryResultFlags, ) { - self.device_fn_1_0.cmd_copy_query_pool_results( + (self.device_fn_1_0.cmd_copy_query_pool_results)( command_buffer, query_pool, first_query, @@ -1215,7 +1634,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_push_constants( &self, command_buffer: vk::CommandBuffer, @@ -1224,7 +1643,7 @@ impl Device { offset: u32, constants: &[u8], ) { - self.device_fn_1_0.cmd_push_constants( + (self.device_fn_1_0.cmd_push_constants)( command_buffer, layout, stage_flags, @@ -1234,46 +1653,43 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_begin_render_pass( &self, command_buffer: vk::CommandBuffer, create_info: &vk::RenderPassBeginInfo, contents: vk::SubpassContents, ) { - self.device_fn_1_0 - .cmd_begin_render_pass(command_buffer, create_info, contents); + (self.device_fn_1_0.cmd_begin_render_pass)(command_buffer, create_info, contents); } - #[doc = ""] + /// pub unsafe fn cmd_next_subpass( &self, command_buffer: vk::CommandBuffer, contents: vk::SubpassContents, ) { - self.device_fn_1_0 - .cmd_next_subpass(command_buffer, contents); + (self.device_fn_1_0.cmd_next_subpass)(command_buffer, contents); } - #[doc = ""] + /// pub unsafe fn cmd_bind_pipeline( &self, command_buffer: vk::CommandBuffer, pipeline_bind_point: vk::PipelineBindPoint, pipeline: vk::Pipeline, ) { - self.device_fn_1_0 - .cmd_bind_pipeline(command_buffer, pipeline_bind_point, pipeline); + (self.device_fn_1_0.cmd_bind_pipeline)(command_buffer, pipeline_bind_point, pipeline); } - #[doc = ""] + /// pub unsafe fn cmd_set_scissor( &self, command_buffer: vk::CommandBuffer, first_scissor: u32, scissors: &[vk::Rect2D], ) { - self.device_fn_1_0.cmd_set_scissor( + (self.device_fn_1_0.cmd_set_scissor)( command_buffer, first_scissor, scissors.len() as u32, @@ -1281,13 +1697,12 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_set_line_width(&self, command_buffer: vk::CommandBuffer, line_width: f32) { - self.device_fn_1_0 - .cmd_set_line_width(command_buffer, line_width); + (self.device_fn_1_0.cmd_set_line_width)(command_buffer, line_width); } - #[doc = ""] + /// pub unsafe fn cmd_bind_vertex_buffers( &self, command_buffer: vk::CommandBuffer, @@ -1296,7 +1711,7 @@ impl Device { offsets: &[vk::DeviceSize], ) { debug_assert_eq!(buffers.len(), offsets.len()); - self.device_fn_1_0.cmd_bind_vertex_buffers( + (self.device_fn_1_0.cmd_bind_vertex_buffers)( command_buffer, first_binding, buffers.len() as u32, @@ -1305,12 +1720,12 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_end_render_pass(&self, command_buffer: vk::CommandBuffer) { - self.device_fn_1_0.cmd_end_render_pass(command_buffer); + (self.device_fn_1_0.cmd_end_render_pass)(command_buffer); } - #[doc = ""] + /// pub unsafe fn cmd_draw( &self, command_buffer: vk::CommandBuffer, @@ -1319,7 +1734,7 @@ impl Device { first_vertex: u32, first_instance: u32, ) { - self.device_fn_1_0.cmd_draw( + (self.device_fn_1_0.cmd_draw)( command_buffer, vertex_count, instance_count, @@ -1328,7 +1743,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_draw_indirect( &self, command_buffer: vk::CommandBuffer, @@ -1337,11 +1752,10 @@ impl Device { draw_count: u32, stride: u32, ) { - self.device_fn_1_0 - .cmd_draw_indirect(command_buffer, buffer, offset, draw_count, stride); + (self.device_fn_1_0.cmd_draw_indirect)(command_buffer, buffer, offset, draw_count, stride); } - #[doc = ""] + /// pub unsafe fn cmd_dispatch( &self, command_buffer: vk::CommandBuffer, @@ -1349,7 +1763,7 @@ impl Device { group_count_y: u32, group_count_z: u32, ) { - self.device_fn_1_0.cmd_dispatch( + (self.device_fn_1_0.cmd_dispatch)( command_buffer, group_count_x, group_count_y, @@ -1357,25 +1771,24 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_dispatch_indirect( &self, command_buffer: vk::CommandBuffer, buffer: vk::Buffer, offset: vk::DeviceSize, ) { - self.device_fn_1_0 - .cmd_dispatch_indirect(command_buffer, buffer, offset); + (self.device_fn_1_0.cmd_dispatch_indirect)(command_buffer, buffer, offset); } - #[doc = ""] + /// pub unsafe fn cmd_set_viewport( &self, command_buffer: vk::CommandBuffer, first_viewport: u32, viewports: &[vk::Viewport], ) { - self.device_fn_1_0.cmd_set_viewport( + (self.device_fn_1_0.cmd_set_viewport)( command_buffer, first_viewport, viewports.len() as u32, @@ -1383,7 +1796,7 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn cmd_set_depth_bias( &self, command_buffer: vk::CommandBuffer, @@ -1391,65 +1804,68 @@ impl Device { clamp: f32, slope_factor: f32, ) { - self.device_fn_1_0 - .cmd_set_depth_bias(command_buffer, constant_factor, clamp, slope_factor); + (self.device_fn_1_0.cmd_set_depth_bias)( + command_buffer, + constant_factor, + clamp, + slope_factor, + ); } - #[doc = ""] + /// pub unsafe fn cmd_set_blend_constants( &self, command_buffer: vk::CommandBuffer, blend_constants: &[f32; 4], ) { - self.device_fn_1_0 - .cmd_set_blend_constants(command_buffer, blend_constants); + (self.device_fn_1_0.cmd_set_blend_constants)(command_buffer, blend_constants); } - #[doc = ""] + /// pub unsafe fn cmd_set_depth_bounds( &self, command_buffer: vk::CommandBuffer, min_depth_bounds: f32, max_depth_bounds: f32, ) { - self.device_fn_1_0 - .cmd_set_depth_bounds(command_buffer, min_depth_bounds, max_depth_bounds); + (self.device_fn_1_0.cmd_set_depth_bounds)( + command_buffer, + min_depth_bounds, + max_depth_bounds, + ); } - #[doc = ""] + /// pub unsafe fn cmd_set_stencil_compare_mask( &self, command_buffer: vk::CommandBuffer, face_mask: vk::StencilFaceFlags, compare_mask: u32, ) { - self.device_fn_1_0 - .cmd_set_stencil_compare_mask(command_buffer, face_mask, compare_mask); + (self.device_fn_1_0.cmd_set_stencil_compare_mask)(command_buffer, face_mask, compare_mask); } - #[doc = ""] + /// pub unsafe fn cmd_set_stencil_write_mask( &self, command_buffer: vk::CommandBuffer, face_mask: vk::StencilFaceFlags, write_mask: u32, ) { - self.device_fn_1_0 - .cmd_set_stencil_write_mask(command_buffer, face_mask, write_mask); + (self.device_fn_1_0.cmd_set_stencil_write_mask)(command_buffer, face_mask, write_mask); } - #[doc = ""] + /// pub unsafe fn cmd_set_stencil_reference( &self, command_buffer: vk::CommandBuffer, face_mask: vk::StencilFaceFlags, reference: u32, ) { - self.device_fn_1_0 - .cmd_set_stencil_reference(command_buffer, face_mask, reference); + (self.device_fn_1_0.cmd_set_stencil_reference)(command_buffer, face_mask, reference); } - #[doc = ""] + /// pub unsafe fn get_query_pool_results( &self, query_pool: vk::QueryPool, @@ -1464,21 +1880,20 @@ impl Device { "query_count was higher than the length of the slice" ); let data_size = mem::size_of::() * data_length; - self.device_fn_1_0 - .get_query_pool_results( - self.handle(), - query_pool, - first_query, - query_count, - data_size, - data.as_mut_ptr() as *mut _, - mem::size_of::() as _, - flags, - ) - .result() + (self.device_fn_1_0.get_query_pool_results)( + self.handle(), + query_pool, + first_query, + query_count, + data_size, + data.as_mut_ptr() as *mut _, + mem::size_of::() as _, + flags, + ) + .result() } - #[doc = ""] + /// pub unsafe fn cmd_begin_query( &self, command_buffer: vk::CommandBuffer, @@ -1486,22 +1901,20 @@ impl Device { query: u32, flags: vk::QueryControlFlags, ) { - self.device_fn_1_0 - .cmd_begin_query(command_buffer, query_pool, query, flags); + (self.device_fn_1_0.cmd_begin_query)(command_buffer, query_pool, query, flags); } - #[doc = ""] + /// pub unsafe fn cmd_end_query( &self, command_buffer: vk::CommandBuffer, query_pool: vk::QueryPool, query: u32, ) { - self.device_fn_1_0 - .cmd_end_query(command_buffer, query_pool, query); + (self.device_fn_1_0.cmd_end_query)(command_buffer, query_pool, query); } - #[doc = ""] + /// pub unsafe fn cmd_reset_query_pool( &self, command_buffer: vk::CommandBuffer, @@ -1509,11 +1922,10 @@ impl Device { first_query: u32, query_count: u32, ) { - self.device_fn_1_0 - .cmd_reset_query_pool(command_buffer, pool, first_query, query_count); + (self.device_fn_1_0.cmd_reset_query_pool)(command_buffer, pool, first_query, query_count); } - #[doc = ""] + /// pub unsafe fn cmd_write_timestamp( &self, command_buffer: vk::CommandBuffer, @@ -1521,28 +1933,26 @@ impl Device { query_pool: vk::QueryPool, query: u32, ) { - self.device_fn_1_0 - .cmd_write_timestamp(command_buffer, pipeline_stage, query_pool, query); + (self.device_fn_1_0.cmd_write_timestamp)(command_buffer, pipeline_stage, query_pool, query); } - #[doc = ""] + /// pub unsafe fn create_semaphore( &self, create_info: &vk::SemaphoreCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut semaphore = mem::zeroed(); - self.device_fn_1_0 - .create_semaphore( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut semaphore, - ) - .result_with_success(semaphore) + (self.device_fn_1_0.create_semaphore)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut semaphore, + ) + .result_with_success(semaphore) } - #[doc = ""] + /// pub unsafe fn create_graphics_pipelines( &self, pipeline_cache: vk::PipelineCache, @@ -1550,7 +1960,7 @@ impl Device { allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> Result, (Vec, vk::Result)> { let mut pipelines = Vec::with_capacity(create_infos.len()); - let err_code = self.device_fn_1_0.create_graphics_pipelines( + let err_code = (self.device_fn_1_0.create_graphics_pipelines)( self.handle(), pipeline_cache, create_infos.len() as u32, @@ -1565,7 +1975,7 @@ impl Device { } } - #[doc = ""] + /// pub unsafe fn create_compute_pipelines( &self, pipeline_cache: vk::PipelineCache, @@ -1573,7 +1983,7 @@ impl Device { allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> Result, (Vec, vk::Result)> { let mut pipelines = Vec::with_capacity(create_infos.len()); - let err_code = self.device_fn_1_0.create_compute_pipelines( + let err_code = (self.device_fn_1_0.create_compute_pipelines)( self.handle(), pipeline_cache, create_infos.len() as u32, @@ -1588,64 +1998,61 @@ impl Device { } } - #[doc = ""] + /// pub unsafe fn create_buffer( &self, create_info: &vk::BufferCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut buffer = mem::zeroed(); - self.device_fn_1_0 - .create_buffer( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut buffer, - ) - .result_with_success(buffer) + (self.device_fn_1_0.create_buffer)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut buffer, + ) + .result_with_success(buffer) } - #[doc = ""] + /// pub unsafe fn create_pipeline_layout( &self, create_info: &vk::PipelineLayoutCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut pipeline_layout = mem::zeroed(); - self.device_fn_1_0 - .create_pipeline_layout( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut pipeline_layout, - ) - .result_with_success(pipeline_layout) + (self.device_fn_1_0.create_pipeline_layout)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut pipeline_layout, + ) + .result_with_success(pipeline_layout) } - #[doc = ""] + /// pub unsafe fn create_pipeline_cache( &self, create_info: &vk::PipelineCacheCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut pipeline_cache = mem::zeroed(); - self.device_fn_1_0 - .create_pipeline_cache( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut pipeline_cache, - ) - .result_with_success(pipeline_cache) + (self.device_fn_1_0.create_pipeline_cache)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut pipeline_cache, + ) + .result_with_success(pipeline_cache) } - #[doc = ""] + /// pub unsafe fn get_pipeline_cache_data( &self, pipeline_cache: vk::PipelineCache, ) -> VkResult> { read_into_uninitialized_vector(|count, data| { - self.device_fn_1_0.get_pipeline_cache_data( + (self.device_fn_1_0.get_pipeline_cache_data)( self.handle(), pipeline_cache, count, @@ -1654,23 +2061,22 @@ impl Device { }) } - #[doc = ""] + /// pub unsafe fn merge_pipeline_caches( &self, dst_cache: vk::PipelineCache, src_caches: &[vk::PipelineCache], ) -> VkResult<()> { - self.device_fn_1_0 - .merge_pipeline_caches( - self.handle(), - dst_cache, - src_caches.len() as u32, - src_caches.as_ptr(), - ) - .result() + (self.device_fn_1_0.merge_pipeline_caches)( + self.handle(), + dst_cache, + src_caches.len() as u32, + src_caches.as_ptr(), + ) + .result() } - #[doc = ""] + /// pub unsafe fn map_memory( &self, memory: vk::DeviceMemory, @@ -1679,57 +2085,61 @@ impl Device { flags: vk::MemoryMapFlags, ) -> VkResult<*mut c_void> { let mut data: *mut c_void = ptr::null_mut(); - self.device_fn_1_0 - .map_memory(self.handle(), memory, offset, size, flags, &mut data) + (self.device_fn_1_0.map_memory)(self.handle(), memory, offset, size, flags, &mut data) .result_with_success(data) } - #[doc = ""] + /// pub unsafe fn unmap_memory(&self, memory: vk::DeviceMemory) { - self.device_fn_1_0.unmap_memory(self.handle(), memory); + (self.device_fn_1_0.unmap_memory)(self.handle(), memory); } - #[doc = ""] + /// pub unsafe fn invalidate_mapped_memory_ranges( &self, ranges: &[vk::MappedMemoryRange], ) -> VkResult<()> { - self.device_fn_1_0 - .invalidate_mapped_memory_ranges(self.handle(), ranges.len() as u32, ranges.as_ptr()) - .result() + (self.device_fn_1_0.invalidate_mapped_memory_ranges)( + self.handle(), + ranges.len() as u32, + ranges.as_ptr(), + ) + .result() } - #[doc = ""] + /// pub unsafe fn flush_mapped_memory_ranges( &self, ranges: &[vk::MappedMemoryRange], ) -> VkResult<()> { - self.device_fn_1_0 - .flush_mapped_memory_ranges(self.handle(), ranges.len() as u32, ranges.as_ptr()) - .result() + (self.device_fn_1_0.flush_mapped_memory_ranges)( + self.handle(), + ranges.len() as u32, + ranges.as_ptr(), + ) + .result() } - #[doc = ""] + /// pub unsafe fn create_framebuffer( &self, create_info: &vk::FramebufferCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut framebuffer = mem::zeroed(); - self.device_fn_1_0 - .create_framebuffer( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut framebuffer, - ) - .result_with_success(framebuffer) + (self.device_fn_1_0.create_framebuffer)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut framebuffer, + ) + .result_with_success(framebuffer) } - #[doc = ""] + /// pub unsafe fn get_device_queue(&self, queue_family_index: u32, queue_index: u32) -> vk::Queue { let mut queue = mem::zeroed(); - self.device_fn_1_0.get_device_queue( + (self.device_fn_1_0.get_device_queue)( self.handle(), queue_family_index, queue_index, @@ -1738,7 +2148,7 @@ impl Device { queue } - #[doc = ""] + /// pub unsafe fn cmd_pipeline_barrier( &self, command_buffer: vk::CommandBuffer, @@ -1749,7 +2159,7 @@ impl Device { buffer_memory_barriers: &[vk::BufferMemoryBarrier], image_memory_barriers: &[vk::ImageMemoryBarrier], ) { - self.device_fn_1_0.cmd_pipeline_barrier( + (self.device_fn_1_0.cmd_pipeline_barrier)( command_buffer, src_stage_mask, dst_stage_mask, @@ -1763,62 +2173,56 @@ impl Device { ); } - #[doc = ""] + /// pub unsafe fn create_render_pass( &self, create_info: &vk::RenderPassCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut renderpass = mem::zeroed(); - self.device_fn_1_0 - .create_render_pass( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut renderpass, - ) - .result_with_success(renderpass) + (self.device_fn_1_0.create_render_pass)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut renderpass, + ) + .result_with_success(renderpass) } - #[doc = ""] + /// pub unsafe fn begin_command_buffer( &self, command_buffer: vk::CommandBuffer, begin_info: &vk::CommandBufferBeginInfo, ) -> VkResult<()> { - self.device_fn_1_0 - .begin_command_buffer(command_buffer, begin_info) - .result() + (self.device_fn_1_0.begin_command_buffer)(command_buffer, begin_info).result() } - #[doc = ""] + /// pub unsafe fn end_command_buffer(&self, command_buffer: vk::CommandBuffer) -> VkResult<()> { - self.device_fn_1_0 - .end_command_buffer(command_buffer) - .result() + (self.device_fn_1_0.end_command_buffer)(command_buffer).result() } - #[doc = ""] + /// pub unsafe fn wait_for_fences( &self, fences: &[vk::Fence], wait_all: bool, timeout: u64, ) -> VkResult<()> { - self.device_fn_1_0 - .wait_for_fences( - self.handle(), - fences.len() as u32, - fences.as_ptr(), - wait_all as u32, - timeout, - ) - .result() + (self.device_fn_1_0.wait_for_fences)( + self.handle(), + fences.len() as u32, + fences.as_ptr(), + wait_all as u32, + timeout, + ) + .result() } - #[doc = ""] + /// pub unsafe fn get_fence_status(&self, fence: vk::Fence) -> VkResult { - let err_code = self.device_fn_1_0.get_fence_status(self.handle(), fence); + let err_code = (self.device_fn_1_0.get_fence_status)(self.handle(), fence); match err_code { vk::Result::SUCCESS => Ok(true), vk::Result::NOT_READY => Ok(false), @@ -1826,89 +2230,90 @@ impl Device { } } - #[doc = ""] + /// pub unsafe fn queue_wait_idle(&self, queue: vk::Queue) -> VkResult<()> { - self.device_fn_1_0.queue_wait_idle(queue).result() + (self.device_fn_1_0.queue_wait_idle)(queue).result() } - #[doc = ""] + /// pub unsafe fn queue_submit( &self, queue: vk::Queue, submits: &[vk::SubmitInfo], fence: vk::Fence, ) -> VkResult<()> { - self.device_fn_1_0 - .queue_submit(queue, submits.len() as u32, submits.as_ptr(), fence) + (self.device_fn_1_0.queue_submit)(queue, submits.len() as u32, submits.as_ptr(), fence) .result() } - #[doc = ""] + /// pub unsafe fn queue_bind_sparse( &self, queue: vk::Queue, bind_info: &[vk::BindSparseInfo], fence: vk::Fence, ) -> VkResult<()> { - self.device_fn_1_0 - .queue_bind_sparse(queue, bind_info.len() as u32, bind_info.as_ptr(), fence) - .result() + (self.device_fn_1_0.queue_bind_sparse)( + queue, + bind_info.len() as u32, + bind_info.as_ptr(), + fence, + ) + .result() } - #[doc = ""] + /// pub unsafe fn create_buffer_view( &self, create_info: &vk::BufferViewCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut buffer_view = mem::zeroed(); - self.device_fn_1_0 - .create_buffer_view( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut buffer_view, - ) - .result_with_success(buffer_view) + (self.device_fn_1_0.create_buffer_view)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut buffer_view, + ) + .result_with_success(buffer_view) } - #[doc = ""] + /// pub unsafe fn destroy_buffer_view( &self, buffer_view: vk::BufferView, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) { - self.device_fn_1_0.destroy_buffer_view( + (self.device_fn_1_0.destroy_buffer_view)( self.handle(), buffer_view, allocation_callbacks.as_raw_ptr(), ); } - #[doc = ""] + /// pub unsafe fn create_image_view( &self, create_info: &vk::ImageViewCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut image_view = mem::zeroed(); - self.device_fn_1_0 - .create_image_view( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut image_view, - ) - .result_with_success(image_view) + (self.device_fn_1_0.create_image_view)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut image_view, + ) + .result_with_success(image_view) } - #[doc = ""] + /// pub unsafe fn allocate_command_buffers( &self, create_info: &vk::CommandBufferAllocateInfo, ) -> VkResult> { let mut buffers = Vec::with_capacity(create_info.command_buffer_count as usize); - let err_code = self.device_fn_1_0.allocate_command_buffers( + let err_code = (self.device_fn_1_0.allocate_command_buffers)( self.handle(), create_info, buffers.as_mut_ptr(), @@ -1917,65 +2322,62 @@ impl Device { err_code.result_with_success(buffers) } - #[doc = ""] + /// pub unsafe fn create_command_pool( &self, create_info: &vk::CommandPoolCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut pool = mem::zeroed(); - self.device_fn_1_0 - .create_command_pool( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut pool, - ) - .result_with_success(pool) + (self.device_fn_1_0.create_command_pool)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut pool, + ) + .result_with_success(pool) } - #[doc = ""] + /// pub unsafe fn create_query_pool( &self, create_info: &vk::QueryPoolCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut pool = mem::zeroed(); - self.device_fn_1_0 - .create_query_pool( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut pool, - ) - .result_with_success(pool) + (self.device_fn_1_0.create_query_pool)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut pool, + ) + .result_with_success(pool) } - #[doc = ""] + /// pub unsafe fn create_image( &self, create_info: &vk::ImageCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut image = mem::zeroed(); - self.device_fn_1_0 - .create_image( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut image, - ) - .result_with_success(image) + (self.device_fn_1_0.create_image)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut image, + ) + .result_with_success(image) } - #[doc = ""] + /// pub unsafe fn get_image_subresource_layout( &self, image: vk::Image, subresource: vk::ImageSubresource, ) -> vk::SubresourceLayout { let mut layout = mem::zeroed(); - self.device_fn_1_0.get_image_subresource_layout( + (self.device_fn_1_0.get_image_subresource_layout)( self.handle(), image, &subresource, @@ -1984,104 +2386,96 @@ impl Device { layout } - #[doc = ""] + /// pub unsafe fn get_image_memory_requirements(&self, image: vk::Image) -> vk::MemoryRequirements { let mut mem_req = mem::zeroed(); - self.device_fn_1_0 - .get_image_memory_requirements(self.handle(), image, &mut mem_req); + (self.device_fn_1_0.get_image_memory_requirements)(self.handle(), image, &mut mem_req); mem_req } - #[doc = ""] + /// pub unsafe fn get_buffer_memory_requirements( &self, buffer: vk::Buffer, ) -> vk::MemoryRequirements { let mut mem_req = mem::zeroed(); - self.device_fn_1_0 - .get_buffer_memory_requirements(self.handle(), buffer, &mut mem_req); + (self.device_fn_1_0.get_buffer_memory_requirements)(self.handle(), buffer, &mut mem_req); mem_req } - #[doc = ""] + /// pub unsafe fn allocate_memory( &self, create_info: &vk::MemoryAllocateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut memory = mem::zeroed(); - self.device_fn_1_0 - .allocate_memory( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut memory, - ) - .result_with_success(memory) + (self.device_fn_1_0.allocate_memory)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut memory, + ) + .result_with_success(memory) } - #[doc = ""] + /// pub unsafe fn create_shader_module( &self, create_info: &vk::ShaderModuleCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut shader = mem::zeroed(); - self.device_fn_1_0 - .create_shader_module( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut shader, - ) - .result_with_success(shader) + (self.device_fn_1_0.create_shader_module)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut shader, + ) + .result_with_success(shader) } - #[doc = ""] + /// pub unsafe fn create_fence( &self, create_info: &vk::FenceCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut fence = mem::zeroed(); - self.device_fn_1_0 - .create_fence( - self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut fence, - ) - .result_with_success(fence) + (self.device_fn_1_0.create_fence)( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut fence, + ) + .result_with_success(fence) } - #[doc = ""] + /// pub unsafe fn bind_buffer_memory( &self, buffer: vk::Buffer, device_memory: vk::DeviceMemory, offset: vk::DeviceSize, ) -> VkResult<()> { - self.device_fn_1_0 - .bind_buffer_memory(self.handle(), buffer, device_memory, offset) + (self.device_fn_1_0.bind_buffer_memory)(self.handle(), buffer, device_memory, offset) .result() } - #[doc = ""] + /// pub unsafe fn bind_image_memory( &self, image: vk::Image, device_memory: vk::DeviceMemory, offset: vk::DeviceSize, ) -> VkResult<()> { - self.device_fn_1_0 - .bind_image_memory(self.handle(), image, device_memory, offset) - .result() + (self.device_fn_1_0.bind_image_memory)(self.handle(), image, device_memory, offset).result() } - #[doc = ""] + /// pub unsafe fn get_render_area_granularity(&self, render_pass: vk::RenderPass) -> vk::Extent2D { let mut granularity = mem::zeroed(); - self.device_fn_1_0.get_render_area_granularity( + (self.device_fn_1_0.get_render_area_granularity)( self.handle(), render_pass, &mut granularity, @@ -2089,10 +2483,10 @@ impl Device { granularity } - #[doc = ""] + /// pub unsafe fn get_device_memory_commitment(&self, memory: vk::DeviceMemory) -> vk::DeviceSize { let mut committed_memory_in_bytes = 0; - self.device_fn_1_0.get_device_memory_commitment( + (self.device_fn_1_0.get_device_memory_commitment)( self.handle(), memory, &mut committed_memory_in_bytes, @@ -2100,13 +2494,13 @@ impl Device { committed_memory_in_bytes } - #[doc = ""] + /// pub unsafe fn get_image_sparse_memory_requirements( &self, image: vk::Image, ) -> Vec { read_into_uninitialized_vector(|count, data| { - self.device_fn_1_0.get_image_sparse_memory_requirements( + (self.device_fn_1_0.get_image_sparse_memory_requirements)( self.handle(), image, count, diff --git a/third_party/rust/ash/src/entry.rs b/third_party/rust/ash/src/entry.rs index b3a4a123fcf26..e323aa05adea3 100644 --- a/third_party/rust/ash/src/entry.rs +++ b/third_party/rust/ash/src/entry.rs @@ -22,6 +22,7 @@ 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>, } @@ -142,18 +143,23 @@ 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| unsafe { - mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr())) + let load_fn = |name: &std::ffi::CStr| { + 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, } @@ -167,7 +173,7 @@ impl Entry { &self.static_fn } - #[doc = ""] + /// /// ```no_run /// # use ash::{Entry, vk}; /// # fn main() -> Result<(), Box> { @@ -189,10 +195,10 @@ impl Entry { let mut api_version = 0; let enumerate_instance_version: Option = { 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) @@ -203,7 +209,7 @@ impl Entry { } } - #[doc = ""] + /// /// /// # Safety /// In order for the created [`Instance`] to be valid for the duration of its @@ -215,45 +221,47 @@ impl Entry { allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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)) } - #[doc = ""] + /// pub fn enumerate_instance_layer_properties(&self) -> VkResult> { 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) }) } } - #[doc = ""] + /// pub fn enumerate_instance_extension_properties( &self, + layer_name: Option<&CStr>, ) -> VkResult> { unsafe { read_into_uninitialized_vector(|count, data| { - self.entry_fn_1_0 - .enumerate_instance_extension_properties(ptr::null(), count, data) + (self.entry_fn_1_0.enumerate_instance_extension_properties)( + layer_name.map_or(ptr::null(), |str| str.as_ptr()), + count, + data, + ) }) } } - #[doc = ""] + /// 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) } } @@ -264,15 +272,14 @@ 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"] - #[doc = ""] + #[deprecated = "This function is unavailable and therefore panics on Vulkan 1.0, please use `try_enumerate_instance_version()` instead"] + /// /// - /// Please use [`Self::try_enumerate_instance_version`] instead. + /// Please use [`try_enumerate_instance_version()`][Self::try_enumerate_instance_version()] instead. pub fn enumerate_instance_version(&self) -> VkResult { 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) } } @@ -286,6 +293,14 @@ 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 { diff --git a/third_party/rust/ash/src/extensions/experimental/amd.rs b/third_party/rust/ash/src/extensions/experimental/amd.rs index c39c5a777a50b..35b4289f1661f 100644 --- a/third_party/rust/ash/src/extensions/experimental/amd.rs +++ b/third_party/rust/ash/src/extensions/experimental/amd.rs @@ -240,11 +240,16 @@ impl<'a> ::std::ops::Deref for PhysicalDeviceGpaPropertiesAmdBuilder<'a> { } } impl<'a> PhysicalDeviceGpaPropertiesAmdBuilder<'a> { - pub fn next(mut self, next: &'a mut T) -> PhysicalDeviceGpaPropertiesAmdBuilder<'a> + pub fn push_next(mut self, next: &'a mut T) -> PhysicalDeviceGpaPropertiesAmdBuilder<'a> where T: ExtendsPhysicalDeviceGpaPropertiesAmd, { - self.inner.p_next = next as *mut T as *mut c_void; + 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 } pub fn build(self) -> PhysicalDeviceGpaPropertiesAmd { @@ -409,9 +414,9 @@ impl AmdGpaInterfaceFn { stringify!(create_gpa_session_amd) )) } - let raw_name = stringify!(vkCreateGpaSessionAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCreateGpaSessionAMD\0"); + let val = _f(cname); if val.is_null() { create_gpa_session_amd } else { @@ -429,9 +434,9 @@ impl AmdGpaInterfaceFn { stringify!(destroy_gpa_session_amd) )) } - let raw_name = stringify!(vkDestroyGpaSessionAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkDestroyGpaSessionAMD\0"); + let val = _f(cname); if val.is_null() { destroy_gpa_session_amd } else { @@ -448,9 +453,10 @@ impl AmdGpaInterfaceFn { stringify!(set_gpa_device_clock_mode_amd) )) } - let raw_name = stringify!(vkSetGpaDeviceClockModeAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkSetGpaDeviceClockModeAMD\0", + ); + let val = _f(cname); if val.is_null() { set_gpa_device_clock_mode_amd } else { @@ -467,9 +473,9 @@ impl AmdGpaInterfaceFn { stringify!(cmd_begin_gpa_session_amd) )) } - let raw_name = stringify!(vkCmdBeginGpaSessionAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBeginGpaSessionAMD\0"); + let val = _f(cname); if val.is_null() { cmd_begin_gpa_session_amd } else { @@ -486,9 +492,9 @@ impl AmdGpaInterfaceFn { stringify!(cmd_end_gpa_session_amd) )) } - let raw_name = stringify!(vkCmdEndGpaSessionAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSessionAMD\0"); + let val = _f(cname); if val.is_null() { cmd_end_gpa_session_amd } else { @@ -507,9 +513,9 @@ impl AmdGpaInterfaceFn { stringify!(cmd_begin_gpa_sample_amd) )) } - let raw_name = stringify!(vkCmdBeginGpaSampleAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBeginGpaSampleAMD\0"); + let val = _f(cname); if val.is_null() { cmd_begin_gpa_sample_amd } else { @@ -527,9 +533,9 @@ impl AmdGpaInterfaceFn { stringify!(cmd_end_gpa_sample_amd) )) } - let raw_name = stringify!(vkCmdEndGpaSampleAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSampleAMD\0"); + let val = _f(cname); if val.is_null() { cmd_end_gpa_sample_amd } else { @@ -546,9 +552,9 @@ impl AmdGpaInterfaceFn { stringify!(get_gpa_session_status_amd) )) } - let raw_name = stringify!(vkGetGpaSessionStatusAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetGpaSessionStatusAMD\0"); + let val = _f(cname); if val.is_null() { get_gpa_session_status_amd } else { @@ -568,9 +574,9 @@ impl AmdGpaInterfaceFn { stringify!(get_gpa_session_results_amd) )) } - let raw_name = stringify!(vkGetGpaSessionResultsAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetGpaSessionResultsAMD\0"); + let val = _f(cname); if val.is_null() { get_gpa_session_results_amd } else { @@ -587,9 +593,9 @@ impl AmdGpaInterfaceFn { stringify!(reset_gpa_session_amd) )) } - let raw_name = stringify!(vkCmdEndGpaSampleAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndGpaSampleAMD\0"); + let val = _f(cname); if val.is_null() { reset_gpa_session_amd } else { @@ -606,9 +612,10 @@ impl AmdGpaInterfaceFn { stringify!(cmd_copy_gpa_session_results_amd) )) } - let raw_name = stringify!(vkCmdCopyGpaSessionResultsAMD); - let cname = ::std::ffi::CString::new(raw_name).unwrap(); - let val = _f(&cname); + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdCopyGpaSessionResultsAMD\0", + ); + let val = _f(cname); if val.is_null() { cmd_copy_gpa_session_results_amd } else { @@ -692,10 +699,10 @@ impl<'a> PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> { T: ExtendsPhysicalDeviceWaveLimitPropertiesAmd, { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } diff --git a/third_party/rust/ash/src/extensions/ext/buffer_device_address.rs b/third_party/rust/ash/src/extensions/ext/buffer_device_address.rs index 61578eeed0f15..61a38fd15b121 100644 --- a/third_party/rust/ash/src/extensions/ext/buffer_device_address.rs +++ b/third_party/rust/ash/src/extensions/ext/buffer_device_address.rs @@ -18,15 +18,15 @@ impl BufferDeviceAddress { Self { handle, fp } } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtBufferDeviceAddressFn::name() } diff --git a/third_party/rust/ash/src/extensions/ext/calibrated_timestamps.rs b/third_party/rust/ash/src/extensions/ext/calibrated_timestamps.rs new file mode 100644 index 0000000000000..c5e8db7738b5a --- /dev/null +++ b/third_party/rust/ash/src/extensions/ext/calibrated_timestamps.rs @@ -0,0 +1,67 @@ +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 } + } + + /// + pub unsafe fn get_physical_device_calibrateable_time_domains( + &self, + physical_device: vk::PhysicalDevice, + ) -> VkResult> { + read_into_uninitialized_vector(|count, data| { + (self.fp.get_physical_device_calibrateable_time_domains_ext)( + physical_device, + count, + data, + ) + }) + } + + /// + /// + /// Returns a tuple containing `(timestamps, max_deviation)` + pub unsafe fn get_calibrated_timestamps( + &self, + device: vk::Device, + info: &[vk::CalibratedTimestampInfoEXT], + ) -> VkResult<(Vec, Vec)> { + 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 + } +} diff --git a/third_party/rust/ash/src/extensions/ext/debug_marker.rs b/third_party/rust/ash/src/extensions/ext/debug_marker.rs index 1d2f76a42cd63..579ca8956c655 100755 --- a/third_party/rust/ash/src/extensions/ext/debug_marker.rs +++ b/third_party/rust/ash/src/extensions/ext/debug_marker.rs @@ -19,42 +19,38 @@ impl DebugMarker { Self { handle, fp } } - #[doc = ""] + /// 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() } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtDebugMarkerFn::name() } diff --git a/third_party/rust/ash/src/extensions/ext/debug_report.rs b/third_party/rust/ash/src/extensions/ext/debug_report.rs index 63825090a5ea0..e2b9e8610bcfd 100755 --- a/third_party/rust/ash/src/extensions/ext/debug_report.rs +++ b/third_party/rust/ash/src/extensions/ext/debug_report.rs @@ -20,37 +20,36 @@ impl DebugReport { Self { handle, fp } } - #[doc = ""] + /// 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(), ); } - #[doc = ""] + /// pub unsafe fn create_debug_report_callback( &self, create_info: &vk::DebugReportCallbackCreateInfoEXT, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtDebugReportFn::name() } diff --git a/third_party/rust/ash/src/extensions/ext/debug_utils.rs b/third_party/rust/ash/src/extensions/ext/debug_utils.rs index 0b38d5e446c11..7de46d7b97b6f 100755 --- a/third_party/rust/ash/src/extensions/ext/debug_utils.rs +++ b/third_party/rust/ash/src/extensions/ext/debug_utils.rs @@ -19,111 +19,103 @@ impl DebugUtils { Self { handle, fp } } - #[doc = ""] + /// 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() } - #[doc = ""] + /// 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() } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// pub unsafe fn create_debug_utils_messenger( &self, create_info: &vk::DebugUtilsMessengerCreateInfoEXT, allocator: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// 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()); } - #[doc = ""] + /// 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, @@ -131,7 +123,7 @@ impl DebugUtils { ); } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtDebugUtilsFn::name() } diff --git a/third_party/rust/ash/src/extensions/ext/extended_dynamic_state.rs b/third_party/rust/ash/src/extensions/ext/extended_dynamic_state.rs index eda5d6169ac7d..5c118c3c95f41 100644 --- a/third_party/rust/ash/src/extensions/ext/extended_dynamic_state.rs +++ b/third_party/rust/ash/src/extensions/ext/extended_dynamic_state.rs @@ -17,61 +17,60 @@ impl ExtendedDynamicState { Self { fp } } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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(), ) } - #[doc = ""] + /// 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(), ) } - #[doc = ""] + /// pub unsafe fn cmd_bind_vertex_buffers2( &self, command_buffer: vk::CommandBuffer, @@ -94,7 +93,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, @@ -105,57 +104,55 @@ impl ExtendedDynamicState { ) } - #[doc = ""] + /// 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()) } - #[doc = ""] + /// 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()) } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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(), + ) } - #[doc = ""] + /// 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()) } - #[doc = ""] + /// pub unsafe fn cmd_set_stencil_op( &self, command_buffer: vk::CommandBuffer, @@ -165,7 +162,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, @@ -175,7 +172,7 @@ impl ExtendedDynamicState { ) } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtExtendedDynamicStateFn::name() } diff --git a/third_party/rust/ash/src/extensions/ext/extended_dynamic_state2.rs b/third_party/rust/ash/src/extensions/ext/extended_dynamic_state2.rs new file mode 100644 index 0000000000000..47b6b23ba7721 --- /dev/null +++ b/third_party/rust/ash/src/extensions/ext/extended_dynamic_state2.rs @@ -0,0 +1,78 @@ +use crate::vk; +use crate::{Device, Instance}; +use std::ffi::CStr; +use std::mem; + +/// +#[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 } + } + + /// + 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) + } + + /// + 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(), + ) + } + + /// + 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()) + } + + /// + 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) + } + + /// + 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 + } +} diff --git a/third_party/rust/ash/src/extensions/ext/full_screen_exclusive.rs b/third_party/rust/ash/src/extensions/ext/full_screen_exclusive.rs index 0d7fd459035b8..8f1db46608523 100644 --- a/third_party/rust/ash/src/extensions/ext/full_screen_exclusive.rs +++ b/third_party/rust/ash/src/extensions/ext/full_screen_exclusive.rs @@ -19,24 +19,22 @@ impl FullScreenExclusive { Self { handle, fp } } - #[doc = ""] + /// 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() } - #[doc = ""] + /// pub unsafe fn get_physical_device_surface_present_modes2( &self, physical_device: vk::PhysicalDevice, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR, ) -> VkResult> { 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, @@ -45,32 +43,29 @@ impl FullScreenExclusive { }) } - #[doc = ""] + /// 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() } - #[doc = ""] + /// pub unsafe fn get_device_group_surface_present_modes2( &self, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtFullScreenExclusiveFn::name() } diff --git a/third_party/rust/ash/src/extensions/ext/headless_surface.rs b/third_party/rust/ash/src/extensions/ext/headless_surface.rs new file mode 100644 index 0000000000000..c0af800d73869 --- /dev/null +++ b/third_party/rust/ash/src/extensions/ext/headless_surface.rs @@ -0,0 +1,51 @@ +use crate::prelude::*; +use crate::vk; +use crate::RawPtr; +use crate::{Entry, Instance}; +use std::ffi::CStr; +use std::mem; + +/// +#[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 } + } + + /// + pub unsafe fn create_headless_surface( + &self, + create_info: &vk::HeadlessSurfaceCreateInfoEXT, + allocation_callbacks: Option<&vk::AllocationCallbacks>, + ) -> VkResult { + 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 + } +} diff --git a/third_party/rust/ash/src/extensions/ext/metal_surface.rs b/third_party/rust/ash/src/extensions/ext/metal_surface.rs index d4be230efb074..f93c84400776b 100644 --- a/third_party/rust/ash/src/extensions/ext/metal_surface.rs +++ b/third_party/rust/ash/src/extensions/ext/metal_surface.rs @@ -20,24 +20,23 @@ impl MetalSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_metal_surface( &self, create_info: &vk::MetalSurfaceCreateInfoEXT, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtMetalSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/ext/mod.rs b/third_party/rust/ash/src/extensions/ext/mod.rs index e25806eeedacc..7151e27b689ed 100644 --- a/third_party/rust/ash/src/extensions/ext/mod.rs +++ b/third_party/rust/ash/src/extensions/ext/mod.rs @@ -1,23 +1,31 @@ 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; diff --git a/third_party/rust/ash/src/extensions/ext/physical_device_drm.rs b/third_party/rust/ash/src/extensions/ext/physical_device_drm.rs index 56ca314640f32..2847b65d8e23d 100644 --- a/third_party/rust/ash/src/extensions/ext/physical_device_drm.rs +++ b/third_party/rust/ash/src/extensions/ext/physical_device_drm.rs @@ -18,7 +18,7 @@ impl PhysicalDeviceDrm { props_drm } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtPhysicalDeviceDrmFn::name() } } diff --git a/third_party/rust/ash/src/extensions/ext/private_data.rs b/third_party/rust/ash/src/extensions/ext/private_data.rs new file mode 100644 index 0000000000000..25f02d4e50b72 --- /dev/null +++ b/third_party/rust/ash/src/extensions/ext/private_data.rs @@ -0,0 +1,98 @@ +use crate::prelude::*; +use crate::vk; +use crate::RawPtr; +use crate::{Device, Instance}; +use std::ffi::CStr; +use std::mem; + +/// +#[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 } + } + + /// + pub unsafe fn create_private_data_slot( + &self, + create_info: &vk::PrivateDataSlotCreateInfoEXT, + allocation_callbacks: Option<&vk::AllocationCallbacks>, + ) -> VkResult { + 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) + } + + /// + 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(), + ) + } + + /// + pub unsafe fn set_private_data( + &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() + } + + /// + pub unsafe fn get_private_data( + &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 + } +} diff --git a/third_party/rust/ash/src/extensions/ext/tooling_info.rs b/third_party/rust/ash/src/extensions/ext/tooling_info.rs index ccc854401a1f0..fdbb51d773993 100644 --- a/third_party/rust/ash/src/extensions/ext/tooling_info.rs +++ b/third_party/rust/ash/src/extensions/ext/tooling_info.rs @@ -17,18 +17,17 @@ impl ToolingInfo { Self { fp } } - #[doc = ""] + /// pub unsafe fn get_physical_device_tool_properties( &self, physical_device: vk::PhysicalDevice, ) -> VkResult> { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::ExtToolingInfoFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/acceleration_structure.rs b/third_party/rust/ash/src/extensions/khr/acceleration_structure.rs index 6b9b8e846f2aa..8bb2ced8db4d2 100644 --- a/third_party/rust/ash/src/extensions/khr/acceleration_structure.rs +++ b/third_party/rust/ash/src/extensions/khr/acceleration_structure.rs @@ -32,37 +32,36 @@ impl AccelerationStructure { props_rt } - #[doc = ""] + /// pub unsafe fn create_acceleration_structure( &self, create_info: &vk::AccelerationStructureCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// 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(), ); } - #[doc = ""] + /// pub unsafe fn cmd_build_acceleration_structures( &self, command_buffer: vk::CommandBuffer, @@ -80,7 +79,7 @@ impl AccelerationStructure { }) .collect::>(); - self.fp.cmd_build_acceleration_structures_khr( + (self.fp.cmd_build_acceleration_structures_khr)( command_buffer, infos.len() as _, infos.as_ptr(), @@ -88,7 +87,7 @@ impl AccelerationStructure { ); } - #[doc = ""] + /// pub unsafe fn cmd_build_acceleration_structures_indirect( &self, command_buffer: vk::CommandBuffer, @@ -110,7 +109,7 @@ impl AccelerationStructure { }) .collect::>(); - self.fp.cmd_build_acceleration_structures_indirect_khr( + (self.fp.cmd_build_acceleration_structures_indirect_khr)( command_buffer, infos.len() as _, infos.as_ptr(), @@ -120,7 +119,7 @@ impl AccelerationStructure { ); } - #[doc = ""] + /// pub unsafe fn build_acceleration_structures( &self, deferred_operation: vk::DeferredOperationKHR, @@ -138,59 +137,46 @@ impl AccelerationStructure { }) .collect::>(); - 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() } - #[doc = ""] + /// 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 as *const _) - .result() + (self.fp.copy_acceleration_structure_khr)(self.handle, deferred_operation, info).result() } - #[doc = ""] + /// 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 as *const _, - ) + (self.fp.copy_acceleration_structure_to_memory_khr)(self.handle, deferred_operation, info) .result() } - #[doc = ""] + /// 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 as *const _, - ) + (self.fp.copy_memory_to_acceleration_structure_khr)(self.handle, deferred_operation, info) .result() } - #[doc = ""] + /// pub unsafe fn write_acceleration_structures_properties( &self, acceleration_structures: &[vk::AccelerationStructureKHR], @@ -198,59 +184,54 @@ 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() } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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 as *const _); + (self.fp.cmd_copy_acceleration_structure_to_memory_khr)(command_buffer, info); } - #[doc = ""] + /// 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 as *const _); + (self.fp.cmd_copy_memory_to_acceleration_structure_khr)(command_buffer, info); } - #[doc = ""] + /// 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 as *const _) + (self.fp.get_acceleration_structure_device_address_khr)(self.handle, info) } - #[doc = ""] + /// pub unsafe fn cmd_write_acceleration_structures_properties( &self, command_buffer: vk::CommandBuffer, @@ -259,7 +240,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(), @@ -269,23 +250,23 @@ impl AccelerationStructure { ); } - #[doc = ""] + /// 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 as *mut _, + &mut compatibility, ); compatibility } - #[doc = ""] + /// pub unsafe fn get_acceleration_structure_build_sizes( &self, build_type: vk::AccelerationStructureBuildTypeKHR, @@ -296,18 +277,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 as *const _, + build_info, max_primitive_counts.as_ptr(), - &mut size_info as *mut _, + &mut size_info, ); size_info } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrAccelerationStructureFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/android_surface.rs b/third_party/rust/ash/src/extensions/khr/android_surface.rs index 336ae107b46f6..76bf0f68413a5 100755 --- a/third_party/rust/ash/src/extensions/khr/android_surface.rs +++ b/third_party/rust/ash/src/extensions/khr/android_surface.rs @@ -20,24 +20,23 @@ impl AndroidSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_android_surface( &self, create_info: &vk::AndroidSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrAndroidSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/buffer_device_address.rs b/third_party/rust/ash/src/extensions/khr/buffer_device_address.rs index 26e8308079643..8ab501da39914 100644 --- a/third_party/rust/ash/src/extensions/khr/buffer_device_address.rs +++ b/third_party/rust/ash/src/extensions/khr/buffer_device_address.rs @@ -18,33 +18,31 @@ impl BufferDeviceAddress { Self { handle, fp } } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrBufferDeviceAddressFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/copy_commands2.rs b/third_party/rust/ash/src/extensions/khr/copy_commands2.rs new file mode 100644 index 0000000000000..2cfe081992279 --- /dev/null +++ b/third_party/rust/ash/src/extensions/khr/copy_commands2.rs @@ -0,0 +1,76 @@ +use crate::vk; +use crate::{Device, Instance}; +use std::ffi::CStr; +use std::mem; + +/// +#[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 } + } + + /// + 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) + } + /// + 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) + } + /// + 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) + } + /// + 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) + } + /// + 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) + } + /// + 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 + } +} diff --git a/third_party/rust/ash/src/extensions/khr/create_render_pass2.rs b/third_party/rust/ash/src/extensions/khr/create_render_pass2.rs index 537906a6a800d..b9e2c650346c4 100644 --- a/third_party/rust/ash/src/extensions/khr/create_render_pass2.rs +++ b/third_party/rust/ash/src/extensions/khr/create_render_pass2.rs @@ -20,59 +20,56 @@ impl CreateRenderPass2 { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_render_pass2( &self, create_info: &vk::RenderPassCreateInfo2, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// 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, ); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrCreateRenderpass2Fn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/deferred_host_operations.rs b/third_party/rust/ash/src/extensions/khr/deferred_host_operations.rs index ba84207f9051f..c2a05b55d1997 100644 --- a/third_party/rust/ash/src/extensions/khr/deferred_host_operations.rs +++ b/third_party/rust/ash/src/extensions/khr/deferred_host_operations.rs @@ -20,64 +20,58 @@ impl DeferredHostOperations { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_deferred_operation( &self, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// 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() } - #[doc = ""] + /// 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(), ); } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrDeferredHostOperationsFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/display.rs b/third_party/rust/ash/src/extensions/khr/display.rs index 0d1ee9ab940f3..fd8cad7940c88 100755 --- a/third_party/rust/ash/src/extensions/khr/display.rs +++ b/third_party/rust/ash/src/extensions/khr/display.rs @@ -20,36 +20,34 @@ impl Display { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn get_physical_device_display_properties( &self, physical_device: vk::PhysicalDevice, ) -> VkResult> { 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) }) } - #[doc = ""] + /// pub unsafe fn get_physical_device_display_plane_properties( &self, physical_device: vk::PhysicalDevice, ) -> VkResult> { 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) }) } - #[doc = ""] + /// pub unsafe fn get_display_plane_supported_displays( &self, physical_device: vk::PhysicalDevice, plane_index: u32, ) -> VkResult> { 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, @@ -58,19 +56,18 @@ impl Display { }) } - #[doc = ""] + /// pub unsafe fn get_display_mode_properties( &self, physical_device: vk::PhysicalDevice, display: vk::DisplayKHR, ) -> VkResult> { 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) }) } - #[doc = ""] + /// pub unsafe fn create_display_mode( &self, physical_device: vk::PhysicalDevice, @@ -79,18 +76,17 @@ impl Display { allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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()) } - #[doc = ""] + /// pub unsafe fn get_display_plane_capabilities( &self, physical_device: vk::PhysicalDevice, @@ -98,34 +94,32 @@ impl Display { plane_index: u32, ) -> VkResult { 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()) } - #[doc = ""] + /// pub unsafe fn create_display_plane_surface( &self, create_info: &vk::DisplaySurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrDisplayFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/display_swapchain.rs b/third_party/rust/ash/src/extensions/khr/display_swapchain.rs index 588d01d1e7f76..e05b782865034 100755 --- a/third_party/rust/ash/src/extensions/khr/display_swapchain.rs +++ b/third_party/rust/ash/src/extensions/khr/display_swapchain.rs @@ -20,14 +20,14 @@ impl DisplaySwapchain { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_shared_swapchains( &self, create_infos: &[vk::SwapchainCreateInfoKHR], allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult> { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrDisplaySwapchainFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/draw_indirect_count.rs b/third_party/rust/ash/src/extensions/khr/draw_indirect_count.rs index 133eb743ae3d7..ac2b6ab379b6e 100644 --- a/third_party/rust/ash/src/extensions/khr/draw_indirect_count.rs +++ b/third_party/rust/ash/src/extensions/khr/draw_indirect_count.rs @@ -16,7 +16,7 @@ impl DrawIndirectCount { Self { fp } } - #[doc = ""] + /// 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 { ); } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrDrawIndirectCountFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/dynamic_rendering.rs b/third_party/rust/ash/src/extensions/khr/dynamic_rendering.rs index 983a14520a3e3..07af324b84c0f 100644 --- a/third_party/rust/ash/src/extensions/khr/dynamic_rendering.rs +++ b/third_party/rust/ash/src/extensions/khr/dynamic_rendering.rs @@ -16,22 +16,21 @@ impl DynamicRendering { Self { fp } } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrDynamicRenderingFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/external_fence_fd.rs b/third_party/rust/ash/src/extensions/khr/external_fence_fd.rs index a243e4f7c3928..9a93722ccdeb1 100644 --- a/third_party/rust/ash/src/extensions/khr/external_fence_fd.rs +++ b/third_party/rust/ash/src/extensions/khr/external_fence_fd.rs @@ -19,22 +19,18 @@ impl ExternalFenceFd { Self { handle, fp } } - #[doc = ""] + /// 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() } - #[doc = ""] + /// pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrExternalFenceFdFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/external_fence_win32.rs b/third_party/rust/ash/src/extensions/khr/external_fence_win32.rs new file mode 100644 index 0000000000000..3ea8a6434a091 --- /dev/null +++ b/third_party/rust/ash/src/extensions/khr/external_fence_win32.rs @@ -0,0 +1,53 @@ +use crate::prelude::*; +use crate::vk; +use crate::{Device, Instance}; +use std::ffi::CStr; +use std::mem; +use std::ptr; + +/// +#[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 } + } + + /// + 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() + } + + /// + pub unsafe fn get_fence_win32_handle( + &self, + get_info: &vk::FenceGetWin32HandleInfoKHR, + ) -> VkResult { + 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 + } +} diff --git a/third_party/rust/ash/src/extensions/khr/external_memory_fd.rs b/third_party/rust/ash/src/extensions/khr/external_memory_fd.rs index 1f752a5a96a1e..246701ae407db 100644 --- a/third_party/rust/ash/src/extensions/khr/external_memory_fd.rs +++ b/third_party/rust/ash/src/extensions/khr/external_memory_fd.rs @@ -19,27 +19,29 @@ impl ExternalMemoryFd { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult { 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) } - #[doc = ""] - pub unsafe fn get_memory_fd_properties_khr( + /// + pub unsafe fn get_memory_fd_properties( &self, handle_type: vk::ExternalMemoryHandleTypeFlags, fd: i32, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrExternalMemoryFdFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/external_memory_win32.rs b/third_party/rust/ash/src/extensions/khr/external_memory_win32.rs new file mode 100644 index 0000000000000..c62da59d49b92 --- /dev/null +++ b/third_party/rust/ash/src/extensions/khr/external_memory_win32.rs @@ -0,0 +1,61 @@ +use crate::prelude::*; +use crate::vk; +use crate::{Device, Instance}; +use std::ffi::CStr; +use std::mem; +use std::ptr; + +/// +#[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 } + } + + /// + pub unsafe fn get_memory_win32_handle( + &self, + create_info: &vk::MemoryGetWin32HandleInfoKHR, + ) -> VkResult { + let mut handle = ptr::null_mut(); + (self.fp.get_memory_win32_handle_khr)(self.handle, create_info, &mut handle) + .result_with_success(handle) + } + + /// + pub unsafe fn get_memory_win32_handle_properties( + &self, + handle_type: vk::ExternalMemoryHandleTypeFlags, + handle: vk::HANDLE, + ) -> VkResult { + 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 + } +} diff --git a/third_party/rust/ash/src/extensions/khr/external_semaphore_fd.rs b/third_party/rust/ash/src/extensions/khr/external_semaphore_fd.rs index 1a7e45e5346c5..d72270d20185e 100644 --- a/third_party/rust/ash/src/extensions/khr/external_semaphore_fd.rs +++ b/third_party/rust/ash/src/extensions/khr/external_semaphore_fd.rs @@ -19,25 +19,21 @@ impl ExternalSemaphoreFd { Self { handle, fp } } - #[doc = ""] + /// 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() } - #[doc = ""] + /// pub unsafe fn get_semaphore_fd(&self, get_info: &vk::SemaphoreGetFdInfoKHR) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrExternalSemaphoreFdFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/external_semaphore_win32.rs b/third_party/rust/ash/src/extensions/khr/external_semaphore_win32.rs new file mode 100644 index 0000000000000..c076a67163290 --- /dev/null +++ b/third_party/rust/ash/src/extensions/khr/external_semaphore_win32.rs @@ -0,0 +1,53 @@ +use crate::prelude::*; +use crate::vk; +use crate::{Device, Instance}; +use std::ffi::CStr; +use std::mem; +use std::ptr; + +/// +#[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 } + } + + /// + 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() + } + + /// + pub unsafe fn get_semaphore_win32_handle( + &self, + get_info: &vk::SemaphoreGetWin32HandleInfoKHR, + ) -> VkResult { + 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 + } +} diff --git a/third_party/rust/ash/src/extensions/khr/get_memory_requirements2.rs b/third_party/rust/ash/src/extensions/khr/get_memory_requirements2.rs index dc15119dcd6df..6ffe498e3d630 100644 --- a/third_party/rust/ash/src/extensions/khr/get_memory_requirements2.rs +++ b/third_party/rust/ash/src/extensions/khr/get_memory_requirements2.rs @@ -19,33 +19,31 @@ impl GetMemoryRequirements2 { Self { handle, fp } } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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 [`Self::get_image_sparse_memory_requirements2()`] + /// Retrieve the number of elements to pass to [`get_image_sparse_memory_requirements2()`][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, @@ -54,9 +52,9 @@ impl GetMemoryRequirements2 { count as usize } - #[doc = ""] + /// /// - /// Call [`Self::get_image_sparse_memory_requirements2_len()`] to query the number of elements to pass to `out`. + /// Call [`get_image_sparse_memory_requirements2_len()`][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, @@ -64,15 +62,16 @@ 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrGetMemoryRequirements2Fn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/get_physical_device_properties2.rs b/third_party/rust/ash/src/extensions/khr/get_physical_device_properties2.rs index 268d67de137e7..06f5bbd9e81c5 100644 --- a/third_party/rust/ash/src/extensions/khr/get_physical_device_properties2.rs +++ b/third_party/rust/ash/src/extensions/khr/get_physical_device_properties2.rs @@ -18,73 +18,69 @@ impl GetPhysicalDeviceProperties2 { Self { fp } } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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, ); } - #[doc = ""] + /// 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() } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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 [`Self::get_physical_device_queue_family_properties2()`] + /// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][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(), @@ -92,9 +88,9 @@ impl GetPhysicalDeviceProperties2 { count as usize } - #[doc = ""] + /// /// - /// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`. + /// 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`. /// 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, @@ -102,33 +98,35 @@ 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 [`Self::get_physical_device_sparse_image_format_properties2()`] + /// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][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 } - #[doc = ""] + /// /// - /// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`. + /// 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`. /// 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, @@ -137,16 +135,18 @@ 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(), - ); + (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()); } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrGetPhysicalDeviceProperties2Fn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/get_surface_capabilities2.rs b/third_party/rust/ash/src/extensions/khr/get_surface_capabilities2.rs new file mode 100644 index 0000000000000..cd32c1a400aa1 --- /dev/null +++ b/third_party/rust/ash/src/extensions/khr/get_surface_capabilities2.rs @@ -0,0 +1,79 @@ +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 } + } + + /// + pub unsafe fn get_physical_device_surface_capabilities2( + &self, + physical_device: vk::PhysicalDevice, + surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR, + ) -> VkResult { + 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 { + 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) + } + + /// + /// + /// 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 + } +} diff --git a/third_party/rust/ash/src/extensions/khr/maintenance1.rs b/third_party/rust/ash/src/extensions/khr/maintenance1.rs index 058dfabd7410a..6f27cd37fae25 100644 --- a/third_party/rust/ash/src/extensions/khr/maintenance1.rs +++ b/third_party/rust/ash/src/extensions/khr/maintenance1.rs @@ -18,17 +18,16 @@ impl Maintenance1 { Self { handle, fp } } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrMaintenance1Fn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/maintenance3.rs b/third_party/rust/ash/src/extensions/khr/maintenance3.rs index 5028b05b0d9a7..fd67a59ffad76 100644 --- a/third_party/rust/ash/src/extensions/khr/maintenance3.rs +++ b/third_party/rust/ash/src/extensions/khr/maintenance3.rs @@ -18,17 +18,16 @@ impl Maintenance3 { Self { handle, fp } } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrMaintenance3Fn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/maintenance4.rs b/third_party/rust/ash/src/extensions/khr/maintenance4.rs index 5f234e06d0ba0..f90f5e972cf05 100644 --- a/third_party/rust/ash/src/extensions/khr/maintenance4.rs +++ b/third_party/rust/ash/src/extensions/khr/maintenance4.rs @@ -18,33 +18,31 @@ impl Maintenance4 { Self { handle, fp } } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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 [`Self::get_device_image_sparse_memory_requirements()`] + /// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][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, @@ -53,9 +51,9 @@ impl Maintenance4 { count as usize } - #[doc = ""] + /// /// - /// Call [`Self::get_device_image_sparse_memory_requirements_len()`] to query the number of elements to pass to `out`. + /// 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`. /// 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, @@ -63,16 +61,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, out.len() as u32); + assert_eq!(count as usize, out.len()); } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrMaintenance4Fn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/mod.rs b/third_party/rust/ash/src/extensions/khr/mod.rs index 69cffe0741c65..55f6e8ee734ec 100644 --- a/third_party/rust/ash/src/extensions/khr/mod.rs +++ b/third_party/rust/ash/src/extensions/khr/mod.rs @@ -1,6 +1,7 @@ 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; @@ -8,10 +9,14 @@ 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; @@ -31,6 +36,7 @@ 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; @@ -38,10 +44,14 @@ 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; diff --git a/third_party/rust/ash/src/extensions/khr/pipeline_executable_properties.rs b/third_party/rust/ash/src/extensions/khr/pipeline_executable_properties.rs index 3c4f459c941f6..475f1c9ab42d6 100644 --- a/third_party/rust/ash/src/extensions/khr/pipeline_executable_properties.rs +++ b/third_party/rust/ash/src/extensions/khr/pipeline_executable_properties.rs @@ -19,40 +19,43 @@ impl PipelineExecutableProperties { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn get_pipeline_executable_internal_representations( &self, executable_info: &vk::PipelineExecutableInfoKHR, ) -> VkResult> { 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, + ) }) } - #[doc = ""] + /// pub unsafe fn get_pipeline_executable_properties( &self, pipeline_info: &vk::PipelineInfoKHR, ) -> VkResult> { 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, + ) }) } - #[doc = ""] + /// pub unsafe fn get_pipeline_executable_statistics( &self, executable_info: &vk::PipelineExecutableInfoKHR, ) -> VkResult> { 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, @@ -61,7 +64,7 @@ impl PipelineExecutableProperties { }) } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrPipelineExecutablePropertiesFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/present_wait.rs b/third_party/rust/ash/src/extensions/khr/present_wait.rs index 2d7a9c5bf4978..ccbbbde216ba5 100644 --- a/third_party/rust/ash/src/extensions/khr/present_wait.rs +++ b/third_party/rust/ash/src/extensions/khr/present_wait.rs @@ -19,19 +19,17 @@ impl PresentWait { Self { handle, fp } } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrPresentWaitFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/push_descriptor.rs b/third_party/rust/ash/src/extensions/khr/push_descriptor.rs index e4d700f767747..f5f73a2fbc205 100644 --- a/third_party/rust/ash/src/extensions/khr/push_descriptor.rs +++ b/third_party/rust/ash/src/extensions/khr/push_descriptor.rs @@ -17,7 +17,7 @@ impl PushDescriptor { Self { fp } } - #[doc = ""] + /// 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 { ); } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrPushDescriptorFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/ray_tracing_pipeline.rs b/third_party/rust/ash/src/extensions/khr/ray_tracing_pipeline.rs index dc5bc8a478a5d..5ec75ae49d34e 100644 --- a/third_party/rust/ash/src/extensions/khr/ray_tracing_pipeline.rs +++ b/third_party/rust/ash/src/extensions/khr/ray_tracing_pipeline.rs @@ -32,7 +32,7 @@ impl RayTracingPipeline { props_rt } - #[doc = ""] + /// 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 as *const _, - miss_shader_binding_tables as *const _, - hit_shader_binding_tables as *const _, - callable_shader_binding_tables as *const _, + raygen_shader_binding_tables, + miss_shader_binding_tables, + hit_shader_binding_tables, + callable_shader_binding_tables, width, height, depth, ); } - #[doc = ""] + /// pub unsafe fn create_ray_tracing_pipelines( &self, deferred_operation: vk::DeferredOperationKHR, @@ -65,20 +65,19 @@ impl RayTracingPipeline { allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult> { 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) } - #[doc = ""] + /// pub unsafe fn get_ray_tracing_shader_group_handles( &self, pipeline: vk::Pipeline, @@ -87,7 +86,7 @@ impl RayTracingPipeline { data_size: usize, ) -> VkResult> { let mut data = Vec::::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, @@ -99,7 +98,7 @@ impl RayTracingPipeline { err_code.result_with_success(data) } - #[doc = ""] + /// pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles( &self, pipeline: vk::Pipeline, @@ -109,19 +108,20 @@ impl RayTracingPipeline { ) -> VkResult> { let mut data: Vec = 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) } - #[doc = ""] + /// 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 { ); } - #[doc = ""] + /// 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,17 +156,16 @@ impl RayTracingPipeline { ) } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrRayTracingPipelineFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/surface.rs b/third_party/rust/ash/src/extensions/khr/surface.rs index 7e4fd3d59539f..a3afb77b26a1a 100755 --- a/third_party/rust/ash/src/extensions/khr/surface.rs +++ b/third_party/rust/ash/src/extensions/khr/surface.rs @@ -20,7 +20,7 @@ impl Surface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn get_physical_device_surface_support( &self, physical_device: vk::PhysicalDevice, @@ -28,24 +28,23 @@ impl Surface { surface: vk::SurfaceKHR, ) -> VkResult { 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) } - #[doc = ""] + /// pub unsafe fn get_physical_device_surface_present_modes( &self, physical_device: vk::PhysicalDevice, surface: vk::SurfaceKHR, ) -> VkResult> { 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, @@ -54,45 +53,42 @@ impl Surface { }) } - #[doc = ""] + /// pub unsafe fn get_physical_device_surface_capabilities( &self, physical_device: vk::PhysicalDevice, surface: vk::SurfaceKHR, ) -> VkResult { 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) } - #[doc = ""] + /// pub unsafe fn get_physical_device_surface_formats( &self, physical_device: vk::PhysicalDevice, surface: vk::SurfaceKHR, ) -> VkResult> { 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) }) } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/swapchain.rs b/third_party/rust/ash/src/extensions/khr/swapchain.rs index 682ff04ebfc6f..407433b964ca0 100755 --- a/third_party/rust/ash/src/extensions/khr/swapchain.rs +++ b/third_party/rust/ash/src/extensions/khr/swapchain.rs @@ -20,18 +20,17 @@ impl Swapchain { Self { handle, fp } } - #[doc = ""] + /// 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. - #[doc = ""] + /// pub unsafe fn acquire_next_image( &self, swapchain: vk::SwapchainKHR, @@ -40,7 +39,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, @@ -55,31 +54,30 @@ impl Swapchain { } } - #[doc = ""] + /// pub unsafe fn create_swapchain( &self, create_info: &vk::SwapchainCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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. - #[doc = ""] + /// pub unsafe fn queue_present( &self, queue: vk::Queue, present_info: &vk::PresentInfoKHR, ) -> VkResult { - 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), @@ -87,18 +85,17 @@ impl Swapchain { } } - #[doc = ""] + /// pub unsafe fn get_swapchain_images( &self, swapchain: vk::SwapchainKHR, ) -> VkResult> { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrSwapchainFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/synchronization2.rs b/third_party/rust/ash/src/extensions/khr/synchronization2.rs index d53cae69baeed..89de33b3d9171 100644 --- a/third_party/rust/ash/src/extensions/khr/synchronization2.rs +++ b/third_party/rust/ash/src/extensions/khr/synchronization2.rs @@ -17,39 +17,36 @@ impl Synchronization2 { Self { fp } } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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) } - #[doc = ""] + /// pub unsafe fn cmd_wait_events2( &self, command_buffer: vk::CommandBuffer, @@ -57,7 +54,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(), @@ -65,7 +62,7 @@ impl Synchronization2 { ) } - #[doc = ""] + /// pub unsafe fn cmd_write_timestamp2( &self, command_buffer: vk::CommandBuffer, @@ -73,23 +70,20 @@ 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) } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrSynchronization2Fn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/timeline_semaphore.rs b/third_party/rust/ash/src/extensions/khr/timeline_semaphore.rs index 589633024ce0b..ea099a32ced9d 100644 --- a/third_party/rust/ash/src/extensions/khr/timeline_semaphore.rs +++ b/third_party/rust/ash/src/extensions/khr/timeline_semaphore.rs @@ -19,33 +19,28 @@ impl TimelineSemaphore { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { 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) } - #[doc = ""] + /// 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() } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrTimelineSemaphoreFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/wayland_surface.rs b/third_party/rust/ash/src/extensions/khr/wayland_surface.rs index 67848bcfd577f..6f9c8433c0f49 100755 --- a/third_party/rust/ash/src/extensions/khr/wayland_surface.rs +++ b/third_party/rust/ash/src/extensions/khr/wayland_surface.rs @@ -20,42 +20,39 @@ impl WaylandSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_wayland_surface( &self, create_info: &vk::WaylandSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrWaylandSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/win32_surface.rs b/third_party/rust/ash/src/extensions/khr/win32_surface.rs index 3713c19f8f19b..27422f1cb5f69 100755 --- a/third_party/rust/ash/src/extensions/khr/win32_surface.rs +++ b/third_party/rust/ash/src/extensions/khr/win32_surface.rs @@ -20,30 +20,29 @@ impl Win32Surface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_win32_surface( &self, create_info: &vk::Win32SurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// 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, ); @@ -51,7 +50,7 @@ impl Win32Surface { b > 0 } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrWin32SurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/xcb_surface.rs b/third_party/rust/ash/src/extensions/khr/xcb_surface.rs index db30e293bfcf9..423a6e111d359 100755 --- a/third_party/rust/ash/src/extensions/khr/xcb_surface.rs +++ b/third_party/rust/ash/src/extensions/khr/xcb_surface.rs @@ -20,24 +20,23 @@ impl XcbSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_xcb_surface( &self, create_info: &vk::XcbSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// pub unsafe fn get_physical_device_xcb_presentation_support( &self, physical_device: vk::PhysicalDevice, @@ -45,7 +44,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, @@ -55,7 +54,7 @@ impl XcbSurface { b > 0 } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrXcbSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/khr/xlib_surface.rs b/third_party/rust/ash/src/extensions/khr/xlib_surface.rs index 16e4bcc09fdf3..8f80c70748147 100755 --- a/third_party/rust/ash/src/extensions/khr/xlib_surface.rs +++ b/third_party/rust/ash/src/extensions/khr/xlib_surface.rs @@ -20,24 +20,23 @@ impl XlibSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_xlib_surface( &self, create_info: &vk::XlibSurfaceCreateInfoKHR, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// pub unsafe fn get_physical_device_xlib_presentation_support( &self, physical_device: vk::PhysicalDevice, @@ -45,7 +44,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, @@ -55,7 +54,7 @@ impl XlibSurface { b > 0 } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::KhrXlibSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/mvk/ios_surface.rs b/third_party/rust/ash/src/extensions/mvk/ios_surface.rs index 3ab7ec880190b..4b29e1e7782c1 100755 --- a/third_party/rust/ash/src/extensions/mvk/ios_surface.rs +++ b/third_party/rust/ash/src/extensions/mvk/ios_surface.rs @@ -20,24 +20,23 @@ impl IOSSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_ios_surface( &self, create_info: &vk::IOSSurfaceCreateInfoMVK, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::MvkIosSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/mvk/macos_surface.rs b/third_party/rust/ash/src/extensions/mvk/macos_surface.rs index e916ef619c01c..249448364fffc 100755 --- a/third_party/rust/ash/src/extensions/mvk/macos_surface.rs +++ b/third_party/rust/ash/src/extensions/mvk/macos_surface.rs @@ -20,24 +20,23 @@ impl MacOSSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_mac_os_surface( &self, create_info: &vk::MacOSSurfaceCreateInfoMVK, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::MvkMacosSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/nn/vi_surface.rs b/third_party/rust/ash/src/extensions/nn/vi_surface.rs index 03ae9754fde0f..5982c9ded22b5 100644 --- a/third_party/rust/ash/src/extensions/nn/vi_surface.rs +++ b/third_party/rust/ash/src/extensions/nn/vi_surface.rs @@ -20,24 +20,23 @@ impl ViSurface { Self { handle, fp } } - #[doc = ""] + /// pub unsafe fn create_vi_surface( &self, create_info: &vk::ViSurfaceCreateInfoNN, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::NnViSurfaceFn::name() } diff --git a/third_party/rust/ash/src/extensions/nv/device_diagnostic_checkpoints.rs b/third_party/rust/ash/src/extensions/nv/device_diagnostic_checkpoints.rs index a55bbde1e4531..3d52230087140 100644 --- a/third_party/rust/ash/src/extensions/nv/device_diagnostic_checkpoints.rs +++ b/third_party/rust/ash/src/extensions/nv/device_diagnostic_checkpoints.rs @@ -4,6 +4,7 @@ use std::ffi::CStr; use std::mem; use std::os::raw::c_void; +/// #[derive(Clone)] pub struct DeviceDiagnosticCheckpoints { fp: vk::NvDeviceDiagnosticCheckpointsFn, @@ -17,35 +18,37 @@ impl DeviceDiagnosticCheckpoints { Self { fp } } - #[doc = ""] + /// 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); } - #[doc = ""] - pub unsafe fn get_queue_checkpoint_data(&self, queue: vk::Queue) -> Vec { - 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 = - 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 + /// 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 } - pub fn name() -> &'static CStr { + /// + /// + /// 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 { vk::NvDeviceDiagnosticCheckpointsFn::name() } diff --git a/third_party/rust/ash/src/extensions/nv/mesh_shader.rs b/third_party/rust/ash/src/extensions/nv/mesh_shader.rs index 63fb4da0d381b..2033e55224b43 100755 --- a/third_party/rust/ash/src/extensions/nv/mesh_shader.rs +++ b/third_party/rust/ash/src/extensions/nv/mesh_shader.rs @@ -16,18 +16,17 @@ impl MeshShader { Self { fp } } - #[doc = ""] + /// 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); } - #[doc = ""] + /// pub unsafe fn cmd_draw_mesh_tasks_indirect( &self, command_buffer: vk::CommandBuffer, @@ -36,11 +35,16 @@ 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, + ); } - #[doc = ""] + /// pub unsafe fn cmd_draw_mesh_tasks_indirect_count( &self, command_buffer: vk::CommandBuffer, @@ -51,7 +55,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, @@ -62,7 +66,7 @@ impl MeshShader { ); } - pub fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::NvMeshShaderFn::name() } diff --git a/third_party/rust/ash/src/extensions/nv/ray_tracing.rs b/third_party/rust/ash/src/extensions/nv/ray_tracing.rs index 1a46f3f7544ef..1df468f947c57 100755 --- a/third_party/rust/ash/src/extensions/nv/ray_tracing.rs +++ b/third_party/rust/ash/src/extensions/nv/ray_tracing.rs @@ -32,43 +32,42 @@ impl RayTracing { props_rt } - #[doc = ""] + /// pub unsafe fn create_acceleration_structure( &self, create_info: &vk::AccelerationStructureCreateInfoNV, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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) } - #[doc = ""] + /// 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(), ); } - #[doc = ""] + /// 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, @@ -76,21 +75,20 @@ impl RayTracing { requirements } - #[doc = ""] + /// 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() } - #[doc = ""] + /// pub unsafe fn cmd_build_acceleration_structure( &self, command_buffer: vk::CommandBuffer, @@ -103,7 +101,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, @@ -116,7 +114,7 @@ impl RayTracing { ); } - #[doc = ""] + /// pub unsafe fn cmd_copy_acceleration_structure( &self, command_buffer: vk::CommandBuffer, @@ -124,11 +122,10 @@ 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); } - #[doc = ""] + /// pub unsafe fn cmd_trace_rays( &self, command_buffer: vk::CommandBuffer, @@ -147,7 +144,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, @@ -166,7 +163,7 @@ impl RayTracing { ); } - #[doc = ""] + /// pub unsafe fn create_ray_tracing_pipelines( &self, pipeline_cache: vk::PipelineCache, @@ -174,19 +171,18 @@ impl RayTracing { allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult> { 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) } - #[doc = ""] + /// pub unsafe fn get_ray_tracing_shader_group_handles( &self, pipeline: vk::Pipeline, @@ -194,36 +190,34 @@ 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() } - #[doc = ""] + /// pub unsafe fn get_acceleration_structure_handle( &self, accel_struct: vk::AccelerationStructureNV, ) -> VkResult { 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::(), - 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::(), + handle_ptr as *mut std::ffi::c_void, + ) + .result_with_success(handle) } - #[doc = ""] + /// pub unsafe fn cmd_write_acceleration_structures_properties( &self, command_buffer: vk::CommandBuffer, @@ -232,7 +226,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(), @@ -242,14 +236,12 @@ impl RayTracing { ); } - #[doc = ""] + /// 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 fn name() -> &'static CStr { + pub const fn name() -> &'static CStr { vk::NvRayTracingFn::name() } diff --git a/third_party/rust/ash/src/instance.rs b/third_party/rust/ash/src/instance.rs index 1ea464ea9b37f..6ebb4d46ff93d 100644 --- a/third_party/rust/ash/src/instance.rs +++ b/third_party/rust/ash/src/instance.rs @@ -6,7 +6,7 @@ use std::mem; use std::os::raw::c_char; use std::ptr; -#[doc = ""] +/// #[derive(Clone)] pub struct Instance { pub(crate) handle: vk::Instance, @@ -14,12 +14,13 @@ 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 { @@ -28,6 +29,7 @@ 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), } } @@ -36,6 +38,48 @@ 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 { + 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) + } + + /// + /// + /// 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 { @@ -51,138 +95,147 @@ impl Instance { &self.instance_fn_1_1 } - /// Retrieve the number of elements to pass to [`Self::enumerate_physical_device_groups()`] + /// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()] pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult { 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) } - #[doc = ""] + /// /// - /// Call [`Self::enumerate_physical_device_groups_len()`] to query the number of elements to pass to `out`. + /// Call [`enumerate_physical_device_groups_len()`][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 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() - } - - #[doc = ""] + 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(()) + } + + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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); } - #[doc = ""] + /// 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 [`Self::get_physical_device_queue_family_properties2()`] + /// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][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 } - #[doc = ""] + /// /// - /// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`. + /// 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`. /// 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 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(), - ); + 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()); } - #[doc = ""] + /// 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 [`Self::get_physical_device_sparse_image_format_properties2()`] + /// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][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 } - #[doc = ""] + /// /// - /// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`. + /// 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`. /// 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, @@ -190,59 +243,64 @@ impl Instance { format_info: &vk::PhysicalDeviceSparseImageFormatInfo2, out: &mut [vk::SparseImageFormatProperties2], ) { - 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(), - ); + 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()); } - #[doc = ""] + /// 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, + ); } - #[doc = ""] + /// 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, + ); } - #[doc = ""] + /// 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, + ); } } @@ -253,7 +311,7 @@ impl Instance { &self.instance_fn_1_0 } - #[doc = ""] + /// /// /// # Safety /// In order for the created [`Device`] to be valid for the duration of its @@ -266,40 +324,38 @@ impl Instance { allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { 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)) } - #[doc = ""] + /// 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) } - #[doc = ""] + /// 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()); } - #[doc = ""] + /// 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, @@ -307,7 +363,7 @@ impl Instance { format_prop } - #[doc = ""] + /// pub unsafe fn get_physical_device_image_format_properties( &self, physical_device: vk::PhysicalDevice, @@ -318,81 +374,84 @@ impl Instance { flags: vk::ImageCreateFlags, ) -> VkResult { 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) } - #[doc = ""] + /// 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 } - #[doc = ""] + /// 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 } - #[doc = ""] + /// pub unsafe fn get_physical_device_queue_family_properties( &self, physical_device: vk::PhysicalDevice, ) -> Vec { 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() } - #[doc = ""] + /// 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 } - #[doc = ""] + /// pub unsafe fn enumerate_physical_devices(&self) -> VkResult> { 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) }) } - #[doc = ""] + /// pub unsafe fn enumerate_device_extension_properties( &self, device: vk::PhysicalDevice, ) -> VkResult> { 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, @@ -401,18 +460,17 @@ impl Instance { }) } - #[doc = ""] + /// pub unsafe fn enumerate_device_layer_properties( &self, device: vk::PhysicalDevice, ) -> VkResult> { 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) }) } - #[doc = ""] + /// pub unsafe fn get_physical_device_sparse_image_format_properties( &self, physical_device: vk::PhysicalDevice, @@ -423,17 +481,18 @@ impl Instance { tiling: vk::ImageTiling, ) -> Vec { 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 diff --git a/third_party/rust/ash/src/lib.rs b/third_party/rust/ash/src/lib.rs index 86f337d58e3ef..50c9d8fa890c3 100644 --- a/third_party/rust/ash/src/lib.rs +++ b/third_party/rust/ash/src/lib.rs @@ -1,4 +1,5 @@ #![deny(clippy::use_self)] +#![warn(trivial_casts, trivial_numeric_casts)] #![allow( clippy::too_many_arguments, clippy::missing_safety_doc, @@ -7,7 +8,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] //! # Vulkan API //! -//! +//! //! //! ## Examples //! @@ -59,8 +60,7 @@ pub trait RawPtr { impl<'r, T> RawPtr for Option<&'r T> { fn as_raw_ptr(&self) -> *const T { match *self { - Some(inner) => inner as *const T, - + Some(inner) => inner, _ => ::std::ptr::null(), } } @@ -74,16 +74,15 @@ mod tests { let mut variable_pointers = vk::PhysicalDeviceVariablePointerFeatures::builder(); let mut corner = vk::PhysicalDeviceCornerSampledImageFeaturesNV::builder(); let chain = vec![ - &variable_pointers as *const _ as usize, - &corner as *const _ as usize, + <*mut _>::cast(&mut variable_pointers), + <*mut _>::cast(&mut corner), ]; let mut device_create_info = vk::DeviceCreateInfo::builder() .push_next(&mut corner) .push_next(&mut variable_pointers); - let chain2: Vec = unsafe { + let chain2: Vec<*mut vk::BaseOutStructure> = unsafe { vk::ptr_chain_iter(&mut device_create_info) .skip(1) - .map(|ptr| ptr as usize) .collect() }; assert_eq!(chain, chain2); diff --git a/third_party/rust/ash/src/prelude.rs b/third_party/rust/ash/src/prelude.rs index 2a29c393d9c00..c3a9959936f5c 100644 --- a/third_party/rust/ash/src/prelude.rs +++ b/third_party/rust/ash/src/prelude.rs @@ -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.2-extensions/man/html/vkEnumerateInstanceExtensionProperties.html +/// [`vkEnumerateInstanceExtensionProperties`]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html pub(crate) unsafe fn read_into_uninitialized_vector, T>( f: impl Fn(&mut N, *mut T) -> vk::Result, ) -> VkResult> @@ -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.2-extensions/man/html/vkEnumerateInstanceExtensionProperties.html +/// [`vkEnumerateInstanceExtensionProperties`]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html pub(crate) unsafe fn read_into_defaulted_vector< N: Copy + Default + TryInto, T: Default + Clone, diff --git a/third_party/rust/ash/src/vk.rs b/third_party/rust/ash/src/vk.rs index 32aedb2731051..611c5f3ce1d79 100644 --- a/third_party/rust/ash/src/vk.rs +++ b/third_party/rust/ash/src/vk.rs @@ -29,18 +29,19 @@ 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(ptr: &mut T) -> impl Iterator { - let ptr: *mut BaseOutStructure = ptr as *mut T as _; + let ptr = <*mut T>::cast::(ptr); (0..).scan(ptr, |p_ptr, _| { if p_ptr.is_null() { return None; } - let n_ptr = (**p_ptr).p_next as *mut BaseOutStructure; + let n_ptr = (**p_ptr).p_next; let old = *p_ptr; *p_ptr = n_ptr; Some(old) diff --git a/third_party/rust/ash/src/vk/aliases.rs b/third_party/rust/ash/src/vk/aliases.rs index 8ef4b1c39c01f..ef6940bff4aab 100644 --- a/third_party/rust/ash/src/vk/aliases.rs +++ b/third_party/rust/ash/src/vk/aliases.rs @@ -4,8 +4,14 @@ 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; @@ -19,10 +25,14 @@ 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; @@ -35,6 +45,9 @@ 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; @@ -86,8 +99,10 @@ 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; @@ -107,14 +122,24 @@ 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; @@ -154,14 +179,64 @@ 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; diff --git a/third_party/rust/ash/src/vk/bitflags.rs b/third_party/rust/ash/src/vk/bitflags.rs index cf9d12192c0c5..f69039a733fa4 100644 --- a/third_party/rust/ash/src/vk/bitflags.rs +++ b/third_party/rust/ash/src/vk/bitflags.rs @@ -1,13 +1,13 @@ use crate::vk::definitions::*; #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineCacheCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineCacheCreateFlags, Flags); impl PipelineCacheCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct QueueFlags(pub(crate) Flags); vk_bitflags_wrapped!(QueueFlags, Flags); impl QueueFlags { @@ -22,7 +22,7 @@ impl QueueFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct CullModeFlags(pub(crate) Flags); vk_bitflags_wrapped!(CullModeFlags, Flags); impl CullModeFlags { @@ -33,19 +33,19 @@ impl CullModeFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct RenderPassCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(RenderPassCreateFlags, Flags); impl RenderPassCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DeviceQueueCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(DeviceQueueCreateFlags, Flags); impl DeviceQueueCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct MemoryPropertyFlags(pub(crate) Flags); vk_bitflags_wrapped!(MemoryPropertyFlags, Flags); impl MemoryPropertyFlags { @@ -62,7 +62,7 @@ impl MemoryPropertyFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct MemoryHeapFlags(pub(crate) Flags); vk_bitflags_wrapped!(MemoryHeapFlags, Flags); impl MemoryHeapFlags { @@ -71,7 +71,7 @@ impl MemoryHeapFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct AccessFlags(pub(crate) Flags); vk_bitflags_wrapped!(AccessFlags, Flags); impl AccessFlags { @@ -112,7 +112,7 @@ impl AccessFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct BufferUsageFlags(pub(crate) Flags); vk_bitflags_wrapped!(BufferUsageFlags, Flags); impl BufferUsageFlags { @@ -137,7 +137,7 @@ impl BufferUsageFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct BufferCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(BufferCreateFlags, Flags); impl BufferCreateFlags { @@ -150,7 +150,7 @@ impl BufferCreateFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ShaderStageFlags(pub(crate) Flags); vk_bitflags_wrapped!(ShaderStageFlags, Flags); impl ShaderStageFlags { @@ -165,7 +165,7 @@ impl ShaderStageFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ImageUsageFlags(pub(crate) Flags); vk_bitflags_wrapped!(ImageUsageFlags, Flags); impl ImageUsageFlags { @@ -188,7 +188,7 @@ impl ImageUsageFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ImageCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(ImageCreateFlags, Flags); impl ImageCreateFlags { @@ -205,19 +205,19 @@ impl ImageCreateFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ImageViewCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(ImageViewCreateFlags, Flags); impl ImageViewCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SamplerCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(SamplerCreateFlags, Flags); impl SamplerCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineCreateFlags, Flags); impl PipelineCreateFlags { @@ -227,13 +227,13 @@ impl PipelineCreateFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineShaderStageCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineShaderStageCreateFlags, Flags); impl PipelineShaderStageCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ColorComponentFlags(pub(crate) Flags); vk_bitflags_wrapped!(ColorComponentFlags, Flags); impl ColorComponentFlags { @@ -244,7 +244,7 @@ impl ColorComponentFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct FenceCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(FenceCreateFlags, Flags); impl FenceCreateFlags { @@ -252,13 +252,13 @@ impl FenceCreateFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(SemaphoreCreateFlags, Flags); impl SemaphoreCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct FormatFeatureFlags(pub(crate) Flags); vk_bitflags_wrapped!(FormatFeatureFlags, Flags); impl FormatFeatureFlags { @@ -291,7 +291,7 @@ impl FormatFeatureFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct QueryControlFlags(pub(crate) Flags); vk_bitflags_wrapped!(QueryControlFlags, Flags); impl QueryControlFlags { @@ -300,7 +300,7 @@ impl QueryControlFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct QueryResultFlags(pub(crate) Flags); vk_bitflags_wrapped!(QueryResultFlags, Flags); impl QueryResultFlags { @@ -315,7 +315,7 @@ impl QueryResultFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferUsageFlags(pub(crate) Flags); vk_bitflags_wrapped!(CommandBufferUsageFlags, Flags); impl CommandBufferUsageFlags { @@ -326,7 +326,7 @@ impl CommandBufferUsageFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct QueryPipelineStatisticFlags(pub(crate) Flags); vk_bitflags_wrapped!(QueryPipelineStatisticFlags, Flags); impl QueryPipelineStatisticFlags { @@ -355,7 +355,7 @@ impl QueryPipelineStatisticFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ImageAspectFlags(pub(crate) Flags); vk_bitflags_wrapped!(ImageAspectFlags, Flags); impl ImageAspectFlags { @@ -366,7 +366,7 @@ impl ImageAspectFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SparseImageFormatFlags(pub(crate) Flags); vk_bitflags_wrapped!(SparseImageFormatFlags, Flags); impl SparseImageFormatFlags { @@ -379,7 +379,7 @@ impl SparseImageFormatFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SparseMemoryBindFlags(pub(crate) Flags); vk_bitflags_wrapped!(SparseMemoryBindFlags, Flags); impl SparseMemoryBindFlags { @@ -388,7 +388,7 @@ impl SparseMemoryBindFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineStageFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineStageFlags, Flags); impl PipelineStageFlags { @@ -429,7 +429,7 @@ impl PipelineStageFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct CommandPoolCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(CommandPoolCreateFlags, Flags); impl CommandPoolCreateFlags { @@ -440,7 +440,7 @@ impl CommandPoolCreateFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct CommandPoolResetFlags(pub(crate) Flags); vk_bitflags_wrapped!(CommandPoolResetFlags, Flags); impl CommandPoolResetFlags { @@ -449,7 +449,7 @@ impl CommandPoolResetFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferResetFlags(pub(crate) Flags); vk_bitflags_wrapped!(CommandBufferResetFlags, Flags); impl CommandBufferResetFlags { @@ -458,7 +458,7 @@ impl CommandBufferResetFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SampleCountFlags(pub(crate) Flags); vk_bitflags_wrapped!(SampleCountFlags, Flags); impl SampleCountFlags { @@ -479,7 +479,7 @@ impl SampleCountFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct AttachmentDescriptionFlags(pub(crate) Flags); vk_bitflags_wrapped!(AttachmentDescriptionFlags, Flags); impl AttachmentDescriptionFlags { @@ -488,7 +488,7 @@ impl AttachmentDescriptionFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct StencilFaceFlags(pub(crate) Flags); vk_bitflags_wrapped!(StencilFaceFlags, Flags); impl StencilFaceFlags { @@ -501,7 +501,7 @@ impl StencilFaceFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DescriptorPoolCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(DescriptorPoolCreateFlags, Flags); impl DescriptorPoolCreateFlags { @@ -510,7 +510,7 @@ impl DescriptorPoolCreateFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DependencyFlags(pub(crate) Flags); vk_bitflags_wrapped!(DependencyFlags, Flags); impl DependencyFlags { @@ -519,7 +519,7 @@ impl DependencyFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreWaitFlags(pub(crate) Flags); vk_bitflags_wrapped!(SemaphoreWaitFlags, Flags); impl SemaphoreWaitFlags { @@ -527,7 +527,7 @@ impl SemaphoreWaitFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DisplayPlaneAlphaFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(DisplayPlaneAlphaFlagsKHR, Flags); impl DisplayPlaneAlphaFlagsKHR { @@ -538,7 +538,7 @@ impl DisplayPlaneAlphaFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct CompositeAlphaFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(CompositeAlphaFlagsKHR, Flags); impl CompositeAlphaFlagsKHR { @@ -549,7 +549,7 @@ impl CompositeAlphaFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SurfaceTransformFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(SurfaceTransformFlagsKHR, Flags); impl SurfaceTransformFlagsKHR { @@ -565,7 +565,7 @@ impl SurfaceTransformFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SwapchainImageUsageFlagsANDROID(pub(crate) Flags); vk_bitflags_wrapped!(SwapchainImageUsageFlagsANDROID, Flags); impl SwapchainImageUsageFlagsANDROID { @@ -573,7 +573,7 @@ impl SwapchainImageUsageFlagsANDROID { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DebugReportFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(DebugReportFlagsEXT, Flags); impl DebugReportFlagsEXT { @@ -585,7 +585,7 @@ impl DebugReportFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryHandleTypeFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(ExternalMemoryHandleTypeFlagsNV, Flags); impl ExternalMemoryHandleTypeFlagsNV { @@ -596,7 +596,7 @@ impl ExternalMemoryHandleTypeFlagsNV { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryFeatureFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(ExternalMemoryFeatureFlagsNV, Flags); impl ExternalMemoryFeatureFlagsNV { @@ -606,7 +606,7 @@ impl ExternalMemoryFeatureFlagsNV { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SubgroupFeatureFlags(pub(crate) Flags); vk_bitflags_wrapped!(SubgroupFeatureFlags, Flags); impl SubgroupFeatureFlags { @@ -629,7 +629,7 @@ impl SubgroupFeatureFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct IndirectCommandsLayoutUsageFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(IndirectCommandsLayoutUsageFlagsNV, Flags); impl IndirectCommandsLayoutUsageFlagsNV { @@ -639,7 +639,7 @@ impl IndirectCommandsLayoutUsageFlagsNV { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct IndirectStateFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(IndirectStateFlagsNV, Flags); impl IndirectStateFlagsNV { @@ -647,19 +647,19 @@ impl IndirectStateFlagsNV { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct PrivateDataSlotCreateFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(PrivateDataSlotCreateFlagsEXT, Flags); -impl PrivateDataSlotCreateFlagsEXT {} +#[doc = ""] +pub struct PrivateDataSlotCreateFlags(pub(crate) Flags); +vk_bitflags_wrapped!(PrivateDataSlotCreateFlags, Flags); +impl PrivateDataSlotCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetLayoutCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(DescriptorSetLayoutCreateFlags, Flags); impl DescriptorSetLayoutCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryHandleTypeFlags(pub(crate) Flags); vk_bitflags_wrapped!(ExternalMemoryHandleTypeFlags, Flags); impl ExternalMemoryHandleTypeFlags { @@ -673,7 +673,7 @@ impl ExternalMemoryHandleTypeFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryFeatureFlags(pub(crate) Flags); vk_bitflags_wrapped!(ExternalMemoryFeatureFlags, Flags); impl ExternalMemoryFeatureFlags { @@ -683,7 +683,7 @@ impl ExternalMemoryFeatureFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalSemaphoreHandleTypeFlags(pub(crate) Flags); vk_bitflags_wrapped!(ExternalSemaphoreHandleTypeFlags, Flags); impl ExternalSemaphoreHandleTypeFlags { @@ -696,7 +696,7 @@ impl ExternalSemaphoreHandleTypeFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalSemaphoreFeatureFlags(pub(crate) Flags); vk_bitflags_wrapped!(ExternalSemaphoreFeatureFlags, Flags); impl ExternalSemaphoreFeatureFlags { @@ -705,7 +705,7 @@ impl ExternalSemaphoreFeatureFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreImportFlags(pub(crate) Flags); vk_bitflags_wrapped!(SemaphoreImportFlags, Flags); impl SemaphoreImportFlags { @@ -713,7 +713,7 @@ impl SemaphoreImportFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalFenceHandleTypeFlags(pub(crate) Flags); vk_bitflags_wrapped!(ExternalFenceHandleTypeFlags, Flags); impl ExternalFenceHandleTypeFlags { @@ -724,7 +724,7 @@ impl ExternalFenceHandleTypeFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ExternalFenceFeatureFlags(pub(crate) Flags); vk_bitflags_wrapped!(ExternalFenceFeatureFlags, Flags); impl ExternalFenceFeatureFlags { @@ -733,7 +733,7 @@ impl ExternalFenceFeatureFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct FenceImportFlags(pub(crate) Flags); vk_bitflags_wrapped!(FenceImportFlags, Flags); impl FenceImportFlags { @@ -741,7 +741,7 @@ impl FenceImportFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SurfaceCounterFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(SurfaceCounterFlagsEXT, Flags); impl SurfaceCounterFlagsEXT { @@ -749,7 +749,7 @@ impl SurfaceCounterFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PeerMemoryFeatureFlags(pub(crate) Flags); vk_bitflags_wrapped!(PeerMemoryFeatureFlags, Flags); impl PeerMemoryFeatureFlags { @@ -764,7 +764,7 @@ impl PeerMemoryFeatureFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct MemoryAllocateFlags(pub(crate) Flags); vk_bitflags_wrapped!(MemoryAllocateFlags, Flags); impl MemoryAllocateFlags { @@ -773,7 +773,7 @@ impl MemoryAllocateFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupPresentModeFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(DeviceGroupPresentModeFlagsKHR, Flags); impl DeviceGroupPresentModeFlagsKHR { @@ -788,19 +788,19 @@ impl DeviceGroupPresentModeFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SwapchainCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(SwapchainCreateFlagsKHR, Flags); impl SwapchainCreateFlagsKHR {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct SubpassDescriptionFlags(pub(crate) Flags); vk_bitflags_wrapped!(SubpassDescriptionFlags, Flags); impl SubpassDescriptionFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsMessageSeverityFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(DebugUtilsMessageSeverityFlagsEXT, Flags); impl DebugUtilsMessageSeverityFlagsEXT { @@ -811,7 +811,7 @@ impl DebugUtilsMessageSeverityFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsMessageTypeFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(DebugUtilsMessageTypeFlagsEXT, Flags); impl DebugUtilsMessageTypeFlagsEXT { @@ -821,7 +821,7 @@ impl DebugUtilsMessageTypeFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DescriptorBindingFlags(pub(crate) Flags); vk_bitflags_wrapped!(DescriptorBindingFlags, Flags); impl DescriptorBindingFlags { @@ -832,7 +832,7 @@ impl DescriptorBindingFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ConditionalRenderingFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(ConditionalRenderingFlagsEXT, Flags); impl ConditionalRenderingFlagsEXT { @@ -840,7 +840,7 @@ impl ConditionalRenderingFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ResolveModeFlags(pub(crate) Flags); vk_bitflags_wrapped!(ResolveModeFlags, Flags); impl ResolveModeFlags { @@ -852,7 +852,7 @@ impl ResolveModeFlags { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct GeometryInstanceFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(GeometryInstanceFlagsKHR, Flags); impl GeometryInstanceFlagsKHR { @@ -864,7 +864,7 @@ impl GeometryInstanceFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct GeometryFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(GeometryFlagsKHR, Flags); impl GeometryFlagsKHR { @@ -873,7 +873,7 @@ impl GeometryFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct BuildAccelerationStructureFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(BuildAccelerationStructureFlagsKHR, Flags); impl BuildAccelerationStructureFlagsKHR { @@ -885,7 +885,7 @@ impl BuildAccelerationStructureFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(AccelerationStructureCreateFlagsKHR, Flags); impl AccelerationStructureCreateFlagsKHR { @@ -893,13 +893,13 @@ impl AccelerationStructureCreateFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct FramebufferCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(FramebufferCreateFlags, Flags); impl FramebufferCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DeviceDiagnosticsConfigFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(DeviceDiagnosticsConfigFlagsNV, Flags); impl DeviceDiagnosticsConfigFlagsNV { @@ -909,17 +909,20 @@ impl DeviceDiagnosticsConfigFlagsNV { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct PipelineCreationFeedbackFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(PipelineCreationFeedbackFlagsEXT, Flags); -impl PipelineCreationFeedbackFlagsEXT { +#[doc = ""] +pub struct PipelineCreationFeedbackFlags(pub(crate) Flags); +vk_bitflags_wrapped!(PipelineCreationFeedbackFlags, Flags); +impl PipelineCreationFeedbackFlags { pub const VALID: Self = Self(0b1); + pub const VALID_EXT: Self = Self::VALID; pub const APPLICATION_PIPELINE_CACHE_HIT: Self = Self(0b10); + pub const APPLICATION_PIPELINE_CACHE_HIT_EXT: Self = Self::APPLICATION_PIPELINE_CACHE_HIT; pub const BASE_PIPELINE_ACCELERATION: Self = Self(0b100); + pub const BASE_PIPELINE_ACCELERATION_EXT: Self = Self::BASE_PIPELINE_ACCELERATION; } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PerformanceCounterDescriptionFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(PerformanceCounterDescriptionFlagsKHR, Flags); impl PerformanceCounterDescriptionFlagsKHR { @@ -928,138 +931,191 @@ impl PerformanceCounterDescriptionFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct AcquireProfilingLockFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(AcquireProfilingLockFlagsKHR, Flags); impl AcquireProfilingLockFlagsKHR {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ShaderCorePropertiesFlagsAMD(pub(crate) Flags); vk_bitflags_wrapped!(ShaderCorePropertiesFlagsAMD, Flags); impl ShaderCorePropertiesFlagsAMD {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ShaderModuleCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(ShaderModuleCreateFlags, Flags); impl ShaderModuleCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineCompilerControlFlagsAMD(pub(crate) Flags); vk_bitflags_wrapped!(PipelineCompilerControlFlagsAMD, Flags); impl PipelineCompilerControlFlagsAMD {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct ToolPurposeFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(ToolPurposeFlagsEXT, Flags); -impl ToolPurposeFlagsEXT { +#[doc = ""] +pub struct ToolPurposeFlags(pub(crate) Flags); +vk_bitflags_wrapped!(ToolPurposeFlags, Flags); +impl ToolPurposeFlags { pub const VALIDATION: Self = Self(0b1); + pub const VALIDATION_EXT: Self = Self::VALIDATION; pub const PROFILING: Self = Self(0b10); + pub const PROFILING_EXT: Self = Self::PROFILING; pub const TRACING: Self = Self(0b100); + pub const TRACING_EXT: Self = Self::TRACING; pub const ADDITIONAL_FEATURES: Self = Self(0b1000); + pub const ADDITIONAL_FEATURES_EXT: Self = Self::ADDITIONAL_FEATURES; pub const MODIFYING_FEATURES: Self = Self(0b1_0000); + pub const MODIFYING_FEATURES_EXT: Self = Self::MODIFYING_FEATURES; } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct AccessFlags2KHR(pub(crate) Flags64); -vk_bitflags_wrapped!(AccessFlags2KHR, Flags64); -impl AccessFlags2KHR { +#[doc = ""] +pub struct AccessFlags2(pub(crate) Flags64); +vk_bitflags_wrapped!(AccessFlags2, Flags64); +impl AccessFlags2 { pub const NONE: Self = Self(0); + pub const NONE_KHR: Self = Self::NONE; pub const INDIRECT_COMMAND_READ: Self = Self(0b1); + pub const INDIRECT_COMMAND_READ_KHR: Self = Self::INDIRECT_COMMAND_READ; pub const INDEX_READ: Self = Self(0b10); + pub const INDEX_READ_KHR: Self = Self::INDEX_READ; pub const VERTEX_ATTRIBUTE_READ: Self = Self(0b100); + pub const VERTEX_ATTRIBUTE_READ_KHR: Self = Self::VERTEX_ATTRIBUTE_READ; pub const UNIFORM_READ: Self = Self(0b1000); + pub const UNIFORM_READ_KHR: Self = Self::UNIFORM_READ; pub const INPUT_ATTACHMENT_READ: Self = Self(0b1_0000); + pub const INPUT_ATTACHMENT_READ_KHR: Self = Self::INPUT_ATTACHMENT_READ; pub const SHADER_READ: Self = Self(0b10_0000); + pub const SHADER_READ_KHR: Self = Self::SHADER_READ; pub const SHADER_WRITE: Self = Self(0b100_0000); + pub const SHADER_WRITE_KHR: Self = Self::SHADER_WRITE; pub const COLOR_ATTACHMENT_READ: Self = Self(0b1000_0000); + pub const COLOR_ATTACHMENT_READ_KHR: Self = Self::COLOR_ATTACHMENT_READ; pub const COLOR_ATTACHMENT_WRITE: Self = Self(0b1_0000_0000); + pub const COLOR_ATTACHMENT_WRITE_KHR: Self = Self::COLOR_ATTACHMENT_WRITE; pub const DEPTH_STENCIL_ATTACHMENT_READ: Self = Self(0b10_0000_0000); + pub const DEPTH_STENCIL_ATTACHMENT_READ_KHR: Self = Self::DEPTH_STENCIL_ATTACHMENT_READ; pub const DEPTH_STENCIL_ATTACHMENT_WRITE: Self = Self(0b100_0000_0000); + pub const DEPTH_STENCIL_ATTACHMENT_WRITE_KHR: Self = Self::DEPTH_STENCIL_ATTACHMENT_WRITE; pub const TRANSFER_READ: Self = Self(0b1000_0000_0000); + pub const TRANSFER_READ_KHR: Self = Self::TRANSFER_READ; pub const TRANSFER_WRITE: Self = Self(0b1_0000_0000_0000); + pub const TRANSFER_WRITE_KHR: Self = Self::TRANSFER_WRITE; pub const HOST_READ: Self = Self(0b10_0000_0000_0000); + pub const HOST_READ_KHR: Self = Self::HOST_READ; pub const HOST_WRITE: Self = Self(0b100_0000_0000_0000); + pub const HOST_WRITE_KHR: Self = Self::HOST_WRITE; pub const MEMORY_READ: Self = Self(0b1000_0000_0000_0000); + pub const MEMORY_READ_KHR: Self = Self::MEMORY_READ; pub const MEMORY_WRITE: Self = Self(0b1_0000_0000_0000_0000); + pub const MEMORY_WRITE_KHR: Self = Self::MEMORY_WRITE; pub const SHADER_SAMPLED_READ: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000); + pub const SHADER_SAMPLED_READ_KHR: Self = Self::SHADER_SAMPLED_READ; pub const SHADER_STORAGE_READ: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000); + pub const SHADER_STORAGE_READ_KHR: Self = Self::SHADER_STORAGE_READ; pub const SHADER_STORAGE_WRITE: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000); + pub const SHADER_STORAGE_WRITE_KHR: Self = Self::SHADER_STORAGE_WRITE; } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct PipelineStageFlags2KHR(pub(crate) Flags64); -vk_bitflags_wrapped!(PipelineStageFlags2KHR, Flags64); -impl PipelineStageFlags2KHR { +#[doc = ""] +pub struct PipelineStageFlags2(pub(crate) Flags64); +vk_bitflags_wrapped!(PipelineStageFlags2, Flags64); +impl PipelineStageFlags2 { pub const NONE: Self = Self(0); + pub const NONE_KHR: Self = Self::NONE; pub const TOP_OF_PIPE: Self = Self(0b1); + pub const TOP_OF_PIPE_KHR: Self = Self::TOP_OF_PIPE; pub const DRAW_INDIRECT: Self = Self(0b10); + pub const DRAW_INDIRECT_KHR: Self = Self::DRAW_INDIRECT; pub const VERTEX_INPUT: Self = Self(0b100); + pub const VERTEX_INPUT_KHR: Self = Self::VERTEX_INPUT; pub const VERTEX_SHADER: Self = Self(0b1000); + pub const VERTEX_SHADER_KHR: Self = Self::VERTEX_SHADER; pub const TESSELLATION_CONTROL_SHADER: Self = Self(0b1_0000); + pub const TESSELLATION_CONTROL_SHADER_KHR: Self = Self::TESSELLATION_CONTROL_SHADER; pub const TESSELLATION_EVALUATION_SHADER: Self = Self(0b10_0000); + pub const TESSELLATION_EVALUATION_SHADER_KHR: Self = Self::TESSELLATION_EVALUATION_SHADER; pub const GEOMETRY_SHADER: Self = Self(0b100_0000); + pub const GEOMETRY_SHADER_KHR: Self = Self::GEOMETRY_SHADER; pub const FRAGMENT_SHADER: Self = Self(0b1000_0000); + pub const FRAGMENT_SHADER_KHR: Self = Self::FRAGMENT_SHADER; pub const EARLY_FRAGMENT_TESTS: Self = Self(0b1_0000_0000); + pub const EARLY_FRAGMENT_TESTS_KHR: Self = Self::EARLY_FRAGMENT_TESTS; pub const LATE_FRAGMENT_TESTS: Self = Self(0b10_0000_0000); + pub const LATE_FRAGMENT_TESTS_KHR: Self = Self::LATE_FRAGMENT_TESTS; pub const COLOR_ATTACHMENT_OUTPUT: Self = Self(0b100_0000_0000); + pub const COLOR_ATTACHMENT_OUTPUT_KHR: Self = Self::COLOR_ATTACHMENT_OUTPUT; pub const COMPUTE_SHADER: Self = Self(0b1000_0000_0000); + pub const COMPUTE_SHADER_KHR: Self = Self::COMPUTE_SHADER; pub const ALL_TRANSFER: Self = Self(0b1_0000_0000_0000); - pub const TRANSFER: Self = Self::ALL_TRANSFER; + pub const ALL_TRANSFER_KHR: Self = Self::ALL_TRANSFER; + pub const TRANSFER: Self = Self::ALL_TRANSFER_KHR; + pub const TRANSFER_KHR: Self = Self::TRANSFER; pub const BOTTOM_OF_PIPE: Self = Self(0b10_0000_0000_0000); + pub const BOTTOM_OF_PIPE_KHR: Self = Self::BOTTOM_OF_PIPE; pub const HOST: Self = Self(0b100_0000_0000_0000); + pub const HOST_KHR: Self = Self::HOST; pub const ALL_GRAPHICS: Self = Self(0b1000_0000_0000_0000); + pub const ALL_GRAPHICS_KHR: Self = Self::ALL_GRAPHICS; pub const ALL_COMMANDS: Self = Self(0b1_0000_0000_0000_0000); + pub const ALL_COMMANDS_KHR: Self = Self::ALL_COMMANDS; pub const COPY: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000); + pub const COPY_KHR: Self = Self::COPY; pub const RESOLVE: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000); + pub const RESOLVE_KHR: Self = Self::RESOLVE; pub const BLIT: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000); + pub const BLIT_KHR: Self = Self::BLIT; pub const CLEAR: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000); + pub const CLEAR_KHR: Self = Self::CLEAR; pub const INDEX_INPUT: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000); + pub const INDEX_INPUT_KHR: Self = Self::INDEX_INPUT; pub const VERTEX_ATTRIBUTE_INPUT: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000_0000); + pub const VERTEX_ATTRIBUTE_INPUT_KHR: Self = Self::VERTEX_ATTRIBUTE_INPUT; pub const PRE_RASTERIZATION_SHADERS: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000_0000); + pub const PRE_RASTERIZATION_SHADERS_KHR: Self = Self::PRE_RASTERIZATION_SHADERS; } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct SubmitFlagsKHR(pub(crate) Flags); -vk_bitflags_wrapped!(SubmitFlagsKHR, Flags); -impl SubmitFlagsKHR { +#[doc = ""] +pub struct SubmitFlags(pub(crate) Flags); +vk_bitflags_wrapped!(SubmitFlags, Flags); +impl SubmitFlags { pub const PROTECTED: Self = Self(0b1); + pub const PROTECTED_KHR: Self = Self::PROTECTED; } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct EventCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(EventCreateFlags, Flags); impl EventCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineLayoutCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineLayoutCreateFlags, Flags); impl PipelineLayoutCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineColorBlendStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineColorBlendStateCreateFlags, Flags); impl PipelineColorBlendStateCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineDepthStencilStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineDepthStencilStateCreateFlags, Flags); impl PipelineDepthStencilStateCreateFlags {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoCodecOperationFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoCodecOperationFlagsKHR, Flags); impl VideoCodecOperationFlagsKHR { @@ -1067,7 +1123,7 @@ impl VideoCodecOperationFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoChromaSubsamplingFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoChromaSubsamplingFlagsKHR, Flags); impl VideoChromaSubsamplingFlagsKHR { @@ -1079,7 +1135,7 @@ impl VideoChromaSubsamplingFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoComponentBitDepthFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoComponentBitDepthFlagsKHR, Flags); impl VideoComponentBitDepthFlagsKHR { @@ -1090,7 +1146,7 @@ impl VideoComponentBitDepthFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoCapabilityFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoCapabilityFlagsKHR, Flags); impl VideoCapabilityFlagsKHR { @@ -1099,7 +1155,7 @@ impl VideoCapabilityFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoSessionCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoSessionCreateFlagsKHR, Flags); impl VideoSessionCreateFlagsKHR { @@ -1108,7 +1164,7 @@ impl VideoSessionCreateFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoCodingQualityPresetFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoCodingQualityPresetFlagsKHR, Flags); impl VideoCodingQualityPresetFlagsKHR { @@ -1118,7 +1174,7 @@ impl VideoCodingQualityPresetFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264PictureLayoutFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoDecodeH264PictureLayoutFlagsEXT, Flags); impl VideoDecodeH264PictureLayoutFlagsEXT { @@ -1128,7 +1184,7 @@ impl VideoDecodeH264PictureLayoutFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoCodingControlFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoCodingControlFlagsKHR, Flags); impl VideoCodingControlFlagsKHR { @@ -1137,7 +1193,17 @@ impl VideoCodingControlFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] +pub struct VideoDecodeCapabilityFlagsKHR(pub(crate) Flags); +vk_bitflags_wrapped!(VideoDecodeCapabilityFlagsKHR, Flags); +impl VideoDecodeCapabilityFlagsKHR { + pub const DEFAULT: Self = Self(0); + pub const DPB_AND_OUTPUT_COINCIDE: Self = Self(0b1); + pub const DPB_AND_OUTPUT_DISTINCT: Self = Self(0b10); +} +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] pub struct VideoDecodeFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoDecodeFlagsKHR, Flags); impl VideoDecodeFlagsKHR { @@ -1146,7 +1212,7 @@ impl VideoDecodeFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeFlagsKHR, Flags); impl VideoEncodeFlagsKHR { @@ -1155,7 +1221,16 @@ impl VideoEncodeFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] +pub struct VideoEncodeCapabilityFlagsKHR(pub(crate) Flags); +vk_bitflags_wrapped!(VideoEncodeCapabilityFlagsKHR, Flags); +impl VideoEncodeCapabilityFlagsKHR { + pub const DEFAULT: Self = Self(0); + pub const PRECEDING_EXTERNALLY_ENCODED_BYTES: Self = Self(0b1); +} +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] pub struct VideoEncodeRateControlFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeRateControlFlagsKHR, Flags); impl VideoEncodeRateControlFlagsKHR { @@ -1164,7 +1239,7 @@ impl VideoEncodeRateControlFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeRateControlModeFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeRateControlModeFlagsKHR, Flags); impl VideoEncodeRateControlModeFlagsKHR { @@ -1174,25 +1249,37 @@ impl VideoEncodeRateControlModeFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264CapabilityFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeH264CapabilityFlagsEXT, Flags); impl VideoEncodeH264CapabilityFlagsEXT { - pub const CABAC: Self = Self(0b1); - pub const CAVLC: Self = Self(0b10); - pub const WEIGHTED_BI_PRED_IMPLICIT: Self = Self(0b100); - pub const TRANSFORM_8X8: Self = Self(0b1000); - pub const CHROMA_QP_OFFSET: Self = Self(0b1_0000); - pub const SECOND_CHROMA_QP_OFFSET: Self = Self(0b10_0000); - pub const DEBLOCKING_FILTER_DISABLED: Self = Self(0b100_0000); - pub const DEBLOCKING_FILTER_ENABLED: Self = Self(0b1000_0000); - pub const DEBLOCKING_FILTER_PARTIAL: Self = Self(0b1_0000_0000); - pub const MULTIPLE_SLICE_PER_FRAME: Self = Self(0b10_0000_0000); - pub const EVENLY_DISTRIBUTED_SLICE_SIZE: Self = Self(0b100_0000_0000); -} -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] + pub const DIRECT_8X8_INFERENCE: Self = Self(0b1); + pub const SEPARATE_COLOUR_PLANE: Self = Self(0b10); + pub const QPPRIME_Y_ZERO_TRANSFORM_BYPASS: Self = Self(0b100); + pub const SCALING_LISTS: Self = Self(0b1000); + pub const HRD_COMPLIANCE: Self = Self(0b1_0000); + pub const CHROMA_QP_OFFSET: Self = Self(0b10_0000); + pub const SECOND_CHROMA_QP_OFFSET: Self = Self(0b100_0000); + pub const PIC_INIT_QP_MINUS26: Self = Self(0b1000_0000); + pub const WEIGHTED_PRED: Self = Self(0b1_0000_0000); + pub const WEIGHTED_BIPRED_EXPLICIT: Self = Self(0b10_0000_0000); + pub const WEIGHTED_BIPRED_IMPLICIT: Self = Self(0b100_0000_0000); + pub const WEIGHTED_PRED_NO_TABLE: Self = Self(0b1000_0000_0000); + pub const TRANSFORM_8X8: Self = Self(0b1_0000_0000_0000); + pub const CABAC: Self = Self(0b10_0000_0000_0000); + pub const CAVLC: Self = Self(0b100_0000_0000_0000); + pub const DEBLOCKING_FILTER_DISABLED: Self = Self(0b1000_0000_0000_0000); + pub const DEBLOCKING_FILTER_ENABLED: Self = Self(0b1_0000_0000_0000_0000); + pub const DEBLOCKING_FILTER_PARTIAL: Self = Self(0b10_0000_0000_0000_0000); + pub const DISABLE_DIRECT_SPATIAL_MV_PRED: Self = Self(0b100_0000_0000_0000_0000); + pub const MULTIPLE_SLICE_PER_FRAME: Self = Self(0b1000_0000_0000_0000_0000); + pub const SLICE_MB_COUNT: Self = Self(0b1_0000_0000_0000_0000_0000); + pub const ROW_UNALIGNED_SLICE: Self = Self(0b10_0000_0000_0000_0000_0000); + pub const DIFFERENT_SLICE_TYPE: Self = Self(0b100_0000_0000_0000_0000_0000); +} +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] pub struct VideoEncodeH264InputModeFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeH264InputModeFlagsEXT, Flags); impl VideoEncodeH264InputModeFlagsEXT { @@ -1202,7 +1289,7 @@ impl VideoEncodeH264InputModeFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264OutputModeFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeH264OutputModeFlagsEXT, Flags); impl VideoEncodeH264OutputModeFlagsEXT { @@ -1212,16 +1299,7 @@ impl VideoEncodeH264OutputModeFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH264CreateFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH264CreateFlagsEXT, Flags); -impl VideoEncodeH264CreateFlagsEXT { - pub const DEFAULT: Self = Self(0); - pub const RESERVED_0: Self = Self(0b1); -} -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264RateControlStructureFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeH264RateControlStructureFlagsEXT, Flags); impl VideoEncodeH264RateControlStructureFlagsEXT { @@ -1231,13 +1309,13 @@ impl VideoEncodeH264RateControlStructureFlagsEXT { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ImageFormatConstraintsFlagsFUCHSIA(pub(crate) Flags); vk_bitflags_wrapped!(ImageFormatConstraintsFlagsFUCHSIA, Flags); impl ImageFormatConstraintsFlagsFUCHSIA {} #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ImageConstraintsInfoFlagsFUCHSIA(pub(crate) Flags); vk_bitflags_wrapped!(ImageConstraintsInfoFlagsFUCHSIA, Flags); impl ImageConstraintsInfoFlagsFUCHSIA { @@ -1249,91 +1327,173 @@ impl ImageConstraintsInfoFlagsFUCHSIA { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct FormatFeatureFlags2KHR(pub(crate) Flags64); -vk_bitflags_wrapped!(FormatFeatureFlags2KHR, Flags64); -impl FormatFeatureFlags2KHR { +#[doc = ""] +pub struct FormatFeatureFlags2(pub(crate) Flags64); +vk_bitflags_wrapped!(FormatFeatureFlags2, Flags64); +impl FormatFeatureFlags2 { pub const SAMPLED_IMAGE: Self = Self(0b1); + pub const SAMPLED_IMAGE_KHR: Self = Self::SAMPLED_IMAGE; pub const STORAGE_IMAGE: Self = Self(0b10); + pub const STORAGE_IMAGE_KHR: Self = Self::STORAGE_IMAGE; pub const STORAGE_IMAGE_ATOMIC: Self = Self(0b100); + pub const STORAGE_IMAGE_ATOMIC_KHR: Self = Self::STORAGE_IMAGE_ATOMIC; pub const UNIFORM_TEXEL_BUFFER: Self = Self(0b1000); + pub const UNIFORM_TEXEL_BUFFER_KHR: Self = Self::UNIFORM_TEXEL_BUFFER; pub const STORAGE_TEXEL_BUFFER: Self = Self(0b1_0000); + pub const STORAGE_TEXEL_BUFFER_KHR: Self = Self::STORAGE_TEXEL_BUFFER; pub const STORAGE_TEXEL_BUFFER_ATOMIC: Self = Self(0b10_0000); + pub const STORAGE_TEXEL_BUFFER_ATOMIC_KHR: Self = Self::STORAGE_TEXEL_BUFFER_ATOMIC; pub const VERTEX_BUFFER: Self = Self(0b100_0000); + pub const VERTEX_BUFFER_KHR: Self = Self::VERTEX_BUFFER; pub const COLOR_ATTACHMENT: Self = Self(0b1000_0000); + pub const COLOR_ATTACHMENT_KHR: Self = Self::COLOR_ATTACHMENT; pub const COLOR_ATTACHMENT_BLEND: Self = Self(0b1_0000_0000); + pub const COLOR_ATTACHMENT_BLEND_KHR: Self = Self::COLOR_ATTACHMENT_BLEND; pub const DEPTH_STENCIL_ATTACHMENT: Self = Self(0b10_0000_0000); + pub const DEPTH_STENCIL_ATTACHMENT_KHR: Self = Self::DEPTH_STENCIL_ATTACHMENT; pub const BLIT_SRC: Self = Self(0b100_0000_0000); + pub const BLIT_SRC_KHR: Self = Self::BLIT_SRC; pub const BLIT_DST: Self = Self(0b1000_0000_0000); + pub const BLIT_DST_KHR: Self = Self::BLIT_DST; pub const SAMPLED_IMAGE_FILTER_LINEAR: Self = Self(0b1_0000_0000_0000); - pub const SAMPLED_IMAGE_FILTER_CUBIC_EXT: Self = Self(0b10_0000_0000_0000); + pub const SAMPLED_IMAGE_FILTER_LINEAR_KHR: Self = Self::SAMPLED_IMAGE_FILTER_LINEAR; + pub const SAMPLED_IMAGE_FILTER_CUBIC: Self = Self(0b10_0000_0000_0000); + pub const SAMPLED_IMAGE_FILTER_CUBIC_EXT: Self = Self::SAMPLED_IMAGE_FILTER_CUBIC; pub const TRANSFER_SRC: Self = Self(0b100_0000_0000_0000); + pub const TRANSFER_SRC_KHR: Self = Self::TRANSFER_SRC; pub const TRANSFER_DST: Self = Self(0b1000_0000_0000_0000); + pub const TRANSFER_DST_KHR: Self = Self::TRANSFER_DST; pub const SAMPLED_IMAGE_FILTER_MINMAX: Self = Self(0b1_0000_0000_0000_0000); + pub const SAMPLED_IMAGE_FILTER_MINMAX_KHR: Self = Self::SAMPLED_IMAGE_FILTER_MINMAX; pub const MIDPOINT_CHROMA_SAMPLES: Self = Self(0b10_0000_0000_0000_0000); + pub const MIDPOINT_CHROMA_SAMPLES_KHR: Self = Self::MIDPOINT_CHROMA_SAMPLES; pub const SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER: Self = Self(0b100_0000_0000_0000_0000); + pub const SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_KHR: Self = + Self::SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER; pub const SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER: Self = Self(0b1000_0000_0000_0000_0000); + pub const SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_KHR: Self = + Self::SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER; pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT: Self = Self(0b1_0000_0000_0000_0000_0000); + pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_KHR: Self = + Self::SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT; pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE: Self = Self(0b10_0000_0000_0000_0000_0000); + pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_KHR: Self = + Self::SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE; pub const DISJOINT: Self = Self(0b100_0000_0000_0000_0000_0000); + pub const DISJOINT_KHR: Self = Self::DISJOINT; pub const COSITED_CHROMA_SAMPLES: Self = Self(0b1000_0000_0000_0000_0000_0000); + pub const COSITED_CHROMA_SAMPLES_KHR: Self = Self::COSITED_CHROMA_SAMPLES; pub const STORAGE_READ_WITHOUT_FORMAT: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000); + pub const STORAGE_READ_WITHOUT_FORMAT_KHR: Self = Self::STORAGE_READ_WITHOUT_FORMAT; pub const STORAGE_WRITE_WITHOUT_FORMAT: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000); + pub const STORAGE_WRITE_WITHOUT_FORMAT_KHR: Self = Self::STORAGE_WRITE_WITHOUT_FORMAT; pub const SAMPLED_IMAGE_DEPTH_COMPARISON: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000); + pub const SAMPLED_IMAGE_DEPTH_COMPARISON_KHR: Self = Self::SAMPLED_IMAGE_DEPTH_COMPARISON; } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] +pub struct RenderingFlags(pub(crate) Flags); +vk_bitflags_wrapped!(RenderingFlags, Flags); +impl RenderingFlags { + pub const CONTENTS_SECONDARY_COMMAND_BUFFERS: Self = Self(0b1); + pub const CONTENTS_SECONDARY_COMMAND_BUFFERS_KHR: Self = + Self::CONTENTS_SECONDARY_COMMAND_BUFFERS; + pub const SUSPENDING: Self = Self(0b10); + pub const SUSPENDING_KHR: Self = Self::SUSPENDING; + pub const RESUMING: Self = Self(0b100); + pub const RESUMING_KHR: Self = Self::RESUMING; +} +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] +pub struct VideoEncodeH265CapabilityFlagsEXT(pub(crate) Flags); +vk_bitflags_wrapped!(VideoEncodeH265CapabilityFlagsEXT, Flags); +impl VideoEncodeH265CapabilityFlagsEXT { + pub const SEPARATE_COLOUR_PLANE: Self = Self(0b1); + pub const SCALING_LISTS: Self = Self(0b10); + pub const SAMPLE_ADAPTIVE_OFFSET_ENABLED: Self = Self(0b100); + pub const PCM_ENABLE: Self = Self(0b1000); + pub const SPS_TEMPORAL_MVP_ENABLED: Self = Self(0b1_0000); + pub const HRD_COMPLIANCE: Self = Self(0b10_0000); + pub const INIT_QP_MINUS26: Self = Self(0b100_0000); + pub const LOG2_PARALLEL_MERGE_LEVEL_MINUS2: Self = Self(0b1000_0000); + pub const SIGN_DATA_HIDING_ENABLED: Self = Self(0b1_0000_0000); + pub const TRANSFORM_SKIP_ENABLED: Self = Self(0b10_0000_0000); + pub const PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT: Self = Self(0b100_0000_0000); + pub const WEIGHTED_PRED: Self = Self(0b1000_0000_0000); + pub const WEIGHTED_BIPRED: Self = Self(0b1_0000_0000_0000); + pub const WEIGHTED_PRED_NO_TABLE: Self = Self(0b10_0000_0000_0000); + pub const TRANSQUANT_BYPASS_ENABLED: Self = Self(0b100_0000_0000_0000); + pub const ENTROPY_CODING_SYNC_ENABLED: Self = Self(0b1000_0000_0000_0000); + pub const DEBLOCKING_FILTER_OVERRIDE_ENABLED: Self = Self(0b1_0000_0000_0000_0000); + pub const MULTIPLE_TILE_PER_FRAME: Self = Self(0b10_0000_0000_0000_0000); + pub const MULTIPLE_SLICE_PER_TILE: Self = Self(0b100_0000_0000_0000_0000); + pub const MULTIPLE_TILE_PER_SLICE: Self = Self(0b1000_0000_0000_0000_0000); + pub const SLICE_SEGMENT_CTB_COUNT: Self = Self(0b1_0000_0000_0000_0000_0000); + pub const ROW_UNALIGNED_SLICE_SEGMENT: Self = Self(0b10_0000_0000_0000_0000_0000); + pub const DEPENDENT_SLICE_SEGMENT: Self = Self(0b100_0000_0000_0000_0000_0000); + pub const DIFFERENT_SLICE_TYPE: Self = Self(0b1000_0000_0000_0000_0000_0000); +} +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] pub struct VideoEncodeH265InputModeFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeH265InputModeFlagsEXT, Flags); impl VideoEncodeH265InputModeFlagsEXT { pub const FRAME: Self = Self(0b1); - pub const SLICE: Self = Self(0b10); + pub const SLICE_SEGMENT: Self = Self(0b10); pub const NON_VCL: Self = Self(0b100); } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265OutputModeFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeH265OutputModeFlagsEXT, Flags); impl VideoEncodeH265OutputModeFlagsEXT { pub const FRAME: Self = Self(0b1); - pub const SLICE: Self = Self(0b10); + pub const SLICE_SEGMENT: Self = Self(0b10); pub const NON_VCL: Self = Self(0b100); } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] +pub struct VideoEncodeH265RateControlStructureFlagsEXT(pub(crate) Flags); +vk_bitflags_wrapped!(VideoEncodeH265RateControlStructureFlagsEXT, Flags); +impl VideoEncodeH265RateControlStructureFlagsEXT { + pub const UNKNOWN: Self = Self(0); + pub const FLAT: Self = Self(0b1); + pub const DYADIC: Self = Self(0b10); +} +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] pub struct VideoEncodeH265CtbSizeFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeH265CtbSizeFlagsEXT, Flags); impl VideoEncodeH265CtbSizeFlagsEXT { - pub const TYPE_8: Self = Self(0b1); - pub const TYPE_16: Self = Self(0b10); - pub const TYPE_32: Self = Self(0b100); - pub const TYPE_64: Self = Self(0b1000); + pub const TYPE_16: Self = Self(0b1); + pub const TYPE_32: Self = Self(0b10); + pub const TYPE_64: Self = Self(0b100); } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct RenderingFlagsKHR(pub(crate) Flags); -vk_bitflags_wrapped!(RenderingFlagsKHR, Flags); -impl RenderingFlagsKHR { - pub const CONTENTS_SECONDARY_COMMAND_BUFFERS: Self = Self(0b1); - pub const SUSPENDING: Self = Self(0b10); - pub const RESUMING: Self = Self(0b100); +#[doc = ""] +pub struct VideoEncodeH265TransformBlockSizeFlagsEXT(pub(crate) Flags); +vk_bitflags_wrapped!(VideoEncodeH265TransformBlockSizeFlagsEXT, Flags); +impl VideoEncodeH265TransformBlockSizeFlagsEXT { + pub const TYPE_4: Self = Self(0b1); + pub const TYPE_8: Self = Self(0b10); + pub const TYPE_16: Self = Self(0b100); + pub const TYPE_32: Self = Self(0b1000); } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH265RateControlStructureFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH265RateControlStructureFlagsEXT, Flags); -impl VideoEncodeH265RateControlStructureFlagsEXT { - pub const UNKNOWN: Self = Self(0); - pub const FLAT: Self = Self(0b1); - pub const DYADIC: Self = Self(0b10); -} +#[doc = ""] +pub struct InstanceCreateFlags(pub(crate) Flags); +vk_bitflags_wrapped!(InstanceCreateFlags, Flags); +impl InstanceCreateFlags {} diff --git a/third_party/rust/ash/src/vk/const_debugs.rs b/third_party/rust/ash/src/vk/const_debugs.rs index c3e4c07d6fd7c..249f1990d88f7 100644 --- a/third_party/rust/ash/src/vk/const_debugs.rs +++ b/third_party/rust/ash/src/vk/const_debugs.rs @@ -189,119 +189,122 @@ impl fmt::Debug for AccessFlags { AccessFlags::COMMAND_PREPROCESS_WRITE_NV.0, "COMMAND_PREPROCESS_WRITE_NV", ), - (AccessFlags::NONE_KHR.0, "NONE_KHR"), + (AccessFlags::NONE.0, "NONE"), ]; debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for AccessFlags2KHR { +impl fmt::Debug for AccessFlags2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags64, &str)] = &[ - (AccessFlags2KHR::NONE.0, "NONE"), + (AccessFlags2::NONE.0, "NONE"), ( - AccessFlags2KHR::INDIRECT_COMMAND_READ.0, + AccessFlags2::INDIRECT_COMMAND_READ.0, "INDIRECT_COMMAND_READ", ), - (AccessFlags2KHR::INDEX_READ.0, "INDEX_READ"), + (AccessFlags2::INDEX_READ.0, "INDEX_READ"), ( - AccessFlags2KHR::VERTEX_ATTRIBUTE_READ.0, + AccessFlags2::VERTEX_ATTRIBUTE_READ.0, "VERTEX_ATTRIBUTE_READ", ), - (AccessFlags2KHR::UNIFORM_READ.0, "UNIFORM_READ"), + (AccessFlags2::UNIFORM_READ.0, "UNIFORM_READ"), ( - AccessFlags2KHR::INPUT_ATTACHMENT_READ.0, + AccessFlags2::INPUT_ATTACHMENT_READ.0, "INPUT_ATTACHMENT_READ", ), - (AccessFlags2KHR::SHADER_READ.0, "SHADER_READ"), - (AccessFlags2KHR::SHADER_WRITE.0, "SHADER_WRITE"), + (AccessFlags2::SHADER_READ.0, "SHADER_READ"), + (AccessFlags2::SHADER_WRITE.0, "SHADER_WRITE"), ( - AccessFlags2KHR::COLOR_ATTACHMENT_READ.0, + AccessFlags2::COLOR_ATTACHMENT_READ.0, "COLOR_ATTACHMENT_READ", ), ( - AccessFlags2KHR::COLOR_ATTACHMENT_WRITE.0, + AccessFlags2::COLOR_ATTACHMENT_WRITE.0, "COLOR_ATTACHMENT_WRITE", ), ( - AccessFlags2KHR::DEPTH_STENCIL_ATTACHMENT_READ.0, + AccessFlags2::DEPTH_STENCIL_ATTACHMENT_READ.0, "DEPTH_STENCIL_ATTACHMENT_READ", ), ( - AccessFlags2KHR::DEPTH_STENCIL_ATTACHMENT_WRITE.0, + AccessFlags2::DEPTH_STENCIL_ATTACHMENT_WRITE.0, "DEPTH_STENCIL_ATTACHMENT_WRITE", ), - (AccessFlags2KHR::TRANSFER_READ.0, "TRANSFER_READ"), - (AccessFlags2KHR::TRANSFER_WRITE.0, "TRANSFER_WRITE"), - (AccessFlags2KHR::HOST_READ.0, "HOST_READ"), - (AccessFlags2KHR::HOST_WRITE.0, "HOST_WRITE"), - (AccessFlags2KHR::MEMORY_READ.0, "MEMORY_READ"), - (AccessFlags2KHR::MEMORY_WRITE.0, "MEMORY_WRITE"), + (AccessFlags2::TRANSFER_READ.0, "TRANSFER_READ"), + (AccessFlags2::TRANSFER_WRITE.0, "TRANSFER_WRITE"), + (AccessFlags2::HOST_READ.0, "HOST_READ"), + (AccessFlags2::HOST_WRITE.0, "HOST_WRITE"), + (AccessFlags2::MEMORY_READ.0, "MEMORY_READ"), + (AccessFlags2::MEMORY_WRITE.0, "MEMORY_WRITE"), + (AccessFlags2::SHADER_SAMPLED_READ.0, "SHADER_SAMPLED_READ"), + (AccessFlags2::SHADER_STORAGE_READ.0, "SHADER_STORAGE_READ"), + (AccessFlags2::SHADER_STORAGE_WRITE.0, "SHADER_STORAGE_WRITE"), ( - AccessFlags2KHR::SHADER_SAMPLED_READ.0, - "SHADER_SAMPLED_READ", + AccessFlags2::VIDEO_DECODE_READ_KHR.0, + "VIDEO_DECODE_READ_KHR", ), ( - AccessFlags2KHR::SHADER_STORAGE_READ.0, - "SHADER_STORAGE_READ", + AccessFlags2::VIDEO_DECODE_WRITE_KHR.0, + "VIDEO_DECODE_WRITE_KHR", ), ( - AccessFlags2KHR::SHADER_STORAGE_WRITE.0, - "SHADER_STORAGE_WRITE", + AccessFlags2::VIDEO_ENCODE_READ_KHR.0, + "VIDEO_ENCODE_READ_KHR", ), - (AccessFlags2KHR::VIDEO_DECODE_READ.0, "VIDEO_DECODE_READ"), - (AccessFlags2KHR::VIDEO_DECODE_WRITE.0, "VIDEO_DECODE_WRITE"), - (AccessFlags2KHR::VIDEO_ENCODE_READ.0, "VIDEO_ENCODE_READ"), - (AccessFlags2KHR::VIDEO_ENCODE_WRITE.0, "VIDEO_ENCODE_WRITE"), ( - AccessFlags2KHR::TRANSFORM_FEEDBACK_WRITE_EXT.0, + AccessFlags2::VIDEO_ENCODE_WRITE_KHR.0, + "VIDEO_ENCODE_WRITE_KHR", + ), + ( + AccessFlags2::TRANSFORM_FEEDBACK_WRITE_EXT.0, "TRANSFORM_FEEDBACK_WRITE_EXT", ), ( - AccessFlags2KHR::TRANSFORM_FEEDBACK_COUNTER_READ_EXT.0, + AccessFlags2::TRANSFORM_FEEDBACK_COUNTER_READ_EXT.0, "TRANSFORM_FEEDBACK_COUNTER_READ_EXT", ), ( - AccessFlags2KHR::TRANSFORM_FEEDBACK_COUNTER_WRITE_EXT.0, + AccessFlags2::TRANSFORM_FEEDBACK_COUNTER_WRITE_EXT.0, "TRANSFORM_FEEDBACK_COUNTER_WRITE_EXT", ), ( - AccessFlags2KHR::CONDITIONAL_RENDERING_READ_EXT.0, + AccessFlags2::CONDITIONAL_RENDERING_READ_EXT.0, "CONDITIONAL_RENDERING_READ_EXT", ), ( - AccessFlags2KHR::COMMAND_PREPROCESS_READ_NV.0, + AccessFlags2::COMMAND_PREPROCESS_READ_NV.0, "COMMAND_PREPROCESS_READ_NV", ), ( - AccessFlags2KHR::COMMAND_PREPROCESS_WRITE_NV.0, + AccessFlags2::COMMAND_PREPROCESS_WRITE_NV.0, "COMMAND_PREPROCESS_WRITE_NV", ), ( - AccessFlags2KHR::FRAGMENT_SHADING_RATE_ATTACHMENT_READ.0, - "FRAGMENT_SHADING_RATE_ATTACHMENT_READ", + AccessFlags2::FRAGMENT_SHADING_RATE_ATTACHMENT_READ_KHR.0, + "FRAGMENT_SHADING_RATE_ATTACHMENT_READ_KHR", ), ( - AccessFlags2KHR::ACCELERATION_STRUCTURE_READ.0, - "ACCELERATION_STRUCTURE_READ", + AccessFlags2::ACCELERATION_STRUCTURE_READ_KHR.0, + "ACCELERATION_STRUCTURE_READ_KHR", ), ( - AccessFlags2KHR::ACCELERATION_STRUCTURE_WRITE.0, - "ACCELERATION_STRUCTURE_WRITE", + AccessFlags2::ACCELERATION_STRUCTURE_WRITE_KHR.0, + "ACCELERATION_STRUCTURE_WRITE_KHR", ), ( - AccessFlags2KHR::FRAGMENT_DENSITY_MAP_READ_EXT.0, + AccessFlags2::FRAGMENT_DENSITY_MAP_READ_EXT.0, "FRAGMENT_DENSITY_MAP_READ_EXT", ), ( - AccessFlags2KHR::COLOR_ATTACHMENT_READ_NONCOHERENT_EXT.0, + AccessFlags2::COLOR_ATTACHMENT_READ_NONCOHERENT_EXT.0, "COLOR_ATTACHMENT_READ_NONCOHERENT_EXT", ), - (AccessFlags2KHR::RESERVED_41_AMD.0, "RESERVED_41_AMD"), + (AccessFlags2::RESERVED_41_AMD.0, "RESERVED_41_AMD"), ( - AccessFlags2KHR::INVOCATION_MASK_READ_HUAWEI.0, + AccessFlags2::INVOCATION_MASK_READ_HUAWEI.0, "INVOCATION_MASK_READ_HUAWEI", ), - (AccessFlags2KHR::RESERVED_387.0, "RESERVED_387"), + (AccessFlags2::RESERVED_387_KHR.0, "RESERVED_387_KHR"), ]; debug_flags(f, KNOWN, self.0) } @@ -345,7 +348,7 @@ impl fmt::Debug for AttachmentStoreOp { let name = match *self { Self::STORE => Some("STORE"), Self::DONT_CARE => Some("DONT_CARE"), - Self::NONE_KHR => Some("NONE_KHR"), + Self::NONE => Some("NONE"), _ => None, }; if let Some(x) = name { @@ -1109,10 +1112,10 @@ impl fmt::Debug for DescriptorType { Self::UNIFORM_BUFFER_DYNAMIC => Some("UNIFORM_BUFFER_DYNAMIC"), Self::STORAGE_BUFFER_DYNAMIC => Some("STORAGE_BUFFER_DYNAMIC"), Self::INPUT_ATTACHMENT => Some("INPUT_ATTACHMENT"), - Self::INLINE_UNIFORM_BLOCK_EXT => Some("INLINE_UNIFORM_BLOCK_EXT"), Self::ACCELERATION_STRUCTURE_KHR => Some("ACCELERATION_STRUCTURE_KHR"), Self::ACCELERATION_STRUCTURE_NV => Some("ACCELERATION_STRUCTURE_NV"), Self::MUTABLE_VALVE => Some("MUTABLE_VALVE"), + Self::INLINE_UNIFORM_BLOCK => Some("INLINE_UNIFORM_BLOCK"), _ => None, }; if let Some(x) = name { @@ -1324,6 +1327,7 @@ impl fmt::Debug for DriverId { Self::MESA_V3DV => Some("MESA_V3DV"), Self::MESA_PANVK => Some("MESA_PANVK"), Self::SAMSUNG_PROPRIETARY => Some("SAMSUNG_PROPRIETARY"), + Self::MESA_VENUS => Some("MESA_VENUS"), _ => None, }; if let Some(x) = name { @@ -1356,25 +1360,25 @@ impl fmt::Debug for DynamicState { Self::EXCLUSIVE_SCISSOR_NV => Some("EXCLUSIVE_SCISSOR_NV"), Self::FRAGMENT_SHADING_RATE_KHR => Some("FRAGMENT_SHADING_RATE_KHR"), Self::LINE_STIPPLE_EXT => Some("LINE_STIPPLE_EXT"), - Self::CULL_MODE_EXT => Some("CULL_MODE_EXT"), - Self::FRONT_FACE_EXT => Some("FRONT_FACE_EXT"), - Self::PRIMITIVE_TOPOLOGY_EXT => Some("PRIMITIVE_TOPOLOGY_EXT"), - Self::VIEWPORT_WITH_COUNT_EXT => Some("VIEWPORT_WITH_COUNT_EXT"), - Self::SCISSOR_WITH_COUNT_EXT => Some("SCISSOR_WITH_COUNT_EXT"), - Self::VERTEX_INPUT_BINDING_STRIDE_EXT => Some("VERTEX_INPUT_BINDING_STRIDE_EXT"), - Self::DEPTH_TEST_ENABLE_EXT => Some("DEPTH_TEST_ENABLE_EXT"), - Self::DEPTH_WRITE_ENABLE_EXT => Some("DEPTH_WRITE_ENABLE_EXT"), - Self::DEPTH_COMPARE_OP_EXT => Some("DEPTH_COMPARE_OP_EXT"), - Self::DEPTH_BOUNDS_TEST_ENABLE_EXT => Some("DEPTH_BOUNDS_TEST_ENABLE_EXT"), - Self::STENCIL_TEST_ENABLE_EXT => Some("STENCIL_TEST_ENABLE_EXT"), - Self::STENCIL_OP_EXT => Some("STENCIL_OP_EXT"), Self::VERTEX_INPUT_EXT => Some("VERTEX_INPUT_EXT"), Self::PATCH_CONTROL_POINTS_EXT => Some("PATCH_CONTROL_POINTS_EXT"), - Self::RASTERIZER_DISCARD_ENABLE_EXT => Some("RASTERIZER_DISCARD_ENABLE_EXT"), - Self::DEPTH_BIAS_ENABLE_EXT => Some("DEPTH_BIAS_ENABLE_EXT"), Self::LOGIC_OP_EXT => Some("LOGIC_OP_EXT"), - Self::PRIMITIVE_RESTART_ENABLE_EXT => Some("PRIMITIVE_RESTART_ENABLE_EXT"), Self::COLOR_WRITE_ENABLE_EXT => Some("COLOR_WRITE_ENABLE_EXT"), + Self::CULL_MODE => Some("CULL_MODE"), + Self::FRONT_FACE => Some("FRONT_FACE"), + Self::PRIMITIVE_TOPOLOGY => Some("PRIMITIVE_TOPOLOGY"), + Self::VIEWPORT_WITH_COUNT => Some("VIEWPORT_WITH_COUNT"), + Self::SCISSOR_WITH_COUNT => Some("SCISSOR_WITH_COUNT"), + Self::VERTEX_INPUT_BINDING_STRIDE => Some("VERTEX_INPUT_BINDING_STRIDE"), + Self::DEPTH_TEST_ENABLE => Some("DEPTH_TEST_ENABLE"), + Self::DEPTH_WRITE_ENABLE => Some("DEPTH_WRITE_ENABLE"), + Self::DEPTH_COMPARE_OP => Some("DEPTH_COMPARE_OP"), + Self::DEPTH_BOUNDS_TEST_ENABLE => Some("DEPTH_BOUNDS_TEST_ENABLE"), + Self::STENCIL_TEST_ENABLE => Some("STENCIL_TEST_ENABLE"), + Self::STENCIL_OP => Some("STENCIL_OP"), + Self::RASTERIZER_DISCARD_ENABLE => Some("RASTERIZER_DISCARD_ENABLE"), + Self::DEPTH_BIAS_ENABLE => Some("DEPTH_BIAS_ENABLE"), + Self::PRIMITIVE_RESTART_ENABLE => Some("PRIMITIVE_RESTART_ENABLE"), _ => None, }; if let Some(x) = name { @@ -1386,7 +1390,7 @@ impl fmt::Debug for DynamicState { } impl fmt::Debug for EventCreateFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[(EventCreateFlags::DEVICE_ONLY_KHR.0, "DEVICE_ONLY_KHR")]; + const KNOWN: &[(Flags, &str)] = &[(EventCreateFlags::DEVICE_ONLY.0, "DEVICE_ONLY")]; debug_flags(f, KNOWN, self.0) } } @@ -1789,20 +1793,6 @@ impl fmt::Debug for Format { Self::PVRTC1_4BPP_SRGB_BLOCK_IMG => Some("PVRTC1_4BPP_SRGB_BLOCK_IMG"), Self::PVRTC2_2BPP_SRGB_BLOCK_IMG => Some("PVRTC2_2BPP_SRGB_BLOCK_IMG"), Self::PVRTC2_4BPP_SRGB_BLOCK_IMG => Some("PVRTC2_4BPP_SRGB_BLOCK_IMG"), - Self::ASTC_4X4_SFLOAT_BLOCK_EXT => Some("ASTC_4X4_SFLOAT_BLOCK_EXT"), - Self::ASTC_5X4_SFLOAT_BLOCK_EXT => Some("ASTC_5X4_SFLOAT_BLOCK_EXT"), - Self::ASTC_5X5_SFLOAT_BLOCK_EXT => Some("ASTC_5X5_SFLOAT_BLOCK_EXT"), - Self::ASTC_6X5_SFLOAT_BLOCK_EXT => Some("ASTC_6X5_SFLOAT_BLOCK_EXT"), - Self::ASTC_6X6_SFLOAT_BLOCK_EXT => Some("ASTC_6X6_SFLOAT_BLOCK_EXT"), - Self::ASTC_8X5_SFLOAT_BLOCK_EXT => Some("ASTC_8X5_SFLOAT_BLOCK_EXT"), - Self::ASTC_8X6_SFLOAT_BLOCK_EXT => Some("ASTC_8X6_SFLOAT_BLOCK_EXT"), - Self::ASTC_8X8_SFLOAT_BLOCK_EXT => Some("ASTC_8X8_SFLOAT_BLOCK_EXT"), - Self::ASTC_10X5_SFLOAT_BLOCK_EXT => Some("ASTC_10X5_SFLOAT_BLOCK_EXT"), - Self::ASTC_10X6_SFLOAT_BLOCK_EXT => Some("ASTC_10X6_SFLOAT_BLOCK_EXT"), - Self::ASTC_10X8_SFLOAT_BLOCK_EXT => Some("ASTC_10X8_SFLOAT_BLOCK_EXT"), - Self::ASTC_10X10_SFLOAT_BLOCK_EXT => Some("ASTC_10X10_SFLOAT_BLOCK_EXT"), - Self::ASTC_12X10_SFLOAT_BLOCK_EXT => Some("ASTC_12X10_SFLOAT_BLOCK_EXT"), - Self::ASTC_12X12_SFLOAT_BLOCK_EXT => Some("ASTC_12X12_SFLOAT_BLOCK_EXT"), Self::ASTC_3X3X3_UNORM_BLOCK_EXT => Some("ASTC_3X3X3_UNORM_BLOCK_EXT"), Self::ASTC_3X3X3_SRGB_BLOCK_EXT => Some("ASTC_3X3X3_SRGB_BLOCK_EXT"), Self::ASTC_3X3X3_SFLOAT_BLOCK_EXT => Some("ASTC_3X3X3_SFLOAT_BLOCK_EXT"), @@ -1833,16 +1823,6 @@ impl fmt::Debug for Format { Self::ASTC_6X6X6_UNORM_BLOCK_EXT => Some("ASTC_6X6X6_UNORM_BLOCK_EXT"), Self::ASTC_6X6X6_SRGB_BLOCK_EXT => Some("ASTC_6X6X6_SRGB_BLOCK_EXT"), Self::ASTC_6X6X6_SFLOAT_BLOCK_EXT => Some("ASTC_6X6X6_SFLOAT_BLOCK_EXT"), - Self::G8_B8R8_2PLANE_444_UNORM_EXT => Some("G8_B8R8_2PLANE_444_UNORM_EXT"), - Self::G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT => { - Some("G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT") - } - Self::G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT => { - Some("G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT") - } - Self::G16_B16R16_2PLANE_444_UNORM_EXT => Some("G16_B16R16_2PLANE_444_UNORM_EXT"), - Self::A4R4G4B4_UNORM_PACK16_EXT => Some("A4R4G4B4_UNORM_PACK16_EXT"), - Self::A4B4G4R4_UNORM_PACK16_EXT => Some("A4B4G4R4_UNORM_PACK16_EXT"), Self::G8B8G8R8_422_UNORM => Some("G8B8G8R8_422_UNORM"), Self::B8G8R8G8_422_UNORM => Some("B8G8R8G8_422_UNORM"), Self::G8_B8_R8_3PLANE_420_UNORM => Some("G8_B8_R8_3PLANE_420_UNORM"), @@ -1905,6 +1885,30 @@ impl fmt::Debug for Format { Self::G16_B16_R16_3PLANE_422_UNORM => Some("G16_B16_R16_3PLANE_422_UNORM"), Self::G16_B16R16_2PLANE_422_UNORM => Some("G16_B16R16_2PLANE_422_UNORM"), Self::G16_B16_R16_3PLANE_444_UNORM => Some("G16_B16_R16_3PLANE_444_UNORM"), + Self::G8_B8R8_2PLANE_444_UNORM => Some("G8_B8R8_2PLANE_444_UNORM"), + Self::G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16 => { + Some("G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16") + } + Self::G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16 => { + Some("G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16") + } + Self::G16_B16R16_2PLANE_444_UNORM => Some("G16_B16R16_2PLANE_444_UNORM"), + Self::A4R4G4B4_UNORM_PACK16 => Some("A4R4G4B4_UNORM_PACK16"), + Self::A4B4G4R4_UNORM_PACK16 => Some("A4B4G4R4_UNORM_PACK16"), + Self::ASTC_4X4_SFLOAT_BLOCK => Some("ASTC_4X4_SFLOAT_BLOCK"), + Self::ASTC_5X4_SFLOAT_BLOCK => Some("ASTC_5X4_SFLOAT_BLOCK"), + Self::ASTC_5X5_SFLOAT_BLOCK => Some("ASTC_5X5_SFLOAT_BLOCK"), + Self::ASTC_6X5_SFLOAT_BLOCK => Some("ASTC_6X5_SFLOAT_BLOCK"), + Self::ASTC_6X6_SFLOAT_BLOCK => Some("ASTC_6X6_SFLOAT_BLOCK"), + Self::ASTC_8X5_SFLOAT_BLOCK => Some("ASTC_8X5_SFLOAT_BLOCK"), + Self::ASTC_8X6_SFLOAT_BLOCK => Some("ASTC_8X6_SFLOAT_BLOCK"), + Self::ASTC_8X8_SFLOAT_BLOCK => Some("ASTC_8X8_SFLOAT_BLOCK"), + Self::ASTC_10X5_SFLOAT_BLOCK => Some("ASTC_10X5_SFLOAT_BLOCK"), + Self::ASTC_10X6_SFLOAT_BLOCK => Some("ASTC_10X6_SFLOAT_BLOCK"), + Self::ASTC_10X8_SFLOAT_BLOCK => Some("ASTC_10X8_SFLOAT_BLOCK"), + Self::ASTC_10X10_SFLOAT_BLOCK => Some("ASTC_10X10_SFLOAT_BLOCK"), + Self::ASTC_12X10_SFLOAT_BLOCK => Some("ASTC_12X10_SFLOAT_BLOCK"), + Self::ASTC_12X12_SFLOAT_BLOCK => Some("ASTC_12X12_SFLOAT_BLOCK"), _ => None, }; if let Some(x) = name { @@ -1920,9 +1924,9 @@ impl fmt::Debug for FormatFeatureFlags { debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for FormatFeatureFlags2KHR { +impl fmt::Debug for FormatFeatureFlags2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN : & [(Flags64 , & str)] = & [(FormatFeatureFlags2KHR :: SAMPLED_IMAGE . 0 , "SAMPLED_IMAGE") , (FormatFeatureFlags2KHR :: STORAGE_IMAGE . 0 , "STORAGE_IMAGE") , (FormatFeatureFlags2KHR :: STORAGE_IMAGE_ATOMIC . 0 , "STORAGE_IMAGE_ATOMIC") , (FormatFeatureFlags2KHR :: UNIFORM_TEXEL_BUFFER . 0 , "UNIFORM_TEXEL_BUFFER") , (FormatFeatureFlags2KHR :: STORAGE_TEXEL_BUFFER . 0 , "STORAGE_TEXEL_BUFFER") , (FormatFeatureFlags2KHR :: STORAGE_TEXEL_BUFFER_ATOMIC . 0 , "STORAGE_TEXEL_BUFFER_ATOMIC") , (FormatFeatureFlags2KHR :: VERTEX_BUFFER . 0 , "VERTEX_BUFFER") , (FormatFeatureFlags2KHR :: COLOR_ATTACHMENT . 0 , "COLOR_ATTACHMENT") , (FormatFeatureFlags2KHR :: COLOR_ATTACHMENT_BLEND . 0 , "COLOR_ATTACHMENT_BLEND") , (FormatFeatureFlags2KHR :: DEPTH_STENCIL_ATTACHMENT . 0 , "DEPTH_STENCIL_ATTACHMENT") , (FormatFeatureFlags2KHR :: BLIT_SRC . 0 , "BLIT_SRC") , (FormatFeatureFlags2KHR :: BLIT_DST . 0 , "BLIT_DST") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_FILTER_LINEAR . 0 , "SAMPLED_IMAGE_FILTER_LINEAR") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_FILTER_CUBIC_EXT . 0 , "SAMPLED_IMAGE_FILTER_CUBIC_EXT") , (FormatFeatureFlags2KHR :: TRANSFER_SRC . 0 , "TRANSFER_SRC") , (FormatFeatureFlags2KHR :: TRANSFER_DST . 0 , "TRANSFER_DST") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_FILTER_MINMAX . 0 , "SAMPLED_IMAGE_FILTER_MINMAX") , (FormatFeatureFlags2KHR :: MIDPOINT_CHROMA_SAMPLES . 0 , "MIDPOINT_CHROMA_SAMPLES") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE") , (FormatFeatureFlags2KHR :: DISJOINT . 0 , "DISJOINT") , (FormatFeatureFlags2KHR :: COSITED_CHROMA_SAMPLES . 0 , "COSITED_CHROMA_SAMPLES") , (FormatFeatureFlags2KHR :: STORAGE_READ_WITHOUT_FORMAT . 0 , "STORAGE_READ_WITHOUT_FORMAT") , (FormatFeatureFlags2KHR :: STORAGE_WRITE_WITHOUT_FORMAT . 0 , "STORAGE_WRITE_WITHOUT_FORMAT") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_DEPTH_COMPARISON . 0 , "SAMPLED_IMAGE_DEPTH_COMPARISON") , (FormatFeatureFlags2KHR :: VIDEO_DECODE_OUTPUT . 0 , "VIDEO_DECODE_OUTPUT") , (FormatFeatureFlags2KHR :: VIDEO_DECODE_DPB . 0 , "VIDEO_DECODE_DPB") , (FormatFeatureFlags2KHR :: ACCELERATION_STRUCTURE_VERTEX_BUFFER . 0 , "ACCELERATION_STRUCTURE_VERTEX_BUFFER") , (FormatFeatureFlags2KHR :: FRAGMENT_DENSITY_MAP_EXT . 0 , "FRAGMENT_DENSITY_MAP_EXT") , (FormatFeatureFlags2KHR :: FRAGMENT_SHADING_RATE_ATTACHMENT . 0 , "FRAGMENT_SHADING_RATE_ATTACHMENT") , (FormatFeatureFlags2KHR :: VIDEO_ENCODE_INPUT . 0 , "VIDEO_ENCODE_INPUT") , (FormatFeatureFlags2KHR :: VIDEO_ENCODE_DPB . 0 , "VIDEO_ENCODE_DPB") , (FormatFeatureFlags2KHR :: LINEAR_COLOR_ATTACHMENT_NV . 0 , "LINEAR_COLOR_ATTACHMENT_NV") , (FormatFeatureFlags2KHR :: RESERVED_34_QCOM . 0 , "RESERVED_34_QCOM") , (FormatFeatureFlags2KHR :: RESERVED_35_QCOM . 0 , "RESERVED_35_QCOM") , (FormatFeatureFlags2KHR :: RESERVED_36_QCOM . 0 , "RESERVED_36_QCOM") , (FormatFeatureFlags2KHR :: RESERVED_37_QCOM . 0 , "RESERVED_37_QCOM")] ; + const KNOWN : & [(Flags64 , & str)] = & [(FormatFeatureFlags2 :: SAMPLED_IMAGE . 0 , "SAMPLED_IMAGE") , (FormatFeatureFlags2 :: STORAGE_IMAGE . 0 , "STORAGE_IMAGE") , (FormatFeatureFlags2 :: STORAGE_IMAGE_ATOMIC . 0 , "STORAGE_IMAGE_ATOMIC") , (FormatFeatureFlags2 :: UNIFORM_TEXEL_BUFFER . 0 , "UNIFORM_TEXEL_BUFFER") , (FormatFeatureFlags2 :: STORAGE_TEXEL_BUFFER . 0 , "STORAGE_TEXEL_BUFFER") , (FormatFeatureFlags2 :: STORAGE_TEXEL_BUFFER_ATOMIC . 0 , "STORAGE_TEXEL_BUFFER_ATOMIC") , (FormatFeatureFlags2 :: VERTEX_BUFFER . 0 , "VERTEX_BUFFER") , (FormatFeatureFlags2 :: COLOR_ATTACHMENT . 0 , "COLOR_ATTACHMENT") , (FormatFeatureFlags2 :: COLOR_ATTACHMENT_BLEND . 0 , "COLOR_ATTACHMENT_BLEND") , (FormatFeatureFlags2 :: DEPTH_STENCIL_ATTACHMENT . 0 , "DEPTH_STENCIL_ATTACHMENT") , (FormatFeatureFlags2 :: BLIT_SRC . 0 , "BLIT_SRC") , (FormatFeatureFlags2 :: BLIT_DST . 0 , "BLIT_DST") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_FILTER_LINEAR . 0 , "SAMPLED_IMAGE_FILTER_LINEAR") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_FILTER_CUBIC . 0 , "SAMPLED_IMAGE_FILTER_CUBIC") , (FormatFeatureFlags2 :: TRANSFER_SRC . 0 , "TRANSFER_SRC") , (FormatFeatureFlags2 :: TRANSFER_DST . 0 , "TRANSFER_DST") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_FILTER_MINMAX . 0 , "SAMPLED_IMAGE_FILTER_MINMAX") , (FormatFeatureFlags2 :: MIDPOINT_CHROMA_SAMPLES . 0 , "MIDPOINT_CHROMA_SAMPLES") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE") , (FormatFeatureFlags2 :: DISJOINT . 0 , "DISJOINT") , (FormatFeatureFlags2 :: COSITED_CHROMA_SAMPLES . 0 , "COSITED_CHROMA_SAMPLES") , (FormatFeatureFlags2 :: STORAGE_READ_WITHOUT_FORMAT . 0 , "STORAGE_READ_WITHOUT_FORMAT") , (FormatFeatureFlags2 :: STORAGE_WRITE_WITHOUT_FORMAT . 0 , "STORAGE_WRITE_WITHOUT_FORMAT") , (FormatFeatureFlags2 :: SAMPLED_IMAGE_DEPTH_COMPARISON . 0 , "SAMPLED_IMAGE_DEPTH_COMPARISON") , (FormatFeatureFlags2 :: VIDEO_DECODE_OUTPUT_KHR . 0 , "VIDEO_DECODE_OUTPUT_KHR") , (FormatFeatureFlags2 :: VIDEO_DECODE_DPB_KHR . 0 , "VIDEO_DECODE_DPB_KHR") , (FormatFeatureFlags2 :: ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR . 0 , "ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR") , (FormatFeatureFlags2 :: FRAGMENT_DENSITY_MAP_EXT . 0 , "FRAGMENT_DENSITY_MAP_EXT") , (FormatFeatureFlags2 :: FRAGMENT_SHADING_RATE_ATTACHMENT_KHR . 0 , "FRAGMENT_SHADING_RATE_ATTACHMENT_KHR") , (FormatFeatureFlags2 :: VIDEO_ENCODE_INPUT_KHR . 0 , "VIDEO_ENCODE_INPUT_KHR") , (FormatFeatureFlags2 :: VIDEO_ENCODE_DPB_KHR . 0 , "VIDEO_ENCODE_DPB_KHR") , (FormatFeatureFlags2 :: LINEAR_COLOR_ATTACHMENT_NV . 0 , "LINEAR_COLOR_ATTACHMENT_NV") , (FormatFeatureFlags2 :: RESERVED_34_QCOM . 0 , "RESERVED_34_QCOM") , (FormatFeatureFlags2 :: RESERVED_35_QCOM . 0 , "RESERVED_35_QCOM") , (FormatFeatureFlags2 :: RESERVED_36_QCOM . 0 , "RESERVED_36_QCOM") , (FormatFeatureFlags2 :: RESERVED_37_QCOM . 0 , "RESERVED_37_QCOM") , (FormatFeatureFlags2 :: RESERVED_39_EXT . 0 , "RESERVED_39_EXT")] ; debug_flags(f, KNOWN, self.0) } } @@ -2087,10 +2091,10 @@ impl fmt::Debug for ImageAspectFlags { (ImageAspectFlags::MEMORY_PLANE_1_EXT.0, "MEMORY_PLANE_1_EXT"), (ImageAspectFlags::MEMORY_PLANE_2_EXT.0, "MEMORY_PLANE_2_EXT"), (ImageAspectFlags::MEMORY_PLANE_3_EXT.0, "MEMORY_PLANE_3_EXT"), - (ImageAspectFlags::NONE_KHR.0, "NONE_KHR"), (ImageAspectFlags::PLANE_0.0, "PLANE_0"), (ImageAspectFlags::PLANE_1.0, "PLANE_1"), (ImageAspectFlags::PLANE_2.0, "PLANE_2"), + (ImageAspectFlags::NONE.0, "NONE"), ]; debug_flags(f, KNOWN, self.0) } @@ -2137,6 +2141,7 @@ impl fmt::Debug for ImageCreateFlags { ), (ImageCreateFlags::SUBSAMPLED_EXT.0, "SUBSAMPLED_EXT"), (ImageCreateFlags::RESERVED_16_AMD.0, "RESERVED_16_AMD"), + (ImageCreateFlags::RESERVED_18_EXT.0, "RESERVED_18_EXT"), (ImageCreateFlags::RESERVED_394_EXT.0, "RESERVED_394_EXT"), ( ImageCreateFlags::FRAGMENT_DENSITY_MAP_OFFSET_QCOM.0, @@ -2192,8 +2197,6 @@ impl fmt::Debug for ImageLayout { Self::VIDEO_ENCODE_DST_KHR => Some("VIDEO_ENCODE_DST_KHR"), Self::VIDEO_ENCODE_SRC_KHR => Some("VIDEO_ENCODE_SRC_KHR"), Self::VIDEO_ENCODE_DPB_KHR => Some("VIDEO_ENCODE_DPB_KHR"), - Self::READ_ONLY_OPTIMAL_KHR => Some("READ_ONLY_OPTIMAL_KHR"), - Self::ATTACHMENT_OPTIMAL_KHR => Some("ATTACHMENT_OPTIMAL_KHR"), Self::DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL => { Some("DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL") } @@ -2204,6 +2207,8 @@ impl fmt::Debug for ImageLayout { Self::DEPTH_READ_ONLY_OPTIMAL => Some("DEPTH_READ_ONLY_OPTIMAL"), Self::STENCIL_ATTACHMENT_OPTIMAL => Some("STENCIL_ATTACHMENT_OPTIMAL"), Self::STENCIL_READ_ONLY_OPTIMAL => Some("STENCIL_READ_ONLY_OPTIMAL"), + Self::READ_ONLY_OPTIMAL => Some("READ_ONLY_OPTIMAL"), + Self::ATTACHMENT_OPTIMAL => Some("ATTACHMENT_OPTIMAL"), _ => None, }; if let Some(x) = name { @@ -2288,6 +2293,7 @@ impl fmt::Debug for ImageUsageFlags { ImageUsageFlags::FRAGMENT_SHADING_RATE_ATTACHMENT_KHR.0, "FRAGMENT_SHADING_RATE_ATTACHMENT_KHR", ), + (ImageUsageFlags::RESERVED_22_EXT.0, "RESERVED_22_EXT"), ( ImageUsageFlags::VIDEO_ENCODE_DST_KHR.0, "VIDEO_ENCODE_DST_KHR", @@ -2318,6 +2324,7 @@ impl fmt::Debug for ImageViewCreateFlags { ImageViewCreateFlags::FRAGMENT_DENSITY_MAP_DYNAMIC_EXT.0, "FRAGMENT_DENSITY_MAP_DYNAMIC_EXT", ), + (ImageViewCreateFlags::RESERVED_2_AMD.0, "RESERVED_2_AMD"), ( ImageViewCreateFlags::FRAGMENT_DENSITY_MAP_DEFERRED_EXT.0, "FRAGMENT_DENSITY_MAP_DEFERRED_EXT", @@ -2409,7 +2416,10 @@ impl fmt::Debug for IndirectStateFlagsNV { } impl fmt::Debug for InstanceCreateFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[]; + const KNOWN: &[(Flags, &str)] = &[( + InstanceCreateFlags::ENUMERATE_PORTABILITY_KHR.0, + "ENUMERATE_PORTABILITY_KHR", + )]; debug_flags(f, KNOWN, self.0) } } @@ -2727,11 +2737,11 @@ impl fmt::Debug for PipelineCacheCreateFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ (PipelineCacheCreateFlags::RESERVED_1_EXT.0, "RESERVED_1_EXT"), + (PipelineCacheCreateFlags::RESERVED_2_KHR.0, "RESERVED_2_KHR"), ( - PipelineCacheCreateFlags::EXTERNALLY_SYNCHRONIZED_EXT.0, - "EXTERNALLY_SYNCHRONIZED_EXT", + PipelineCacheCreateFlags::EXTERNALLY_SYNCHRONIZED.0, + "EXTERNALLY_SYNCHRONIZED", ), - (PipelineCacheCreateFlags::RESERVED_2_KHR.0, "RESERVED_2_KHR"), ]; debug_flags(f, KNOWN, self.0) } @@ -2844,14 +2854,6 @@ impl fmt::Debug for PipelineCreateFlags { "INDIRECT_BINDABLE_NV", ), (PipelineCreateFlags::LIBRARY_KHR.0, "LIBRARY_KHR"), - ( - PipelineCreateFlags::FAIL_ON_PIPELINE_COMPILE_REQUIRED_EXT.0, - "FAIL_ON_PIPELINE_COMPILE_REQUIRED_EXT", - ), - ( - PipelineCreateFlags::EARLY_RETURN_ON_FAILURE_EXT.0, - "EARLY_RETURN_ON_FAILURE_EXT", - ), (PipelineCreateFlags::RESERVED_23_AMD.0, "RESERVED_23_AMD"), (PipelineCreateFlags::RESERVED_10_AMD.0, "RESERVED_10_AMD"), ( @@ -2863,20 +2865,28 @@ impl fmt::Debug for PipelineCreateFlags { "VIEW_INDEX_FROM_DEVICE_INDEX", ), (PipelineCreateFlags::DISPATCH_BASE.0, "DISPATCH_BASE"), + ( + PipelineCreateFlags::FAIL_ON_PIPELINE_COMPILE_REQUIRED.0, + "FAIL_ON_PIPELINE_COMPILE_REQUIRED", + ), + ( + PipelineCreateFlags::EARLY_RETURN_ON_FAILURE.0, + "EARLY_RETURN_ON_FAILURE", + ), ]; debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for PipelineCreationFeedbackFlagsEXT { +impl fmt::Debug for PipelineCreationFeedbackFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ - (PipelineCreationFeedbackFlagsEXT::VALID.0, "VALID"), + (PipelineCreationFeedbackFlags::VALID.0, "VALID"), ( - PipelineCreationFeedbackFlagsEXT::APPLICATION_PIPELINE_CACHE_HIT.0, + PipelineCreationFeedbackFlags::APPLICATION_PIPELINE_CACHE_HIT.0, "APPLICATION_PIPELINE_CACHE_HIT", ), ( - PipelineCreationFeedbackFlagsEXT::BASE_PIPELINE_ACCELERATION.0, + PipelineCreationFeedbackFlags::BASE_PIPELINE_ACCELERATION.0, "BASE_PIPELINE_ACCELERATION", ), ]; @@ -2976,16 +2986,16 @@ impl fmt::Debug for PipelineShaderStageCreateFlags { "RESERVED_2_NV", ), ( - PipelineShaderStageCreateFlags::ALLOW_VARYING_SUBGROUP_SIZE_EXT.0, - "ALLOW_VARYING_SUBGROUP_SIZE_EXT", + PipelineShaderStageCreateFlags::RESERVED_3_KHR.0, + "RESERVED_3_KHR", ), ( - PipelineShaderStageCreateFlags::REQUIRE_FULL_SUBGROUPS_EXT.0, - "REQUIRE_FULL_SUBGROUPS_EXT", + PipelineShaderStageCreateFlags::ALLOW_VARYING_SUBGROUP_SIZE.0, + "ALLOW_VARYING_SUBGROUP_SIZE", ), ( - PipelineShaderStageCreateFlags::RESERVED_3_KHR.0, - "RESERVED_3_KHR", + PipelineShaderStageCreateFlags::REQUIRE_FULL_SUBGROUPS.0, + "REQUIRE_FULL_SUBGROUPS", ), ]; debug_flags(f, KNOWN, self.0) @@ -3056,101 +3066,101 @@ impl fmt::Debug for PipelineStageFlags { PipelineStageFlags::COMMAND_PREPROCESS_NV.0, "COMMAND_PREPROCESS_NV", ), - (PipelineStageFlags::NONE_KHR.0, "NONE_KHR"), + (PipelineStageFlags::NONE.0, "NONE"), ]; debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for PipelineStageFlags2KHR { +impl fmt::Debug for PipelineStageFlags2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags64, &str)] = &[ - (PipelineStageFlags2KHR::NONE.0, "NONE"), - (PipelineStageFlags2KHR::TOP_OF_PIPE.0, "TOP_OF_PIPE"), - (PipelineStageFlags2KHR::DRAW_INDIRECT.0, "DRAW_INDIRECT"), - (PipelineStageFlags2KHR::VERTEX_INPUT.0, "VERTEX_INPUT"), - (PipelineStageFlags2KHR::VERTEX_SHADER.0, "VERTEX_SHADER"), + (PipelineStageFlags2::NONE.0, "NONE"), + (PipelineStageFlags2::TOP_OF_PIPE.0, "TOP_OF_PIPE"), + (PipelineStageFlags2::DRAW_INDIRECT.0, "DRAW_INDIRECT"), + (PipelineStageFlags2::VERTEX_INPUT.0, "VERTEX_INPUT"), + (PipelineStageFlags2::VERTEX_SHADER.0, "VERTEX_SHADER"), ( - PipelineStageFlags2KHR::TESSELLATION_CONTROL_SHADER.0, + PipelineStageFlags2::TESSELLATION_CONTROL_SHADER.0, "TESSELLATION_CONTROL_SHADER", ), ( - PipelineStageFlags2KHR::TESSELLATION_EVALUATION_SHADER.0, + PipelineStageFlags2::TESSELLATION_EVALUATION_SHADER.0, "TESSELLATION_EVALUATION_SHADER", ), - (PipelineStageFlags2KHR::GEOMETRY_SHADER.0, "GEOMETRY_SHADER"), - (PipelineStageFlags2KHR::FRAGMENT_SHADER.0, "FRAGMENT_SHADER"), + (PipelineStageFlags2::GEOMETRY_SHADER.0, "GEOMETRY_SHADER"), + (PipelineStageFlags2::FRAGMENT_SHADER.0, "FRAGMENT_SHADER"), ( - PipelineStageFlags2KHR::EARLY_FRAGMENT_TESTS.0, + PipelineStageFlags2::EARLY_FRAGMENT_TESTS.0, "EARLY_FRAGMENT_TESTS", ), ( - PipelineStageFlags2KHR::LATE_FRAGMENT_TESTS.0, + PipelineStageFlags2::LATE_FRAGMENT_TESTS.0, "LATE_FRAGMENT_TESTS", ), ( - PipelineStageFlags2KHR::COLOR_ATTACHMENT_OUTPUT.0, + PipelineStageFlags2::COLOR_ATTACHMENT_OUTPUT.0, "COLOR_ATTACHMENT_OUTPUT", ), - (PipelineStageFlags2KHR::COMPUTE_SHADER.0, "COMPUTE_SHADER"), - (PipelineStageFlags2KHR::ALL_TRANSFER.0, "ALL_TRANSFER"), - (PipelineStageFlags2KHR::BOTTOM_OF_PIPE.0, "BOTTOM_OF_PIPE"), - (PipelineStageFlags2KHR::HOST.0, "HOST"), - (PipelineStageFlags2KHR::ALL_GRAPHICS.0, "ALL_GRAPHICS"), - (PipelineStageFlags2KHR::ALL_COMMANDS.0, "ALL_COMMANDS"), - (PipelineStageFlags2KHR::COPY.0, "COPY"), - (PipelineStageFlags2KHR::RESOLVE.0, "RESOLVE"), - (PipelineStageFlags2KHR::BLIT.0, "BLIT"), - (PipelineStageFlags2KHR::CLEAR.0, "CLEAR"), - (PipelineStageFlags2KHR::INDEX_INPUT.0, "INDEX_INPUT"), - ( - PipelineStageFlags2KHR::VERTEX_ATTRIBUTE_INPUT.0, + (PipelineStageFlags2::COMPUTE_SHADER.0, "COMPUTE_SHADER"), + (PipelineStageFlags2::ALL_TRANSFER.0, "ALL_TRANSFER"), + (PipelineStageFlags2::BOTTOM_OF_PIPE.0, "BOTTOM_OF_PIPE"), + (PipelineStageFlags2::HOST.0, "HOST"), + (PipelineStageFlags2::ALL_GRAPHICS.0, "ALL_GRAPHICS"), + (PipelineStageFlags2::ALL_COMMANDS.0, "ALL_COMMANDS"), + (PipelineStageFlags2::COPY.0, "COPY"), + (PipelineStageFlags2::RESOLVE.0, "RESOLVE"), + (PipelineStageFlags2::BLIT.0, "BLIT"), + (PipelineStageFlags2::CLEAR.0, "CLEAR"), + (PipelineStageFlags2::INDEX_INPUT.0, "INDEX_INPUT"), + ( + PipelineStageFlags2::VERTEX_ATTRIBUTE_INPUT.0, "VERTEX_ATTRIBUTE_INPUT", ), ( - PipelineStageFlags2KHR::PRE_RASTERIZATION_SHADERS.0, + PipelineStageFlags2::PRE_RASTERIZATION_SHADERS.0, "PRE_RASTERIZATION_SHADERS", ), - (PipelineStageFlags2KHR::VIDEO_DECODE.0, "VIDEO_DECODE"), - (PipelineStageFlags2KHR::VIDEO_ENCODE.0, "VIDEO_ENCODE"), + (PipelineStageFlags2::VIDEO_DECODE_KHR.0, "VIDEO_DECODE_KHR"), + (PipelineStageFlags2::VIDEO_ENCODE_KHR.0, "VIDEO_ENCODE_KHR"), ( - PipelineStageFlags2KHR::TRANSFORM_FEEDBACK_EXT.0, + PipelineStageFlags2::TRANSFORM_FEEDBACK_EXT.0, "TRANSFORM_FEEDBACK_EXT", ), ( - PipelineStageFlags2KHR::CONDITIONAL_RENDERING_EXT.0, + PipelineStageFlags2::CONDITIONAL_RENDERING_EXT.0, "CONDITIONAL_RENDERING_EXT", ), ( - PipelineStageFlags2KHR::COMMAND_PREPROCESS_NV.0, + PipelineStageFlags2::COMMAND_PREPROCESS_NV.0, "COMMAND_PREPROCESS_NV", ), ( - PipelineStageFlags2KHR::FRAGMENT_SHADING_RATE_ATTACHMENT.0, - "FRAGMENT_SHADING_RATE_ATTACHMENT", + PipelineStageFlags2::FRAGMENT_SHADING_RATE_ATTACHMENT_KHR.0, + "FRAGMENT_SHADING_RATE_ATTACHMENT_KHR", ), ( - PipelineStageFlags2KHR::ACCELERATION_STRUCTURE_BUILD.0, - "ACCELERATION_STRUCTURE_BUILD", + PipelineStageFlags2::ACCELERATION_STRUCTURE_BUILD_KHR.0, + "ACCELERATION_STRUCTURE_BUILD_KHR", ), ( - PipelineStageFlags2KHR::RAY_TRACING_SHADER.0, - "RAY_TRACING_SHADER", + PipelineStageFlags2::RAY_TRACING_SHADER_KHR.0, + "RAY_TRACING_SHADER_KHR", ), ( - PipelineStageFlags2KHR::FRAGMENT_DENSITY_PROCESS_EXT.0, + PipelineStageFlags2::FRAGMENT_DENSITY_PROCESS_EXT.0, "FRAGMENT_DENSITY_PROCESS_EXT", ), - (PipelineStageFlags2KHR::TASK_SHADER_NV.0, "TASK_SHADER_NV"), - (PipelineStageFlags2KHR::MESH_SHADER_NV.0, "MESH_SHADER_NV"), + (PipelineStageFlags2::TASK_SHADER_NV.0, "TASK_SHADER_NV"), + (PipelineStageFlags2::MESH_SHADER_NV.0, "MESH_SHADER_NV"), ( - PipelineStageFlags2KHR::SUBPASS_SHADING_HUAWEI.0, + PipelineStageFlags2::SUBPASS_SHADING_HUAWEI.0, "SUBPASS_SHADING_HUAWEI", ), ( - PipelineStageFlags2KHR::INVOCATION_MASK_HUAWEI.0, + PipelineStageFlags2::INVOCATION_MASK_HUAWEI.0, "INVOCATION_MASK_HUAWEI", ), - (PipelineStageFlags2KHR::RESERVED_387.0, "RESERVED_387"), + (PipelineStageFlags2::RESERVED_387_KHR.0, "RESERVED_387_KHR"), ]; debug_flags(f, KNOWN, self.0) } @@ -3250,7 +3260,7 @@ impl fmt::Debug for PrimitiveTopology { } } } -impl fmt::Debug for PrivateDataSlotCreateFlagsEXT { +impl fmt::Debug for PrivateDataSlotCreateFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[]; debug_flags(f, KNOWN, self.0) @@ -3419,7 +3429,7 @@ impl fmt::Debug for QueueFlags { debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for QueueGlobalPriorityEXT { +impl fmt::Debug for QueueGlobalPriorityKHR { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let name = match *self { Self::LOW => Some("LOW"), @@ -3473,15 +3483,15 @@ impl fmt::Debug for RenderPassCreateFlags { debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for RenderingFlagsKHR { +impl fmt::Debug for RenderingFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ ( - RenderingFlagsKHR::CONTENTS_SECONDARY_COMMAND_BUFFERS.0, + RenderingFlags::CONTENTS_SECONDARY_COMMAND_BUFFERS.0, "CONTENTS_SECONDARY_COMMAND_BUFFERS", ), - (RenderingFlagsKHR::SUSPENDING.0, "SUSPENDING"), - (RenderingFlagsKHR::RESUMING.0, "RESUMING"), + (RenderingFlags::SUSPENDING.0, "SUSPENDING"), + (RenderingFlags::RESUMING.0, "RESUMING"), ]; debug_flags(f, KNOWN, self.0) } @@ -3983,6 +3993,7 @@ impl fmt::Debug for StructureType { Some("QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_2_KHR") } Self::VIDEO_DECODE_INFO_KHR => Some("VIDEO_DECODE_INFO_KHR"), + Self::VIDEO_DECODE_CAPABILITIES_KHR => Some("VIDEO_DECODE_CAPABILITIES_KHR"), Self::DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV => { Some("DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV") } @@ -4007,9 +4018,6 @@ impl fmt::Debug for StructureType { Self::IMAGE_VIEW_HANDLE_INFO_NVX => Some("IMAGE_VIEW_HANDLE_INFO_NVX"), Self::IMAGE_VIEW_ADDRESS_PROPERTIES_NVX => Some("IMAGE_VIEW_ADDRESS_PROPERTIES_NVX"), Self::VIDEO_ENCODE_H264_CAPABILITIES_EXT => Some("VIDEO_ENCODE_H264_CAPABILITIES_EXT"), - Self::VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT => { - Some("VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT") - } Self::VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT => { Some("VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT") } @@ -4033,10 +4041,10 @@ impl fmt::Debug for StructureType { Self::VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT => { Some("VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT") } - Self::VIDEO_ENCODE_H265_CAPABILITIES_EXT => Some("VIDEO_ENCODE_H265_CAPABILITIES_EXT"), - Self::VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT => { - Some("VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT") + Self::VIDEO_ENCODE_H264_REFERENCE_LISTS_EXT => { + Some("VIDEO_ENCODE_H264_REFERENCE_LISTS_EXT") } + Self::VIDEO_ENCODE_H265_CAPABILITIES_EXT => Some("VIDEO_ENCODE_H265_CAPABILITIES_EXT"), Self::VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT => { Some("VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT") } @@ -4049,7 +4057,9 @@ impl fmt::Debug for StructureType { Self::VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT => { Some("VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT") } - Self::VIDEO_ENCODE_H265_NALU_SLICE_EXT => Some("VIDEO_ENCODE_H265_NALU_SLICE_EXT"), + Self::VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_EXT => { + Some("VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_EXT") + } Self::VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT => { Some("VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT") } @@ -4064,9 +4074,6 @@ impl fmt::Debug for StructureType { Some("VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT") } Self::VIDEO_DECODE_H264_CAPABILITIES_EXT => Some("VIDEO_DECODE_H264_CAPABILITIES_EXT"), - Self::VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT => { - Some("VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT") - } Self::VIDEO_DECODE_H264_PICTURE_INFO_EXT => Some("VIDEO_DECODE_H264_PICTURE_INFO_EXT"), Self::VIDEO_DECODE_H264_MVC_EXT => Some("VIDEO_DECODE_H264_MVC_EXT"), Self::VIDEO_DECODE_H264_PROFILE_EXT => Some("VIDEO_DECODE_H264_PROFILE_EXT"), @@ -4082,15 +4089,6 @@ impl fmt::Debug for StructureType { Self::TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD => { Some("TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD") } - Self::RENDERING_INFO_KHR => Some("RENDERING_INFO_KHR"), - Self::RENDERING_ATTACHMENT_INFO_KHR => Some("RENDERING_ATTACHMENT_INFO_KHR"), - Self::PIPELINE_RENDERING_CREATE_INFO_KHR => Some("PIPELINE_RENDERING_CREATE_INFO_KHR"), - Self::PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR => { - Some("PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR") - } - Self::COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR => { - Some("COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR") - } Self::RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR => { Some("RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR") } @@ -4118,9 +4116,6 @@ impl fmt::Debug for StructureType { } Self::VALIDATION_FLAGS_EXT => Some("VALIDATION_FLAGS_EXT"), Self::VI_SURFACE_CREATE_INFO_NN => Some("VI_SURFACE_CREATE_INFO_NN"), - Self::PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT") - } Self::IMAGE_VIEW_ASTC_DECODE_MODE_EXT => Some("IMAGE_VIEW_ASTC_DECODE_MODE_EXT"), Self::PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT => { Some("PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT") @@ -4259,18 +4254,6 @@ impl fmt::Debug for StructureType { Self::ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID => { Some("ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID") } - Self::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT") - } - Self::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT => { - Some("PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT") - } - Self::WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT => { - Some("WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT") - } - Self::DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT => { - Some("DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT") - } Self::SAMPLE_LOCATIONS_INFO_EXT => Some("SAMPLE_LOCATIONS_INFO_EXT"), Self::RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT => { Some("RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT") @@ -4443,9 +4426,6 @@ impl fmt::Debug for StructureType { Self::FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT => { Some("FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT") } - Self::DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT => { - Some("DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT") - } Self::IMPORT_MEMORY_HOST_POINTER_INFO_EXT => { Some("IMPORT_MEMORY_HOST_POINTER_INFO_EXT") } @@ -4464,9 +4444,6 @@ impl fmt::Debug for StructureType { Some("PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD") } Self::VIDEO_DECODE_H265_CAPABILITIES_EXT => Some("VIDEO_DECODE_H265_CAPABILITIES_EXT"), - Self::VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT => { - Some("VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT") - } Self::VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT => { Some("VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT") } @@ -4478,6 +4455,15 @@ impl fmt::Debug for StructureType { Self::VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT => { Some("VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT") } + Self::DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR => { + Some("DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR") + } + Self::PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR => { + Some("PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR") + } + Self::QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR => { + Some("QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR") + } Self::DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD => { Some("DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD") } @@ -4491,9 +4477,6 @@ impl fmt::Debug for StructureType { Some("PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT") } Self::PRESENT_FRAME_TOKEN_GGP => Some("PRESENT_FRAME_TOKEN_GGP"), - Self::PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT => { - Some("PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT") - } Self::PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV => { Some("PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV") } @@ -4548,9 +4531,6 @@ impl fmt::Debug for StructureType { Self::IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA => { Some("IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA") } - Self::PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR => { - Some("PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR") - } Self::METAL_SURFACE_CREATE_INFO_EXT => Some("METAL_SURFACE_CREATE_INFO_EXT"), Self::PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT => { Some("PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT") @@ -4561,15 +4541,6 @@ impl fmt::Debug for StructureType { Self::RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT => { Some("RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT") } - Self::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT => { - Some("PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT") - } - Self::PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT => { - Some("PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT") - } - Self::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT") - } Self::FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR => { Some("FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR") } @@ -4611,9 +4582,6 @@ impl fmt::Debug for StructureType { Self::BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT => { Some("BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT") } - Self::PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT => { - Some("PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT") - } Self::VALIDATION_FEATURES_EXT => Some("VALIDATION_FEATURES_EXT"), Self::PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR => { Some("PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR") @@ -4690,9 +4658,6 @@ impl fmt::Debug for StructureType { Self::PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT => { Some("PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT") } - Self::PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT") - } Self::PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV => { Some("PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV") } @@ -4719,18 +4684,9 @@ impl fmt::Debug for StructureType { Self::COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV => { Some("COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV") } - Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR => { - Some("PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR") - } - Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR => { - Some("PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR") - } Self::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT => { Some("PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT") } - Self::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT => { - Some("PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT") - } Self::COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM => { Some("COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM") } @@ -4766,21 +4722,12 @@ impl fmt::Debug for StructureType { Self::PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR => { Some("PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR") } - Self::PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT") - } - Self::DEVICE_PRIVATE_DATA_CREATE_INFO_EXT => { - Some("DEVICE_PRIVATE_DATA_CREATE_INFO_EXT") - } - Self::PRIVATE_DATA_SLOT_CREATE_INFO_EXT => Some("PRIVATE_DATA_SLOT_CREATE_INFO_EXT"), - Self::PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT") - } Self::VIDEO_ENCODE_INFO_KHR => Some("VIDEO_ENCODE_INFO_KHR"), Self::VIDEO_ENCODE_RATE_CONTROL_INFO_KHR => Some("VIDEO_ENCODE_RATE_CONTROL_INFO_KHR"), Self::VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR => { Some("VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR") } + Self::VIDEO_ENCODE_CAPABILITIES_KHR => Some("VIDEO_ENCODE_CAPABILITIES_KHR"), Self::PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV => { Some("PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV") } @@ -4788,16 +4735,6 @@ impl fmt::Debug for StructureType { Some("DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV") } Self::RESERVED_QCOM => Some("RESERVED_QCOM"), - Self::MEMORY_BARRIER_2_KHR => Some("MEMORY_BARRIER_2_KHR"), - Self::BUFFER_MEMORY_BARRIER_2_KHR => Some("BUFFER_MEMORY_BARRIER_2_KHR"), - Self::IMAGE_MEMORY_BARRIER_2_KHR => Some("IMAGE_MEMORY_BARRIER_2_KHR"), - Self::DEPENDENCY_INFO_KHR => Some("DEPENDENCY_INFO_KHR"), - Self::SUBMIT_INFO_2_KHR => Some("SUBMIT_INFO_2_KHR"), - Self::SEMAPHORE_SUBMIT_INFO_KHR => Some("SEMAPHORE_SUBMIT_INFO_KHR"), - Self::COMMAND_BUFFER_SUBMIT_INFO_KHR => Some("COMMAND_BUFFER_SUBMIT_INFO_KHR"), - Self::PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR => { - Some("PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR") - } Self::QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV => { Some("QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV") } @@ -4805,9 +4742,6 @@ impl fmt::Debug for StructureType { Self::PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR => { Some("PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR") } - Self::PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR => { - Some("PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR") - } Self::PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV => { Some("PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV") } @@ -4836,23 +4770,9 @@ impl fmt::Debug for StructureType { Some("PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT") } Self::COPY_COMMAND_TRANSFORM_INFO_QCOM => Some("COPY_COMMAND_TRANSFORM_INFO_QCOM"), - Self::PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT") - } Self::PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR => { Some("PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR") } - Self::COPY_BUFFER_INFO_2_KHR => Some("COPY_BUFFER_INFO_2_KHR"), - Self::COPY_IMAGE_INFO_2_KHR => Some("COPY_IMAGE_INFO_2_KHR"), - Self::COPY_BUFFER_TO_IMAGE_INFO_2_KHR => Some("COPY_BUFFER_TO_IMAGE_INFO_2_KHR"), - Self::COPY_IMAGE_TO_BUFFER_INFO_2_KHR => Some("COPY_IMAGE_TO_BUFFER_INFO_2_KHR"), - Self::BLIT_IMAGE_INFO_2_KHR => Some("BLIT_IMAGE_INFO_2_KHR"), - Self::RESOLVE_IMAGE_INFO_2_KHR => Some("RESOLVE_IMAGE_INFO_2_KHR"), - Self::BUFFER_COPY_2_KHR => Some("BUFFER_COPY_2_KHR"), - Self::IMAGE_COPY_2_KHR => Some("IMAGE_COPY_2_KHR"), - Self::IMAGE_BLIT_2_KHR => Some("IMAGE_BLIT_2_KHR"), - Self::BUFFER_IMAGE_COPY_2_KHR => Some("BUFFER_IMAGE_COPY_2_KHR"), - Self::IMAGE_RESOLVE_2_KHR => Some("IMAGE_RESOLVE_2_KHR"), Self::PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT => { Some("PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT") } @@ -4888,7 +4808,6 @@ impl fmt::Debug for StructureType { Self::PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT => { Some("PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT") } - Self::FORMAT_PROPERTIES_3_KHR => Some("FORMAT_PROPERTIES_3_KHR"), Self::IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA => { Some("IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA") } @@ -4954,12 +4873,6 @@ impl fmt::Debug for StructureType { Self::PIPELINE_COLOR_WRITE_CREATE_INFO_EXT => { Some("PIPELINE_COLOR_WRITE_CREATE_INFO_EXT") } - Self::PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT => { - Some("PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT") - } - Self::QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT => { - Some("QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT") - } Self::PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT => { Some("PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT") } @@ -4979,17 +4892,14 @@ impl fmt::Debug for StructureType { Self::PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT => { Some("PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT") } - Self::PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR => { - Some("PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR") + Self::PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE => { + Some("PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE") } - Self::PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR => { - Some("PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR") + Self::DESCRIPTOR_SET_BINDING_REFERENCE_VALVE => { + Some("DESCRIPTOR_SET_BINDING_REFERENCE_VALVE") } - Self::DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR => { - Some("DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR") - } - Self::DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR => { - Some("DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR") + Self::DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE => { + Some("DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE") } Self::PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM => { Some("PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM") @@ -5238,6 +5148,108 @@ impl fmt::Debug for StructureType { Self::DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO => { Some("DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO") } + Self::PHYSICAL_DEVICE_VULKAN_1_3_FEATURES => { + Some("PHYSICAL_DEVICE_VULKAN_1_3_FEATURES") + } + Self::PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES => { + Some("PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES") + } + Self::PIPELINE_CREATION_FEEDBACK_CREATE_INFO => { + Some("PIPELINE_CREATION_FEEDBACK_CREATE_INFO") + } + Self::PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES => { + Some("PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES") + } + Self::PHYSICAL_DEVICE_TOOL_PROPERTIES => Some("PHYSICAL_DEVICE_TOOL_PROPERTIES"), + Self::PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES => { + Some("PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES") + } + Self::PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES => { + Some("PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES") + } + Self::DEVICE_PRIVATE_DATA_CREATE_INFO => Some("DEVICE_PRIVATE_DATA_CREATE_INFO"), + Self::PRIVATE_DATA_SLOT_CREATE_INFO => Some("PRIVATE_DATA_SLOT_CREATE_INFO"), + Self::PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES => { + Some("PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES") + } + Self::MEMORY_BARRIER_2 => Some("MEMORY_BARRIER_2"), + Self::BUFFER_MEMORY_BARRIER_2 => Some("BUFFER_MEMORY_BARRIER_2"), + Self::IMAGE_MEMORY_BARRIER_2 => Some("IMAGE_MEMORY_BARRIER_2"), + Self::DEPENDENCY_INFO => Some("DEPENDENCY_INFO"), + Self::SUBMIT_INFO_2 => Some("SUBMIT_INFO_2"), + Self::SEMAPHORE_SUBMIT_INFO => Some("SEMAPHORE_SUBMIT_INFO"), + Self::COMMAND_BUFFER_SUBMIT_INFO => Some("COMMAND_BUFFER_SUBMIT_INFO"), + Self::PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES => { + Some("PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES") + } + Self::PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES => { + Some("PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES") + } + Self::PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES => { + Some("PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES") + } + Self::COPY_BUFFER_INFO_2 => Some("COPY_BUFFER_INFO_2"), + Self::COPY_IMAGE_INFO_2 => Some("COPY_IMAGE_INFO_2"), + Self::COPY_BUFFER_TO_IMAGE_INFO_2 => Some("COPY_BUFFER_TO_IMAGE_INFO_2"), + Self::COPY_IMAGE_TO_BUFFER_INFO_2 => Some("COPY_IMAGE_TO_BUFFER_INFO_2"), + Self::BLIT_IMAGE_INFO_2 => Some("BLIT_IMAGE_INFO_2"), + Self::RESOLVE_IMAGE_INFO_2 => Some("RESOLVE_IMAGE_INFO_2"), + Self::BUFFER_COPY_2 => Some("BUFFER_COPY_2"), + Self::IMAGE_COPY_2 => Some("IMAGE_COPY_2"), + Self::IMAGE_BLIT_2 => Some("IMAGE_BLIT_2"), + Self::BUFFER_IMAGE_COPY_2 => Some("BUFFER_IMAGE_COPY_2"), + Self::IMAGE_RESOLVE_2 => Some("IMAGE_RESOLVE_2"), + Self::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES => { + Some("PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES") + } + Self::PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO => { + Some("PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO") + } + Self::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES => { + Some("PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES") + } + Self::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES => { + Some("PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES") + } + Self::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES => { + Some("PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES") + } + Self::WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK => { + Some("WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK") + } + Self::DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO => { + Some("DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO") + } + Self::PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES => { + Some("PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES") + } + Self::RENDERING_INFO => Some("RENDERING_INFO"), + Self::RENDERING_ATTACHMENT_INFO => Some("RENDERING_ATTACHMENT_INFO"), + Self::PIPELINE_RENDERING_CREATE_INFO => Some("PIPELINE_RENDERING_CREATE_INFO"), + Self::PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES => { + Some("PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES") + } + Self::COMMAND_BUFFER_INHERITANCE_RENDERING_INFO => { + Some("COMMAND_BUFFER_INHERITANCE_RENDERING_INFO") + } + Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES => { + Some("PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES") + } + Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES => { + Some("PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES") + } + Self::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES => { + Some("PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES") + } + Self::FORMAT_PROPERTIES_3 => Some("FORMAT_PROPERTIES_3"), + Self::PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES => { + Some("PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES") + } + Self::PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES => { + Some("PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES") + } + Self::DEVICE_BUFFER_MEMORY_REQUIREMENTS => Some("DEVICE_BUFFER_MEMORY_REQUIREMENTS"), + Self::DEVICE_IMAGE_MEMORY_REQUIREMENTS => Some("DEVICE_IMAGE_MEMORY_REQUIREMENTS"), _ => None, }; if let Some(x) = name { @@ -5263,9 +5275,9 @@ impl fmt::Debug for SubgroupFeatureFlags { debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for SubmitFlagsKHR { +impl fmt::Debug for SubmitFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[(SubmitFlagsKHR::PROTECTED.0, "PROTECTED")]; + const KNOWN: &[(Flags, &str)] = &[(SubmitFlags::PROTECTED.0, "PROTECTED")]; debug_flags(f, KNOWN, self.0) } } @@ -5418,22 +5430,22 @@ impl fmt::Debug for TimeDomainEXT { } } } -impl fmt::Debug for ToolPurposeFlagsEXT { +impl fmt::Debug for ToolPurposeFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ - (ToolPurposeFlagsEXT::VALIDATION.0, "VALIDATION"), - (ToolPurposeFlagsEXT::PROFILING.0, "PROFILING"), - (ToolPurposeFlagsEXT::TRACING.0, "TRACING"), + (ToolPurposeFlags::VALIDATION.0, "VALIDATION"), + (ToolPurposeFlags::PROFILING.0, "PROFILING"), + (ToolPurposeFlags::TRACING.0, "TRACING"), ( - ToolPurposeFlagsEXT::ADDITIONAL_FEATURES.0, + ToolPurposeFlags::ADDITIONAL_FEATURES.0, "ADDITIONAL_FEATURES", ), + (ToolPurposeFlags::MODIFYING_FEATURES.0, "MODIFYING_FEATURES"), ( - ToolPurposeFlagsEXT::MODIFYING_FEATURES.0, - "MODIFYING_FEATURES", + ToolPurposeFlags::DEBUG_REPORTING_EXT.0, + "DEBUG_REPORTING_EXT", ), - (ToolPurposeFlagsEXT::DEBUG_REPORTING.0, "DEBUG_REPORTING"), - (ToolPurposeFlagsEXT::DEBUG_MARKERS.0, "DEBUG_MARKERS"), + (ToolPurposeFlags::DEBUG_MARKERS_EXT.0, "DEBUG_MARKERS_EXT"), ]; debug_flags(f, KNOWN, self.0) } @@ -5633,18 +5645,28 @@ impl fmt::Debug for VideoComponentBitDepthFlagsKHR { debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for VideoDecodeFlagsKHR { +impl fmt::Debug for VideoDecodeCapabilityFlagsKHR { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ - (VideoDecodeFlagsKHR::DEFAULT.0, "DEFAULT"), - (VideoDecodeFlagsKHR::RESERVED_0.0, "RESERVED_0"), + (VideoDecodeCapabilityFlagsKHR::DEFAULT.0, "DEFAULT"), + ( + VideoDecodeCapabilityFlagsKHR::DPB_AND_OUTPUT_COINCIDE.0, + "DPB_AND_OUTPUT_COINCIDE", + ), + ( + VideoDecodeCapabilityFlagsKHR::DPB_AND_OUTPUT_DISTINCT.0, + "DPB_AND_OUTPUT_DISTINCT", + ), ]; debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for VideoDecodeH264CreateFlagsEXT { +impl fmt::Debug for VideoDecodeFlagsKHR { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[]; + const KNOWN: &[(Flags, &str)] = &[ + (VideoDecodeFlagsKHR::DEFAULT.0, "DEFAULT"), + (VideoDecodeFlagsKHR::RESERVED_0.0, "RESERVED_0"), + ]; debug_flags(f, KNOWN, self.0) } } @@ -5667,9 +5689,15 @@ impl fmt::Debug for VideoDecodeH264PictureLayoutFlagsEXT { debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for VideoDecodeH265CreateFlagsEXT { +impl fmt::Debug for VideoEncodeCapabilityFlagsKHR { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[]; + const KNOWN: &[(Flags, &str)] = &[ + (VideoEncodeCapabilityFlagsKHR::DEFAULT.0, "DEFAULT"), + ( + VideoEncodeCapabilityFlagsKHR::PRECEDING_EXTERNALLY_ENCODED_BYTES.0, + "PRECEDING_EXTERNALLY_ENCODED_BYTES", + ), + ]; debug_flags(f, KNOWN, self.0) } } @@ -5685,15 +5713,25 @@ impl fmt::Debug for VideoEncodeFlagsKHR { impl fmt::Debug for VideoEncodeH264CapabilityFlagsEXT { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeH264CapabilityFlagsEXT::CABAC.0, "CABAC"), - (VideoEncodeH264CapabilityFlagsEXT::CAVLC.0, "CAVLC"), ( - VideoEncodeH264CapabilityFlagsEXT::WEIGHTED_BI_PRED_IMPLICIT.0, - "WEIGHTED_BI_PRED_IMPLICIT", + VideoEncodeH264CapabilityFlagsEXT::DIRECT_8X8_INFERENCE.0, + "DIRECT_8X8_INFERENCE", ), ( - VideoEncodeH264CapabilityFlagsEXT::TRANSFORM_8X8.0, - "TRANSFORM_8X8", + VideoEncodeH264CapabilityFlagsEXT::SEPARATE_COLOUR_PLANE.0, + "SEPARATE_COLOUR_PLANE", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::QPPRIME_Y_ZERO_TRANSFORM_BYPASS.0, + "QPPRIME_Y_ZERO_TRANSFORM_BYPASS", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::SCALING_LISTS.0, + "SCALING_LISTS", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::HRD_COMPLIANCE.0, + "HRD_COMPLIANCE", ), ( VideoEncodeH264CapabilityFlagsEXT::CHROMA_QP_OFFSET.0, @@ -5703,6 +5741,32 @@ impl fmt::Debug for VideoEncodeH264CapabilityFlagsEXT { VideoEncodeH264CapabilityFlagsEXT::SECOND_CHROMA_QP_OFFSET.0, "SECOND_CHROMA_QP_OFFSET", ), + ( + VideoEncodeH264CapabilityFlagsEXT::PIC_INIT_QP_MINUS26.0, + "PIC_INIT_QP_MINUS26", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::WEIGHTED_PRED.0, + "WEIGHTED_PRED", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::WEIGHTED_BIPRED_EXPLICIT.0, + "WEIGHTED_BIPRED_EXPLICIT", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::WEIGHTED_BIPRED_IMPLICIT.0, + "WEIGHTED_BIPRED_IMPLICIT", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::WEIGHTED_PRED_NO_TABLE.0, + "WEIGHTED_PRED_NO_TABLE", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::TRANSFORM_8X8.0, + "TRANSFORM_8X8", + ), + (VideoEncodeH264CapabilityFlagsEXT::CABAC.0, "CABAC"), + (VideoEncodeH264CapabilityFlagsEXT::CAVLC.0, "CAVLC"), ( VideoEncodeH264CapabilityFlagsEXT::DEBLOCKING_FILTER_DISABLED.0, "DEBLOCKING_FILTER_DISABLED", @@ -5715,23 +5779,26 @@ impl fmt::Debug for VideoEncodeH264CapabilityFlagsEXT { VideoEncodeH264CapabilityFlagsEXT::DEBLOCKING_FILTER_PARTIAL.0, "DEBLOCKING_FILTER_PARTIAL", ), + ( + VideoEncodeH264CapabilityFlagsEXT::DISABLE_DIRECT_SPATIAL_MV_PRED.0, + "DISABLE_DIRECT_SPATIAL_MV_PRED", + ), ( VideoEncodeH264CapabilityFlagsEXT::MULTIPLE_SLICE_PER_FRAME.0, "MULTIPLE_SLICE_PER_FRAME", ), ( - VideoEncodeH264CapabilityFlagsEXT::EVENLY_DISTRIBUTED_SLICE_SIZE.0, - "EVENLY_DISTRIBUTED_SLICE_SIZE", + VideoEncodeH264CapabilityFlagsEXT::SLICE_MB_COUNT.0, + "SLICE_MB_COUNT", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::ROW_UNALIGNED_SLICE.0, + "ROW_UNALIGNED_SLICE", + ), + ( + VideoEncodeH264CapabilityFlagsEXT::DIFFERENT_SLICE_TYPE.0, + "DIFFERENT_SLICE_TYPE", ), - ]; - debug_flags(f, KNOWN, self.0) - } -} -impl fmt::Debug for VideoEncodeH264CreateFlagsEXT { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeH264CreateFlagsEXT::DEFAULT.0, "DEFAULT"), - (VideoEncodeH264CreateFlagsEXT::RESERVED_0.0, "RESERVED_0"), ]; debug_flags(f, KNOWN, self.0) } @@ -5774,20 +5841,110 @@ impl fmt::Debug for VideoEncodeH264RateControlStructureFlagsEXT { } impl fmt::Debug for VideoEncodeH265CapabilityFlagsEXT { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[]; - debug_flags(f, KNOWN, self.0) - } -} -impl fmt::Debug for VideoEncodeH265CreateFlagsEXT { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[]; + const KNOWN: &[(Flags, &str)] = &[ + ( + VideoEncodeH265CapabilityFlagsEXT::SEPARATE_COLOUR_PLANE.0, + "SEPARATE_COLOUR_PLANE", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::SCALING_LISTS.0, + "SCALING_LISTS", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::SAMPLE_ADAPTIVE_OFFSET_ENABLED.0, + "SAMPLE_ADAPTIVE_OFFSET_ENABLED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::PCM_ENABLE.0, + "PCM_ENABLE", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::SPS_TEMPORAL_MVP_ENABLED.0, + "SPS_TEMPORAL_MVP_ENABLED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::HRD_COMPLIANCE.0, + "HRD_COMPLIANCE", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::INIT_QP_MINUS26.0, + "INIT_QP_MINUS26", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::LOG2_PARALLEL_MERGE_LEVEL_MINUS2.0, + "LOG2_PARALLEL_MERGE_LEVEL_MINUS2", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::SIGN_DATA_HIDING_ENABLED.0, + "SIGN_DATA_HIDING_ENABLED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::TRANSFORM_SKIP_ENABLED.0, + "TRANSFORM_SKIP_ENABLED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT.0, + "PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::WEIGHTED_PRED.0, + "WEIGHTED_PRED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::WEIGHTED_BIPRED.0, + "WEIGHTED_BIPRED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::WEIGHTED_PRED_NO_TABLE.0, + "WEIGHTED_PRED_NO_TABLE", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::TRANSQUANT_BYPASS_ENABLED.0, + "TRANSQUANT_BYPASS_ENABLED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::ENTROPY_CODING_SYNC_ENABLED.0, + "ENTROPY_CODING_SYNC_ENABLED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::DEBLOCKING_FILTER_OVERRIDE_ENABLED.0, + "DEBLOCKING_FILTER_OVERRIDE_ENABLED", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::MULTIPLE_TILE_PER_FRAME.0, + "MULTIPLE_TILE_PER_FRAME", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::MULTIPLE_SLICE_PER_TILE.0, + "MULTIPLE_SLICE_PER_TILE", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::MULTIPLE_TILE_PER_SLICE.0, + "MULTIPLE_TILE_PER_SLICE", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::SLICE_SEGMENT_CTB_COUNT.0, + "SLICE_SEGMENT_CTB_COUNT", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::ROW_UNALIGNED_SLICE_SEGMENT.0, + "ROW_UNALIGNED_SLICE_SEGMENT", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::DEPENDENT_SLICE_SEGMENT.0, + "DEPENDENT_SLICE_SEGMENT", + ), + ( + VideoEncodeH265CapabilityFlagsEXT::DIFFERENT_SLICE_TYPE.0, + "DIFFERENT_SLICE_TYPE", + ), + ]; debug_flags(f, KNOWN, self.0) } } impl fmt::Debug for VideoEncodeH265CtbSizeFlagsEXT { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeH265CtbSizeFlagsEXT::TYPE_8.0, "TYPE_8"), (VideoEncodeH265CtbSizeFlagsEXT::TYPE_16.0, "TYPE_16"), (VideoEncodeH265CtbSizeFlagsEXT::TYPE_32.0, "TYPE_32"), (VideoEncodeH265CtbSizeFlagsEXT::TYPE_64.0, "TYPE_64"), @@ -5799,7 +5956,10 @@ impl fmt::Debug for VideoEncodeH265InputModeFlagsEXT { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ (VideoEncodeH265InputModeFlagsEXT::FRAME.0, "FRAME"), - (VideoEncodeH265InputModeFlagsEXT::SLICE.0, "SLICE"), + ( + VideoEncodeH265InputModeFlagsEXT::SLICE_SEGMENT.0, + "SLICE_SEGMENT", + ), (VideoEncodeH265InputModeFlagsEXT::NON_VCL.0, "NON_VCL"), ]; debug_flags(f, KNOWN, self.0) @@ -5809,7 +5969,10 @@ impl fmt::Debug for VideoEncodeH265OutputModeFlagsEXT { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ (VideoEncodeH265OutputModeFlagsEXT::FRAME.0, "FRAME"), - (VideoEncodeH265OutputModeFlagsEXT::SLICE.0, "SLICE"), + ( + VideoEncodeH265OutputModeFlagsEXT::SLICE_SEGMENT.0, + "SLICE_SEGMENT", + ), (VideoEncodeH265OutputModeFlagsEXT::NON_VCL.0, "NON_VCL"), ]; debug_flags(f, KNOWN, self.0) @@ -5831,6 +5994,29 @@ impl fmt::Debug for VideoEncodeH265RateControlStructureFlagsEXT { debug_flags(f, KNOWN, self.0) } } +impl fmt::Debug for VideoEncodeH265TransformBlockSizeFlagsEXT { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + const KNOWN: &[(Flags, &str)] = &[ + ( + VideoEncodeH265TransformBlockSizeFlagsEXT::TYPE_4.0, + "TYPE_4", + ), + ( + VideoEncodeH265TransformBlockSizeFlagsEXT::TYPE_8.0, + "TYPE_8", + ), + ( + VideoEncodeH265TransformBlockSizeFlagsEXT::TYPE_16.0, + "TYPE_16", + ), + ( + VideoEncodeH265TransformBlockSizeFlagsEXT::TYPE_32.0, + "TYPE_32", + ), + ]; + debug_flags(f, KNOWN, self.0) + } +} impl fmt::Debug for VideoEncodeRateControlFlagsKHR { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ diff --git a/third_party/rust/ash/src/vk/constants.rs b/third_party/rust/ash/src/vk/constants.rs index 361b197983ba1..b10fad2acf28a 100644 --- a/third_party/rust/ash/src/vk/constants.rs +++ b/third_party/rust/ash/src/vk/constants.rs @@ -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_EXT: usize = 16; +pub const MAX_GLOBAL_PRIORITY_SIZE_KHR: usize = 16; pub const SHADER_UNUSED_NV: u32 = SHADER_UNUSED_KHR; diff --git a/third_party/rust/ash/src/vk/definitions.rs b/third_party/rust/ash/src/vk/definitions.rs index 8953f9e81ab5a..9e1c2c112330e 100644 --- a/third_party/rust/ash/src/vk/definitions.rs +++ b/third_party/rust/ash/src/vk/definitions.rs @@ -9,439 +9,416 @@ use crate::vk::{ptr_chain_iter, Handle}; use std::fmt; use std::os::raw::*; #[deprecated = "This define is deprecated. VK_MAKE_API_VERSION should be used instead."] -#[doc = ""] +#[doc = ""] pub const fn make_version(major: u32, minor: u32, patch: u32) -> u32 { ((major) << 22) | ((minor) << 12) | (patch) } #[deprecated = "This define is deprecated. VK_API_VERSION_MAJOR should be used instead."] -#[doc = ""] +#[doc = ""] pub const fn version_major(version: u32) -> u32 { (version) >> 22 } #[deprecated = "This define is deprecated. VK_API_VERSION_MINOR should be used instead."] -#[doc = ""] +#[doc = ""] pub const fn version_minor(version: u32) -> u32 { ((version) >> 12) & 0x3ffu32 } #[deprecated = "This define is deprecated. VK_API_VERSION_PATCH should be used instead."] -#[doc = ""] +#[doc = ""] pub const fn version_patch(version: u32) -> u32 { (version) & 0xfffu32 } -#[doc = ""] +#[doc = ""] pub const fn make_api_version(variant: u32, major: u32, minor: u32, patch: u32) -> u32 { ((variant) << 29) | ((major) << 22) | ((minor) << 12) | (patch) } -#[doc = ""] +#[doc = ""] pub const fn api_version_variant(version: u32) -> u32 { (version) >> 29 } -#[doc = ""] +#[doc = ""] pub const fn api_version_major(version: u32) -> u32 { ((version) >> 22) & 0x7fu32 } -#[doc = ""] +#[doc = ""] pub const fn api_version_minor(version: u32) -> u32 { ((version) >> 12) & 0x3ffu32 } -#[doc = ""] +#[doc = ""] pub const fn api_version_patch(version: u32) -> u32 { (version) & 0xfffu32 } -#[doc = ""] +#[doc = ""] pub const API_VERSION_1_0: u32 = make_api_version(0, 1, 0, 0); -#[doc = ""] +#[doc = ""] pub const API_VERSION_1_1: u32 = make_api_version(0, 1, 1, 0); -#[doc = ""] +#[doc = ""] pub const API_VERSION_1_2: u32 = make_api_version(0, 1, 2, 0); -pub const HEADER_VERSION: u32 = 203u32; -#[doc = ""] -pub const HEADER_VERSION_COMPLETE: u32 = make_api_version(0, 1, 2, HEADER_VERSION); -#[doc = ""] +#[doc = ""] +pub const API_VERSION_1_3: u32 = make_api_version(0, 1, 3, 0); +pub const HEADER_VERSION: u32 = 209u32; +#[doc = ""] +pub const HEADER_VERSION_COMPLETE: u32 = make_api_version(0, 1, 3, HEADER_VERSION); +#[doc = ""] pub type SampleMask = u32; -#[doc = ""] +#[doc = ""] pub type Bool32 = u32; -#[doc = ""] +#[doc = ""] pub type Flags = u32; -#[doc = ""] +#[doc = ""] pub type Flags64 = u64; -#[doc = ""] +#[doc = ""] pub type DeviceSize = u64; -#[doc = ""] +#[doc = ""] pub type DeviceAddress = u64; #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct QueryPoolCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(QueryPoolCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineDynamicStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineDynamicStateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineMultisampleStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineMultisampleStateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineRasterizationStateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineViewportStateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineTessellationStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineTessellationStateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineInputAssemblyStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineInputAssemblyStateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineVertexInputStateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(PipelineVertexInputStateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct BufferViewCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(BufferViewCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct InstanceCreateFlags(pub(crate) Flags); -vk_bitflags_wrapped!(InstanceCreateFlags, Flags); -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DeviceCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(DeviceCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct MemoryMapFlags(pub(crate) Flags); vk_bitflags_wrapped!(MemoryMapFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DescriptorPoolResetFlags(pub(crate) Flags); vk_bitflags_wrapped!(DescriptorPoolResetFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DescriptorUpdateTemplateCreateFlags(pub(crate) Flags); vk_bitflags_wrapped!(DescriptorUpdateTemplateCreateFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMotionInfoFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(AccelerationStructureMotionInfoFlagsNV, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMotionInstanceFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(AccelerationStructureMotionInstanceFlagsNV, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DisplayModeCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(DisplayModeCreateFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DisplaySurfaceCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(DisplaySurfaceCreateFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct AndroidSurfaceCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(AndroidSurfaceCreateFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ViSurfaceCreateFlagsNN(pub(crate) Flags); vk_bitflags_wrapped!(ViSurfaceCreateFlagsNN, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct WaylandSurfaceCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(WaylandSurfaceCreateFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct Win32SurfaceCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(Win32SurfaceCreateFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct XlibSurfaceCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(XlibSurfaceCreateFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct XcbSurfaceCreateFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(XcbSurfaceCreateFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DirectFBSurfaceCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(DirectFBSurfaceCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct IOSSurfaceCreateFlagsMVK(pub(crate) Flags); vk_bitflags_wrapped!(IOSSurfaceCreateFlagsMVK, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct MacOSSurfaceCreateFlagsMVK(pub(crate) Flags); vk_bitflags_wrapped!(MacOSSurfaceCreateFlagsMVK, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct MetalSurfaceCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(MetalSurfaceCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ImagePipeSurfaceCreateFlagsFUCHSIA(pub(crate) Flags); vk_bitflags_wrapped!(ImagePipeSurfaceCreateFlagsFUCHSIA, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct StreamDescriptorSurfaceCreateFlagsGGP(pub(crate) Flags); vk_bitflags_wrapped!(StreamDescriptorSurfaceCreateFlagsGGP, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct HeadlessSurfaceCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(HeadlessSurfaceCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ScreenSurfaceCreateFlagsQNX(pub(crate) Flags); vk_bitflags_wrapped!(ScreenSurfaceCreateFlagsQNX, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct CommandPoolTrimFlags(pub(crate) Flags); vk_bitflags_wrapped!(CommandPoolTrimFlags, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportSwizzleStateCreateFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(PipelineViewportSwizzleStateCreateFlagsNV, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineDiscardRectangleStateCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(PipelineDiscardRectangleStateCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineCoverageToColorStateCreateFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(PipelineCoverageToColorStateCreateFlagsNV, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineCoverageModulationStateCreateFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(PipelineCoverageModulationStateCreateFlagsNV, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineCoverageReductionStateCreateFlagsNV(pub(crate) Flags); vk_bitflags_wrapped!(PipelineCoverageReductionStateCreateFlagsNV, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct ValidationCacheCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(ValidationCacheCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsMessengerCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(DebugUtilsMessengerCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsMessengerCallbackDataFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(DebugUtilsMessengerCallbackDataFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct DeviceMemoryReportFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(DeviceMemoryReportFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationConservativeStateCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(PipelineRasterizationConservativeStateCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationStateStreamCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(PipelineRasterizationStateStreamCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationDepthClipStateCreateFlagsEXT(pub(crate) Flags); vk_bitflags_wrapped!(PipelineRasterizationDepthClipStateCreateFlagsEXT, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoBeginCodingFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoBeginCodingFlagsKHR, Flags); #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] +#[doc = ""] pub struct VideoEndCodingFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoEndCodingFlagsKHR, Flags); -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoDecodeH264CreateFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoDecodeH264CreateFlagsEXT, Flags); -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoDecodeH265CreateFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoDecodeH265CreateFlagsEXT, Flags); -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH265CapabilityFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH265CapabilityFlagsEXT, Flags); -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH265CreateFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH265CreateFlagsEXT, Flags); define_handle!( Instance, INSTANCE, - doc = "" + doc = "" ); -define_handle ! (PhysicalDevice , PHYSICAL_DEVICE , doc = "") ; +define_handle ! (PhysicalDevice , PHYSICAL_DEVICE , doc = "") ; define_handle!( Device, DEVICE, - doc = "" + doc = "" ); define_handle!( Queue, QUEUE, - doc = "" + doc = "" ); -define_handle ! (CommandBuffer , COMMAND_BUFFER , doc = "") ; -handle_nondispatchable ! (DeviceMemory , DEVICE_MEMORY , doc = "") ; -handle_nondispatchable ! (CommandPool , COMMAND_POOL , doc = "") ; +define_handle ! (CommandBuffer , COMMAND_BUFFER , doc = "") ; +handle_nondispatchable ! (DeviceMemory , DEVICE_MEMORY , doc = "") ; +handle_nondispatchable ! (CommandPool , COMMAND_POOL , doc = "") ; handle_nondispatchable!( Buffer, BUFFER, - doc = "" + doc = "" ); handle_nondispatchable!( BufferView, BUFFER_VIEW, doc = - "" + "" ); handle_nondispatchable!( Image, IMAGE, - doc = "" + doc = "" ); handle_nondispatchable!( ImageView, IMAGE_VIEW, doc = - "" + "" ); -handle_nondispatchable ! (ShaderModule , SHADER_MODULE , doc = "") ; +handle_nondispatchable ! (ShaderModule , SHADER_MODULE , doc = "") ; handle_nondispatchable!( Pipeline, PIPELINE, - doc = "" + doc = "" ); -handle_nondispatchable ! (PipelineLayout , PIPELINE_LAYOUT , doc = "") ; +handle_nondispatchable ! (PipelineLayout , PIPELINE_LAYOUT , doc = "") ; handle_nondispatchable!( Sampler, SAMPLER, - doc = "" + doc = "" ); -handle_nondispatchable ! (DescriptorSet , DESCRIPTOR_SET , doc = "") ; -handle_nondispatchable ! (DescriptorSetLayout , DESCRIPTOR_SET_LAYOUT , doc = "") ; -handle_nondispatchable ! (DescriptorPool , DESCRIPTOR_POOL , doc = "") ; +handle_nondispatchable ! (DescriptorSet , DESCRIPTOR_SET , doc = "") ; +handle_nondispatchable ! (DescriptorSetLayout , DESCRIPTOR_SET_LAYOUT , doc = "") ; +handle_nondispatchable ! (DescriptorPool , DESCRIPTOR_POOL , doc = "") ; handle_nondispatchable!( Fence, FENCE, - doc = "" + doc = "" ); handle_nondispatchable!( Semaphore, SEMAPHORE, doc = - "" + "" ); handle_nondispatchable!( Event, EVENT, - doc = "" + doc = "" ); handle_nondispatchable!( QueryPool, QUERY_POOL, doc = - "" + "" ); -handle_nondispatchable ! (Framebuffer , FRAMEBUFFER , doc = "") ; +handle_nondispatchable ! (Framebuffer , FRAMEBUFFER , doc = "") ; handle_nondispatchable!( RenderPass, RENDER_PASS, doc = - "" + "" ); -handle_nondispatchable ! (PipelineCache , PIPELINE_CACHE , doc = "") ; -handle_nondispatchable ! (IndirectCommandsLayoutNV , INDIRECT_COMMANDS_LAYOUT_NV , doc = "") ; -handle_nondispatchable ! (DescriptorUpdateTemplate , DESCRIPTOR_UPDATE_TEMPLATE , doc = "") ; -handle_nondispatchable ! (SamplerYcbcrConversion , SAMPLER_YCBCR_CONVERSION , doc = "") ; -handle_nondispatchable ! (ValidationCacheEXT , VALIDATION_CACHE_EXT , doc = "") ; -handle_nondispatchable ! (AccelerationStructureKHR , ACCELERATION_STRUCTURE_KHR , doc = "") ; -handle_nondispatchable ! (AccelerationStructureNV , ACCELERATION_STRUCTURE_NV , doc = "") ; -handle_nondispatchable ! (PerformanceConfigurationINTEL , PERFORMANCE_CONFIGURATION_INTEL , doc = "") ; -handle_nondispatchable ! (BufferCollectionFUCHSIA , BUFFER_COLLECTION_FUCHSIA , doc = "") ; -handle_nondispatchable ! (DeferredOperationKHR , DEFERRED_OPERATION_KHR , doc = "") ; -handle_nondispatchable ! (PrivateDataSlotEXT , PRIVATE_DATA_SLOT_EXT , doc = "") ; -handle_nondispatchable ! (CuModuleNVX , CU_MODULE_NVX , doc = "") ; -handle_nondispatchable ! (CuFunctionNVX , CU_FUNCTION_NVX , doc = "") ; +handle_nondispatchable ! (PipelineCache , PIPELINE_CACHE , doc = "") ; +handle_nondispatchable ! (IndirectCommandsLayoutNV , INDIRECT_COMMANDS_LAYOUT_NV , doc = "") ; +handle_nondispatchable ! (DescriptorUpdateTemplate , DESCRIPTOR_UPDATE_TEMPLATE , doc = "") ; +handle_nondispatchable ! (SamplerYcbcrConversion , SAMPLER_YCBCR_CONVERSION , doc = "") ; +handle_nondispatchable ! (ValidationCacheEXT , VALIDATION_CACHE_EXT , doc = "") ; +handle_nondispatchable ! (AccelerationStructureKHR , ACCELERATION_STRUCTURE_KHR , doc = "") ; +handle_nondispatchable ! (AccelerationStructureNV , ACCELERATION_STRUCTURE_NV , doc = "") ; +handle_nondispatchable ! (PerformanceConfigurationINTEL , PERFORMANCE_CONFIGURATION_INTEL , doc = "") ; +handle_nondispatchable ! (BufferCollectionFUCHSIA , BUFFER_COLLECTION_FUCHSIA , doc = "") ; +handle_nondispatchable ! (DeferredOperationKHR , DEFERRED_OPERATION_KHR , doc = "") ; +handle_nondispatchable ! (PrivateDataSlot , PRIVATE_DATA_SLOT , doc = "") ; +handle_nondispatchable ! (CuModuleNVX , CU_MODULE_NVX , doc = "") ; +handle_nondispatchable ! (CuFunctionNVX , CU_FUNCTION_NVX , doc = "") ; handle_nondispatchable!( DisplayKHR, DISPLAY_KHR, doc = - "" + "" ); -handle_nondispatchable ! (DisplayModeKHR , DISPLAY_MODE_KHR , doc = "") ; +handle_nondispatchable ! (DisplayModeKHR , DISPLAY_MODE_KHR , doc = "") ; handle_nondispatchable!( SurfaceKHR, SURFACE_KHR, doc = - "" + "" ); -handle_nondispatchable ! (SwapchainKHR , SWAPCHAIN_KHR , doc = "") ; -handle_nondispatchable ! (DebugReportCallbackEXT , DEBUG_REPORT_CALLBACK_EXT , doc = "") ; -handle_nondispatchable ! (DebugUtilsMessengerEXT , DEBUG_UTILS_MESSENGER_EXT , doc = "") ; -handle_nondispatchable ! (VideoSessionKHR , VIDEO_SESSION_KHR , doc = "") ; -handle_nondispatchable ! (VideoSessionParametersKHR , VIDEO_SESSION_PARAMETERS_KHR , doc = "") ; +handle_nondispatchable ! (SwapchainKHR , SWAPCHAIN_KHR , doc = "") ; +handle_nondispatchable ! (DebugReportCallbackEXT , DEBUG_REPORT_CALLBACK_EXT , doc = "") ; +handle_nondispatchable ! (DebugUtilsMessengerEXT , DEBUG_UTILS_MESSENGER_EXT , doc = "") ; +handle_nondispatchable ! (VideoSessionKHR , VIDEO_SESSION_KHR , doc = "") ; +handle_nondispatchable ! (VideoSessionParametersKHR , VIDEO_SESSION_PARAMETERS_KHR , doc = "") ; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkInternalAllocationNotification = Option< unsafe extern "system" fn( p_user_data: *mut c_void, @@ -451,7 +428,7 @@ pub type PFN_vkInternalAllocationNotification = Option< ), >; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkInternalFreeNotification = Option< unsafe extern "system" fn( p_user_data: *mut c_void, @@ -461,7 +438,7 @@ pub type PFN_vkInternalFreeNotification = Option< ), >; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkReallocationFunction = Option< unsafe extern "system" fn( p_user_data: *mut c_void, @@ -472,7 +449,7 @@ pub type PFN_vkReallocationFunction = Option< ) -> *mut c_void, >; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkAllocationFunction = Option< unsafe extern "system" fn( p_user_data: *mut c_void, @@ -482,14 +459,14 @@ pub type PFN_vkAllocationFunction = Option< ) -> *mut c_void, >; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkFreeFunction = Option; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkVoidFunction = Option; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkDebugReportCallbackEXT = Option< unsafe extern "system" fn( flags: DebugReportFlagsEXT, @@ -503,7 +480,7 @@ pub type PFN_vkDebugReportCallbackEXT = Option< ) -> Bool32, >; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkDebugUtilsMessengerCallbackEXT = Option< unsafe extern "system" fn( message_severity: DebugUtilsMessageSeverityFlagsEXT, @@ -513,7 +490,7 @@ pub type PFN_vkDebugUtilsMessengerCallbackEXT = Option< ) -> Bool32, >; #[allow(non_camel_case_types)] -#[doc = ""] +#[doc = ""] pub type PFN_vkDeviceMemoryReportCallbackEXT = Option< unsafe extern "system" fn( p_callback_data: *const DeviceMemoryReportCallbackDataEXT, @@ -523,7 +500,7 @@ pub type PFN_vkDeviceMemoryReportCallbackEXT = Option< #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BaseOutStructure { pub s_type: StructureType, pub p_next: *mut Self, @@ -539,7 +516,7 @@ impl ::std::default::Default for BaseOutStructure { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BaseInStructure { pub s_type: StructureType, pub p_next: *const Self, @@ -555,7 +532,7 @@ impl ::std::default::Default for BaseInStructure { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] -#[doc = ""] +#[doc = ""] pub struct Offset2D { pub x: i32, pub y: i32, @@ -603,7 +580,7 @@ impl<'a> Offset2DBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] -#[doc = ""] +#[doc = ""] pub struct Offset3D { pub x: i32, pub y: i32, @@ -656,7 +633,7 @@ impl<'a> Offset3DBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] -#[doc = ""] +#[doc = ""] pub struct Extent2D { pub width: u32, pub height: u32, @@ -704,7 +681,7 @@ impl<'a> Extent2DBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] -#[doc = ""] +#[doc = ""] pub struct Extent3D { pub width: u32, pub height: u32, @@ -757,7 +734,7 @@ impl<'a> Extent3DBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct Viewport { pub x: f32, pub y: f32, @@ -825,7 +802,7 @@ impl<'a> ViewportBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] -#[doc = ""] +#[doc = ""] pub struct Rect2D { pub offset: Offset2D, pub extent: Extent2D, @@ -873,7 +850,7 @@ impl<'a> Rect2DBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] -#[doc = ""] +#[doc = ""] pub struct ClearRect { pub rect: Rect2D, pub base_array_layer: u32, @@ -926,7 +903,7 @@ impl<'a> ClearRectBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ComponentMapping { pub r: ComponentSwizzle, pub g: ComponentSwizzle, @@ -983,7 +960,7 @@ impl<'a> ComponentMappingBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceProperties { pub api_version: u32, pub driver_version: u32, @@ -1005,7 +982,7 @@ impl fmt::Debug for PhysicalDeviceProperties { .field("device_id", &self.device_id) .field("device_type", &self.device_type) .field("device_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.device_name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.device_name.as_ptr()) }) .field("pipeline_cache_uuid", &self.pipeline_cache_uuid) .field("limits", &self.limits) @@ -1098,7 +1075,7 @@ impl<'a> PhysicalDevicePropertiesBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExtensionProperties { pub extension_name: [c_char; MAX_EXTENSION_NAME_SIZE], pub spec_version: u32, @@ -1108,7 +1085,7 @@ impl fmt::Debug for ExtensionProperties { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("ExtensionProperties") .field("extension_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.extension_name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.extension_name.as_ptr()) }) .field("spec_version", &self.spec_version) .finish() @@ -1164,7 +1141,7 @@ impl<'a> ExtensionPropertiesBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct LayerProperties { pub layer_name: [c_char; MAX_EXTENSION_NAME_SIZE], pub spec_version: u32, @@ -1176,12 +1153,12 @@ impl fmt::Debug for LayerProperties { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt.debug_struct("LayerProperties") .field("layer_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.layer_name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.layer_name.as_ptr()) }) .field("spec_version", &self.spec_version) .field("implementation_version", &self.implementation_version) .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.description.as_ptr()) }) .finish() } @@ -1247,7 +1224,7 @@ impl<'a> LayerPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ApplicationInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -1324,7 +1301,7 @@ impl<'a> ApplicationInfoBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AllocationCallbacks { pub p_user_data: *mut c_void, pub pfn_allocation: PFN_vkAllocationFunction, @@ -1432,7 +1409,7 @@ impl<'a> AllocationCallbacksBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceQueueCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -1499,10 +1476,10 @@ impl<'a> DeviceQueueCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -1516,7 +1493,7 @@ impl<'a> DeviceQueueCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -1601,10 +1578,10 @@ impl<'a> DeviceCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -1618,7 +1595,7 @@ impl<'a> DeviceCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct InstanceCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -1694,10 +1671,10 @@ impl<'a> InstanceCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -1711,7 +1688,7 @@ impl<'a> InstanceCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct QueueFamilyProperties { pub queue_flags: QueueFlags, pub queue_count: u32, @@ -1772,7 +1749,7 @@ impl<'a> QueueFamilyPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMemoryProperties { pub memory_type_count: u32, pub memory_types: [MemoryType; MAX_MEMORY_TYPES], @@ -1840,7 +1817,7 @@ impl<'a> PhysicalDeviceMemoryPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryAllocateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -1898,10 +1875,10 @@ impl<'a> MemoryAllocateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -1915,7 +1892,7 @@ impl<'a> MemoryAllocateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct MemoryRequirements { pub size: DeviceSize, pub alignment: DeviceSize, @@ -1968,7 +1945,7 @@ impl<'a> MemoryRequirementsBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SparseImageFormatProperties { pub aspect_mask: ImageAspectFlags, pub image_granularity: Extent3D, @@ -2021,7 +1998,7 @@ impl<'a> SparseImageFormatPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SparseImageMemoryRequirements { pub format_properties: SparseImageFormatProperties, pub image_mip_tail_first_lod: u32, @@ -2084,7 +2061,7 @@ impl<'a> SparseImageMemoryRequirementsBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct MemoryType { pub property_flags: MemoryPropertyFlags, pub heap_index: u32, @@ -2132,7 +2109,7 @@ impl<'a> MemoryTypeBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct MemoryHeap { pub size: DeviceSize, pub flags: MemoryHeapFlags, @@ -2180,7 +2157,7 @@ impl<'a> MemoryHeapBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MappedMemoryRange { pub s_type: StructureType, pub p_next: *const c_void, @@ -2246,7 +2223,7 @@ impl<'a> MappedMemoryRangeBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct FormatProperties { pub linear_tiling_features: FormatFeatureFlags, pub optimal_tiling_features: FormatFeatureFlags, @@ -2299,7 +2276,7 @@ impl<'a> FormatPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ImageFormatProperties { pub max_extent: Extent3D, pub max_mip_levels: u32, @@ -2362,7 +2339,7 @@ impl<'a> ImageFormatPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DescriptorBufferInfo { pub buffer: Buffer, pub offset: DeviceSize, @@ -2415,7 +2392,7 @@ impl<'a> DescriptorBufferInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DescriptorImageInfo { pub sampler: Sampler, pub image_view: ImageView, @@ -2468,7 +2445,7 @@ impl<'a> DescriptorImageInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct WriteDescriptorSet { pub s_type: StructureType, pub p_next: *const c_void, @@ -2561,10 +2538,10 @@ impl<'a> WriteDescriptorSetBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -2578,7 +2555,7 @@ impl<'a> WriteDescriptorSetBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CopyDescriptorSet { pub s_type: StructureType, pub p_next: *const c_void, @@ -2668,7 +2645,7 @@ impl<'a> CopyDescriptorSetBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -2747,10 +2724,10 @@ impl<'a> BufferCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -2764,7 +2741,7 @@ impl<'a> BufferCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferViewCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -2842,7 +2819,7 @@ impl<'a> BufferViewCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ImageSubresource { pub aspect_mask: ImageAspectFlags, pub mip_level: u32, @@ -2895,7 +2872,7 @@ impl<'a> ImageSubresourceBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ImageSubresourceLayers { pub aspect_mask: ImageAspectFlags, pub mip_level: u32, @@ -2953,7 +2930,7 @@ impl<'a> ImageSubresourceLayersBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ImageSubresourceRange { pub aspect_mask: ImageAspectFlags, pub base_mip_level: u32, @@ -3016,7 +2993,7 @@ impl<'a> ImageSubresourceRangeBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryBarrier { pub s_type: StructureType, pub p_next: *const c_void, @@ -3076,7 +3053,7 @@ impl<'a> MemoryBarrierBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferMemoryBarrier { pub s_type: StructureType, pub p_next: *const c_void, @@ -3166,7 +3143,7 @@ impl<'a> BufferMemoryBarrierBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageMemoryBarrier { pub s_type: StructureType, pub p_next: *const c_void, @@ -3260,10 +3237,10 @@ impl<'a> ImageMemoryBarrierBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -3277,7 +3254,7 @@ impl<'a> ImageMemoryBarrierBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -3398,10 +3375,10 @@ impl<'a> ImageCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -3415,7 +3392,7 @@ impl<'a> ImageCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SubresourceLayout { pub offset: DeviceSize, pub size: DeviceSize, @@ -3478,7 +3455,7 @@ impl<'a> SubresourceLayoutBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageViewCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -3560,10 +3537,10 @@ impl<'a> ImageViewCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -3577,7 +3554,7 @@ impl<'a> ImageViewCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct BufferCopy { pub src_offset: DeviceSize, pub dst_offset: DeviceSize, @@ -3630,7 +3607,7 @@ impl<'a> BufferCopyBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SparseMemoryBind { pub resource_offset: DeviceSize, pub size: DeviceSize, @@ -3693,7 +3670,7 @@ impl<'a> SparseMemoryBindBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SparseImageMemoryBind { pub subresource: ImageSubresource, pub offset: Offset3D, @@ -3761,7 +3738,7 @@ impl<'a> SparseImageMemoryBindBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SparseBufferMemoryBindInfo { pub buffer: Buffer, pub bind_count: u32, @@ -3820,7 +3797,7 @@ impl<'a> SparseBufferMemoryBindInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SparseImageOpaqueMemoryBindInfo { pub image: Image, pub bind_count: u32, @@ -3879,7 +3856,7 @@ impl<'a> SparseImageOpaqueMemoryBindInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SparseImageMemoryBindInfo { pub image: Image, pub bind_count: u32, @@ -3938,7 +3915,7 @@ impl<'a> SparseImageMemoryBindInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindSparseInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -4032,10 +4009,10 @@ impl<'a> BindSparseInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -4049,7 +4026,7 @@ impl<'a> BindSparseInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ImageCopy { pub src_subresource: ImageSubresourceLayers, pub src_offset: Offset3D, @@ -4112,7 +4089,7 @@ impl<'a> ImageCopyBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageBlit { pub src_subresource: ImageSubresourceLayers, pub src_offsets: [Offset3D; 2], @@ -4180,7 +4157,7 @@ impl<'a> ImageBlitBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct BufferImageCopy { pub buffer_offset: DeviceSize, pub buffer_row_length: u32, @@ -4248,7 +4225,7 @@ impl<'a> BufferImageCopyBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ImageResolve { pub src_subresource: ImageSubresourceLayers, pub src_offset: Offset3D, @@ -4311,7 +4288,7 @@ impl<'a> ImageResolveBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ShaderModuleCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -4362,7 +4339,7 @@ impl<'a> ShaderModuleCreateInfoBuilder<'a> { } pub fn code(mut self, code: &'a [u32]) -> Self { self.inner.code_size = code.len() * 4; - self.inner.p_code = code.as_ptr() as *const u32; + self.inner.p_code = code.as_ptr(); self } #[doc = r" Prepends the given extension struct between the root and the first pointer. This"] @@ -4372,10 +4349,10 @@ impl<'a> ShaderModuleCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -4389,7 +4366,7 @@ impl<'a> ShaderModuleCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetLayoutBinding { pub binding: u32, pub descriptor_type: DescriptorType, @@ -4464,7 +4441,7 @@ impl<'a> DescriptorSetLayoutBindingBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetLayoutCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -4525,10 +4502,10 @@ impl<'a> DescriptorSetLayoutCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -4542,7 +4519,7 @@ impl<'a> DescriptorSetLayoutCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DescriptorPoolSize { pub ty: DescriptorType, pub descriptor_count: u32, @@ -4590,7 +4567,7 @@ impl<'a> DescriptorPoolSizeBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorPoolCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -4657,10 +4634,10 @@ impl<'a> DescriptorPoolCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -4674,7 +4651,7 @@ impl<'a> DescriptorPoolCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetAllocateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -4735,10 +4712,10 @@ impl<'a> DescriptorSetAllocateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -4752,7 +4729,7 @@ impl<'a> DescriptorSetAllocateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SpecializationMapEntry { pub constant_id: u32, pub offset: u32, @@ -4805,7 +4782,7 @@ impl<'a> SpecializationMapEntryBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SpecializationInfo { pub map_entry_count: u32, pub p_map_entries: *const SpecializationMapEntry, @@ -4853,7 +4830,7 @@ impl<'a> SpecializationInfoBuilder<'a> { self } pub fn data(mut self, data: &'a [u8]) -> Self { - self.inner.data_size = data.len() as _; + self.inner.data_size = data.len(); self.inner.p_data = data.as_ptr() as *const c_void; self } @@ -4867,7 +4844,7 @@ impl<'a> SpecializationInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineShaderStageCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -4943,10 +4920,10 @@ impl<'a> PipelineShaderStageCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -4960,7 +4937,7 @@ impl<'a> PipelineShaderStageCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ComputePipelineCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5036,10 +5013,10 @@ impl<'a> ComputePipelineCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -5053,7 +5030,7 @@ impl<'a> ComputePipelineCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct VertexInputBindingDescription { pub binding: u32, pub stride: u32, @@ -5106,7 +5083,7 @@ impl<'a> VertexInputBindingDescriptionBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct VertexInputAttributeDescription { pub location: u32, pub binding: u32, @@ -5164,7 +5141,7 @@ impl<'a> VertexInputAttributeDescriptionBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineVertexInputStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5243,10 +5220,10 @@ impl<'a> PipelineVertexInputStateCreateInfoBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -5260,7 +5237,7 @@ impl<'a> PipelineVertexInputStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineInputAssemblyStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5326,7 +5303,7 @@ impl<'a> PipelineInputAssemblyStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineTessellationStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5387,10 +5364,10 @@ impl<'a> PipelineTessellationStateCreateInfoBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -5404,7 +5381,7 @@ impl<'a> PipelineTessellationStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5482,10 +5459,10 @@ impl<'a> PipelineViewportStateCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -5499,7 +5476,7 @@ impl<'a> PipelineViewportStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5614,10 +5591,10 @@ impl<'a> PipelineRasterizationStateCreateInfoBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -5631,7 +5608,7 @@ impl<'a> PipelineRasterizationStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineMultisampleStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5703,13 +5680,13 @@ impl<'a> PipelineMultisampleStateCreateInfoBuilder<'a> { #[doc = r" Sets `p_sample_mask` to `null` if the slice is empty. The mask will"] #[doc = r" be treated as if it has all bits set to `1`."] #[doc = r""] - #[doc = r" See "] + #[doc = r" See "] #[doc = r" for more details."] pub fn sample_mask(mut self, sample_mask: &'a [SampleMask]) -> Self { self.inner.p_sample_mask = if sample_mask.is_empty() { std::ptr::null() } else { - sample_mask.as_ptr() as *const SampleMask + sample_mask.as_ptr() }; self } @@ -5731,10 +5708,10 @@ impl<'a> PipelineMultisampleStateCreateInfoBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -5748,7 +5725,7 @@ impl<'a> PipelineMultisampleStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct PipelineColorBlendAttachmentState { pub blend_enable: Bool32, pub src_color_blend_factor: BlendFactor, @@ -5826,7 +5803,7 @@ impl<'a> PipelineColorBlendAttachmentStateBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineColorBlendStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5908,10 +5885,10 @@ impl<'a> PipelineColorBlendStateCreateInfoBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -5925,7 +5902,7 @@ impl<'a> PipelineColorBlendStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineDynamicStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -5988,7 +5965,7 @@ impl<'a> PipelineDynamicStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct StencilOpState { pub fail_op: StencilOp, pub pass_op: StencilOp, @@ -6061,7 +6038,7 @@ impl<'a> StencilOpStateBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineDepthStencilStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6169,7 +6146,7 @@ impl<'a> PipelineDepthStencilStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GraphicsPipelineCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6335,10 +6312,10 @@ impl<'a> GraphicsPipelineCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -6352,7 +6329,7 @@ impl<'a> GraphicsPipelineCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineCacheCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6401,7 +6378,7 @@ impl<'a> PipelineCacheCreateInfoBuilder<'a> { self } pub fn initial_data(mut self, initial_data: &'a [u8]) -> Self { - self.inner.initial_data_size = initial_data.len() as _; + self.inner.initial_data_size = initial_data.len(); self.inner.p_initial_data = initial_data.as_ptr() as *const c_void; self } @@ -6415,7 +6392,7 @@ impl<'a> PipelineCacheCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineCacheHeaderVersionOne { pub header_size: u32, pub header_version: PipelineCacheHeaderVersion, @@ -6489,7 +6466,7 @@ impl<'a> PipelineCacheHeaderVersionOneBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct PushConstantRange { pub stage_flags: ShaderStageFlags, pub offset: u32, @@ -6542,7 +6519,7 @@ impl<'a> PushConstantRangeBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineLayoutCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6614,7 +6591,7 @@ impl<'a> PipelineLayoutCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SamplerCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6756,10 +6733,10 @@ impl<'a> SamplerCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -6773,7 +6750,7 @@ impl<'a> SamplerCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CommandPoolCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6833,7 +6810,7 @@ impl<'a> CommandPoolCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferAllocateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6899,7 +6876,7 @@ impl<'a> CommandBufferAllocateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferInheritanceInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -6981,10 +6958,10 @@ impl<'a> CommandBufferInheritanceInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -6998,7 +6975,7 @@ impl<'a> CommandBufferInheritanceInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferBeginInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -7056,10 +7033,10 @@ impl<'a> CommandBufferBeginInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -7072,7 +7049,7 @@ impl<'a> CommandBufferBeginInfoBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassBeginInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -7159,10 +7136,10 @@ impl<'a> RenderPassBeginInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -7175,7 +7152,7 @@ impl<'a> RenderPassBeginInfoBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union ClearColorValue { pub float32: [f32; 4], pub int32: [i32; 4], @@ -7189,7 +7166,7 @@ impl ::std::default::Default for ClearColorValue { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ClearDepthStencilValue { pub depth: f32, pub stencil: u32, @@ -7236,7 +7213,7 @@ impl<'a> ClearDepthStencilValueBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union ClearValue { pub color: ClearColorValue, pub depth_stencil: ClearDepthStencilValue, @@ -7248,7 +7225,7 @@ impl ::std::default::Default for ClearValue { } #[repr(C)] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ClearAttachment { pub aspect_mask: ImageAspectFlags, pub color_attachment: u32, @@ -7311,7 +7288,7 @@ impl<'a> ClearAttachmentBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct AttachmentDescription { pub flags: AttachmentDescriptionFlags, pub format: Format, @@ -7394,7 +7371,7 @@ impl<'a> AttachmentDescriptionBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct AttachmentReference { pub attachment: u32, pub layout: ImageLayout, @@ -7442,7 +7419,7 @@ impl<'a> AttachmentReferenceBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassDescription { pub flags: SubpassDescriptionFlags, pub pipeline_bind_point: PipelineBindPoint, @@ -7541,7 +7518,7 @@ impl<'a> SubpassDescriptionBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SubpassDependency { pub src_subpass: u32, pub dst_subpass: u32, @@ -7614,7 +7591,7 @@ impl<'a> SubpassDependencyBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -7693,10 +7670,10 @@ impl<'a> RenderPassCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -7710,7 +7687,7 @@ impl<'a> RenderPassCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct EventCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -7764,7 +7741,7 @@ impl<'a> EventCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FenceCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -7816,10 +7793,10 @@ impl<'a> FenceCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -7833,7 +7810,7 @@ impl<'a> FenceCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFeatures { pub robust_buffer_access: Bool32, pub full_draw_index_uint32: Bool32, @@ -8184,7 +8161,7 @@ impl<'a> PhysicalDeviceFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSparseProperties { pub residency_standard2_d_block_shape: Bool32, pub residency_standard2_d_multisample_block_shape: Bool32, @@ -8257,7 +8234,7 @@ impl<'a> PhysicalDeviceSparsePropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceLimits { pub max_image_dimension1_d: u32, pub max_image_dimension2_d: u32, @@ -9078,7 +9055,7 @@ impl<'a> PhysicalDeviceLimitsBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -9130,10 +9107,10 @@ impl<'a> SemaphoreCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -9147,7 +9124,7 @@ impl<'a> SemaphoreCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct QueryPoolCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -9217,10 +9194,10 @@ impl<'a> QueryPoolCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -9234,7 +9211,7 @@ impl<'a> QueryPoolCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FramebufferCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -9319,10 +9296,10 @@ impl<'a> FramebufferCreateInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -9336,7 +9313,7 @@ impl<'a> FramebufferCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DrawIndirectCommand { pub vertex_count: u32, pub instance_count: u32, @@ -9394,7 +9371,7 @@ impl<'a> DrawIndirectCommandBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DrawIndexedIndirectCommand { pub index_count: u32, pub instance_count: u32, @@ -9457,7 +9434,7 @@ impl<'a> DrawIndexedIndirectCommandBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DispatchIndirectCommand { pub x: u32, pub y: u32, @@ -9510,7 +9487,7 @@ impl<'a> DispatchIndirectCommandBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct MultiDrawInfoEXT { pub first_vertex: u32, pub vertex_count: u32, @@ -9558,7 +9535,7 @@ impl<'a> MultiDrawInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct MultiDrawIndexedInfoEXT { pub first_index: u32, pub index_count: u32, @@ -9611,7 +9588,7 @@ impl<'a> MultiDrawIndexedInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubmitInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -9691,10 +9668,10 @@ impl<'a> SubmitInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -9708,7 +9685,7 @@ impl<'a> SubmitInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayPropertiesKHR { pub display: DisplayKHR, pub display_name: *const c_char, @@ -9794,7 +9771,7 @@ impl<'a> DisplayPropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DisplayPlanePropertiesKHR { pub current_display: DisplayKHR, pub current_stack_index: u32, @@ -9842,7 +9819,7 @@ impl<'a> DisplayPlanePropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DisplayModeParametersKHR { pub visible_region: Extent2D, pub refresh_rate: u32, @@ -9890,7 +9867,7 @@ impl<'a> DisplayModeParametersKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DisplayModePropertiesKHR { pub display_mode: DisplayModeKHR, pub parameters: DisplayModeParametersKHR, @@ -9938,7 +9915,7 @@ impl<'a> DisplayModePropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayModeCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -9998,7 +9975,7 @@ impl<'a> DisplayModeCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DisplayPlaneCapabilitiesKHR { pub supported_alpha: DisplayPlaneAlphaFlagsKHR, pub min_src_position: Offset2D, @@ -10081,7 +10058,7 @@ impl<'a> DisplayPlaneCapabilitiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplaySurfaceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -10177,7 +10154,7 @@ impl<'a> DisplaySurfaceCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayPresentInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -10245,7 +10222,7 @@ impl<'a> DisplayPresentInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SurfaceCapabilitiesKHR { pub min_image_count: u32, pub max_image_count: u32, @@ -10336,7 +10313,7 @@ impl<'a> SurfaceCapabilitiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AndroidSurfaceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -10396,7 +10373,7 @@ impl<'a> AndroidSurfaceCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ViSurfaceCreateInfoNN { pub s_type: StructureType, pub p_next: *const c_void, @@ -10456,7 +10433,7 @@ impl<'a> ViSurfaceCreateInfoNNBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct WaylandSurfaceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -10522,7 +10499,7 @@ impl<'a> WaylandSurfaceCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct Win32SurfaceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -10588,7 +10565,7 @@ impl<'a> Win32SurfaceCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct XlibSurfaceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -10654,7 +10631,7 @@ impl<'a> XlibSurfaceCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct XcbSurfaceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -10720,7 +10697,7 @@ impl<'a> XcbSurfaceCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DirectFBSurfaceCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -10786,7 +10763,7 @@ impl<'a> DirectFBSurfaceCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImagePipeSurfaceCreateInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -10846,7 +10823,7 @@ impl<'a> ImagePipeSurfaceCreateInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct StreamDescriptorSurfaceCreateInfoGGP { pub s_type: StructureType, pub p_next: *const c_void, @@ -10906,7 +10883,7 @@ impl<'a> StreamDescriptorSurfaceCreateInfoGGPBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ScreenSurfaceCreateInfoQNX { pub s_type: StructureType, pub p_next: *const c_void, @@ -10972,7 +10949,7 @@ impl<'a> ScreenSurfaceCreateInfoQNXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] -#[doc = ""] +#[doc = ""] pub struct SurfaceFormatKHR { pub format: Format, pub color_space: ColorSpaceKHR, @@ -11020,7 +10997,7 @@ impl<'a> SurfaceFormatKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SwapchainCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -11159,10 +11136,10 @@ impl<'a> SwapchainCreateInfoKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -11176,7 +11153,7 @@ impl<'a> SwapchainCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PresentInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -11254,10 +11231,10 @@ impl<'a> PresentInfoKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -11270,7 +11247,7 @@ impl<'a> PresentInfoKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugReportCallbackCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -11350,7 +11327,7 @@ impl<'a> DebugReportCallbackCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ValidationFlagsEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -11412,7 +11389,7 @@ impl<'a> ValidationFlagsEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ValidationFeaturesEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -11486,7 +11463,7 @@ impl<'a> ValidationFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationStateRasterizationOrderAMD { pub s_type: StructureType, pub p_next: *const c_void, @@ -11548,7 +11525,7 @@ impl<'a> PipelineRasterizationStateRasterizationOrderAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugMarkerObjectNameInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -11614,7 +11591,7 @@ impl<'a> DebugMarkerObjectNameInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugMarkerObjectTagInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -11675,7 +11652,7 @@ impl<'a> DebugMarkerObjectTagInfoEXTBuilder<'a> { self } pub fn tag(mut self, tag: &'a [u8]) -> Self { - self.inner.tag_size = tag.len() as _; + self.inner.tag_size = tag.len(); self.inner.p_tag = tag.as_ptr() as *const c_void; self } @@ -11689,7 +11666,7 @@ impl<'a> DebugMarkerObjectTagInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugMarkerMarkerInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -11749,7 +11726,7 @@ impl<'a> DebugMarkerMarkerInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DedicatedAllocationImageCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -11805,7 +11782,7 @@ impl<'a> DedicatedAllocationImageCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DedicatedAllocationBufferCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -11861,7 +11838,7 @@ impl<'a> DedicatedAllocationBufferCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DedicatedAllocationMemoryAllocateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -11923,7 +11900,7 @@ impl<'a> DedicatedAllocationMemoryAllocateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ExternalImageFormatPropertiesNV { pub image_format_properties: ImageFormatProperties, pub external_memory_features: ExternalMemoryFeatureFlagsNV, @@ -11993,7 +11970,7 @@ impl<'a> ExternalImageFormatPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryImageCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -12049,7 +12026,7 @@ impl<'a> ExternalMemoryImageCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportMemoryAllocateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -12105,7 +12082,7 @@ impl<'a> ExportMemoryAllocateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportMemoryWin32HandleInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -12167,7 +12144,7 @@ impl<'a> ImportMemoryWin32HandleInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportMemoryWin32HandleInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -12229,7 +12206,7 @@ impl<'a> ExportMemoryWin32HandleInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct Win32KeyedMutexAcquireReleaseInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -12271,8 +12248,8 @@ pub struct Win32KeyedMutexAcquireReleaseInfoNVBuilder<'a> { } unsafe impl ExtendsSubmitInfo for Win32KeyedMutexAcquireReleaseInfoNVBuilder<'_> {} unsafe impl ExtendsSubmitInfo for Win32KeyedMutexAcquireReleaseInfoNV {} -unsafe impl ExtendsSubmitInfo2KHR for Win32KeyedMutexAcquireReleaseInfoNVBuilder<'_> {} -unsafe impl ExtendsSubmitInfo2KHR for Win32KeyedMutexAcquireReleaseInfoNV {} +unsafe impl ExtendsSubmitInfo2 for Win32KeyedMutexAcquireReleaseInfoNVBuilder<'_> {} +unsafe impl ExtendsSubmitInfo2 for Win32KeyedMutexAcquireReleaseInfoNV {} impl<'a> ::std::ops::Deref for Win32KeyedMutexAcquireReleaseInfoNVBuilder<'a> { type Target = Win32KeyedMutexAcquireReleaseInfoNV; fn deref(&self) -> &Self::Target { @@ -12320,7 +12297,7 @@ impl<'a> Win32KeyedMutexAcquireReleaseInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -12381,48 +12358,48 @@ impl<'a> PhysicalDeviceDeviceGeneratedCommandsFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct DevicePrivateDataCreateInfoEXT { +#[doc = ""] +pub struct DevicePrivateDataCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, pub private_data_slot_request_count: u32, } -impl ::std::default::Default for DevicePrivateDataCreateInfoEXT { +impl ::std::default::Default for DevicePrivateDataCreateInfo { fn default() -> Self { Self { - s_type: StructureType::DEVICE_PRIVATE_DATA_CREATE_INFO_EXT, + s_type: StructureType::DEVICE_PRIVATE_DATA_CREATE_INFO, p_next: ::std::ptr::null(), private_data_slot_request_count: u32::default(), } } } -impl DevicePrivateDataCreateInfoEXT { - pub fn builder<'a>() -> DevicePrivateDataCreateInfoEXTBuilder<'a> { - DevicePrivateDataCreateInfoEXTBuilder { +impl DevicePrivateDataCreateInfo { + pub fn builder<'a>() -> DevicePrivateDataCreateInfoBuilder<'a> { + DevicePrivateDataCreateInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct DevicePrivateDataCreateInfoEXTBuilder<'a> { - inner: DevicePrivateDataCreateInfoEXT, +pub struct DevicePrivateDataCreateInfoBuilder<'a> { + inner: DevicePrivateDataCreateInfo, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsDeviceCreateInfo for DevicePrivateDataCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for DevicePrivateDataCreateInfoEXT {} -impl<'a> ::std::ops::Deref for DevicePrivateDataCreateInfoEXTBuilder<'a> { - type Target = DevicePrivateDataCreateInfoEXT; +unsafe impl ExtendsDeviceCreateInfo for DevicePrivateDataCreateInfoBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for DevicePrivateDataCreateInfo {} +impl<'a> ::std::ops::Deref for DevicePrivateDataCreateInfoBuilder<'a> { + type Target = DevicePrivateDataCreateInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for DevicePrivateDataCreateInfoEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for DevicePrivateDataCreateInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> DevicePrivateDataCreateInfoEXTBuilder<'a> { +impl<'a> DevicePrivateDataCreateInfoBuilder<'a> { pub fn private_data_slot_request_count(mut self, private_data_slot_request_count: u32) -> Self { self.inner.private_data_slot_request_count = private_data_slot_request_count; self @@ -12430,111 +12407,111 @@ impl<'a> DevicePrivateDataCreateInfoEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> DevicePrivateDataCreateInfoEXT { + pub fn build(self) -> DevicePrivateDataCreateInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PrivateDataSlotCreateInfoEXT { +#[doc = ""] +pub struct PrivateDataSlotCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, - pub flags: PrivateDataSlotCreateFlagsEXT, + pub flags: PrivateDataSlotCreateFlags, } -impl ::std::default::Default for PrivateDataSlotCreateInfoEXT { +impl ::std::default::Default for PrivateDataSlotCreateInfo { fn default() -> Self { Self { - s_type: StructureType::PRIVATE_DATA_SLOT_CREATE_INFO_EXT, + s_type: StructureType::PRIVATE_DATA_SLOT_CREATE_INFO, p_next: ::std::ptr::null(), - flags: PrivateDataSlotCreateFlagsEXT::default(), + flags: PrivateDataSlotCreateFlags::default(), } } } -impl PrivateDataSlotCreateInfoEXT { - pub fn builder<'a>() -> PrivateDataSlotCreateInfoEXTBuilder<'a> { - PrivateDataSlotCreateInfoEXTBuilder { +impl PrivateDataSlotCreateInfo { + pub fn builder<'a>() -> PrivateDataSlotCreateInfoBuilder<'a> { + PrivateDataSlotCreateInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PrivateDataSlotCreateInfoEXTBuilder<'a> { - inner: PrivateDataSlotCreateInfoEXT, +pub struct PrivateDataSlotCreateInfoBuilder<'a> { + inner: PrivateDataSlotCreateInfo, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for PrivateDataSlotCreateInfoEXTBuilder<'a> { - type Target = PrivateDataSlotCreateInfoEXT; +impl<'a> ::std::ops::Deref for PrivateDataSlotCreateInfoBuilder<'a> { + type Target = PrivateDataSlotCreateInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PrivateDataSlotCreateInfoEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PrivateDataSlotCreateInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PrivateDataSlotCreateInfoEXTBuilder<'a> { - pub fn flags(mut self, flags: PrivateDataSlotCreateFlagsEXT) -> Self { +impl<'a> PrivateDataSlotCreateInfoBuilder<'a> { + pub fn flags(mut self, flags: PrivateDataSlotCreateFlags) -> Self { self.inner.flags = flags; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PrivateDataSlotCreateInfoEXT { + pub fn build(self) -> PrivateDataSlotCreateInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDevicePrivateDataFeaturesEXT { +#[doc = ""] +pub struct PhysicalDevicePrivateDataFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub private_data: Bool32, } -impl ::std::default::Default for PhysicalDevicePrivateDataFeaturesEXT { +impl ::std::default::Default for PhysicalDevicePrivateDataFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES, p_next: ::std::ptr::null_mut(), private_data: Bool32::default(), } } } -impl PhysicalDevicePrivateDataFeaturesEXT { - pub fn builder<'a>() -> PhysicalDevicePrivateDataFeaturesEXTBuilder<'a> { - PhysicalDevicePrivateDataFeaturesEXTBuilder { +impl PhysicalDevicePrivateDataFeatures { + pub fn builder<'a>() -> PhysicalDevicePrivateDataFeaturesBuilder<'a> { + PhysicalDevicePrivateDataFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDevicePrivateDataFeaturesEXTBuilder<'a> { - inner: PhysicalDevicePrivateDataFeaturesEXT, +pub struct PhysicalDevicePrivateDataFeaturesBuilder<'a> { + inner: PhysicalDevicePrivateDataFeatures, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDevicePrivateDataFeaturesEXTBuilder<'_> {} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDevicePrivateDataFeaturesEXT {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePrivateDataFeaturesEXTBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePrivateDataFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDevicePrivateDataFeaturesEXTBuilder<'a> { - type Target = PhysicalDevicePrivateDataFeaturesEXT; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDevicePrivateDataFeaturesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDevicePrivateDataFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePrivateDataFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePrivateDataFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDevicePrivateDataFeaturesBuilder<'a> { + type Target = PhysicalDevicePrivateDataFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDevicePrivateDataFeaturesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDevicePrivateDataFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDevicePrivateDataFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDevicePrivateDataFeaturesBuilder<'a> { pub fn private_data(mut self, private_data: bool) -> Self { self.inner.private_data = private_data.into(); self @@ -12542,14 +12519,14 @@ impl<'a> PhysicalDevicePrivateDataFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDevicePrivateDataFeaturesEXT { + pub fn build(self) -> PhysicalDevicePrivateDataFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -12680,7 +12657,7 @@ impl<'a> PhysicalDeviceDeviceGeneratedCommandsPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMultiDrawPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -12736,7 +12713,7 @@ impl<'a> PhysicalDeviceMultiDrawPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GraphicsShaderGroupCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -12811,7 +12788,7 @@ impl<'a> GraphicsShaderGroupCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GraphicsPipelineShaderGroupsCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -12882,7 +12859,7 @@ impl<'a> GraphicsPipelineShaderGroupsCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct BindShaderGroupIndirectCommandNV { pub group_index: u32, } @@ -12925,7 +12902,7 @@ impl<'a> BindShaderGroupIndirectCommandNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct BindIndexBufferIndirectCommandNV { pub buffer_address: DeviceAddress, pub size: u32, @@ -12978,7 +12955,7 @@ impl<'a> BindIndexBufferIndirectCommandNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct BindVertexBufferIndirectCommandNV { pub buffer_address: DeviceAddress, pub size: u32, @@ -13031,7 +13008,7 @@ impl<'a> BindVertexBufferIndirectCommandNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SetStateFlagsIndirectCommandNV { pub data: u32, } @@ -13074,7 +13051,7 @@ impl<'a> SetStateFlagsIndirectCommandNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct IndirectCommandsStreamNV { pub buffer: Buffer, pub offset: DeviceSize, @@ -13122,7 +13099,7 @@ impl<'a> IndirectCommandsStreamNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct IndirectCommandsLayoutTokenNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -13252,7 +13229,7 @@ impl<'a> IndirectCommandsLayoutTokenNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct IndirectCommandsLayoutCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -13330,7 +13307,7 @@ impl<'a> IndirectCommandsLayoutCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GeneratedCommandsInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -13456,7 +13433,7 @@ impl<'a> GeneratedCommandsInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GeneratedCommandsMemoryRequirementsInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -13531,7 +13508,7 @@ impl<'a> GeneratedCommandsMemoryRequirementsInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFeatures2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13585,10 +13562,10 @@ impl<'a> PhysicalDeviceFeatures2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -13602,7 +13579,7 @@ impl<'a> PhysicalDeviceFeatures2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceProperties2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13654,10 +13631,10 @@ impl<'a> PhysicalDeviceProperties2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -13671,7 +13648,7 @@ impl<'a> PhysicalDeviceProperties2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FormatProperties2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13723,10 +13700,10 @@ impl<'a> FormatProperties2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -13740,7 +13717,7 @@ impl<'a> FormatProperties2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageFormatProperties2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13795,10 +13772,10 @@ impl<'a> ImageFormatProperties2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -13812,7 +13789,7 @@ impl<'a> ImageFormatProperties2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceImageFormatInfo2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -13888,10 +13865,10 @@ impl<'a> PhysicalDeviceImageFormatInfo2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -13905,7 +13882,7 @@ impl<'a> PhysicalDeviceImageFormatInfo2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct QueueFamilyProperties2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -13960,10 +13937,10 @@ impl<'a> QueueFamilyProperties2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -13977,7 +13954,7 @@ impl<'a> QueueFamilyProperties2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMemoryProperties2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14029,10 +14006,10 @@ impl<'a> PhysicalDeviceMemoryProperties2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -14046,7 +14023,7 @@ impl<'a> PhysicalDeviceMemoryProperties2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SparseImageFormatProperties2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14100,7 +14077,7 @@ impl<'a> SparseImageFormatProperties2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSparseImageFormatInfo2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -14178,7 +14155,7 @@ impl<'a> PhysicalDeviceSparseImageFormatInfo2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePushDescriptorPropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14237,7 +14214,7 @@ impl<'a> PhysicalDevicePushDescriptorPropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ConformanceVersion { pub major: u8, pub minor: u8, @@ -14294,7 +14271,7 @@ impl<'a> ConformanceVersionBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDriverProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14311,10 +14288,10 @@ impl fmt::Debug for PhysicalDeviceDriverProperties { .field("p_next", &self.p_next) .field("driver_id", &self.driver_id) .field("driver_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.driver_name.as_ptr()) }) .field("driver_info", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_info.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.driver_info.as_ptr()) }) .field("conformance_version", &self.conformance_version) .finish() @@ -14385,7 +14362,7 @@ impl<'a> PhysicalDeviceDriverPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PresentRegionsKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -14444,7 +14421,7 @@ impl<'a> PresentRegionsKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PresentRegionKHR { pub rectangle_count: u32, pub p_rectangles: *const RectLayerKHR, @@ -14497,7 +14474,7 @@ impl<'a> PresentRegionKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct RectLayerKHR { pub offset: Offset2D, pub extent: Extent2D, @@ -14550,7 +14527,7 @@ impl<'a> RectLayerKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVariablePointersFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14617,7 +14594,7 @@ impl<'a> PhysicalDeviceVariablePointersFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryProperties { pub external_memory_features: ExternalMemoryFeatureFlags, pub export_from_imported_handle_types: ExternalMemoryHandleTypeFlags, @@ -14679,7 +14656,7 @@ impl<'a> ExternalMemoryPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExternalImageFormatInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -14738,7 +14715,7 @@ impl<'a> PhysicalDeviceExternalImageFormatInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalImageFormatProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14797,7 +14774,7 @@ impl<'a> ExternalImageFormatPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExternalBufferInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -14863,7 +14840,7 @@ impl<'a> PhysicalDeviceExternalBufferInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalBufferProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -14920,7 +14897,7 @@ impl<'a> ExternalBufferPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceIDProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15000,7 +14977,7 @@ impl<'a> PhysicalDeviceIDPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryImageCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -15056,7 +15033,7 @@ impl<'a> ExternalMemoryImageCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalMemoryBufferCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -15112,7 +15089,7 @@ impl<'a> ExternalMemoryBufferCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportMemoryAllocateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -15168,7 +15145,7 @@ impl<'a> ExportMemoryAllocateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportMemoryWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -15236,7 +15213,7 @@ impl<'a> ImportMemoryWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportMemoryWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -15304,7 +15281,7 @@ impl<'a> ExportMemoryWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportMemoryZirconHandleInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -15366,7 +15343,7 @@ impl<'a> ImportMemoryZirconHandleInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryZirconHandlePropertiesFUCHSIA { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15420,7 +15397,7 @@ impl<'a> MemoryZirconHandlePropertiesFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryGetZirconHandleInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -15480,7 +15457,7 @@ impl<'a> MemoryGetZirconHandleInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryWin32HandlePropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15534,7 +15511,7 @@ impl<'a> MemoryWin32HandlePropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryGetWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -15594,7 +15571,7 @@ impl<'a> MemoryGetWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportMemoryFdInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -15656,7 +15633,7 @@ impl<'a> ImportMemoryFdInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryFdPropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -15710,7 +15687,7 @@ impl<'a> MemoryFdPropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryGetFdInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -15770,7 +15747,7 @@ impl<'a> MemoryGetFdInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct Win32KeyedMutexAcquireReleaseInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -15812,8 +15789,8 @@ pub struct Win32KeyedMutexAcquireReleaseInfoKHRBuilder<'a> { } unsafe impl ExtendsSubmitInfo for Win32KeyedMutexAcquireReleaseInfoKHRBuilder<'_> {} unsafe impl ExtendsSubmitInfo for Win32KeyedMutexAcquireReleaseInfoKHR {} -unsafe impl ExtendsSubmitInfo2KHR for Win32KeyedMutexAcquireReleaseInfoKHRBuilder<'_> {} -unsafe impl ExtendsSubmitInfo2KHR for Win32KeyedMutexAcquireReleaseInfoKHR {} +unsafe impl ExtendsSubmitInfo2 for Win32KeyedMutexAcquireReleaseInfoKHRBuilder<'_> {} +unsafe impl ExtendsSubmitInfo2 for Win32KeyedMutexAcquireReleaseInfoKHR {} impl<'a> ::std::ops::Deref for Win32KeyedMutexAcquireReleaseInfoKHRBuilder<'a> { type Target = Win32KeyedMutexAcquireReleaseInfoKHR; fn deref(&self) -> &Self::Target { @@ -15861,7 +15838,7 @@ impl<'a> Win32KeyedMutexAcquireReleaseInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExternalSemaphoreInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -15916,10 +15893,10 @@ impl<'a> PhysicalDeviceExternalSemaphoreInfoBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -15933,7 +15910,7 @@ impl<'a> PhysicalDeviceExternalSemaphoreInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalSemaphoreProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16008,7 +15985,7 @@ impl<'a> ExternalSemaphorePropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportSemaphoreCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -16064,7 +16041,7 @@ impl<'a> ExportSemaphoreCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportSemaphoreWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16142,7 +16119,7 @@ impl<'a> ImportSemaphoreWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportSemaphoreWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16210,7 +16187,7 @@ impl<'a> ExportSemaphoreWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct D3D12FenceSubmitInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16278,7 +16255,7 @@ impl<'a> D3D12FenceSubmitInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreGetWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16338,7 +16315,7 @@ impl<'a> SemaphoreGetWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportSemaphoreFdInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16410,7 +16387,7 @@ impl<'a> ImportSemaphoreFdInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreGetFdInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16470,7 +16447,7 @@ impl<'a> SemaphoreGetFdInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportSemaphoreZirconHandleInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -16542,7 +16519,7 @@ impl<'a> ImportSemaphoreZirconHandleInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreGetZirconHandleInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -16602,7 +16579,7 @@ impl<'a> SemaphoreGetZirconHandleInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExternalFenceInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -16656,7 +16633,7 @@ impl<'a> PhysicalDeviceExternalFenceInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalFenceProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -16731,7 +16708,7 @@ impl<'a> ExternalFencePropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportFenceCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -16787,7 +16764,7 @@ impl<'a> ExportFenceCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportFenceWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16865,7 +16842,7 @@ impl<'a> ImportFenceWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExportFenceWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16933,7 +16910,7 @@ impl<'a> ExportFenceWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FenceGetWin32HandleInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -16993,7 +16970,7 @@ impl<'a> FenceGetWin32HandleInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportFenceFdInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -17065,7 +17042,7 @@ impl<'a> ImportFenceFdInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FenceGetFdInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -17125,7 +17102,7 @@ impl<'a> FenceGetFdInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMultiviewFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17195,7 +17172,7 @@ impl<'a> PhysicalDeviceMultiviewFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMultiviewProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17257,7 +17234,7 @@ impl<'a> PhysicalDeviceMultiviewPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassMultiviewCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -17334,7 +17311,7 @@ impl<'a> RenderPassMultiviewCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SurfaceCapabilities2EXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17454,7 +17431,7 @@ impl<'a> SurfaceCapabilities2EXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayPowerInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -17508,7 +17485,7 @@ impl<'a> DisplayPowerInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceEventInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -17562,7 +17539,7 @@ impl<'a> DeviceEventInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayEventInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -17616,7 +17593,7 @@ impl<'a> DisplayEventInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SwapchainCounterCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -17672,7 +17649,7 @@ impl<'a> SwapchainCounterCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceGroupProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -17741,7 +17718,7 @@ impl<'a> PhysicalDeviceGroupPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryAllocateFlagsInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -17803,7 +17780,7 @@ impl<'a> MemoryAllocateFlagsInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindBufferMemoryInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -17867,10 +17844,10 @@ impl<'a> BindBufferMemoryInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -17884,7 +17861,7 @@ impl<'a> BindBufferMemoryInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindBufferMemoryDeviceGroupInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -17943,7 +17920,7 @@ impl<'a> BindBufferMemoryDeviceGroupInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindImageMemoryInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18007,10 +17984,10 @@ impl<'a> BindImageMemoryInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -18024,7 +18001,7 @@ impl<'a> BindImageMemoryInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindImageMemoryDeviceGroupInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18095,7 +18072,7 @@ impl<'a> BindImageMemoryDeviceGroupInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupRenderPassBeginInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18129,8 +18106,8 @@ pub struct DeviceGroupRenderPassBeginInfoBuilder<'a> { } unsafe impl ExtendsRenderPassBeginInfo for DeviceGroupRenderPassBeginInfoBuilder<'_> {} unsafe impl ExtendsRenderPassBeginInfo for DeviceGroupRenderPassBeginInfo {} -unsafe impl ExtendsRenderingInfoKHR for DeviceGroupRenderPassBeginInfoBuilder<'_> {} -unsafe impl ExtendsRenderingInfoKHR for DeviceGroupRenderPassBeginInfo {} +unsafe impl ExtendsRenderingInfo for DeviceGroupRenderPassBeginInfoBuilder<'_> {} +unsafe impl ExtendsRenderingInfo for DeviceGroupRenderPassBeginInfo {} impl<'a> ::std::ops::Deref for DeviceGroupRenderPassBeginInfoBuilder<'a> { type Target = DeviceGroupRenderPassBeginInfo; fn deref(&self) -> &Self::Target { @@ -18162,7 +18139,7 @@ impl<'a> DeviceGroupRenderPassBeginInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupCommandBufferBeginInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18218,7 +18195,7 @@ impl<'a> DeviceGroupCommandBufferBeginInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupSubmitInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18301,7 +18278,7 @@ impl<'a> DeviceGroupSubmitInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupBindSparseInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18363,7 +18340,7 @@ impl<'a> DeviceGroupBindSparseInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupPresentCapabilitiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -18423,7 +18400,7 @@ impl<'a> DeviceGroupPresentCapabilitiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageSwapchainCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -18479,7 +18456,7 @@ impl<'a> ImageSwapchainCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindImageMemorySwapchainInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -18541,7 +18518,7 @@ impl<'a> BindImageMemorySwapchainInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AcquireNextImageInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -18619,7 +18596,7 @@ impl<'a> AcquireNextImageInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupPresentInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -18684,7 +18661,7 @@ impl<'a> DeviceGroupPresentInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupDeviceCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18743,7 +18720,7 @@ impl<'a> DeviceGroupDeviceCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceGroupSwapchainCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -18799,7 +18776,7 @@ impl<'a> DeviceGroupSwapchainCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DescriptorUpdateTemplateEntry { pub dst_binding: u32, pub dst_array_element: u32, @@ -18867,7 +18844,7 @@ impl<'a> DescriptorUpdateTemplateEntryBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorUpdateTemplateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -18963,7 +18940,7 @@ impl<'a> DescriptorUpdateTemplateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct XYColorEXT { pub x: f32, pub y: f32, @@ -19011,7 +18988,7 @@ impl<'a> XYColorEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePresentIdFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19069,7 +19046,7 @@ impl<'a> PhysicalDevicePresentIdFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PresentIdKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -19128,7 +19105,7 @@ impl<'a> PresentIdKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePresentWaitFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19186,7 +19163,7 @@ impl<'a> PhysicalDevicePresentWaitFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct HdrMetadataEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -19282,7 +19259,7 @@ impl<'a> HdrMetadataEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayNativeHdrSurfaceCapabilitiesAMD { pub s_type: StructureType, pub p_next: *mut c_void, @@ -19338,7 +19315,7 @@ impl<'a> DisplayNativeHdrSurfaceCapabilitiesAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SwapchainDisplayNativeHdrCreateInfoAMD { pub s_type: StructureType, pub p_next: *const c_void, @@ -19394,7 +19371,7 @@ impl<'a> SwapchainDisplayNativeHdrCreateInfoAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct RefreshCycleDurationGOOGLE { pub refresh_duration: u64, } @@ -19437,7 +19414,7 @@ impl<'a> RefreshCycleDurationGOOGLEBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct PastPresentationTimingGOOGLE { pub present_id: u32, pub desired_present_time: u64, @@ -19500,7 +19477,7 @@ impl<'a> PastPresentationTimingGOOGLEBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PresentTimesInfoGOOGLE { pub s_type: StructureType, pub p_next: *const c_void, @@ -19559,7 +19536,7 @@ impl<'a> PresentTimesInfoGOOGLEBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct PresentTimeGOOGLE { pub present_id: u32, pub desired_present_time: u64, @@ -19607,7 +19584,7 @@ impl<'a> PresentTimeGOOGLEBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct IOSSurfaceCreateInfoMVK { pub s_type: StructureType, pub p_next: *const c_void, @@ -19667,7 +19644,7 @@ impl<'a> IOSSurfaceCreateInfoMVKBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MacOSSurfaceCreateInfoMVK { pub s_type: StructureType, pub p_next: *const c_void, @@ -19727,7 +19704,7 @@ impl<'a> MacOSSurfaceCreateInfoMVKBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MetalSurfaceCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -19787,7 +19764,7 @@ impl<'a> MetalSurfaceCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ViewportWScalingNV { pub xcoeff: f32, pub ycoeff: f32, @@ -19835,7 +19812,7 @@ impl<'a> ViewportWScalingNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportWScalingStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -19903,7 +19880,7 @@ impl<'a> PipelineViewportWScalingStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ViewportSwizzleNV { pub x: ViewportCoordinateSwizzleNV, pub y: ViewportCoordinateSwizzleNV, @@ -19961,7 +19938,7 @@ impl<'a> ViewportSwizzleNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportSwizzleStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -20029,7 +20006,7 @@ impl<'a> PipelineViewportSwizzleStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDiscardRectanglePropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20088,7 +20065,7 @@ impl<'a> PhysicalDeviceDiscardRectanglePropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineDiscardRectangleStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -20165,7 +20142,7 @@ impl<'a> PipelineDiscardRectangleStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20230,7 +20207,7 @@ impl<'a> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct InputAttachmentAspectReference { pub subpass: u32, pub input_attachment_index: u32, @@ -20283,7 +20260,7 @@ impl<'a> InputAttachmentAspectReferenceBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassInputAttachmentAspectCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -20345,7 +20322,7 @@ impl<'a> RenderPassInputAttachmentAspectCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSurfaceInfo2KHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -20397,10 +20374,10 @@ impl<'a> PhysicalDeviceSurfaceInfo2KHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -20414,7 +20391,7 @@ impl<'a> PhysicalDeviceSurfaceInfo2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SurfaceCapabilities2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20466,10 +20443,10 @@ impl<'a> SurfaceCapabilities2KHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -20483,7 +20460,7 @@ impl<'a> SurfaceCapabilities2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SurfaceFormat2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20537,7 +20514,7 @@ impl<'a> SurfaceFormat2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayProperties2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20591,7 +20568,7 @@ impl<'a> DisplayProperties2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayPlaneProperties2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20648,7 +20625,7 @@ impl<'a> DisplayPlaneProperties2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayModeProperties2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20705,7 +20682,7 @@ impl<'a> DisplayModeProperties2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayPlaneInfo2KHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -20765,7 +20742,7 @@ impl<'a> DisplayPlaneInfo2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DisplayPlaneCapabilities2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20819,7 +20796,7 @@ impl<'a> DisplayPlaneCapabilities2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SharedPresentSurfaceCapabilitiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20878,7 +20855,7 @@ impl<'a> SharedPresentSurfaceCapabilitiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevice16BitStorageFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -20958,7 +20935,7 @@ impl<'a> PhysicalDevice16BitStorageFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSubgroupProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21032,7 +21009,7 @@ impl<'a> PhysicalDeviceSubgroupPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21096,7 +21073,7 @@ impl<'a> PhysicalDeviceShaderSubgroupExtendedTypesFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferMemoryRequirementsInfo2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -21150,46 +21127,46 @@ impl<'a> BufferMemoryRequirementsInfo2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct DeviceBufferMemoryRequirementsKHR { +#[doc = ""] +pub struct DeviceBufferMemoryRequirements { pub s_type: StructureType, pub p_next: *const c_void, pub p_create_info: *const BufferCreateInfo, } -impl ::std::default::Default for DeviceBufferMemoryRequirementsKHR { +impl ::std::default::Default for DeviceBufferMemoryRequirements { fn default() -> Self { Self { - s_type: StructureType::DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR, + s_type: StructureType::DEVICE_BUFFER_MEMORY_REQUIREMENTS, p_next: ::std::ptr::null(), p_create_info: ::std::ptr::null(), } } } -impl DeviceBufferMemoryRequirementsKHR { - pub fn builder<'a>() -> DeviceBufferMemoryRequirementsKHRBuilder<'a> { - DeviceBufferMemoryRequirementsKHRBuilder { +impl DeviceBufferMemoryRequirements { + pub fn builder<'a>() -> DeviceBufferMemoryRequirementsBuilder<'a> { + DeviceBufferMemoryRequirementsBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct DeviceBufferMemoryRequirementsKHRBuilder<'a> { - inner: DeviceBufferMemoryRequirementsKHR, +pub struct DeviceBufferMemoryRequirementsBuilder<'a> { + inner: DeviceBufferMemoryRequirements, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for DeviceBufferMemoryRequirementsKHRBuilder<'a> { - type Target = DeviceBufferMemoryRequirementsKHR; +impl<'a> ::std::ops::Deref for DeviceBufferMemoryRequirementsBuilder<'a> { + type Target = DeviceBufferMemoryRequirements; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for DeviceBufferMemoryRequirementsKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for DeviceBufferMemoryRequirementsBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> DeviceBufferMemoryRequirementsKHRBuilder<'a> { +impl<'a> DeviceBufferMemoryRequirementsBuilder<'a> { pub fn create_info(mut self, create_info: &'a BufferCreateInfo) -> Self { self.inner.p_create_info = create_info; self @@ -21197,14 +21174,14 @@ impl<'a> DeviceBufferMemoryRequirementsKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> DeviceBufferMemoryRequirementsKHR { + pub fn build(self) -> DeviceBufferMemoryRequirements { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageMemoryRequirementsInfo2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -21256,10 +21233,10 @@ impl<'a> ImageMemoryRequirementsInfo2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -21273,7 +21250,7 @@ impl<'a> ImageMemoryRequirementsInfo2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageSparseMemoryRequirementsInfo2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -21327,48 +21304,48 @@ impl<'a> ImageSparseMemoryRequirementsInfo2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct DeviceImageMemoryRequirementsKHR { +#[doc = ""] +pub struct DeviceImageMemoryRequirements { pub s_type: StructureType, pub p_next: *const c_void, pub p_create_info: *const ImageCreateInfo, pub plane_aspect: ImageAspectFlags, } -impl ::std::default::Default for DeviceImageMemoryRequirementsKHR { +impl ::std::default::Default for DeviceImageMemoryRequirements { fn default() -> Self { Self { - s_type: StructureType::DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR, + s_type: StructureType::DEVICE_IMAGE_MEMORY_REQUIREMENTS, p_next: ::std::ptr::null(), p_create_info: ::std::ptr::null(), plane_aspect: ImageAspectFlags::default(), } } } -impl DeviceImageMemoryRequirementsKHR { - pub fn builder<'a>() -> DeviceImageMemoryRequirementsKHRBuilder<'a> { - DeviceImageMemoryRequirementsKHRBuilder { +impl DeviceImageMemoryRequirements { + pub fn builder<'a>() -> DeviceImageMemoryRequirementsBuilder<'a> { + DeviceImageMemoryRequirementsBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct DeviceImageMemoryRequirementsKHRBuilder<'a> { - inner: DeviceImageMemoryRequirementsKHR, +pub struct DeviceImageMemoryRequirementsBuilder<'a> { + inner: DeviceImageMemoryRequirements, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for DeviceImageMemoryRequirementsKHRBuilder<'a> { - type Target = DeviceImageMemoryRequirementsKHR; +impl<'a> ::std::ops::Deref for DeviceImageMemoryRequirementsBuilder<'a> { + type Target = DeviceImageMemoryRequirements; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for DeviceImageMemoryRequirementsKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for DeviceImageMemoryRequirementsBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> DeviceImageMemoryRequirementsKHRBuilder<'a> { +impl<'a> DeviceImageMemoryRequirementsBuilder<'a> { pub fn create_info(mut self, create_info: &'a ImageCreateInfo) -> Self { self.inner.p_create_info = create_info; self @@ -21380,14 +21357,14 @@ impl<'a> DeviceImageMemoryRequirementsKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> DeviceImageMemoryRequirementsKHR { + pub fn build(self) -> DeviceImageMemoryRequirements { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryRequirements2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21439,10 +21416,10 @@ impl<'a> MemoryRequirements2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -21456,7 +21433,7 @@ impl<'a> MemoryRequirements2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SparseImageMemoryRequirements2 { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21513,7 +21490,7 @@ impl<'a> SparseImageMemoryRequirements2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePointClippingProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21572,7 +21549,7 @@ impl<'a> PhysicalDevicePointClippingPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryDedicatedRequirements { pub s_type: StructureType, pub p_next: *mut c_void, @@ -21634,7 +21611,7 @@ impl<'a> MemoryDedicatedRequirementsBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryDedicatedAllocateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -21696,7 +21673,7 @@ impl<'a> MemoryDedicatedAllocateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageViewUsageCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -21752,7 +21729,7 @@ impl<'a> ImageViewUsageCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineTessellationDomainOriginStateCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -21814,7 +21791,7 @@ impl<'a> PipelineTessellationDomainOriginStateCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SamplerYcbcrConversionInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -21872,7 +21849,7 @@ impl<'a> SamplerYcbcrConversionInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SamplerYcbcrConversionCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -21969,10 +21946,10 @@ impl<'a> SamplerYcbcrConversionCreateInfoBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -21986,7 +21963,7 @@ impl<'a> SamplerYcbcrConversionCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindImagePlaneMemoryInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -22042,7 +22019,7 @@ impl<'a> BindImagePlaneMemoryInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImagePlaneMemoryRequirementsInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -22098,7 +22075,7 @@ impl<'a> ImagePlaneMemoryRequirementsInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSamplerYcbcrConversionFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22159,7 +22136,7 @@ impl<'a> PhysicalDeviceSamplerYcbcrConversionFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SamplerYcbcrConversionImageFormatProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22222,7 +22199,7 @@ impl<'a> SamplerYcbcrConversionImageFormatPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct TextureLODGatherFormatPropertiesAMD { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22282,7 +22259,7 @@ impl<'a> TextureLODGatherFormatPropertiesAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ConditionalRenderingBeginInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -22348,7 +22325,7 @@ impl<'a> ConditionalRenderingBeginInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ProtectedSubmitInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -22404,7 +22381,7 @@ impl<'a> ProtectedSubmitInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceProtectedMemoryFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22462,7 +22439,7 @@ impl<'a> PhysicalDeviceProtectedMemoryFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceProtectedMemoryProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22521,7 +22498,7 @@ impl<'a> PhysicalDeviceProtectedMemoryPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceQueueInfo2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -22587,7 +22564,7 @@ impl<'a> DeviceQueueInfo2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineCoverageToColorStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -22658,7 +22635,7 @@ impl<'a> PipelineCoverageToColorStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSamplerFilterMinmaxProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -22731,7 +22708,7 @@ impl<'a> PhysicalDeviceSamplerFilterMinmaxPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SampleLocationEXT { pub x: f32, pub y: f32, @@ -22779,7 +22756,7 @@ impl<'a> SampleLocationEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SampleLocationsInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -22815,8 +22792,8 @@ pub struct SampleLocationsInfoEXTBuilder<'a> { } unsafe impl ExtendsImageMemoryBarrier for SampleLocationsInfoEXTBuilder<'_> {} unsafe impl ExtendsImageMemoryBarrier for SampleLocationsInfoEXT {} -unsafe impl ExtendsImageMemoryBarrier2KHR for SampleLocationsInfoEXTBuilder<'_> {} -unsafe impl ExtendsImageMemoryBarrier2KHR for SampleLocationsInfoEXT {} +unsafe impl ExtendsImageMemoryBarrier2 for SampleLocationsInfoEXTBuilder<'_> {} +unsafe impl ExtendsImageMemoryBarrier2 for SampleLocationsInfoEXT {} impl<'a> ::std::ops::Deref for SampleLocationsInfoEXTBuilder<'a> { type Target = SampleLocationsInfoEXT; fn deref(&self) -> &Self::Target { @@ -22855,7 +22832,7 @@ impl<'a> SampleLocationsInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct AttachmentSampleLocationsEXT { pub attachment_index: u32, pub sample_locations_info: SampleLocationsInfoEXT, @@ -22903,7 +22880,7 @@ impl<'a> AttachmentSampleLocationsEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SubpassSampleLocationsEXT { pub subpass_index: u32, pub sample_locations_info: SampleLocationsInfoEXT, @@ -22951,7 +22928,7 @@ impl<'a> SubpassSampleLocationsEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassSampleLocationsBeginInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -23027,7 +23004,7 @@ impl<'a> RenderPassSampleLocationsBeginInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineSampleLocationsStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -23095,7 +23072,7 @@ impl<'a> PipelineSampleLocationsStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSampleLocationsPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23187,7 +23164,7 @@ impl<'a> PhysicalDeviceSampleLocationsPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MultisamplePropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23244,7 +23221,7 @@ impl<'a> MultisamplePropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SamplerReductionModeCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -23300,7 +23277,7 @@ impl<'a> SamplerReductionModeCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23364,7 +23341,7 @@ impl<'a> PhysicalDeviceBlendOperationAdvancedFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMultiDrawFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23422,7 +23399,7 @@ impl<'a> PhysicalDeviceMultiDrawFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -23528,7 +23505,7 @@ impl<'a> PhysicalDeviceBlendOperationAdvancedPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineColorBlendAdvancedStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -23602,55 +23579,52 @@ impl<'a> PipelineColorBlendAdvancedStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceInlineUniformBlockFeaturesEXT { +#[doc = ""] +pub struct PhysicalDeviceInlineUniformBlockFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub inline_uniform_block: Bool32, pub descriptor_binding_inline_uniform_block_update_after_bind: Bool32, } -impl ::std::default::Default for PhysicalDeviceInlineUniformBlockFeaturesEXT { +impl ::std::default::Default for PhysicalDeviceInlineUniformBlockFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES, p_next: ::std::ptr::null_mut(), inline_uniform_block: Bool32::default(), descriptor_binding_inline_uniform_block_update_after_bind: Bool32::default(), } } } -impl PhysicalDeviceInlineUniformBlockFeaturesEXT { - pub fn builder<'a>() -> PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'a> { - PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder { +impl PhysicalDeviceInlineUniformBlockFeatures { + pub fn builder<'a>() -> PhysicalDeviceInlineUniformBlockFeaturesBuilder<'a> { + PhysicalDeviceInlineUniformBlockFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'a> { - inner: PhysicalDeviceInlineUniformBlockFeaturesEXT, +pub struct PhysicalDeviceInlineUniformBlockFeaturesBuilder<'a> { + inner: PhysicalDeviceInlineUniformBlockFeatures, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceInlineUniformBlockFeaturesEXT {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceInlineUniformBlockFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'a> { - type Target = PhysicalDeviceInlineUniformBlockFeaturesEXT; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceInlineUniformBlockFeaturesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceInlineUniformBlockFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceInlineUniformBlockFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceInlineUniformBlockFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceInlineUniformBlockFeaturesBuilder<'a> { + type Target = PhysicalDeviceInlineUniformBlockFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceInlineUniformBlockFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDeviceInlineUniformBlockFeaturesBuilder<'a> { pub fn inline_uniform_block(mut self, inline_uniform_block: bool) -> Self { self.inner.inline_uniform_block = inline_uniform_block.into(); self @@ -23667,15 +23641,15 @@ impl<'a> PhysicalDeviceInlineUniformBlockFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceInlineUniformBlockFeaturesEXT { + pub fn build(self) -> PhysicalDeviceInlineUniformBlockFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceInlineUniformBlockPropertiesEXT { +#[doc = ""] +pub struct PhysicalDeviceInlineUniformBlockProperties { pub s_type: StructureType, pub p_next: *mut c_void, pub max_inline_uniform_block_size: u32, @@ -23684,10 +23658,10 @@ pub struct PhysicalDeviceInlineUniformBlockPropertiesEXT { pub max_descriptor_set_inline_uniform_blocks: u32, pub max_descriptor_set_update_after_bind_inline_uniform_blocks: u32, } -impl ::std::default::Default for PhysicalDeviceInlineUniformBlockPropertiesEXT { +impl ::std::default::Default for PhysicalDeviceInlineUniformBlockProperties { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES, p_next: ::std::ptr::null_mut(), max_inline_uniform_block_size: u32::default(), max_per_stage_descriptor_inline_uniform_blocks: u32::default(), @@ -23697,36 +23671,36 @@ impl ::std::default::Default for PhysicalDeviceInlineUniformBlockPropertiesEXT { } } } -impl PhysicalDeviceInlineUniformBlockPropertiesEXT { - pub fn builder<'a>() -> PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder<'a> { - PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder { +impl PhysicalDeviceInlineUniformBlockProperties { + pub fn builder<'a>() -> PhysicalDeviceInlineUniformBlockPropertiesBuilder<'a> { + PhysicalDeviceInlineUniformBlockPropertiesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder<'a> { - inner: PhysicalDeviceInlineUniformBlockPropertiesEXT, +pub struct PhysicalDeviceInlineUniformBlockPropertiesBuilder<'a> { + inner: PhysicalDeviceInlineUniformBlockProperties, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceProperties2 - for PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder<'_> + for PhysicalDeviceInlineUniformBlockPropertiesBuilder<'_> { } -unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceInlineUniformBlockPropertiesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder<'a> { - type Target = PhysicalDeviceInlineUniformBlockPropertiesEXT; +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceInlineUniformBlockProperties {} +impl<'a> ::std::ops::Deref for PhysicalDeviceInlineUniformBlockPropertiesBuilder<'a> { + type Target = PhysicalDeviceInlineUniformBlockProperties; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceInlineUniformBlockPropertiesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder<'a> { +impl<'a> PhysicalDeviceInlineUniformBlockPropertiesBuilder<'a> { pub fn max_inline_uniform_block_size(mut self, max_inline_uniform_block_size: u32) -> Self { self.inner.max_inline_uniform_block_size = max_inline_uniform_block_size; self @@ -23768,57 +23742,57 @@ impl<'a> PhysicalDeviceInlineUniformBlockPropertiesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceInlineUniformBlockPropertiesEXT { + pub fn build(self) -> PhysicalDeviceInlineUniformBlockProperties { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct WriteDescriptorSetInlineUniformBlockEXT { +#[doc = ""] +pub struct WriteDescriptorSetInlineUniformBlock { pub s_type: StructureType, pub p_next: *const c_void, pub data_size: u32, pub p_data: *const c_void, } -impl ::std::default::Default for WriteDescriptorSetInlineUniformBlockEXT { +impl ::std::default::Default for WriteDescriptorSetInlineUniformBlock { fn default() -> Self { Self { - s_type: StructureType::WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT, + s_type: StructureType::WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK, p_next: ::std::ptr::null(), data_size: u32::default(), p_data: ::std::ptr::null(), } } } -impl WriteDescriptorSetInlineUniformBlockEXT { - pub fn builder<'a>() -> WriteDescriptorSetInlineUniformBlockEXTBuilder<'a> { - WriteDescriptorSetInlineUniformBlockEXTBuilder { +impl WriteDescriptorSetInlineUniformBlock { + pub fn builder<'a>() -> WriteDescriptorSetInlineUniformBlockBuilder<'a> { + WriteDescriptorSetInlineUniformBlockBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct WriteDescriptorSetInlineUniformBlockEXTBuilder<'a> { - inner: WriteDescriptorSetInlineUniformBlockEXT, +pub struct WriteDescriptorSetInlineUniformBlockBuilder<'a> { + inner: WriteDescriptorSetInlineUniformBlock, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsWriteDescriptorSet for WriteDescriptorSetInlineUniformBlockEXTBuilder<'_> {} -unsafe impl ExtendsWriteDescriptorSet for WriteDescriptorSetInlineUniformBlockEXT {} -impl<'a> ::std::ops::Deref for WriteDescriptorSetInlineUniformBlockEXTBuilder<'a> { - type Target = WriteDescriptorSetInlineUniformBlockEXT; +unsafe impl ExtendsWriteDescriptorSet for WriteDescriptorSetInlineUniformBlockBuilder<'_> {} +unsafe impl ExtendsWriteDescriptorSet for WriteDescriptorSetInlineUniformBlock {} +impl<'a> ::std::ops::Deref for WriteDescriptorSetInlineUniformBlockBuilder<'a> { + type Target = WriteDescriptorSetInlineUniformBlock; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for WriteDescriptorSetInlineUniformBlockEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for WriteDescriptorSetInlineUniformBlockBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> WriteDescriptorSetInlineUniformBlockEXTBuilder<'a> { +impl<'a> WriteDescriptorSetInlineUniformBlockBuilder<'a> { pub fn data(mut self, data: &'a [u8]) -> Self { self.inner.data_size = data.len() as _; self.inner.p_data = data.as_ptr() as *const c_void; @@ -23827,58 +23801,58 @@ impl<'a> WriteDescriptorSetInlineUniformBlockEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> WriteDescriptorSetInlineUniformBlockEXT { + pub fn build(self) -> WriteDescriptorSetInlineUniformBlock { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct DescriptorPoolInlineUniformBlockCreateInfoEXT { +#[doc = ""] +pub struct DescriptorPoolInlineUniformBlockCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, pub max_inline_uniform_block_bindings: u32, } -impl ::std::default::Default for DescriptorPoolInlineUniformBlockCreateInfoEXT { +impl ::std::default::Default for DescriptorPoolInlineUniformBlockCreateInfo { fn default() -> Self { Self { - s_type: StructureType::DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT, + s_type: StructureType::DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO, p_next: ::std::ptr::null(), max_inline_uniform_block_bindings: u32::default(), } } } -impl DescriptorPoolInlineUniformBlockCreateInfoEXT { - pub fn builder<'a>() -> DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder<'a> { - DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder { +impl DescriptorPoolInlineUniformBlockCreateInfo { + pub fn builder<'a>() -> DescriptorPoolInlineUniformBlockCreateInfoBuilder<'a> { + DescriptorPoolInlineUniformBlockCreateInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder<'a> { - inner: DescriptorPoolInlineUniformBlockCreateInfoEXT, +pub struct DescriptorPoolInlineUniformBlockCreateInfoBuilder<'a> { + inner: DescriptorPoolInlineUniformBlockCreateInfo, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsDescriptorPoolCreateInfo - for DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder<'_> + for DescriptorPoolInlineUniformBlockCreateInfoBuilder<'_> { } -unsafe impl ExtendsDescriptorPoolCreateInfo for DescriptorPoolInlineUniformBlockCreateInfoEXT {} -impl<'a> ::std::ops::Deref for DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder<'a> { - type Target = DescriptorPoolInlineUniformBlockCreateInfoEXT; +unsafe impl ExtendsDescriptorPoolCreateInfo for DescriptorPoolInlineUniformBlockCreateInfo {} +impl<'a> ::std::ops::Deref for DescriptorPoolInlineUniformBlockCreateInfoBuilder<'a> { + type Target = DescriptorPoolInlineUniformBlockCreateInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for DescriptorPoolInlineUniformBlockCreateInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder<'a> { +impl<'a> DescriptorPoolInlineUniformBlockCreateInfoBuilder<'a> { pub fn max_inline_uniform_block_bindings( mut self, max_inline_uniform_block_bindings: u32, @@ -23889,14 +23863,14 @@ impl<'a> DescriptorPoolInlineUniformBlockCreateInfoEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> DescriptorPoolInlineUniformBlockCreateInfoEXT { + pub fn build(self) -> DescriptorPoolInlineUniformBlockCreateInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineCoverageModulationStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -23985,7 +23959,7 @@ impl<'a> PipelineCoverageModulationStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageFormatListCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -24048,7 +24022,7 @@ impl<'a> ImageFormatListCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ValidationCacheCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -24097,7 +24071,7 @@ impl<'a> ValidationCacheCreateInfoEXTBuilder<'a> { self } pub fn initial_data(mut self, initial_data: &'a [u8]) -> Self { - self.inner.initial_data_size = initial_data.len() as _; + self.inner.initial_data_size = initial_data.len(); self.inner.p_initial_data = initial_data.as_ptr() as *const c_void; self } @@ -24111,7 +24085,7 @@ impl<'a> ValidationCacheCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ShaderModuleValidationCacheCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -24167,7 +24141,7 @@ impl<'a> ShaderModuleValidationCacheCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMaintenance3Properties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24229,50 +24203,50 @@ impl<'a> PhysicalDeviceMaintenance3PropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceMaintenance4FeaturesKHR { +#[doc = ""] +pub struct PhysicalDeviceMaintenance4Features { pub s_type: StructureType, pub p_next: *mut c_void, pub maintenance4: Bool32, } -impl ::std::default::Default for PhysicalDeviceMaintenance4FeaturesKHR { +impl ::std::default::Default for PhysicalDeviceMaintenance4Features { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR, + s_type: StructureType::PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES, p_next: ::std::ptr::null_mut(), maintenance4: Bool32::default(), } } } -impl PhysicalDeviceMaintenance4FeaturesKHR { - pub fn builder<'a>() -> PhysicalDeviceMaintenance4FeaturesKHRBuilder<'a> { - PhysicalDeviceMaintenance4FeaturesKHRBuilder { +impl PhysicalDeviceMaintenance4Features { + pub fn builder<'a>() -> PhysicalDeviceMaintenance4FeaturesBuilder<'a> { + PhysicalDeviceMaintenance4FeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceMaintenance4FeaturesKHRBuilder<'a> { - inner: PhysicalDeviceMaintenance4FeaturesKHR, +pub struct PhysicalDeviceMaintenance4FeaturesBuilder<'a> { + inner: PhysicalDeviceMaintenance4Features, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceMaintenance4FeaturesKHRBuilder<'_> {} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceMaintenance4FeaturesKHR {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceMaintenance4FeaturesKHRBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceMaintenance4FeaturesKHR {} -impl<'a> ::std::ops::Deref for PhysicalDeviceMaintenance4FeaturesKHRBuilder<'a> { - type Target = PhysicalDeviceMaintenance4FeaturesKHR; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceMaintenance4FeaturesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceMaintenance4Features {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceMaintenance4FeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceMaintenance4Features {} +impl<'a> ::std::ops::Deref for PhysicalDeviceMaintenance4FeaturesBuilder<'a> { + type Target = PhysicalDeviceMaintenance4Features; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceMaintenance4FeaturesKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceMaintenance4FeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceMaintenance4FeaturesKHRBuilder<'a> { +impl<'a> PhysicalDeviceMaintenance4FeaturesBuilder<'a> { pub fn maintenance4(mut self, maintenance4: bool) -> Self { self.inner.maintenance4 = maintenance4.into(); self @@ -24280,58 +24254,55 @@ impl<'a> PhysicalDeviceMaintenance4FeaturesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceMaintenance4FeaturesKHR { + pub fn build(self) -> PhysicalDeviceMaintenance4Features { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceMaintenance4PropertiesKHR { +#[doc = ""] +pub struct PhysicalDeviceMaintenance4Properties { pub s_type: StructureType, pub p_next: *mut c_void, pub max_buffer_size: DeviceSize, } -impl ::std::default::Default for PhysicalDeviceMaintenance4PropertiesKHR { +impl ::std::default::Default for PhysicalDeviceMaintenance4Properties { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR, + s_type: StructureType::PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES, p_next: ::std::ptr::null_mut(), max_buffer_size: DeviceSize::default(), } } } -impl PhysicalDeviceMaintenance4PropertiesKHR { - pub fn builder<'a>() -> PhysicalDeviceMaintenance4PropertiesKHRBuilder<'a> { - PhysicalDeviceMaintenance4PropertiesKHRBuilder { +impl PhysicalDeviceMaintenance4Properties { + pub fn builder<'a>() -> PhysicalDeviceMaintenance4PropertiesBuilder<'a> { + PhysicalDeviceMaintenance4PropertiesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceMaintenance4PropertiesKHRBuilder<'a> { - inner: PhysicalDeviceMaintenance4PropertiesKHR, +pub struct PhysicalDeviceMaintenance4PropertiesBuilder<'a> { + inner: PhysicalDeviceMaintenance4Properties, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsPhysicalDeviceProperties2 - for PhysicalDeviceMaintenance4PropertiesKHRBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceMaintenance4PropertiesKHR {} -impl<'a> ::std::ops::Deref for PhysicalDeviceMaintenance4PropertiesKHRBuilder<'a> { - type Target = PhysicalDeviceMaintenance4PropertiesKHR; +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceMaintenance4PropertiesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceMaintenance4Properties {} +impl<'a> ::std::ops::Deref for PhysicalDeviceMaintenance4PropertiesBuilder<'a> { + type Target = PhysicalDeviceMaintenance4Properties; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceMaintenance4PropertiesKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceMaintenance4PropertiesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceMaintenance4PropertiesKHRBuilder<'a> { +impl<'a> PhysicalDeviceMaintenance4PropertiesBuilder<'a> { pub fn max_buffer_size(mut self, max_buffer_size: DeviceSize) -> Self { self.inner.max_buffer_size = max_buffer_size; self @@ -24339,14 +24310,14 @@ impl<'a> PhysicalDeviceMaintenance4PropertiesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceMaintenance4PropertiesKHR { + pub fn build(self) -> PhysicalDeviceMaintenance4Properties { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetLayoutSupport { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24398,10 +24369,10 @@ impl<'a> DescriptorSetLayoutSupportBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -24415,7 +24386,7 @@ impl<'a> DescriptorSetLayoutSupportBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderDrawParametersFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24476,7 +24447,7 @@ impl<'a> PhysicalDeviceShaderDrawParametersFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderFloat16Int8Features { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24540,7 +24511,7 @@ impl<'a> PhysicalDeviceShaderFloat16Int8FeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFloatControlsProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24737,7 +24708,7 @@ impl<'a> PhysicalDeviceFloatControlsPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceHostQueryResetFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -24795,7 +24766,7 @@ impl<'a> PhysicalDeviceHostQueryResetFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct NativeBufferUsage2ANDROID { pub consumer: u64, pub producer: u64, @@ -24843,7 +24814,7 @@ impl<'a> NativeBufferUsage2ANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct NativeBufferANDROID { pub s_type: StructureType, pub p_next: *const c_void, @@ -24921,7 +24892,7 @@ impl<'a> NativeBufferANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SwapchainImageCreateInfoANDROID { pub s_type: StructureType, pub p_next: *const c_void, @@ -24975,7 +24946,7 @@ impl<'a> SwapchainImageCreateInfoANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePresentationPropertiesANDROID { pub s_type: StructureType, pub p_next: *const c_void, @@ -25029,7 +25000,7 @@ impl<'a> PhysicalDevicePresentationPropertiesANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct ShaderResourceUsageAMD { pub num_used_vgprs: u32, pub num_used_sgprs: u32, @@ -25092,7 +25063,7 @@ impl<'a> ShaderResourceUsageAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ShaderStatisticsInfoAMD { pub shader_stage_mask: ShaderStageFlags, pub resource_usage: ShaderResourceUsageAMD, @@ -25178,109 +25149,109 @@ impl<'a> ShaderStatisticsInfoAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct DeviceQueueGlobalPriorityCreateInfoEXT { +#[doc = ""] +pub struct DeviceQueueGlobalPriorityCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, - pub global_priority: QueueGlobalPriorityEXT, + pub global_priority: QueueGlobalPriorityKHR, } -impl ::std::default::Default for DeviceQueueGlobalPriorityCreateInfoEXT { +impl ::std::default::Default for DeviceQueueGlobalPriorityCreateInfoKHR { fn default() -> Self { Self { - s_type: StructureType::DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT, + s_type: StructureType::DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR, p_next: ::std::ptr::null(), - global_priority: QueueGlobalPriorityEXT::default(), + global_priority: QueueGlobalPriorityKHR::default(), } } } -impl DeviceQueueGlobalPriorityCreateInfoEXT { - pub fn builder<'a>() -> DeviceQueueGlobalPriorityCreateInfoEXTBuilder<'a> { - DeviceQueueGlobalPriorityCreateInfoEXTBuilder { +impl DeviceQueueGlobalPriorityCreateInfoKHR { + pub fn builder<'a>() -> DeviceQueueGlobalPriorityCreateInfoKHRBuilder<'a> { + DeviceQueueGlobalPriorityCreateInfoKHRBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct DeviceQueueGlobalPriorityCreateInfoEXTBuilder<'a> { - inner: DeviceQueueGlobalPriorityCreateInfoEXT, +pub struct DeviceQueueGlobalPriorityCreateInfoKHRBuilder<'a> { + inner: DeviceQueueGlobalPriorityCreateInfoKHR, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsDeviceQueueCreateInfo for DeviceQueueGlobalPriorityCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsDeviceQueueCreateInfo for DeviceQueueGlobalPriorityCreateInfoEXT {} -impl<'a> ::std::ops::Deref for DeviceQueueGlobalPriorityCreateInfoEXTBuilder<'a> { - type Target = DeviceQueueGlobalPriorityCreateInfoEXT; +unsafe impl ExtendsDeviceQueueCreateInfo for DeviceQueueGlobalPriorityCreateInfoKHRBuilder<'_> {} +unsafe impl ExtendsDeviceQueueCreateInfo for DeviceQueueGlobalPriorityCreateInfoKHR {} +impl<'a> ::std::ops::Deref for DeviceQueueGlobalPriorityCreateInfoKHRBuilder<'a> { + type Target = DeviceQueueGlobalPriorityCreateInfoKHR; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for DeviceQueueGlobalPriorityCreateInfoEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for DeviceQueueGlobalPriorityCreateInfoKHRBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> DeviceQueueGlobalPriorityCreateInfoEXTBuilder<'a> { - pub fn global_priority(mut self, global_priority: QueueGlobalPriorityEXT) -> Self { +impl<'a> DeviceQueueGlobalPriorityCreateInfoKHRBuilder<'a> { + pub fn global_priority(mut self, global_priority: QueueGlobalPriorityKHR) -> Self { self.inner.global_priority = global_priority; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> DeviceQueueGlobalPriorityCreateInfoEXT { + pub fn build(self) -> DeviceQueueGlobalPriorityCreateInfoKHR { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceGlobalPriorityQueryFeaturesEXT { +#[doc = ""] +pub struct PhysicalDeviceGlobalPriorityQueryFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, pub global_priority_query: Bool32, } -impl ::std::default::Default for PhysicalDeviceGlobalPriorityQueryFeaturesEXT { +impl ::std::default::Default for PhysicalDeviceGlobalPriorityQueryFeaturesKHR { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR, p_next: ::std::ptr::null_mut(), global_priority_query: Bool32::default(), } } } -impl PhysicalDeviceGlobalPriorityQueryFeaturesEXT { - pub fn builder<'a>() -> PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'a> { - PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder { +impl PhysicalDeviceGlobalPriorityQueryFeaturesKHR { + pub fn builder<'a>() -> PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder<'a> { + PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'a> { - inner: PhysicalDeviceGlobalPriorityQueryFeaturesEXT, +pub struct PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder<'a> { + inner: PhysicalDeviceGlobalPriorityQueryFeaturesKHR, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'_> + for PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder<'_> { } -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceGlobalPriorityQueryFeaturesEXT {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceGlobalPriorityQueryFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'a> { - type Target = PhysicalDeviceGlobalPriorityQueryFeaturesEXT; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceGlobalPriorityQueryFeaturesKHR {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceGlobalPriorityQueryFeaturesKHR {} +impl<'a> ::std::ops::Deref for PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder<'a> { + type Target = PhysicalDeviceGlobalPriorityQueryFeaturesKHR; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDeviceGlobalPriorityQueryFeaturesKHRBuilder<'a> { pub fn global_priority_query(mut self, global_priority_query: bool) -> Self { self.inner.global_priority_query = global_priority_query.into(); self @@ -25288,64 +25259,64 @@ impl<'a> PhysicalDeviceGlobalPriorityQueryFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceGlobalPriorityQueryFeaturesEXT { + pub fn build(self) -> PhysicalDeviceGlobalPriorityQueryFeaturesKHR { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct QueueFamilyGlobalPriorityPropertiesEXT { +#[doc = ""] +pub struct QueueFamilyGlobalPriorityPropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, pub priority_count: u32, - pub priorities: [QueueGlobalPriorityEXT; MAX_GLOBAL_PRIORITY_SIZE_EXT], + pub priorities: [QueueGlobalPriorityKHR; MAX_GLOBAL_PRIORITY_SIZE_KHR], } -impl ::std::default::Default for QueueFamilyGlobalPriorityPropertiesEXT { +impl ::std::default::Default for QueueFamilyGlobalPriorityPropertiesKHR { fn default() -> Self { Self { - s_type: StructureType::QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT, + s_type: StructureType::QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR, p_next: ::std::ptr::null_mut(), priority_count: u32::default(), priorities: unsafe { ::std::mem::zeroed() }, } } } -impl QueueFamilyGlobalPriorityPropertiesEXT { - pub fn builder<'a>() -> QueueFamilyGlobalPriorityPropertiesEXTBuilder<'a> { - QueueFamilyGlobalPriorityPropertiesEXTBuilder { +impl QueueFamilyGlobalPriorityPropertiesKHR { + pub fn builder<'a>() -> QueueFamilyGlobalPriorityPropertiesKHRBuilder<'a> { + QueueFamilyGlobalPriorityPropertiesKHRBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct QueueFamilyGlobalPriorityPropertiesEXTBuilder<'a> { - inner: QueueFamilyGlobalPriorityPropertiesEXT, +pub struct QueueFamilyGlobalPriorityPropertiesKHRBuilder<'a> { + inner: QueueFamilyGlobalPriorityPropertiesKHR, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsQueueFamilyProperties2 for QueueFamilyGlobalPriorityPropertiesEXTBuilder<'_> {} -unsafe impl ExtendsQueueFamilyProperties2 for QueueFamilyGlobalPriorityPropertiesEXT {} -impl<'a> ::std::ops::Deref for QueueFamilyGlobalPriorityPropertiesEXTBuilder<'a> { - type Target = QueueFamilyGlobalPriorityPropertiesEXT; +unsafe impl ExtendsQueueFamilyProperties2 for QueueFamilyGlobalPriorityPropertiesKHRBuilder<'_> {} +unsafe impl ExtendsQueueFamilyProperties2 for QueueFamilyGlobalPriorityPropertiesKHR {} +impl<'a> ::std::ops::Deref for QueueFamilyGlobalPriorityPropertiesKHRBuilder<'a> { + type Target = QueueFamilyGlobalPriorityPropertiesKHR; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for QueueFamilyGlobalPriorityPropertiesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for QueueFamilyGlobalPriorityPropertiesKHRBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> QueueFamilyGlobalPriorityPropertiesEXTBuilder<'a> { +impl<'a> QueueFamilyGlobalPriorityPropertiesKHRBuilder<'a> { pub fn priority_count(mut self, priority_count: u32) -> Self { self.inner.priority_count = priority_count; self } pub fn priorities( mut self, - priorities: [QueueGlobalPriorityEXT; MAX_GLOBAL_PRIORITY_SIZE_EXT], + priorities: [QueueGlobalPriorityKHR; MAX_GLOBAL_PRIORITY_SIZE_KHR], ) -> Self { self.inner.priorities = priorities; self @@ -25353,14 +25324,14 @@ impl<'a> QueueFamilyGlobalPriorityPropertiesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> QueueFamilyGlobalPriorityPropertiesEXT { + pub fn build(self) -> QueueFamilyGlobalPriorityPropertiesKHR { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsObjectNameInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -25426,7 +25397,7 @@ impl<'a> DebugUtilsObjectNameInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsObjectTagInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -25487,7 +25458,7 @@ impl<'a> DebugUtilsObjectTagInfoEXTBuilder<'a> { self } pub fn tag(mut self, tag: &'a [u8]) -> Self { - self.inner.tag_size = tag.len() as _; + self.inner.tag_size = tag.len(); self.inner.p_tag = tag.as_ptr() as *const c_void; self } @@ -25501,7 +25472,7 @@ impl<'a> DebugUtilsObjectTagInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsLabelEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -25560,7 +25531,7 @@ impl<'a> DebugUtilsLabelEXTBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsMessengerCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -25660,7 +25631,7 @@ impl<'a> DebugUtilsMessengerCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DebugUtilsMessengerCallbackDataEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -25759,7 +25730,7 @@ impl<'a> DebugUtilsMessengerCallbackDataEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDeviceMemoryReportFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25819,7 +25790,7 @@ impl<'a> PhysicalDeviceDeviceMemoryReportFeaturesEXTBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceDeviceMemoryReportCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -25905,7 +25876,7 @@ impl<'a> DeviceDeviceMemoryReportCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceMemoryReportCallbackDataEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -25995,7 +25966,7 @@ impl<'a> DeviceMemoryReportCallbackDataEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportMemoryHostPointerInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -26057,7 +26028,7 @@ impl<'a> ImportMemoryHostPointerInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryHostPointerPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26111,7 +26082,7 @@ impl<'a> MemoryHostPointerPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExternalMemoryHostPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26173,7 +26144,7 @@ impl<'a> PhysicalDeviceExternalMemoryHostPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceConservativeRasterizationPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26306,7 +26277,7 @@ impl<'a> PhysicalDeviceConservativeRasterizationPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CalibratedTimestampInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -26360,7 +26331,7 @@ impl<'a> CalibratedTimestampInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderCorePropertiesAMD { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26494,7 +26465,7 @@ impl<'a> PhysicalDeviceShaderCorePropertiesAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderCoreProperties2AMD { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26559,7 +26530,7 @@ impl<'a> PhysicalDeviceShaderCoreProperties2AMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationConservativeStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -26639,7 +26610,7 @@ impl<'a> PipelineRasterizationConservativeStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDescriptorIndexingFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -26897,7 +26868,7 @@ impl<'a> PhysicalDeviceDescriptorIndexingFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDescriptorIndexingProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27194,7 +27165,7 @@ impl<'a> PhysicalDeviceDescriptorIndexingPropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetLayoutBindingFlagsCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -27256,7 +27227,7 @@ impl<'a> DescriptorSetLayoutBindingFlagsCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetVariableDescriptorCountAllocateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -27318,7 +27289,7 @@ impl<'a> DescriptorSetVariableDescriptorCountAllocateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DescriptorSetVariableDescriptorCountLayoutSupport { pub s_type: StructureType, pub p_next: *mut c_void, @@ -27380,7 +27351,7 @@ impl<'a> DescriptorSetVariableDescriptorCountLayoutSupportBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AttachmentDescription2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -27480,10 +27451,10 @@ impl<'a> AttachmentDescription2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -27497,7 +27468,7 @@ impl<'a> AttachmentDescription2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AttachmentReference2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -27561,10 +27532,10 @@ impl<'a> AttachmentReference2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -27578,7 +27549,7 @@ impl<'a> AttachmentReference2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassDescription2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -27685,10 +27656,10 @@ impl<'a> SubpassDescription2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -27702,7 +27673,7 @@ impl<'a> SubpassDescription2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassDependency2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -27796,10 +27767,10 @@ impl<'a> SubpassDependency2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -27813,7 +27784,7 @@ impl<'a> SubpassDependency2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassCreateInfo2 { pub s_type: StructureType, pub p_next: *const c_void, @@ -27901,10 +27872,10 @@ impl<'a> RenderPassCreateInfo2Builder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -27918,7 +27889,7 @@ impl<'a> RenderPassCreateInfo2Builder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassBeginInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -27972,7 +27943,7 @@ impl<'a> SubpassBeginInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassEndInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -28018,10 +27989,10 @@ impl<'a> SubpassEndInfoBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -28035,7 +28006,7 @@ impl<'a> SubpassEndInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceTimelineSemaphoreFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28093,7 +28064,7 @@ impl<'a> PhysicalDeviceTimelineSemaphoreFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceTimelineSemaphoreProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28156,7 +28127,7 @@ impl<'a> PhysicalDeviceTimelineSemaphorePropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreTypeCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -28220,7 +28191,7 @@ impl<'a> SemaphoreTypeCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct TimelineSemaphoreSubmitInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -28290,7 +28261,7 @@ impl<'a> TimelineSemaphoreSubmitInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreWaitInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -28360,7 +28331,7 @@ impl<'a> SemaphoreWaitInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SemaphoreSignalInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -28420,7 +28391,7 @@ impl<'a> SemaphoreSignalInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct VertexInputBindingDivisorDescriptionEXT { pub binding: u32, pub divisor: u32, @@ -28468,7 +28439,7 @@ impl<'a> VertexInputBindingDivisorDescriptionEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineVertexInputDivisorStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -28536,7 +28507,7 @@ impl<'a> PipelineVertexInputDivisorStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVertexAttributeDivisorPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28595,7 +28566,7 @@ impl<'a> PhysicalDeviceVertexAttributeDivisorPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePCIBusInfoPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28669,7 +28640,7 @@ impl<'a> PhysicalDevicePCIBusInfoPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportAndroidHardwareBufferInfoANDROID { pub s_type: StructureType, pub p_next: *const c_void, @@ -28725,7 +28696,7 @@ impl<'a> ImportAndroidHardwareBufferInfoANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AndroidHardwareBufferUsageANDROID { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28781,7 +28752,7 @@ impl<'a> AndroidHardwareBufferUsageANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AndroidHardwareBufferPropertiesANDROID { pub s_type: StructureType, pub p_next: *mut c_void, @@ -28842,10 +28813,10 @@ impl<'a> AndroidHardwareBufferPropertiesANDROIDBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -28859,7 +28830,7 @@ impl<'a> AndroidHardwareBufferPropertiesANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryGetAndroidHardwareBufferInfoANDROID { pub s_type: StructureType, pub p_next: *const c_void, @@ -28913,7 +28884,7 @@ impl<'a> MemoryGetAndroidHardwareBufferInfoANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AndroidHardwareBufferFormatPropertiesANDROID { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29023,7 +28994,7 @@ impl<'a> AndroidHardwareBufferFormatPropertiesANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferInheritanceConditionalRenderingInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -29085,7 +29056,7 @@ impl<'a> CommandBufferInheritanceConditionalRenderingInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ExternalFormatANDROID { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29143,7 +29114,7 @@ impl<'a> ExternalFormatANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevice8BitStorageFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29217,7 +29188,7 @@ impl<'a> PhysicalDevice8BitStorageFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceConditionalRenderingFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29287,7 +29258,7 @@ impl<'a> PhysicalDeviceConditionalRenderingFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVulkanMemoryModelFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29365,7 +29336,7 @@ impl<'a> PhysicalDeviceVulkanMemoryModelFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderAtomicInt64Features { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29429,7 +29400,7 @@ impl<'a> PhysicalDeviceShaderAtomicInt64FeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderAtomicFloatFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29574,7 +29545,7 @@ impl<'a> PhysicalDeviceShaderAtomicFloatFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderAtomicFloat2FeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29737,7 +29708,7 @@ impl<'a> PhysicalDeviceShaderAtomicFloat2FeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVertexAttributeDivisorFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29812,7 +29783,7 @@ impl<'a> PhysicalDeviceVertexAttributeDivisorFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct QueueFamilyCheckpointPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29871,7 +29842,7 @@ impl<'a> QueueFamilyCheckpointPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CheckpointDataNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -29931,7 +29902,7 @@ impl<'a> CheckpointDataNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDepthStencilResolveProperties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30014,7 +29985,7 @@ impl<'a> PhysicalDeviceDepthStencilResolvePropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassDescriptionDepthStencilResolve { pub s_type: StructureType, pub p_next: *const c_void, @@ -30085,7 +30056,7 @@ impl<'a> SubpassDescriptionDepthStencilResolveBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageViewASTCDecodeModeEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -30141,7 +30112,7 @@ impl<'a> ImageViewASTCDecodeModeEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceASTCDecodeFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30199,7 +30170,7 @@ impl<'a> PhysicalDeviceASTCDecodeFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceTransformFeedbackFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30266,7 +30237,7 @@ impl<'a> PhysicalDeviceTransformFeedbackFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceTransformFeedbackPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30402,7 +30373,7 @@ impl<'a> PhysicalDeviceTransformFeedbackPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationStateStreamCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -30470,7 +30441,7 @@ impl<'a> PipelineRasterizationStateStreamCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRepresentativeFragmentTestFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30534,7 +30505,7 @@ impl<'a> PhysicalDeviceRepresentativeFragmentTestFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRepresentativeFragmentTestStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -30599,7 +30570,7 @@ impl<'a> PipelineRepresentativeFragmentTestStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExclusiveScissorFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30657,7 +30628,7 @@ impl<'a> PhysicalDeviceExclusiveScissorFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportExclusiveScissorStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -30722,7 +30693,7 @@ impl<'a> PipelineViewportExclusiveScissorStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceCornerSampledImageFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30783,7 +30754,7 @@ impl<'a> PhysicalDeviceCornerSampledImageFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceComputeShaderDerivativesFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30856,7 +30827,7 @@ impl<'a> PhysicalDeviceComputeShaderDerivativesFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentShaderBarycentricFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30920,7 +30891,7 @@ impl<'a> PhysicalDeviceFragmentShaderBarycentricFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderImageFootprintFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -30981,7 +30952,7 @@ impl<'a> PhysicalDeviceShaderImageFootprintFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31053,7 +31024,7 @@ impl<'a> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ShadingRatePaletteNV { pub shading_rate_palette_entry_count: u32, pub p_shading_rate_palette_entries: *const ShadingRatePaletteEntryNV, @@ -31109,7 +31080,7 @@ impl<'a> ShadingRatePaletteNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportShadingRateImageStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -31183,7 +31154,7 @@ impl<'a> PipelineViewportShadingRateImageStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShadingRateImageFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31250,7 +31221,7 @@ impl<'a> PhysicalDeviceShadingRateImageFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShadingRateImagePropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31321,7 +31292,7 @@ impl<'a> PhysicalDeviceShadingRateImagePropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceInvocationMaskFeaturesHUAWEI { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31382,7 +31353,7 @@ impl<'a> PhysicalDeviceInvocationMaskFeaturesHUAWEIBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct CoarseSampleLocationNV { pub pixel_x: u32, pub pixel_y: u32, @@ -31435,7 +31406,7 @@ impl<'a> CoarseSampleLocationNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CoarseSampleOrderCustomNV { pub shading_rate: ShadingRatePaletteEntryNV, pub sample_count: u32, @@ -31500,7 +31471,7 @@ impl<'a> CoarseSampleOrderCustomNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportCoarseSampleOrderStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -31574,7 +31545,7 @@ impl<'a> PipelineViewportCoarseSampleOrderStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMeshShaderFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31638,7 +31609,7 @@ impl<'a> PhysicalDeviceMeshShaderFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMeshShaderPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -31772,7 +31743,7 @@ impl<'a> PhysicalDeviceMeshShaderPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DrawMeshTasksIndirectCommandNV { pub task_count: u32, pub first_task: u32, @@ -31820,7 +31791,7 @@ impl<'a> DrawMeshTasksIndirectCommandNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RayTracingShaderGroupCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -31898,7 +31869,7 @@ impl<'a> RayTracingShaderGroupCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RayTracingShaderGroupCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -31985,7 +31956,7 @@ impl<'a> RayTracingShaderGroupCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RayTracingPipelineCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32079,10 +32050,10 @@ impl<'a> RayTracingPipelineCreateInfoNVBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -32096,7 +32067,7 @@ impl<'a> RayTracingPipelineCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RayTracingPipelineCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -32214,10 +32185,10 @@ impl<'a> RayTracingPipelineCreateInfoKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -32231,7 +32202,7 @@ impl<'a> RayTracingPipelineCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GeometryTrianglesNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32345,7 +32316,7 @@ impl<'a> GeometryTrianglesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GeometryAABBNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32417,7 +32388,7 @@ impl<'a> GeometryAABBNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct GeometryDataNV { pub triangles: GeometryTrianglesNV, pub aabbs: GeometryAABBNV, @@ -32465,7 +32436,7 @@ impl<'a> GeometryDataNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct GeometryNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32531,7 +32502,7 @@ impl<'a> GeometryNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32606,7 +32577,7 @@ impl<'a> AccelerationStructureInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32666,7 +32637,7 @@ impl<'a> AccelerationStructureCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BindAccelerationStructureMemoryInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32744,7 +32715,7 @@ impl<'a> BindAccelerationStructureMemoryInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct WriteDescriptorSetAccelerationStructureKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -32806,7 +32777,7 @@ impl<'a> WriteDescriptorSetAccelerationStructureKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct WriteDescriptorSetAccelerationStructureNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32868,7 +32839,7 @@ impl<'a> WriteDescriptorSetAccelerationStructureNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMemoryRequirementsInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -32931,7 +32902,7 @@ impl<'a> AccelerationStructureMemoryRequirementsInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceAccelerationStructureFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33033,7 +33004,7 @@ impl<'a> PhysicalDeviceAccelerationStructureFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRayTracingPipelineFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33135,7 +33106,7 @@ impl<'a> PhysicalDeviceRayTracingPipelineFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRayQueryFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33193,7 +33164,7 @@ impl<'a> PhysicalDeviceRayQueryFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceAccelerationStructurePropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33317,7 +33288,7 @@ impl<'a> PhysicalDeviceAccelerationStructurePropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRayTracingPipelinePropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33425,7 +33396,7 @@ impl<'a> PhysicalDeviceRayTracingPipelinePropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRayTracingPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33527,7 +33498,7 @@ impl<'a> PhysicalDeviceRayTracingPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct StridedDeviceAddressRegionKHR { pub device_address: DeviceAddress, pub stride: DeviceSize, @@ -33580,7 +33551,7 @@ impl<'a> StridedDeviceAddressRegionKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct TraceRaysIndirectCommandKHR { pub width: u32, pub height: u32, @@ -33633,7 +33604,7 @@ impl<'a> TraceRaysIndirectCommandKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DrmFormatModifierPropertiesListEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -33695,7 +33666,7 @@ impl<'a> DrmFormatModifierPropertiesListEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DrmFormatModifierPropertiesEXT { pub drm_format_modifier: u64, pub drm_format_modifier_plane_count: u32, @@ -33751,7 +33722,7 @@ impl<'a> DrmFormatModifierPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceImageDrmFormatModifierInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -33825,7 +33796,7 @@ impl<'a> PhysicalDeviceImageDrmFormatModifierInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageDrmFormatModifierListCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -33884,7 +33855,7 @@ impl<'a> ImageDrmFormatModifierListCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageDrmFormatModifierExplicitCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -33949,7 +33920,7 @@ impl<'a> ImageDrmFormatModifierExplicitCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageDrmFormatModifierPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34003,7 +33974,7 @@ impl<'a> ImageDrmFormatModifierPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageStencilUsageCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -34061,7 +34032,7 @@ impl<'a> ImageStencilUsageCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceMemoryOverallocationCreateInfoAMD { pub s_type: StructureType, pub p_next: *const c_void, @@ -34120,7 +34091,7 @@ impl<'a> DeviceMemoryOverallocationCreateInfoAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentDensityMapFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34197,7 +34168,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentDensityMap2FeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34258,7 +34229,7 @@ impl<'a> PhysicalDeviceFragmentDensityMap2FeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34322,7 +34293,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOMBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentDensityMapPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34399,7 +34370,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentDensityMap2PropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34483,7 +34454,7 @@ impl<'a> PhysicalDeviceFragmentDensityMap2PropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34548,7 +34519,7 @@ impl<'a> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOMBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassFragmentDensityMapCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -34609,7 +34580,7 @@ impl<'a> RenderPassFragmentDensityMapCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassFragmentDensityMapOffsetEndInfoQCOM { pub s_type: StructureType, pub p_next: *const c_void, @@ -34668,7 +34639,7 @@ impl<'a> SubpassFragmentDensityMapOffsetEndInfoQCOMBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceScalarBlockLayoutFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34726,7 +34697,7 @@ impl<'a> PhysicalDeviceScalarBlockLayoutFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SurfaceProtectedCapabilitiesKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -34782,7 +34753,7 @@ impl<'a> SurfaceProtectedCapabilitiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceUniformBufferStandardLayoutFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34846,7 +34817,7 @@ impl<'a> PhysicalDeviceUniformBufferStandardLayoutFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDepthClipEnableFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -34904,7 +34875,7 @@ impl<'a> PhysicalDeviceDepthClipEnableFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationDepthClipStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -34972,7 +34943,7 @@ impl<'a> PipelineRasterizationDepthClipStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMemoryBudgetPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35037,7 +35008,7 @@ impl<'a> PhysicalDeviceMemoryBudgetPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMemoryPriorityFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35095,7 +35066,7 @@ impl<'a> PhysicalDeviceMemoryPriorityFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryPriorityAllocateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -35151,7 +35122,7 @@ impl<'a> MemoryPriorityAllocateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35215,7 +35186,7 @@ impl<'a> PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceBufferDeviceAddressFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35295,7 +35266,7 @@ impl<'a> PhysicalDeviceBufferDeviceAddressFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceBufferDeviceAddressFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35375,7 +35346,7 @@ impl<'a> PhysicalDeviceBufferDeviceAddressFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferDeviceAddressInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -35429,7 +35400,7 @@ impl<'a> BufferDeviceAddressInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferOpaqueCaptureAddressCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -35485,7 +35456,7 @@ impl<'a> BufferOpaqueCaptureAddressCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferDeviceAddressCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -35541,7 +35512,7 @@ impl<'a> BufferDeviceAddressCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceImageViewImageFormatInfoEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35600,7 +35571,7 @@ impl<'a> PhysicalDeviceImageViewImageFormatInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FilterCubicImageViewImageFormatPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35665,7 +35636,7 @@ impl<'a> FilterCubicImageViewImageFormatPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceImagelessFramebufferFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -35726,7 +35697,7 @@ impl<'a> PhysicalDeviceImagelessFramebufferFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FramebufferAttachmentsCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -35788,7 +35759,7 @@ impl<'a> FramebufferAttachmentsCreateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FramebufferAttachmentImageInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -35875,7 +35846,7 @@ impl<'a> FramebufferAttachmentImageInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassAttachmentBeginInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -35934,56 +35905,53 @@ impl<'a> RenderPassAttachmentBeginInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT { +#[doc = ""] +pub struct PhysicalDeviceTextureCompressionASTCHDRFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub texture_compression_astc_hdr: Bool32, } -impl ::std::default::Default for PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT { +impl ::std::default::Default for PhysicalDeviceTextureCompressionASTCHDRFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES, p_next: ::std::ptr::null_mut(), texture_compression_astc_hdr: Bool32::default(), } } } -impl PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT { - pub fn builder<'a>() -> PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'a> { - PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder { +impl PhysicalDeviceTextureCompressionASTCHDRFeatures { + pub fn builder<'a>() -> PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder<'a> { + PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'a> { - inner: PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT, +pub struct PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder<'a> { + inner: PhysicalDeviceTextureCompressionASTCHDRFeatures, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT {} -unsafe impl ExtendsDeviceCreateInfo - for PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'_> + for PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder<'_> { } -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'a> { - type Target = PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceTextureCompressionASTCHDRFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceTextureCompressionASTCHDRFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder<'a> { + type Target = PhysicalDeviceTextureCompressionASTCHDRFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDeviceTextureCompressionASTCHDRFeaturesBuilder<'a> { pub fn texture_compression_astc_hdr(mut self, texture_compression_astc_hdr: bool) -> Self { self.inner.texture_compression_astc_hdr = texture_compression_astc_hdr.into(); self @@ -35991,14 +35959,14 @@ impl<'a> PhysicalDeviceTextureCompressionASTCHDRFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT { + pub fn build(self) -> PhysicalDeviceTextureCompressionASTCHDRFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceCooperativeMatrixFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36069,7 +36037,7 @@ impl<'a> PhysicalDeviceCooperativeMatrixFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceCooperativeMatrixPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36131,7 +36099,7 @@ impl<'a> PhysicalDeviceCooperativeMatrixPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CooperativeMatrixPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36227,7 +36195,7 @@ impl<'a> CooperativeMatrixPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceYcbcrImageArraysFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36288,7 +36256,7 @@ impl<'a> PhysicalDeviceYcbcrImageArraysFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageViewHandleInfoNVX { pub s_type: StructureType, pub p_next: *const c_void, @@ -36354,7 +36322,7 @@ impl<'a> ImageViewHandleInfoNVXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageViewAddressPropertiesNVX { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36414,7 +36382,7 @@ impl<'a> ImageViewAddressPropertiesNVXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PresentFrameTokenGGP { pub s_type: StructureType, pub p_next: *const c_void, @@ -36470,37 +36438,37 @@ impl<'a> PresentFrameTokenGGPBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] -pub struct PipelineCreationFeedbackEXT { - pub flags: PipelineCreationFeedbackFlagsEXT, +#[doc = ""] +pub struct PipelineCreationFeedback { + pub flags: PipelineCreationFeedbackFlags, pub duration: u64, } -impl PipelineCreationFeedbackEXT { - pub fn builder<'a>() -> PipelineCreationFeedbackEXTBuilder<'a> { - PipelineCreationFeedbackEXTBuilder { +impl PipelineCreationFeedback { + pub fn builder<'a>() -> PipelineCreationFeedbackBuilder<'a> { + PipelineCreationFeedbackBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PipelineCreationFeedbackEXTBuilder<'a> { - inner: PipelineCreationFeedbackEXT, +pub struct PipelineCreationFeedbackBuilder<'a> { + inner: PipelineCreationFeedback, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for PipelineCreationFeedbackEXTBuilder<'a> { - type Target = PipelineCreationFeedbackEXT; +impl<'a> ::std::ops::Deref for PipelineCreationFeedbackBuilder<'a> { + type Target = PipelineCreationFeedback; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PipelineCreationFeedbackEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PipelineCreationFeedbackBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PipelineCreationFeedbackEXTBuilder<'a> { - pub fn flags(mut self, flags: PipelineCreationFeedbackFlagsEXT) -> Self { +impl<'a> PipelineCreationFeedbackBuilder<'a> { + pub fn flags(mut self, flags: PipelineCreationFeedbackFlags) -> Self { self.inner.flags = flags; self } @@ -36511,25 +36479,25 @@ impl<'a> PipelineCreationFeedbackEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PipelineCreationFeedbackEXT { + pub fn build(self) -> PipelineCreationFeedback { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PipelineCreationFeedbackCreateInfoEXT { +#[doc = ""] +pub struct PipelineCreationFeedbackCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, - pub p_pipeline_creation_feedback: *mut PipelineCreationFeedbackEXT, + pub p_pipeline_creation_feedback: *mut PipelineCreationFeedback, pub pipeline_stage_creation_feedback_count: u32, - pub p_pipeline_stage_creation_feedbacks: *mut PipelineCreationFeedbackEXT, + pub p_pipeline_stage_creation_feedbacks: *mut PipelineCreationFeedback, } -impl ::std::default::Default for PipelineCreationFeedbackCreateInfoEXT { +impl ::std::default::Default for PipelineCreationFeedbackCreateInfo { fn default() -> Self { Self { - s_type: StructureType::PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT, + s_type: StructureType::PIPELINE_CREATION_FEEDBACK_CREATE_INFO, p_next: ::std::ptr::null(), p_pipeline_creation_feedback: ::std::ptr::null_mut(), pipeline_stage_creation_feedback_count: u32::default(), @@ -36537,55 +36505,55 @@ impl ::std::default::Default for PipelineCreationFeedbackCreateInfoEXT { } } } -impl PipelineCreationFeedbackCreateInfoEXT { - pub fn builder<'a>() -> PipelineCreationFeedbackCreateInfoEXTBuilder<'a> { - PipelineCreationFeedbackCreateInfoEXTBuilder { +impl PipelineCreationFeedbackCreateInfo { + pub fn builder<'a>() -> PipelineCreationFeedbackCreateInfoBuilder<'a> { + PipelineCreationFeedbackCreateInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PipelineCreationFeedbackCreateInfoEXTBuilder<'a> { - inner: PipelineCreationFeedbackCreateInfoEXT, +pub struct PipelineCreationFeedbackCreateInfoBuilder<'a> { + inner: PipelineCreationFeedbackCreateInfo, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineCreationFeedbackCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineCreationFeedbackCreateInfoEXT {} -unsafe impl ExtendsComputePipelineCreateInfo for PipelineCreationFeedbackCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsComputePipelineCreateInfo for PipelineCreationFeedbackCreateInfoEXT {} +unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineCreationFeedbackCreateInfoBuilder<'_> {} +unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineCreationFeedbackCreateInfo {} +unsafe impl ExtendsComputePipelineCreateInfo for PipelineCreationFeedbackCreateInfoBuilder<'_> {} +unsafe impl ExtendsComputePipelineCreateInfo for PipelineCreationFeedbackCreateInfo {} unsafe impl ExtendsRayTracingPipelineCreateInfoNV - for PipelineCreationFeedbackCreateInfoEXTBuilder<'_> + for PipelineCreationFeedbackCreateInfoBuilder<'_> { } -unsafe impl ExtendsRayTracingPipelineCreateInfoNV for PipelineCreationFeedbackCreateInfoEXT {} +unsafe impl ExtendsRayTracingPipelineCreateInfoNV for PipelineCreationFeedbackCreateInfo {} unsafe impl ExtendsRayTracingPipelineCreateInfoKHR - for PipelineCreationFeedbackCreateInfoEXTBuilder<'_> + for PipelineCreationFeedbackCreateInfoBuilder<'_> { } -unsafe impl ExtendsRayTracingPipelineCreateInfoKHR for PipelineCreationFeedbackCreateInfoEXT {} -impl<'a> ::std::ops::Deref for PipelineCreationFeedbackCreateInfoEXTBuilder<'a> { - type Target = PipelineCreationFeedbackCreateInfoEXT; +unsafe impl ExtendsRayTracingPipelineCreateInfoKHR for PipelineCreationFeedbackCreateInfo {} +impl<'a> ::std::ops::Deref for PipelineCreationFeedbackCreateInfoBuilder<'a> { + type Target = PipelineCreationFeedbackCreateInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PipelineCreationFeedbackCreateInfoEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PipelineCreationFeedbackCreateInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PipelineCreationFeedbackCreateInfoEXTBuilder<'a> { +impl<'a> PipelineCreationFeedbackCreateInfoBuilder<'a> { pub fn pipeline_creation_feedback( mut self, - pipeline_creation_feedback: &'a mut PipelineCreationFeedbackEXT, + pipeline_creation_feedback: &'a mut PipelineCreationFeedback, ) -> Self { self.inner.p_pipeline_creation_feedback = pipeline_creation_feedback; self } pub fn pipeline_stage_creation_feedbacks( mut self, - pipeline_stage_creation_feedbacks: &'a mut [PipelineCreationFeedbackEXT], + pipeline_stage_creation_feedbacks: &'a mut [PipelineCreationFeedback], ) -> Self { self.inner.pipeline_stage_creation_feedback_count = pipeline_stage_creation_feedbacks.len() as _; @@ -36596,14 +36564,14 @@ impl<'a> PipelineCreationFeedbackCreateInfoEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PipelineCreationFeedbackCreateInfoEXT { + pub fn build(self) -> PipelineCreationFeedbackCreateInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SurfaceFullScreenExclusiveInfoEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36661,7 +36629,7 @@ impl<'a> SurfaceFullScreenExclusiveInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SurfaceFullScreenExclusiveWin32InfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -36722,7 +36690,7 @@ impl<'a> SurfaceFullScreenExclusiveWin32InfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SurfaceCapabilitiesFullScreenExclusiveEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36784,7 +36752,7 @@ impl<'a> SurfaceCapabilitiesFullScreenExclusiveEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePerformanceQueryFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36858,7 +36826,7 @@ impl<'a> PhysicalDevicePerformanceQueryFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePerformanceQueryPropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36920,7 +36888,7 @@ impl<'a> PhysicalDevicePerformanceQueryPropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PerformanceCounterKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -36991,7 +36959,7 @@ impl<'a> PerformanceCounterKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PerformanceCounterDescriptionKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37008,13 +36976,13 @@ impl fmt::Debug for PerformanceCounterDescriptionKHR { .field("p_next", &self.p_next) .field("flags", &self.flags) .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.name.as_ptr()) }) .field("category", &unsafe { - ::std::ffi::CStr::from_ptr(self.category.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.category.as_ptr()) }) .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.description.as_ptr()) }) .finish() } @@ -37082,7 +37050,7 @@ impl<'a> PerformanceCounterDescriptionKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct QueryPoolPerformanceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -37146,7 +37114,7 @@ impl<'a> QueryPoolPerformanceCreateInfoKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union PerformanceCounterResultKHR { pub int32: i32, pub int64: i64, @@ -37163,7 +37131,7 @@ impl ::std::default::Default for PerformanceCounterResultKHR { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AcquireProfilingLockInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -37223,7 +37191,7 @@ impl<'a> AcquireProfilingLockInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PerformanceQuerySubmitInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -37253,8 +37221,8 @@ pub struct PerformanceQuerySubmitInfoKHRBuilder<'a> { } unsafe impl ExtendsSubmitInfo for PerformanceQuerySubmitInfoKHRBuilder<'_> {} unsafe impl ExtendsSubmitInfo for PerformanceQuerySubmitInfoKHR {} -unsafe impl ExtendsSubmitInfo2KHR for PerformanceQuerySubmitInfoKHRBuilder<'_> {} -unsafe impl ExtendsSubmitInfo2KHR for PerformanceQuerySubmitInfoKHR {} +unsafe impl ExtendsSubmitInfo2 for PerformanceQuerySubmitInfoKHRBuilder<'_> {} +unsafe impl ExtendsSubmitInfo2 for PerformanceQuerySubmitInfoKHR {} impl<'a> ::std::ops::Deref for PerformanceQuerySubmitInfoKHRBuilder<'a> { type Target = PerformanceQuerySubmitInfoKHR; fn deref(&self) -> &Self::Target { @@ -37281,7 +37249,7 @@ impl<'a> PerformanceQuerySubmitInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct HeadlessSurfaceCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -37335,7 +37303,7 @@ impl<'a> HeadlessSurfaceCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceCoverageReductionModeFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37396,7 +37364,7 @@ impl<'a> PhysicalDeviceCoverageReductionModeFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineCoverageReductionStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -37467,7 +37435,7 @@ impl<'a> PipelineCoverageReductionStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FramebufferMixedSamplesCombinationNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37542,7 +37510,7 @@ impl<'a> FramebufferMixedSamplesCombinationNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL { pub s_type: StructureType, pub p_next: *mut c_void, @@ -37605,7 +37573,7 @@ impl<'a> PhysicalDeviceShaderIntegerFunctions2FeaturesINTELBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union PerformanceValueDataINTEL { pub value32: u32, pub value64: u64, @@ -37620,7 +37588,7 @@ impl ::std::default::Default for PerformanceValueDataINTEL { } #[repr(C)] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct PerformanceValueINTEL { pub ty: PerformanceValueTypeINTEL, pub data: PerformanceValueDataINTEL, @@ -37677,7 +37645,7 @@ impl<'a> PerformanceValueINTELBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct InitializePerformanceApiInfoINTEL { pub s_type: StructureType, pub p_next: *const c_void, @@ -37731,7 +37699,7 @@ impl<'a> InitializePerformanceApiInfoINTELBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct QueryPoolPerformanceQueryCreateInfoINTEL { pub s_type: StructureType, pub p_next: *const c_void, @@ -37790,7 +37758,7 @@ impl<'a> QueryPoolPerformanceQueryCreateInfoINTELBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PerformanceMarkerInfoINTEL { pub s_type: StructureType, pub p_next: *const c_void, @@ -37844,7 +37812,7 @@ impl<'a> PerformanceMarkerInfoINTELBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PerformanceStreamMarkerInfoINTEL { pub s_type: StructureType, pub p_next: *const c_void, @@ -37898,7 +37866,7 @@ impl<'a> PerformanceStreamMarkerInfoINTELBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PerformanceOverrideInfoINTEL { pub s_type: StructureType, pub p_next: *const c_void, @@ -37964,7 +37932,7 @@ impl<'a> PerformanceOverrideInfoINTELBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PerformanceConfigurationAcquireInfoINTEL { pub s_type: StructureType, pub p_next: *const c_void, @@ -38018,7 +37986,7 @@ impl<'a> PerformanceConfigurationAcquireInfoINTELBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderClockFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38082,7 +38050,7 @@ impl<'a> PhysicalDeviceShaderClockFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceIndexTypeUint8FeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38140,7 +38108,7 @@ impl<'a> PhysicalDeviceIndexTypeUint8FeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderSMBuiltinsPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38205,7 +38173,7 @@ impl<'a> PhysicalDeviceShaderSMBuiltinsPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderSMBuiltinsFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38263,7 +38231,7 @@ impl<'a> PhysicalDeviceShaderSMBuiltinsFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentShaderInterlockFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38349,7 +38317,7 @@ impl<'a> PhysicalDeviceFragmentShaderInterlockFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38413,7 +38381,7 @@ impl<'a> PhysicalDeviceSeparateDepthStencilLayoutsFeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AttachmentReferenceStencilLayout { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38469,7 +38437,7 @@ impl<'a> AttachmentReferenceStencilLayoutBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38549,7 +38517,7 @@ impl<'a> PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AttachmentDescriptionStencilLayout { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38611,7 +38579,7 @@ impl<'a> AttachmentDescriptionStencilLayoutBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePipelineExecutablePropertiesFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38678,7 +38646,7 @@ impl<'a> PhysicalDevicePipelineExecutablePropertiesFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -38731,7 +38699,7 @@ impl<'a> PipelineInfoKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineExecutablePropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38748,10 +38716,10 @@ impl fmt::Debug for PipelineExecutablePropertiesKHR { .field("p_next", &self.p_next) .field("stages", &self.stages) .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.name.as_ptr()) }) .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.description.as_ptr()) }) .field("subgroup_size", &self.subgroup_size) .finish() @@ -38820,7 +38788,7 @@ impl<'a> PipelineExecutablePropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineExecutableInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -38879,7 +38847,7 @@ impl<'a> PipelineExecutableInfoKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union PipelineExecutableStatisticValueKHR { pub b32: Bool32, pub i64: i64, @@ -38893,7 +38861,7 @@ impl ::std::default::Default for PipelineExecutableStatisticValueKHR { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineExecutableStatisticKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38909,10 +38877,10 @@ impl fmt::Debug for PipelineExecutableStatisticKHR { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.name.as_ptr()) }) .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.description.as_ptr()) }) .field("format", &self.format) .field("value", &"union") @@ -38981,7 +38949,7 @@ impl<'a> PipelineExecutableStatisticKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineExecutableInternalRepresentationKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -38998,10 +38966,10 @@ impl fmt::Debug for PipelineExecutableInternalRepresentationKHR { .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.name.as_ptr()) }) .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.description.as_ptr()) }) .field("is_text", &self.is_text) .field("data_size", &self.data_size) @@ -39060,7 +39028,7 @@ impl<'a> PipelineExecutableInternalRepresentationKHRBuilder<'a> { self } pub fn data(mut self, data: &'a mut [u8]) -> Self { - self.inner.data_size = data.len() as _; + self.inner.data_size = data.len(); self.inner.p_data = data.as_mut_ptr() as *mut c_void; self } @@ -39074,61 +39042,59 @@ impl<'a> PipelineExecutableInternalRepresentationKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT { +#[doc = ""] +pub struct PhysicalDeviceShaderDemoteToHelperInvocationFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub shader_demote_to_helper_invocation: Bool32, } -impl ::std::default::Default for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT { +impl ::std::default::Default for PhysicalDeviceShaderDemoteToHelperInvocationFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES, p_next: ::std::ptr::null_mut(), shader_demote_to_helper_invocation: Bool32::default(), } } } -impl PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT { - pub fn builder<'a>() -> PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'a> { - PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder { +impl PhysicalDeviceShaderDemoteToHelperInvocationFeatures { + pub fn builder<'a>() -> PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder<'a> { + PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'a> { - inner: PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT, +pub struct PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder<'a> { + inner: PhysicalDeviceShaderDemoteToHelperInvocationFeatures, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'_> + for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder<'_> { } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT + for PhysicalDeviceShaderDemoteToHelperInvocationFeatures { } unsafe impl ExtendsDeviceCreateInfo - for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'_> + for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder<'_> { } -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'a> { - type Target = PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT; +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderDemoteToHelperInvocationFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder<'a> { + type Target = PhysicalDeviceShaderDemoteToHelperInvocationFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut - for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'a> -{ +impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDeviceShaderDemoteToHelperInvocationFeaturesBuilder<'a> { pub fn shader_demote_to_helper_invocation( mut self, shader_demote_to_helper_invocation: bool, @@ -39139,14 +39105,14 @@ impl<'a> PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT { + pub fn build(self) -> PhysicalDeviceShaderDemoteToHelperInvocationFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceTexelBufferAlignmentFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39207,8 +39173,8 @@ impl<'a> PhysicalDeviceTexelBufferAlignmentFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceTexelBufferAlignmentPropertiesEXT { +#[doc = ""] +pub struct PhysicalDeviceTexelBufferAlignmentProperties { pub s_type: StructureType, pub p_next: *mut c_void, pub storage_texel_buffer_offset_alignment_bytes: DeviceSize, @@ -39216,10 +39182,10 @@ pub struct PhysicalDeviceTexelBufferAlignmentPropertiesEXT { pub uniform_texel_buffer_offset_alignment_bytes: DeviceSize, pub uniform_texel_buffer_offset_single_texel_alignment: Bool32, } -impl ::std::default::Default for PhysicalDeviceTexelBufferAlignmentPropertiesEXT { +impl ::std::default::Default for PhysicalDeviceTexelBufferAlignmentProperties { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES, p_next: ::std::ptr::null_mut(), storage_texel_buffer_offset_alignment_bytes: DeviceSize::default(), storage_texel_buffer_offset_single_texel_alignment: Bool32::default(), @@ -39228,36 +39194,36 @@ impl ::std::default::Default for PhysicalDeviceTexelBufferAlignmentPropertiesEXT } } } -impl PhysicalDeviceTexelBufferAlignmentPropertiesEXT { - pub fn builder<'a>() -> PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder<'a> { - PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder { +impl PhysicalDeviceTexelBufferAlignmentProperties { + pub fn builder<'a>() -> PhysicalDeviceTexelBufferAlignmentPropertiesBuilder<'a> { + PhysicalDeviceTexelBufferAlignmentPropertiesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder<'a> { - inner: PhysicalDeviceTexelBufferAlignmentPropertiesEXT, +pub struct PhysicalDeviceTexelBufferAlignmentPropertiesBuilder<'a> { + inner: PhysicalDeviceTexelBufferAlignmentProperties, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceProperties2 - for PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder<'_> + for PhysicalDeviceTexelBufferAlignmentPropertiesBuilder<'_> { } -unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceTexelBufferAlignmentPropertiesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder<'a> { - type Target = PhysicalDeviceTexelBufferAlignmentPropertiesEXT; +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceTexelBufferAlignmentProperties {} +impl<'a> ::std::ops::Deref for PhysicalDeviceTexelBufferAlignmentPropertiesBuilder<'a> { + type Target = PhysicalDeviceTexelBufferAlignmentProperties; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceTexelBufferAlignmentPropertiesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder<'a> { +impl<'a> PhysicalDeviceTexelBufferAlignmentPropertiesBuilder<'a> { pub fn storage_texel_buffer_offset_alignment_bytes( mut self, storage_texel_buffer_offset_alignment_bytes: DeviceSize, @@ -39295,62 +39261,62 @@ impl<'a> PhysicalDeviceTexelBufferAlignmentPropertiesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceTexelBufferAlignmentPropertiesEXT { + pub fn build(self) -> PhysicalDeviceTexelBufferAlignmentProperties { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceSubgroupSizeControlFeaturesEXT { +#[doc = ""] +pub struct PhysicalDeviceSubgroupSizeControlFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub subgroup_size_control: Bool32, pub compute_full_subgroups: Bool32, } -impl ::std::default::Default for PhysicalDeviceSubgroupSizeControlFeaturesEXT { +impl ::std::default::Default for PhysicalDeviceSubgroupSizeControlFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES, p_next: ::std::ptr::null_mut(), subgroup_size_control: Bool32::default(), compute_full_subgroups: Bool32::default(), } } } -impl PhysicalDeviceSubgroupSizeControlFeaturesEXT { - pub fn builder<'a>() -> PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'a> { - PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder { +impl PhysicalDeviceSubgroupSizeControlFeatures { + pub fn builder<'a>() -> PhysicalDeviceSubgroupSizeControlFeaturesBuilder<'a> { + PhysicalDeviceSubgroupSizeControlFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'a> { - inner: PhysicalDeviceSubgroupSizeControlFeaturesEXT, +pub struct PhysicalDeviceSubgroupSizeControlFeaturesBuilder<'a> { + inner: PhysicalDeviceSubgroupSizeControlFeatures, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'_> + for PhysicalDeviceSubgroupSizeControlFeaturesBuilder<'_> { } -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceSubgroupSizeControlFeaturesEXT {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSubgroupSizeControlFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'a> { - type Target = PhysicalDeviceSubgroupSizeControlFeaturesEXT; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceSubgroupSizeControlFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSubgroupSizeControlFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSubgroupSizeControlFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceSubgroupSizeControlFeaturesBuilder<'a> { + type Target = PhysicalDeviceSubgroupSizeControlFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceSubgroupSizeControlFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDeviceSubgroupSizeControlFeaturesBuilder<'a> { pub fn subgroup_size_control(mut self, subgroup_size_control: bool) -> Self { self.inner.subgroup_size_control = subgroup_size_control.into(); self @@ -39362,15 +39328,15 @@ impl<'a> PhysicalDeviceSubgroupSizeControlFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceSubgroupSizeControlFeaturesEXT { + pub fn build(self) -> PhysicalDeviceSubgroupSizeControlFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceSubgroupSizeControlPropertiesEXT { +#[doc = ""] +pub struct PhysicalDeviceSubgroupSizeControlProperties { pub s_type: StructureType, pub p_next: *mut c_void, pub min_subgroup_size: u32, @@ -39378,10 +39344,10 @@ pub struct PhysicalDeviceSubgroupSizeControlPropertiesEXT { pub max_compute_workgroup_subgroups: u32, pub required_subgroup_size_stages: ShaderStageFlags, } -impl ::std::default::Default for PhysicalDeviceSubgroupSizeControlPropertiesEXT { +impl ::std::default::Default for PhysicalDeviceSubgroupSizeControlProperties { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, p_next: ::std::ptr::null_mut(), min_subgroup_size: u32::default(), max_subgroup_size: u32::default(), @@ -39390,36 +39356,36 @@ impl ::std::default::Default for PhysicalDeviceSubgroupSizeControlPropertiesEXT } } } -impl PhysicalDeviceSubgroupSizeControlPropertiesEXT { - pub fn builder<'a>() -> PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder<'a> { - PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder { +impl PhysicalDeviceSubgroupSizeControlProperties { + pub fn builder<'a>() -> PhysicalDeviceSubgroupSizeControlPropertiesBuilder<'a> { + PhysicalDeviceSubgroupSizeControlPropertiesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder<'a> { - inner: PhysicalDeviceSubgroupSizeControlPropertiesEXT, +pub struct PhysicalDeviceSubgroupSizeControlPropertiesBuilder<'a> { + inner: PhysicalDeviceSubgroupSizeControlProperties, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceProperties2 - for PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder<'_> + for PhysicalDeviceSubgroupSizeControlPropertiesBuilder<'_> { } -unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceSubgroupSizeControlPropertiesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder<'a> { - type Target = PhysicalDeviceSubgroupSizeControlPropertiesEXT; +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceSubgroupSizeControlProperties {} +impl<'a> ::std::ops::Deref for PhysicalDeviceSubgroupSizeControlPropertiesBuilder<'a> { + type Target = PhysicalDeviceSubgroupSizeControlProperties; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceSubgroupSizeControlPropertiesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder<'a> { +impl<'a> PhysicalDeviceSubgroupSizeControlPropertiesBuilder<'a> { pub fn min_subgroup_size(mut self, min_subgroup_size: u32) -> Self { self.inner.min_subgroup_size = min_subgroup_size; self @@ -39442,61 +39408,61 @@ impl<'a> PhysicalDeviceSubgroupSizeControlPropertiesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceSubgroupSizeControlPropertiesEXT { + pub fn build(self) -> PhysicalDeviceSubgroupSizeControlProperties { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT { +#[doc = ""] +pub struct PipelineShaderStageRequiredSubgroupSizeCreateInfo { pub s_type: StructureType, pub p_next: *mut c_void, pub required_subgroup_size: u32, } -impl ::std::default::Default for PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT { +impl ::std::default::Default for PipelineShaderStageRequiredSubgroupSizeCreateInfo { fn default() -> Self { Self { - s_type: StructureType::PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT, + s_type: StructureType::PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, p_next: ::std::ptr::null_mut(), required_subgroup_size: u32::default(), } } } -impl PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT { - pub fn builder<'a>() -> PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder<'a> { - PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder { +impl PipelineShaderStageRequiredSubgroupSizeCreateInfo { + pub fn builder<'a>() -> PipelineShaderStageRequiredSubgroupSizeCreateInfoBuilder<'a> { + PipelineShaderStageRequiredSubgroupSizeCreateInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder<'a> { - inner: PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT, +pub struct PipelineShaderStageRequiredSubgroupSizeCreateInfoBuilder<'a> { + inner: PipelineShaderStageRequiredSubgroupSizeCreateInfo, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPipelineShaderStageCreateInfo - for PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder<'_> + for PipelineShaderStageRequiredSubgroupSizeCreateInfoBuilder<'_> { } unsafe impl ExtendsPipelineShaderStageCreateInfo - for PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT + for PipelineShaderStageRequiredSubgroupSizeCreateInfo { } -impl<'a> ::std::ops::Deref for PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder<'a> { - type Target = PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT; +impl<'a> ::std::ops::Deref for PipelineShaderStageRequiredSubgroupSizeCreateInfoBuilder<'a> { + type Target = PipelineShaderStageRequiredSubgroupSizeCreateInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PipelineShaderStageRequiredSubgroupSizeCreateInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder<'a> { +impl<'a> PipelineShaderStageRequiredSubgroupSizeCreateInfoBuilder<'a> { pub fn required_subgroup_size(mut self, required_subgroup_size: u32) -> Self { self.inner.required_subgroup_size = required_subgroup_size; self @@ -39504,14 +39470,14 @@ impl<'a> PipelineShaderStageRequiredSubgroupSizeCreateInfoEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT { + pub fn build(self) -> PipelineShaderStageRequiredSubgroupSizeCreateInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SubpassShadingPipelineCreateInfoHUAWEI { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39573,7 +39539,7 @@ impl<'a> SubpassShadingPipelineCreateInfoHUAWEIBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSubpassShadingPropertiesHUAWEI { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39636,7 +39602,7 @@ impl<'a> PhysicalDeviceSubpassShadingPropertiesHUAWEIBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryOpaqueCaptureAddressAllocateInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -39692,7 +39658,7 @@ impl<'a> MemoryOpaqueCaptureAddressAllocateInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceMemoryOpaqueCaptureAddressInfo { pub s_type: StructureType, pub p_next: *const c_void, @@ -39746,7 +39712,7 @@ impl<'a> DeviceMemoryOpaqueCaptureAddressInfoBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceLineRasterizationFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39837,7 +39803,7 @@ impl<'a> PhysicalDeviceLineRasterizationFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceLineRasterizationPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -39896,7 +39862,7 @@ impl<'a> PhysicalDeviceLineRasterizationPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationLineStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -39979,59 +39945,56 @@ impl<'a> PipelineRasterizationLineStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDevicePipelineCreationCacheControlFeaturesEXT { +#[doc = ""] +pub struct PhysicalDevicePipelineCreationCacheControlFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub pipeline_creation_cache_control: Bool32, } -impl ::std::default::Default for PhysicalDevicePipelineCreationCacheControlFeaturesEXT { +impl ::std::default::Default for PhysicalDevicePipelineCreationCacheControlFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES, p_next: ::std::ptr::null_mut(), pipeline_creation_cache_control: Bool32::default(), } } } -impl PhysicalDevicePipelineCreationCacheControlFeaturesEXT { - pub fn builder<'a>() -> PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'a> { - PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder { +impl PhysicalDevicePipelineCreationCacheControlFeatures { + pub fn builder<'a>() -> PhysicalDevicePipelineCreationCacheControlFeaturesBuilder<'a> { + PhysicalDevicePipelineCreationCacheControlFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'a> { - inner: PhysicalDevicePipelineCreationCacheControlFeaturesEXT, +pub struct PhysicalDevicePipelineCreationCacheControlFeaturesBuilder<'a> { + inner: PhysicalDevicePipelineCreationCacheControlFeatures, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDevicePipelineCreationCacheControlFeaturesEXT + for PhysicalDevicePipelineCreationCacheControlFeaturesBuilder<'_> { } +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDevicePipelineCreationCacheControlFeatures {} unsafe impl ExtendsDeviceCreateInfo - for PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'_> + for PhysicalDevicePipelineCreationCacheControlFeaturesBuilder<'_> { } -unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePipelineCreationCacheControlFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'a> { - type Target = PhysicalDevicePipelineCreationCacheControlFeaturesEXT; +unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePipelineCreationCacheControlFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDevicePipelineCreationCacheControlFeaturesBuilder<'a> { + type Target = PhysicalDevicePipelineCreationCacheControlFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDevicePipelineCreationCacheControlFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDevicePipelineCreationCacheControlFeaturesBuilder<'a> { pub fn pipeline_creation_cache_control( mut self, pipeline_creation_cache_control: bool, @@ -40042,14 +40005,14 @@ impl<'a> PhysicalDevicePipelineCreationCacheControlFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDevicePipelineCreationCacheControlFeaturesEXT { + pub fn build(self) -> PhysicalDevicePipelineCreationCacheControlFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVulkan11Features { pub s_type: StructureType, pub p_next: *mut c_void, @@ -40180,7 +40143,7 @@ impl<'a> PhysicalDeviceVulkan11FeaturesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVulkan11Properties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -40333,7 +40296,7 @@ impl<'a> PhysicalDeviceVulkan11PropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVulkan12Features { pub s_type: StructureType, pub p_next: *mut c_void, @@ -40771,7 +40734,7 @@ impl<'a> PhysicalDeviceVulkan12FeaturesBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVulkan12Properties { pub s_type: StructureType, pub p_next: *mut c_void, @@ -40836,10 +40799,10 @@ impl fmt::Debug for PhysicalDeviceVulkan12Properties { .field("p_next", &self.p_next) .field("driver_id", &self.driver_id) .field("driver_name", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.driver_name.as_ptr()) }) .field("driver_info", &unsafe { - ::std::ffi::CStr::from_ptr(self.driver_info.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.driver_info.as_ptr()) }) .field("conformance_version", &self.conformance_version) .field( @@ -41509,7 +41472,616 @@ impl<'a> PhysicalDeviceVulkan12PropertiesBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] +pub struct PhysicalDeviceVulkan13Features { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub robust_image_access: Bool32, + pub inline_uniform_block: Bool32, + pub descriptor_binding_inline_uniform_block_update_after_bind: Bool32, + pub pipeline_creation_cache_control: Bool32, + pub private_data: Bool32, + pub shader_demote_to_helper_invocation: Bool32, + pub shader_terminate_invocation: Bool32, + pub subgroup_size_control: Bool32, + pub compute_full_subgroups: Bool32, + pub synchronization2: Bool32, + pub texture_compression_astc_hdr: Bool32, + pub shader_zero_initialize_workgroup_memory: Bool32, + pub dynamic_rendering: Bool32, + pub shader_integer_dot_product: Bool32, + pub maintenance4: Bool32, +} +impl ::std::default::Default for PhysicalDeviceVulkan13Features { + fn default() -> Self { + Self { + s_type: StructureType::PHYSICAL_DEVICE_VULKAN_1_3_FEATURES, + p_next: ::std::ptr::null_mut(), + robust_image_access: Bool32::default(), + inline_uniform_block: Bool32::default(), + descriptor_binding_inline_uniform_block_update_after_bind: Bool32::default(), + pipeline_creation_cache_control: Bool32::default(), + private_data: Bool32::default(), + shader_demote_to_helper_invocation: Bool32::default(), + shader_terminate_invocation: Bool32::default(), + subgroup_size_control: Bool32::default(), + compute_full_subgroups: Bool32::default(), + synchronization2: Bool32::default(), + texture_compression_astc_hdr: Bool32::default(), + shader_zero_initialize_workgroup_memory: Bool32::default(), + dynamic_rendering: Bool32::default(), + shader_integer_dot_product: Bool32::default(), + maintenance4: Bool32::default(), + } + } +} +impl PhysicalDeviceVulkan13Features { + pub fn builder<'a>() -> PhysicalDeviceVulkan13FeaturesBuilder<'a> { + PhysicalDeviceVulkan13FeaturesBuilder { + inner: Self::default(), + marker: ::std::marker::PhantomData, + } + } +} +#[repr(transparent)] +pub struct PhysicalDeviceVulkan13FeaturesBuilder<'a> { + inner: PhysicalDeviceVulkan13Features, + marker: ::std::marker::PhantomData<&'a ()>, +} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceVulkan13FeaturesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceVulkan13Features {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceVulkan13FeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceVulkan13Features {} +impl<'a> ::std::ops::Deref for PhysicalDeviceVulkan13FeaturesBuilder<'a> { + type Target = PhysicalDeviceVulkan13Features; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl<'a> ::std::ops::DerefMut for PhysicalDeviceVulkan13FeaturesBuilder<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} +impl<'a> PhysicalDeviceVulkan13FeaturesBuilder<'a> { + pub fn robust_image_access(mut self, robust_image_access: bool) -> Self { + self.inner.robust_image_access = robust_image_access.into(); + self + } + pub fn inline_uniform_block(mut self, inline_uniform_block: bool) -> Self { + self.inner.inline_uniform_block = inline_uniform_block.into(); + self + } + pub fn descriptor_binding_inline_uniform_block_update_after_bind( + mut self, + descriptor_binding_inline_uniform_block_update_after_bind: bool, + ) -> Self { + self.inner + .descriptor_binding_inline_uniform_block_update_after_bind = + descriptor_binding_inline_uniform_block_update_after_bind.into(); + self + } + pub fn pipeline_creation_cache_control( + mut self, + pipeline_creation_cache_control: bool, + ) -> Self { + self.inner.pipeline_creation_cache_control = pipeline_creation_cache_control.into(); + self + } + pub fn private_data(mut self, private_data: bool) -> Self { + self.inner.private_data = private_data.into(); + self + } + pub fn shader_demote_to_helper_invocation( + mut self, + shader_demote_to_helper_invocation: bool, + ) -> Self { + self.inner.shader_demote_to_helper_invocation = shader_demote_to_helper_invocation.into(); + self + } + pub fn shader_terminate_invocation(mut self, shader_terminate_invocation: bool) -> Self { + self.inner.shader_terminate_invocation = shader_terminate_invocation.into(); + self + } + pub fn subgroup_size_control(mut self, subgroup_size_control: bool) -> Self { + self.inner.subgroup_size_control = subgroup_size_control.into(); + self + } + pub fn compute_full_subgroups(mut self, compute_full_subgroups: bool) -> Self { + self.inner.compute_full_subgroups = compute_full_subgroups.into(); + self + } + pub fn synchronization2(mut self, synchronization2: bool) -> Self { + self.inner.synchronization2 = synchronization2.into(); + self + } + pub fn texture_compression_astc_hdr(mut self, texture_compression_astc_hdr: bool) -> Self { + self.inner.texture_compression_astc_hdr = texture_compression_astc_hdr.into(); + self + } + pub fn shader_zero_initialize_workgroup_memory( + mut self, + shader_zero_initialize_workgroup_memory: bool, + ) -> Self { + self.inner.shader_zero_initialize_workgroup_memory = + shader_zero_initialize_workgroup_memory.into(); + self + } + pub fn dynamic_rendering(mut self, dynamic_rendering: bool) -> Self { + self.inner.dynamic_rendering = dynamic_rendering.into(); + self + } + pub fn shader_integer_dot_product(mut self, shader_integer_dot_product: bool) -> Self { + self.inner.shader_integer_dot_product = shader_integer_dot_product.into(); + self + } + pub fn maintenance4(mut self, maintenance4: bool) -> Self { + self.inner.maintenance4 = maintenance4.into(); + self + } + #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] + #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] + #[doc = r" so references to builders can be passed directly to Vulkan functions."] + pub fn build(self) -> PhysicalDeviceVulkan13Features { + self.inner + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceVulkan13Properties { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub min_subgroup_size: u32, + pub max_subgroup_size: u32, + pub max_compute_workgroup_subgroups: u32, + pub required_subgroup_size_stages: ShaderStageFlags, + pub max_inline_uniform_block_size: u32, + pub max_per_stage_descriptor_inline_uniform_blocks: u32, + pub max_per_stage_descriptor_update_after_bind_inline_uniform_blocks: u32, + pub max_descriptor_set_inline_uniform_blocks: u32, + pub max_descriptor_set_update_after_bind_inline_uniform_blocks: u32, + pub max_inline_uniform_total_size: u32, + pub integer_dot_product8_bit_unsigned_accelerated: Bool32, + pub integer_dot_product8_bit_signed_accelerated: Bool32, + pub integer_dot_product8_bit_mixed_signedness_accelerated: Bool32, + pub integer_dot_product4x8_bit_packed_unsigned_accelerated: Bool32, + pub integer_dot_product4x8_bit_packed_signed_accelerated: Bool32, + pub integer_dot_product4x8_bit_packed_mixed_signedness_accelerated: Bool32, + pub integer_dot_product16_bit_unsigned_accelerated: Bool32, + pub integer_dot_product16_bit_signed_accelerated: Bool32, + pub integer_dot_product16_bit_mixed_signedness_accelerated: Bool32, + pub integer_dot_product32_bit_unsigned_accelerated: Bool32, + pub integer_dot_product32_bit_signed_accelerated: Bool32, + pub integer_dot_product32_bit_mixed_signedness_accelerated: Bool32, + pub integer_dot_product64_bit_unsigned_accelerated: Bool32, + pub integer_dot_product64_bit_signed_accelerated: Bool32, + pub integer_dot_product64_bit_mixed_signedness_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating8_bit_signed_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated: + Bool32, + pub integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating16_bit_signed_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating32_bit_signed_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating64_bit_signed_accelerated: Bool32, + pub integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated: Bool32, + pub storage_texel_buffer_offset_alignment_bytes: DeviceSize, + pub storage_texel_buffer_offset_single_texel_alignment: Bool32, + pub uniform_texel_buffer_offset_alignment_bytes: DeviceSize, + pub uniform_texel_buffer_offset_single_texel_alignment: Bool32, + pub max_buffer_size: DeviceSize, +} +impl ::std::default::Default for PhysicalDeviceVulkan13Properties { + fn default() -> Self { + Self { s_type : StructureType :: PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES , p_next : :: std :: ptr :: null_mut () , min_subgroup_size : u32 :: default () , max_subgroup_size : u32 :: default () , max_compute_workgroup_subgroups : u32 :: default () , required_subgroup_size_stages : ShaderStageFlags :: default () , max_inline_uniform_block_size : u32 :: default () , max_per_stage_descriptor_inline_uniform_blocks : u32 :: default () , max_per_stage_descriptor_update_after_bind_inline_uniform_blocks : u32 :: default () , max_descriptor_set_inline_uniform_blocks : u32 :: default () , max_descriptor_set_update_after_bind_inline_uniform_blocks : u32 :: default () , max_inline_uniform_total_size : u32 :: default () , integer_dot_product8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product64_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated : Bool32 :: default () , storage_texel_buffer_offset_alignment_bytes : DeviceSize :: default () , storage_texel_buffer_offset_single_texel_alignment : Bool32 :: default () , uniform_texel_buffer_offset_alignment_bytes : DeviceSize :: default () , uniform_texel_buffer_offset_single_texel_alignment : Bool32 :: default () , max_buffer_size : DeviceSize :: default () } + } +} +impl PhysicalDeviceVulkan13Properties { + pub fn builder<'a>() -> PhysicalDeviceVulkan13PropertiesBuilder<'a> { + PhysicalDeviceVulkan13PropertiesBuilder { + inner: Self::default(), + marker: ::std::marker::PhantomData, + } + } +} +#[repr(transparent)] +pub struct PhysicalDeviceVulkan13PropertiesBuilder<'a> { + inner: PhysicalDeviceVulkan13Properties, + marker: ::std::marker::PhantomData<&'a ()>, +} +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceVulkan13PropertiesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceVulkan13Properties {} +impl<'a> ::std::ops::Deref for PhysicalDeviceVulkan13PropertiesBuilder<'a> { + type Target = PhysicalDeviceVulkan13Properties; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl<'a> ::std::ops::DerefMut for PhysicalDeviceVulkan13PropertiesBuilder<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} +impl<'a> PhysicalDeviceVulkan13PropertiesBuilder<'a> { + pub fn min_subgroup_size(mut self, min_subgroup_size: u32) -> Self { + self.inner.min_subgroup_size = min_subgroup_size; + self + } + pub fn max_subgroup_size(mut self, max_subgroup_size: u32) -> Self { + self.inner.max_subgroup_size = max_subgroup_size; + self + } + pub fn max_compute_workgroup_subgroups(mut self, max_compute_workgroup_subgroups: u32) -> Self { + self.inner.max_compute_workgroup_subgroups = max_compute_workgroup_subgroups; + self + } + pub fn required_subgroup_size_stages( + mut self, + required_subgroup_size_stages: ShaderStageFlags, + ) -> Self { + self.inner.required_subgroup_size_stages = required_subgroup_size_stages; + self + } + pub fn max_inline_uniform_block_size(mut self, max_inline_uniform_block_size: u32) -> Self { + self.inner.max_inline_uniform_block_size = max_inline_uniform_block_size; + self + } + pub fn max_per_stage_descriptor_inline_uniform_blocks( + mut self, + max_per_stage_descriptor_inline_uniform_blocks: u32, + ) -> Self { + self.inner.max_per_stage_descriptor_inline_uniform_blocks = + max_per_stage_descriptor_inline_uniform_blocks; + self + } + pub fn max_per_stage_descriptor_update_after_bind_inline_uniform_blocks( + mut self, + max_per_stage_descriptor_update_after_bind_inline_uniform_blocks: u32, + ) -> Self { + self.inner + .max_per_stage_descriptor_update_after_bind_inline_uniform_blocks = + max_per_stage_descriptor_update_after_bind_inline_uniform_blocks; + self + } + pub fn max_descriptor_set_inline_uniform_blocks( + mut self, + max_descriptor_set_inline_uniform_blocks: u32, + ) -> Self { + self.inner.max_descriptor_set_inline_uniform_blocks = + max_descriptor_set_inline_uniform_blocks; + self + } + pub fn max_descriptor_set_update_after_bind_inline_uniform_blocks( + mut self, + max_descriptor_set_update_after_bind_inline_uniform_blocks: u32, + ) -> Self { + self.inner + .max_descriptor_set_update_after_bind_inline_uniform_blocks = + max_descriptor_set_update_after_bind_inline_uniform_blocks; + self + } + pub fn max_inline_uniform_total_size(mut self, max_inline_uniform_total_size: u32) -> Self { + self.inner.max_inline_uniform_total_size = max_inline_uniform_total_size; + self + } + pub fn integer_dot_product8_bit_unsigned_accelerated( + mut self, + integer_dot_product8_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product8_bit_unsigned_accelerated = + integer_dot_product8_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product8_bit_signed_accelerated( + mut self, + integer_dot_product8_bit_signed_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product8_bit_signed_accelerated = + integer_dot_product8_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product8_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product8_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product8_bit_mixed_signedness_accelerated = + integer_dot_product8_bit_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product4x8_bit_packed_unsigned_accelerated( + mut self, + integer_dot_product4x8_bit_packed_unsigned_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product4x8_bit_packed_unsigned_accelerated = + integer_dot_product4x8_bit_packed_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product4x8_bit_packed_signed_accelerated( + mut self, + integer_dot_product4x8_bit_packed_signed_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product4x8_bit_packed_signed_accelerated = + integer_dot_product4x8_bit_packed_signed_accelerated.into(); + self + } + pub fn integer_dot_product4x8_bit_packed_mixed_signedness_accelerated( + mut self, + integer_dot_product4x8_bit_packed_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product4x8_bit_packed_mixed_signedness_accelerated = + integer_dot_product4x8_bit_packed_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product16_bit_unsigned_accelerated( + mut self, + integer_dot_product16_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product16_bit_unsigned_accelerated = + integer_dot_product16_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product16_bit_signed_accelerated( + mut self, + integer_dot_product16_bit_signed_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product16_bit_signed_accelerated = + integer_dot_product16_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product16_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product16_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product16_bit_mixed_signedness_accelerated = + integer_dot_product16_bit_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product32_bit_unsigned_accelerated( + mut self, + integer_dot_product32_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product32_bit_unsigned_accelerated = + integer_dot_product32_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product32_bit_signed_accelerated( + mut self, + integer_dot_product32_bit_signed_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product32_bit_signed_accelerated = + integer_dot_product32_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product32_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product32_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product32_bit_mixed_signedness_accelerated = + integer_dot_product32_bit_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product64_bit_unsigned_accelerated( + mut self, + integer_dot_product64_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product64_bit_unsigned_accelerated = + integer_dot_product64_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product64_bit_signed_accelerated( + mut self, + integer_dot_product64_bit_signed_accelerated: bool, + ) -> Self { + self.inner.integer_dot_product64_bit_signed_accelerated = + integer_dot_product64_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product64_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product64_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product64_bit_mixed_signedness_accelerated = + integer_dot_product64_bit_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated( + mut self, + integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated = + integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating8_bit_signed_accelerated( + mut self, + integer_dot_product_accumulating_saturating8_bit_signed_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating8_bit_signed_accelerated = + integer_dot_product_accumulating_saturating8_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated = + integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated( + mut self, + integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated = + integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated( + mut self, + integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated = + integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated( + mut self, + integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated : bool, + ) -> Self { + self . inner . integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated = integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated . into () ; + self + } + pub fn integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated( + mut self, + integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated = + integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating16_bit_signed_accelerated( + mut self, + integer_dot_product_accumulating_saturating16_bit_signed_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating16_bit_signed_accelerated = + integer_dot_product_accumulating_saturating16_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated = + integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated( + mut self, + integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated = + integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating32_bit_signed_accelerated( + mut self, + integer_dot_product_accumulating_saturating32_bit_signed_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating32_bit_signed_accelerated = + integer_dot_product_accumulating_saturating32_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated = + integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated( + mut self, + integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated = + integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating64_bit_signed_accelerated( + mut self, + integer_dot_product_accumulating_saturating64_bit_signed_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating64_bit_signed_accelerated = + integer_dot_product_accumulating_saturating64_bit_signed_accelerated.into(); + self + } + pub fn integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated( + mut self, + integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated: bool, + ) -> Self { + self.inner + .integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated = + integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated.into(); + self + } + pub fn storage_texel_buffer_offset_alignment_bytes( + mut self, + storage_texel_buffer_offset_alignment_bytes: DeviceSize, + ) -> Self { + self.inner.storage_texel_buffer_offset_alignment_bytes = + storage_texel_buffer_offset_alignment_bytes; + self + } + pub fn storage_texel_buffer_offset_single_texel_alignment( + mut self, + storage_texel_buffer_offset_single_texel_alignment: bool, + ) -> Self { + self.inner + .storage_texel_buffer_offset_single_texel_alignment = + storage_texel_buffer_offset_single_texel_alignment.into(); + self + } + pub fn uniform_texel_buffer_offset_alignment_bytes( + mut self, + uniform_texel_buffer_offset_alignment_bytes: DeviceSize, + ) -> Self { + self.inner.uniform_texel_buffer_offset_alignment_bytes = + uniform_texel_buffer_offset_alignment_bytes; + self + } + pub fn uniform_texel_buffer_offset_single_texel_alignment( + mut self, + uniform_texel_buffer_offset_single_texel_alignment: bool, + ) -> Self { + self.inner + .uniform_texel_buffer_offset_single_texel_alignment = + uniform_texel_buffer_offset_single_texel_alignment.into(); + self + } + pub fn max_buffer_size(mut self, max_buffer_size: DeviceSize) -> Self { + self.inner.max_buffer_size = max_buffer_size; + self + } + #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] + #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] + #[doc = r" so references to builders can be passed directly to Vulkan functions."] + pub fn build(self) -> PhysicalDeviceVulkan13Properties { + self.inner + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] pub struct PipelineCompilerControlCreateInfoAMD { pub s_type: StructureType, pub p_next: *const c_void, @@ -41570,7 +42142,7 @@ impl<'a> PipelineCompilerControlCreateInfoAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceCoherentMemoryFeaturesAMD { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41627,76 +42199,76 @@ impl<'a> PhysicalDeviceCoherentMemoryFeaturesAMDBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceToolPropertiesEXT { +#[doc = ""] +pub struct PhysicalDeviceToolProperties { pub s_type: StructureType, pub p_next: *mut c_void, pub name: [c_char; MAX_EXTENSION_NAME_SIZE], pub version: [c_char; MAX_EXTENSION_NAME_SIZE], - pub purposes: ToolPurposeFlagsEXT, + pub purposes: ToolPurposeFlags, pub description: [c_char; MAX_DESCRIPTION_SIZE], pub layer: [c_char; MAX_EXTENSION_NAME_SIZE], } #[cfg(feature = "debug")] -impl fmt::Debug for PhysicalDeviceToolPropertiesEXT { +impl fmt::Debug for PhysicalDeviceToolProperties { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - fmt.debug_struct("PhysicalDeviceToolPropertiesEXT") + fmt.debug_struct("PhysicalDeviceToolProperties") .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("name", &unsafe { - ::std::ffi::CStr::from_ptr(self.name.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.name.as_ptr()) }) .field("version", &unsafe { - ::std::ffi::CStr::from_ptr(self.version.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.version.as_ptr()) }) .field("purposes", &self.purposes) .field("description", &unsafe { - ::std::ffi::CStr::from_ptr(self.description.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.description.as_ptr()) }) .field("layer", &unsafe { - ::std::ffi::CStr::from_ptr(self.layer.as_ptr() as *const c_char) + ::std::ffi::CStr::from_ptr(self.layer.as_ptr()) }) .finish() } } -impl ::std::default::Default for PhysicalDeviceToolPropertiesEXT { +impl ::std::default::Default for PhysicalDeviceToolProperties { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_TOOL_PROPERTIES, p_next: ::std::ptr::null_mut(), name: unsafe { ::std::mem::zeroed() }, version: unsafe { ::std::mem::zeroed() }, - purposes: ToolPurposeFlagsEXT::default(), + purposes: ToolPurposeFlags::default(), description: unsafe { ::std::mem::zeroed() }, layer: unsafe { ::std::mem::zeroed() }, } } } -impl PhysicalDeviceToolPropertiesEXT { - pub fn builder<'a>() -> PhysicalDeviceToolPropertiesEXTBuilder<'a> { - PhysicalDeviceToolPropertiesEXTBuilder { +impl PhysicalDeviceToolProperties { + pub fn builder<'a>() -> PhysicalDeviceToolPropertiesBuilder<'a> { + PhysicalDeviceToolPropertiesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceToolPropertiesEXTBuilder<'a> { - inner: PhysicalDeviceToolPropertiesEXT, +pub struct PhysicalDeviceToolPropertiesBuilder<'a> { + inner: PhysicalDeviceToolProperties, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for PhysicalDeviceToolPropertiesEXTBuilder<'a> { - type Target = PhysicalDeviceToolPropertiesEXT; +impl<'a> ::std::ops::Deref for PhysicalDeviceToolPropertiesBuilder<'a> { + type Target = PhysicalDeviceToolProperties; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceToolPropertiesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceToolPropertiesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceToolPropertiesEXTBuilder<'a> { +impl<'a> PhysicalDeviceToolPropertiesBuilder<'a> { pub fn name(mut self, name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self { self.inner.name = name; self @@ -41705,7 +42277,7 @@ impl<'a> PhysicalDeviceToolPropertiesEXTBuilder<'a> { self.inner.version = version; self } - pub fn purposes(mut self, purposes: ToolPurposeFlagsEXT) -> Self { + pub fn purposes(mut self, purposes: ToolPurposeFlags) -> Self { self.inner.purposes = purposes; self } @@ -41720,13 +42292,13 @@ impl<'a> PhysicalDeviceToolPropertiesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceToolPropertiesEXT { + pub fn build(self) -> PhysicalDeviceToolProperties { self.inner } } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SamplerCustomBorderColorCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -41799,7 +42371,7 @@ impl<'a> SamplerCustomBorderColorCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceCustomBorderColorPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41861,7 +42433,7 @@ impl<'a> PhysicalDeviceCustomBorderColorPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceCustomBorderColorFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -41931,7 +42503,7 @@ impl<'a> PhysicalDeviceCustomBorderColorFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SamplerBorderColorComponentMappingCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -41996,7 +42568,7 @@ impl<'a> SamplerBorderColorComponentMappingCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceBorderColorSwizzleFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -42065,7 +42637,7 @@ impl<'a> PhysicalDeviceBorderColorSwizzleFeaturesEXTBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union DeviceOrHostAddressKHR { pub device_address: DeviceAddress, pub host_address: *mut c_void, @@ -42077,7 +42649,7 @@ impl ::std::default::Default for DeviceOrHostAddressKHR { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union DeviceOrHostAddressConstKHR { pub device_address: DeviceAddress, pub host_address: *const c_void, @@ -42089,7 +42661,7 @@ impl ::std::default::Default for DeviceOrHostAddressConstKHR { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureGeometryTrianglesDataKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42196,10 +42768,10 @@ impl<'a> AccelerationStructureGeometryTrianglesDataKHRBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -42212,7 +42784,7 @@ impl<'a> AccelerationStructureGeometryTrianglesDataKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureGeometryAabbsDataKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42282,7 +42854,7 @@ impl<'a> AccelerationStructureGeometryAabbsDataKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureGeometryInstancesDataKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42352,7 +42924,7 @@ impl<'a> AccelerationStructureGeometryInstancesDataKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union AccelerationStructureGeometryDataKHR { pub triangles: AccelerationStructureGeometryTrianglesDataKHR, pub aabbs: AccelerationStructureGeometryAabbsDataKHR, @@ -42365,7 +42937,7 @@ impl ::std::default::Default for AccelerationStructureGeometryDataKHR { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureGeometryKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42442,7 +43014,7 @@ impl<'a> AccelerationStructureGeometryKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureBuildGeometryInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42575,7 +43147,7 @@ impl<'a> AccelerationStructureBuildGeometryInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureBuildRangeInfoKHR { pub primitive_count: u32, pub primitive_offset: u32, @@ -42633,7 +43205,7 @@ impl<'a> AccelerationStructureBuildRangeInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42718,10 +43290,10 @@ impl<'a> AccelerationStructureCreateInfoKHRBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -42735,7 +43307,7 @@ impl<'a> AccelerationStructureCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct AabbPositionsKHR { pub min_x: f32, pub min_y: f32, @@ -42813,7 +43385,7 @@ pub union AccelerationStructureReferenceKHR { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureInstanceKHR { pub transform: TransformMatrixKHR, #[doc = r" Use [`Packed24_8::new(instance_custom_index, mask)`][Packed24_8::new()] to construct this field"] @@ -42825,7 +43397,7 @@ pub struct AccelerationStructureInstanceKHR { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureDeviceAddressInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42882,7 +43454,7 @@ impl<'a> AccelerationStructureDeviceAddressInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureVersionInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -42923,7 +43495,7 @@ impl<'a> ::std::ops::DerefMut for AccelerationStructureVersionInfoKHRBuilder<'a> } impl<'a> AccelerationStructureVersionInfoKHRBuilder<'a> { pub fn version_data(mut self, version_data: &'a [u8; 2 * UUID_SIZE]) -> Self { - self.inner.p_version_data = version_data as *const [u8; 2 * UUID_SIZE]; + self.inner.p_version_data = version_data; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] @@ -42936,7 +43508,7 @@ impl<'a> AccelerationStructureVersionInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CopyAccelerationStructureInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -43001,7 +43573,7 @@ impl<'a> CopyAccelerationStructureInfoKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CopyAccelerationStructureToMemoryInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -43078,7 +43650,7 @@ impl<'a> CopyAccelerationStructureToMemoryInfoKHRBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CopyMemoryToAccelerationStructureInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -43156,7 +43728,7 @@ impl<'a> CopyMemoryToAccelerationStructureInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RayTracingPipelineInterfaceCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -43219,7 +43791,7 @@ impl<'a> RayTracingPipelineInterfaceCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineLibraryCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -43276,7 +43848,7 @@ impl<'a> PipelineLibraryCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExtendedDynamicStateFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43337,7 +43909,7 @@ impl<'a> PhysicalDeviceExtendedDynamicStateFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExtendedDynamicState2FeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43417,7 +43989,7 @@ impl<'a> PhysicalDeviceExtendedDynamicState2FeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderPassTransformBeginInfoQCOM { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43473,7 +44045,7 @@ impl<'a> RenderPassTransformBeginInfoQCOMBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CopyCommandTransformInfoQCOM { pub s_type: StructureType, pub p_next: *const c_void, @@ -43501,10 +44073,10 @@ pub struct CopyCommandTransformInfoQCOMBuilder<'a> { inner: CopyCommandTransformInfoQCOM, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsBufferImageCopy2KHR for CopyCommandTransformInfoQCOMBuilder<'_> {} -unsafe impl ExtendsBufferImageCopy2KHR for CopyCommandTransformInfoQCOM {} -unsafe impl ExtendsImageBlit2KHR for CopyCommandTransformInfoQCOMBuilder<'_> {} -unsafe impl ExtendsImageBlit2KHR for CopyCommandTransformInfoQCOM {} +unsafe impl ExtendsBufferImageCopy2 for CopyCommandTransformInfoQCOMBuilder<'_> {} +unsafe impl ExtendsBufferImageCopy2 for CopyCommandTransformInfoQCOM {} +unsafe impl ExtendsImageBlit2 for CopyCommandTransformInfoQCOMBuilder<'_> {} +unsafe impl ExtendsImageBlit2 for CopyCommandTransformInfoQCOM {} impl<'a> ::std::ops::Deref for CopyCommandTransformInfoQCOMBuilder<'a> { type Target = CopyCommandTransformInfoQCOM; fn deref(&self) -> &Self::Target { @@ -43531,7 +44103,7 @@ impl<'a> CopyCommandTransformInfoQCOMBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferInheritanceRenderPassTransformInfoQCOM { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43599,7 +44171,7 @@ impl<'a> CommandBufferInheritanceRenderPassTransformInfoQCOMBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDiagnosticsConfigFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43660,7 +44232,7 @@ impl<'a> PhysicalDeviceDiagnosticsConfigFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DeviceDiagnosticsConfigCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -43716,61 +44288,56 @@ impl<'a> DeviceDiagnosticsConfigCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR { +#[doc = ""] +pub struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub shader_zero_initialize_workgroup_memory: Bool32, } -impl ::std::default::Default for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR { +impl ::std::default::Default for PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR, + s_type: StructureType::PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES, p_next: ::std::ptr::null_mut(), shader_zero_initialize_workgroup_memory: Bool32::default(), } } } -impl PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR { - pub fn builder<'a>() -> PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'a> { - PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder { +impl PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures { + pub fn builder<'a>() -> PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder<'a> { + PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'a> { - inner: PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR, +pub struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder<'a> { + inner: PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR + for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder<'_> { } +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures {} unsafe impl ExtendsDeviceCreateInfo - for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'_> + for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder<'_> { } -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR {} -impl<'a> ::std::ops::Deref for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'a> { - type Target = PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR; +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder<'a> { + type Target = PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut - for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'a> -{ +impl<'a> ::std::ops::DerefMut for PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'a> { +impl<'a> PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesBuilder<'a> { pub fn shader_zero_initialize_workgroup_memory( mut self, shader_zero_initialize_workgroup_memory: bool, @@ -43782,14 +44349,14 @@ impl<'a> PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR { + pub fn build(self) -> PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43865,7 +44432,7 @@ impl<'a> PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRobustness2FeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -43935,7 +44502,7 @@ impl<'a> PhysicalDeviceRobustness2FeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRobustness2PropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44005,50 +44572,50 @@ impl<'a> PhysicalDeviceRobustness2PropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceImageRobustnessFeaturesEXT { +#[doc = ""] +pub struct PhysicalDeviceImageRobustnessFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub robust_image_access: Bool32, } -impl ::std::default::Default for PhysicalDeviceImageRobustnessFeaturesEXT { +impl ::std::default::Default for PhysicalDeviceImageRobustnessFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT, + s_type: StructureType::PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES, p_next: ::std::ptr::null_mut(), robust_image_access: Bool32::default(), } } } -impl PhysicalDeviceImageRobustnessFeaturesEXT { - pub fn builder<'a>() -> PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'a> { - PhysicalDeviceImageRobustnessFeaturesEXTBuilder { +impl PhysicalDeviceImageRobustnessFeatures { + pub fn builder<'a>() -> PhysicalDeviceImageRobustnessFeaturesBuilder<'a> { + PhysicalDeviceImageRobustnessFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'a> { - inner: PhysicalDeviceImageRobustnessFeaturesEXT, +pub struct PhysicalDeviceImageRobustnessFeaturesBuilder<'a> { + inner: PhysicalDeviceImageRobustnessFeatures, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'_> {} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceImageRobustnessFeaturesEXT {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceImageRobustnessFeaturesEXT {} -impl<'a> ::std::ops::Deref for PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'a> { - type Target = PhysicalDeviceImageRobustnessFeaturesEXT; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceImageRobustnessFeaturesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceImageRobustnessFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceImageRobustnessFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceImageRobustnessFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceImageRobustnessFeaturesBuilder<'a> { + type Target = PhysicalDeviceImageRobustnessFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceImageRobustnessFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'a> { +impl<'a> PhysicalDeviceImageRobustnessFeaturesBuilder<'a> { pub fn robust_image_access(mut self, robust_image_access: bool) -> Self { self.inner.robust_image_access = robust_image_access.into(); self @@ -44056,14 +44623,14 @@ impl<'a> PhysicalDeviceImageRobustnessFeaturesEXTBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceImageRobustnessFeaturesEXT { + pub fn build(self) -> PhysicalDeviceImageRobustnessFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44166,7 +44733,7 @@ impl<'a> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePortabilitySubsetFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44325,7 +44892,7 @@ impl<'a> PhysicalDevicePortabilitySubsetFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevicePortabilitySubsetPropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44388,7 +44955,7 @@ impl<'a> PhysicalDevicePortabilitySubsetPropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDevice4444FormatsFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44452,7 +45019,7 @@ impl<'a> PhysicalDevice4444FormatsFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceSubpassShadingFeaturesHUAWEI { pub s_type: StructureType, pub p_next: *mut c_void, @@ -44513,18 +45080,18 @@ impl<'a> PhysicalDeviceSubpassShadingFeaturesHUAWEIBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct BufferCopy2KHR { +#[doc = ""] +pub struct BufferCopy2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_offset: DeviceSize, pub dst_offset: DeviceSize, pub size: DeviceSize, } -impl ::std::default::Default for BufferCopy2KHR { +impl ::std::default::Default for BufferCopy2 { fn default() -> Self { Self { - s_type: StructureType::BUFFER_COPY_2_KHR, + s_type: StructureType::BUFFER_COPY_2, p_next: ::std::ptr::null(), src_offset: DeviceSize::default(), dst_offset: DeviceSize::default(), @@ -44532,31 +45099,31 @@ impl ::std::default::Default for BufferCopy2KHR { } } } -impl BufferCopy2KHR { - pub fn builder<'a>() -> BufferCopy2KHRBuilder<'a> { - BufferCopy2KHRBuilder { +impl BufferCopy2 { + pub fn builder<'a>() -> BufferCopy2Builder<'a> { + BufferCopy2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct BufferCopy2KHRBuilder<'a> { - inner: BufferCopy2KHR, +pub struct BufferCopy2Builder<'a> { + inner: BufferCopy2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for BufferCopy2KHRBuilder<'a> { - type Target = BufferCopy2KHR; +impl<'a> ::std::ops::Deref for BufferCopy2Builder<'a> { + type Target = BufferCopy2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for BufferCopy2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for BufferCopy2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> BufferCopy2KHRBuilder<'a> { +impl<'a> BufferCopy2Builder<'a> { pub fn src_offset(mut self, src_offset: DeviceSize) -> Self { self.inner.src_offset = src_offset; self @@ -44572,15 +45139,15 @@ impl<'a> BufferCopy2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> BufferCopy2KHR { + pub fn build(self) -> BufferCopy2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct ImageCopy2KHR { +#[doc = ""] +pub struct ImageCopy2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_subresource: ImageSubresourceLayers, @@ -44589,10 +45156,10 @@ pub struct ImageCopy2KHR { pub dst_offset: Offset3D, pub extent: Extent3D, } -impl ::std::default::Default for ImageCopy2KHR { +impl ::std::default::Default for ImageCopy2 { fn default() -> Self { Self { - s_type: StructureType::IMAGE_COPY_2_KHR, + s_type: StructureType::IMAGE_COPY_2, p_next: ::std::ptr::null(), src_subresource: ImageSubresourceLayers::default(), src_offset: Offset3D::default(), @@ -44602,31 +45169,31 @@ impl ::std::default::Default for ImageCopy2KHR { } } } -impl ImageCopy2KHR { - pub fn builder<'a>() -> ImageCopy2KHRBuilder<'a> { - ImageCopy2KHRBuilder { +impl ImageCopy2 { + pub fn builder<'a>() -> ImageCopy2Builder<'a> { + ImageCopy2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct ImageCopy2KHRBuilder<'a> { - inner: ImageCopy2KHR, +pub struct ImageCopy2Builder<'a> { + inner: ImageCopy2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for ImageCopy2KHRBuilder<'a> { - type Target = ImageCopy2KHR; +impl<'a> ::std::ops::Deref for ImageCopy2Builder<'a> { + type Target = ImageCopy2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for ImageCopy2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for ImageCopy2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> ImageCopy2KHRBuilder<'a> { +impl<'a> ImageCopy2Builder<'a> { pub fn src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self { self.inner.src_subresource = src_subresource; self @@ -44650,15 +45217,15 @@ impl<'a> ImageCopy2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> ImageCopy2KHR { + pub fn build(self) -> ImageCopy2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct ImageBlit2KHR { +#[doc = ""] +pub struct ImageBlit2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_subresource: ImageSubresourceLayers, @@ -44666,10 +45233,10 @@ pub struct ImageBlit2KHR { pub dst_subresource: ImageSubresourceLayers, pub dst_offsets: [Offset3D; 2], } -impl ::std::default::Default for ImageBlit2KHR { +impl ::std::default::Default for ImageBlit2 { fn default() -> Self { Self { - s_type: StructureType::IMAGE_BLIT_2_KHR, + s_type: StructureType::IMAGE_BLIT_2, p_next: ::std::ptr::null(), src_subresource: ImageSubresourceLayers::default(), src_offsets: unsafe { ::std::mem::zeroed() }, @@ -44678,32 +45245,32 @@ impl ::std::default::Default for ImageBlit2KHR { } } } -impl ImageBlit2KHR { - pub fn builder<'a>() -> ImageBlit2KHRBuilder<'a> { - ImageBlit2KHRBuilder { +impl ImageBlit2 { + pub fn builder<'a>() -> ImageBlit2Builder<'a> { + ImageBlit2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct ImageBlit2KHRBuilder<'a> { - inner: ImageBlit2KHR, +pub struct ImageBlit2Builder<'a> { + inner: ImageBlit2, marker: ::std::marker::PhantomData<&'a ()>, } -pub unsafe trait ExtendsImageBlit2KHR {} -impl<'a> ::std::ops::Deref for ImageBlit2KHRBuilder<'a> { - type Target = ImageBlit2KHR; +pub unsafe trait ExtendsImageBlit2 {} +impl<'a> ::std::ops::Deref for ImageBlit2Builder<'a> { + type Target = ImageBlit2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for ImageBlit2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for ImageBlit2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> ImageBlit2KHRBuilder<'a> { +impl<'a> ImageBlit2Builder<'a> { pub fn src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self { self.inner.src_subresource = src_subresource; self @@ -44725,27 +45292,27 @@ impl<'a> ImageBlit2KHRBuilder<'a> { #[doc = r" valid extension structs can be pushed into the chain."] #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] #[doc = r" chain will look like `A -> D -> B -> C`."] - pub fn push_next(mut self, next: &'a mut T) -> Self { + pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> ImageBlit2KHR { + pub fn build(self) -> ImageBlit2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct BufferImageCopy2KHR { +#[doc = ""] +pub struct BufferImageCopy2 { pub s_type: StructureType, pub p_next: *const c_void, pub buffer_offset: DeviceSize, @@ -44755,10 +45322,10 @@ pub struct BufferImageCopy2KHR { pub image_offset: Offset3D, pub image_extent: Extent3D, } -impl ::std::default::Default for BufferImageCopy2KHR { +impl ::std::default::Default for BufferImageCopy2 { fn default() -> Self { Self { - s_type: StructureType::BUFFER_IMAGE_COPY_2_KHR, + s_type: StructureType::BUFFER_IMAGE_COPY_2, p_next: ::std::ptr::null(), buffer_offset: DeviceSize::default(), buffer_row_length: u32::default(), @@ -44769,32 +45336,32 @@ impl ::std::default::Default for BufferImageCopy2KHR { } } } -impl BufferImageCopy2KHR { - pub fn builder<'a>() -> BufferImageCopy2KHRBuilder<'a> { - BufferImageCopy2KHRBuilder { +impl BufferImageCopy2 { + pub fn builder<'a>() -> BufferImageCopy2Builder<'a> { + BufferImageCopy2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct BufferImageCopy2KHRBuilder<'a> { - inner: BufferImageCopy2KHR, +pub struct BufferImageCopy2Builder<'a> { + inner: BufferImageCopy2, marker: ::std::marker::PhantomData<&'a ()>, } -pub unsafe trait ExtendsBufferImageCopy2KHR {} -impl<'a> ::std::ops::Deref for BufferImageCopy2KHRBuilder<'a> { - type Target = BufferImageCopy2KHR; +pub unsafe trait ExtendsBufferImageCopy2 {} +impl<'a> ::std::ops::Deref for BufferImageCopy2Builder<'a> { + type Target = BufferImageCopy2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for BufferImageCopy2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for BufferImageCopy2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> BufferImageCopy2KHRBuilder<'a> { +impl<'a> BufferImageCopy2Builder<'a> { pub fn buffer_offset(mut self, buffer_offset: DeviceSize) -> Self { self.inner.buffer_offset = buffer_offset; self @@ -44824,27 +45391,27 @@ impl<'a> BufferImageCopy2KHRBuilder<'a> { #[doc = r" valid extension structs can be pushed into the chain."] #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] #[doc = r" chain will look like `A -> D -> B -> C`."] - pub fn push_next(mut self, next: &'a mut T) -> Self { + pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> BufferImageCopy2KHR { + pub fn build(self) -> BufferImageCopy2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct ImageResolve2KHR { +#[doc = ""] +pub struct ImageResolve2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_subresource: ImageSubresourceLayers, @@ -44853,10 +45420,10 @@ pub struct ImageResolve2KHR { pub dst_offset: Offset3D, pub extent: Extent3D, } -impl ::std::default::Default for ImageResolve2KHR { +impl ::std::default::Default for ImageResolve2 { fn default() -> Self { Self { - s_type: StructureType::IMAGE_RESOLVE_2_KHR, + s_type: StructureType::IMAGE_RESOLVE_2, p_next: ::std::ptr::null(), src_subresource: ImageSubresourceLayers::default(), src_offset: Offset3D::default(), @@ -44866,31 +45433,31 @@ impl ::std::default::Default for ImageResolve2KHR { } } } -impl ImageResolve2KHR { - pub fn builder<'a>() -> ImageResolve2KHRBuilder<'a> { - ImageResolve2KHRBuilder { +impl ImageResolve2 { + pub fn builder<'a>() -> ImageResolve2Builder<'a> { + ImageResolve2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct ImageResolve2KHRBuilder<'a> { - inner: ImageResolve2KHR, +pub struct ImageResolve2Builder<'a> { + inner: ImageResolve2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for ImageResolve2KHRBuilder<'a> { - type Target = ImageResolve2KHR; +impl<'a> ::std::ops::Deref for ImageResolve2Builder<'a> { + type Target = ImageResolve2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for ImageResolve2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for ImageResolve2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> ImageResolve2KHRBuilder<'a> { +impl<'a> ImageResolve2Builder<'a> { pub fn src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self { self.inner.src_subresource = src_subresource; self @@ -44914,26 +45481,26 @@ impl<'a> ImageResolve2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> ImageResolve2KHR { + pub fn build(self) -> ImageResolve2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct CopyBufferInfo2KHR { +#[doc = ""] +pub struct CopyBufferInfo2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_buffer: Buffer, pub dst_buffer: Buffer, pub region_count: u32, - pub p_regions: *const BufferCopy2KHR, + pub p_regions: *const BufferCopy2, } -impl ::std::default::Default for CopyBufferInfo2KHR { +impl ::std::default::Default for CopyBufferInfo2 { fn default() -> Self { Self { - s_type: StructureType::COPY_BUFFER_INFO_2_KHR, + s_type: StructureType::COPY_BUFFER_INFO_2, p_next: ::std::ptr::null(), src_buffer: Buffer::default(), dst_buffer: Buffer::default(), @@ -44942,31 +45509,31 @@ impl ::std::default::Default for CopyBufferInfo2KHR { } } } -impl CopyBufferInfo2KHR { - pub fn builder<'a>() -> CopyBufferInfo2KHRBuilder<'a> { - CopyBufferInfo2KHRBuilder { +impl CopyBufferInfo2 { + pub fn builder<'a>() -> CopyBufferInfo2Builder<'a> { + CopyBufferInfo2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct CopyBufferInfo2KHRBuilder<'a> { - inner: CopyBufferInfo2KHR, +pub struct CopyBufferInfo2Builder<'a> { + inner: CopyBufferInfo2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for CopyBufferInfo2KHRBuilder<'a> { - type Target = CopyBufferInfo2KHR; +impl<'a> ::std::ops::Deref for CopyBufferInfo2Builder<'a> { + type Target = CopyBufferInfo2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for CopyBufferInfo2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for CopyBufferInfo2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> CopyBufferInfo2KHRBuilder<'a> { +impl<'a> CopyBufferInfo2Builder<'a> { pub fn src_buffer(mut self, src_buffer: Buffer) -> Self { self.inner.src_buffer = src_buffer; self @@ -44975,7 +45542,7 @@ impl<'a> CopyBufferInfo2KHRBuilder<'a> { self.inner.dst_buffer = dst_buffer; self } - pub fn regions(mut self, regions: &'a [BufferCopy2KHR]) -> Self { + pub fn regions(mut self, regions: &'a [BufferCopy2]) -> Self { self.inner.region_count = regions.len() as _; self.inner.p_regions = regions.as_ptr(); self @@ -44983,15 +45550,15 @@ impl<'a> CopyBufferInfo2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> CopyBufferInfo2KHR { + pub fn build(self) -> CopyBufferInfo2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct CopyImageInfo2KHR { +#[doc = ""] +pub struct CopyImageInfo2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_image: Image, @@ -44999,12 +45566,12 @@ pub struct CopyImageInfo2KHR { pub dst_image: Image, pub dst_image_layout: ImageLayout, pub region_count: u32, - pub p_regions: *const ImageCopy2KHR, + pub p_regions: *const ImageCopy2, } -impl ::std::default::Default for CopyImageInfo2KHR { +impl ::std::default::Default for CopyImageInfo2 { fn default() -> Self { Self { - s_type: StructureType::COPY_IMAGE_INFO_2_KHR, + s_type: StructureType::COPY_IMAGE_INFO_2, p_next: ::std::ptr::null(), src_image: Image::default(), src_image_layout: ImageLayout::default(), @@ -45015,31 +45582,31 @@ impl ::std::default::Default for CopyImageInfo2KHR { } } } -impl CopyImageInfo2KHR { - pub fn builder<'a>() -> CopyImageInfo2KHRBuilder<'a> { - CopyImageInfo2KHRBuilder { +impl CopyImageInfo2 { + pub fn builder<'a>() -> CopyImageInfo2Builder<'a> { + CopyImageInfo2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct CopyImageInfo2KHRBuilder<'a> { - inner: CopyImageInfo2KHR, +pub struct CopyImageInfo2Builder<'a> { + inner: CopyImageInfo2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for CopyImageInfo2KHRBuilder<'a> { - type Target = CopyImageInfo2KHR; +impl<'a> ::std::ops::Deref for CopyImageInfo2Builder<'a> { + type Target = CopyImageInfo2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for CopyImageInfo2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for CopyImageInfo2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> CopyImageInfo2KHRBuilder<'a> { +impl<'a> CopyImageInfo2Builder<'a> { pub fn src_image(mut self, src_image: Image) -> Self { self.inner.src_image = src_image; self @@ -45056,7 +45623,7 @@ impl<'a> CopyImageInfo2KHRBuilder<'a> { self.inner.dst_image_layout = dst_image_layout; self } - pub fn regions(mut self, regions: &'a [ImageCopy2KHR]) -> Self { + pub fn regions(mut self, regions: &'a [ImageCopy2]) -> Self { self.inner.region_count = regions.len() as _; self.inner.p_regions = regions.as_ptr(); self @@ -45064,15 +45631,15 @@ impl<'a> CopyImageInfo2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> CopyImageInfo2KHR { + pub fn build(self) -> CopyImageInfo2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct BlitImageInfo2KHR { +#[doc = ""] +pub struct BlitImageInfo2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_image: Image, @@ -45080,13 +45647,13 @@ pub struct BlitImageInfo2KHR { pub dst_image: Image, pub dst_image_layout: ImageLayout, pub region_count: u32, - pub p_regions: *const ImageBlit2KHR, + pub p_regions: *const ImageBlit2, pub filter: Filter, } -impl ::std::default::Default for BlitImageInfo2KHR { +impl ::std::default::Default for BlitImageInfo2 { fn default() -> Self { Self { - s_type: StructureType::BLIT_IMAGE_INFO_2_KHR, + s_type: StructureType::BLIT_IMAGE_INFO_2, p_next: ::std::ptr::null(), src_image: Image::default(), src_image_layout: ImageLayout::default(), @@ -45098,31 +45665,31 @@ impl ::std::default::Default for BlitImageInfo2KHR { } } } -impl BlitImageInfo2KHR { - pub fn builder<'a>() -> BlitImageInfo2KHRBuilder<'a> { - BlitImageInfo2KHRBuilder { +impl BlitImageInfo2 { + pub fn builder<'a>() -> BlitImageInfo2Builder<'a> { + BlitImageInfo2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct BlitImageInfo2KHRBuilder<'a> { - inner: BlitImageInfo2KHR, +pub struct BlitImageInfo2Builder<'a> { + inner: BlitImageInfo2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for BlitImageInfo2KHRBuilder<'a> { - type Target = BlitImageInfo2KHR; +impl<'a> ::std::ops::Deref for BlitImageInfo2Builder<'a> { + type Target = BlitImageInfo2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for BlitImageInfo2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for BlitImageInfo2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> BlitImageInfo2KHRBuilder<'a> { +impl<'a> BlitImageInfo2Builder<'a> { pub fn src_image(mut self, src_image: Image) -> Self { self.inner.src_image = src_image; self @@ -45139,7 +45706,7 @@ impl<'a> BlitImageInfo2KHRBuilder<'a> { self.inner.dst_image_layout = dst_image_layout; self } - pub fn regions(mut self, regions: &'a [ImageBlit2KHR]) -> Self { + pub fn regions(mut self, regions: &'a [ImageBlit2]) -> Self { self.inner.region_count = regions.len() as _; self.inner.p_regions = regions.as_ptr(); self @@ -45151,27 +45718,27 @@ impl<'a> BlitImageInfo2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> BlitImageInfo2KHR { + pub fn build(self) -> BlitImageInfo2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct CopyBufferToImageInfo2KHR { +#[doc = ""] +pub struct CopyBufferToImageInfo2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_buffer: Buffer, pub dst_image: Image, pub dst_image_layout: ImageLayout, pub region_count: u32, - pub p_regions: *const BufferImageCopy2KHR, + pub p_regions: *const BufferImageCopy2, } -impl ::std::default::Default for CopyBufferToImageInfo2KHR { +impl ::std::default::Default for CopyBufferToImageInfo2 { fn default() -> Self { Self { - s_type: StructureType::COPY_BUFFER_TO_IMAGE_INFO_2_KHR, + s_type: StructureType::COPY_BUFFER_TO_IMAGE_INFO_2, p_next: ::std::ptr::null(), src_buffer: Buffer::default(), dst_image: Image::default(), @@ -45181,31 +45748,31 @@ impl ::std::default::Default for CopyBufferToImageInfo2KHR { } } } -impl CopyBufferToImageInfo2KHR { - pub fn builder<'a>() -> CopyBufferToImageInfo2KHRBuilder<'a> { - CopyBufferToImageInfo2KHRBuilder { +impl CopyBufferToImageInfo2 { + pub fn builder<'a>() -> CopyBufferToImageInfo2Builder<'a> { + CopyBufferToImageInfo2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct CopyBufferToImageInfo2KHRBuilder<'a> { - inner: CopyBufferToImageInfo2KHR, +pub struct CopyBufferToImageInfo2Builder<'a> { + inner: CopyBufferToImageInfo2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for CopyBufferToImageInfo2KHRBuilder<'a> { - type Target = CopyBufferToImageInfo2KHR; +impl<'a> ::std::ops::Deref for CopyBufferToImageInfo2Builder<'a> { + type Target = CopyBufferToImageInfo2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for CopyBufferToImageInfo2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for CopyBufferToImageInfo2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> CopyBufferToImageInfo2KHRBuilder<'a> { +impl<'a> CopyBufferToImageInfo2Builder<'a> { pub fn src_buffer(mut self, src_buffer: Buffer) -> Self { self.inner.src_buffer = src_buffer; self @@ -45218,7 +45785,7 @@ impl<'a> CopyBufferToImageInfo2KHRBuilder<'a> { self.inner.dst_image_layout = dst_image_layout; self } - pub fn regions(mut self, regions: &'a [BufferImageCopy2KHR]) -> Self { + pub fn regions(mut self, regions: &'a [BufferImageCopy2]) -> Self { self.inner.region_count = regions.len() as _; self.inner.p_regions = regions.as_ptr(); self @@ -45226,27 +45793,27 @@ impl<'a> CopyBufferToImageInfo2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> CopyBufferToImageInfo2KHR { + pub fn build(self) -> CopyBufferToImageInfo2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct CopyImageToBufferInfo2KHR { +#[doc = ""] +pub struct CopyImageToBufferInfo2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_image: Image, pub src_image_layout: ImageLayout, pub dst_buffer: Buffer, pub region_count: u32, - pub p_regions: *const BufferImageCopy2KHR, + pub p_regions: *const BufferImageCopy2, } -impl ::std::default::Default for CopyImageToBufferInfo2KHR { +impl ::std::default::Default for CopyImageToBufferInfo2 { fn default() -> Self { Self { - s_type: StructureType::COPY_IMAGE_TO_BUFFER_INFO_2_KHR, + s_type: StructureType::COPY_IMAGE_TO_BUFFER_INFO_2, p_next: ::std::ptr::null(), src_image: Image::default(), src_image_layout: ImageLayout::default(), @@ -45256,31 +45823,31 @@ impl ::std::default::Default for CopyImageToBufferInfo2KHR { } } } -impl CopyImageToBufferInfo2KHR { - pub fn builder<'a>() -> CopyImageToBufferInfo2KHRBuilder<'a> { - CopyImageToBufferInfo2KHRBuilder { +impl CopyImageToBufferInfo2 { + pub fn builder<'a>() -> CopyImageToBufferInfo2Builder<'a> { + CopyImageToBufferInfo2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct CopyImageToBufferInfo2KHRBuilder<'a> { - inner: CopyImageToBufferInfo2KHR, +pub struct CopyImageToBufferInfo2Builder<'a> { + inner: CopyImageToBufferInfo2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for CopyImageToBufferInfo2KHRBuilder<'a> { - type Target = CopyImageToBufferInfo2KHR; +impl<'a> ::std::ops::Deref for CopyImageToBufferInfo2Builder<'a> { + type Target = CopyImageToBufferInfo2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for CopyImageToBufferInfo2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for CopyImageToBufferInfo2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> CopyImageToBufferInfo2KHRBuilder<'a> { +impl<'a> CopyImageToBufferInfo2Builder<'a> { pub fn src_image(mut self, src_image: Image) -> Self { self.inner.src_image = src_image; self @@ -45293,7 +45860,7 @@ impl<'a> CopyImageToBufferInfo2KHRBuilder<'a> { self.inner.dst_buffer = dst_buffer; self } - pub fn regions(mut self, regions: &'a [BufferImageCopy2KHR]) -> Self { + pub fn regions(mut self, regions: &'a [BufferImageCopy2]) -> Self { self.inner.region_count = regions.len() as _; self.inner.p_regions = regions.as_ptr(); self @@ -45301,15 +45868,15 @@ impl<'a> CopyImageToBufferInfo2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> CopyImageToBufferInfo2KHR { + pub fn build(self) -> CopyImageToBufferInfo2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct ResolveImageInfo2KHR { +#[doc = ""] +pub struct ResolveImageInfo2 { pub s_type: StructureType, pub p_next: *const c_void, pub src_image: Image, @@ -45317,12 +45884,12 @@ pub struct ResolveImageInfo2KHR { pub dst_image: Image, pub dst_image_layout: ImageLayout, pub region_count: u32, - pub p_regions: *const ImageResolve2KHR, + pub p_regions: *const ImageResolve2, } -impl ::std::default::Default for ResolveImageInfo2KHR { +impl ::std::default::Default for ResolveImageInfo2 { fn default() -> Self { Self { - s_type: StructureType::RESOLVE_IMAGE_INFO_2_KHR, + s_type: StructureType::RESOLVE_IMAGE_INFO_2, p_next: ::std::ptr::null(), src_image: Image::default(), src_image_layout: ImageLayout::default(), @@ -45333,31 +45900,31 @@ impl ::std::default::Default for ResolveImageInfo2KHR { } } } -impl ResolveImageInfo2KHR { - pub fn builder<'a>() -> ResolveImageInfo2KHRBuilder<'a> { - ResolveImageInfo2KHRBuilder { +impl ResolveImageInfo2 { + pub fn builder<'a>() -> ResolveImageInfo2Builder<'a> { + ResolveImageInfo2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct ResolveImageInfo2KHRBuilder<'a> { - inner: ResolveImageInfo2KHR, +pub struct ResolveImageInfo2Builder<'a> { + inner: ResolveImageInfo2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for ResolveImageInfo2KHRBuilder<'a> { - type Target = ResolveImageInfo2KHR; +impl<'a> ::std::ops::Deref for ResolveImageInfo2Builder<'a> { + type Target = ResolveImageInfo2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for ResolveImageInfo2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for ResolveImageInfo2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> ResolveImageInfo2KHRBuilder<'a> { +impl<'a> ResolveImageInfo2Builder<'a> { pub fn src_image(mut self, src_image: Image) -> Self { self.inner.src_image = src_image; self @@ -45374,7 +45941,7 @@ impl<'a> ResolveImageInfo2KHRBuilder<'a> { self.inner.dst_image_layout = dst_image_layout; self } - pub fn regions(mut self, regions: &'a [ImageResolve2KHR]) -> Self { + pub fn regions(mut self, regions: &'a [ImageResolve2]) -> Self { self.inner.region_count = regions.len() as _; self.inner.p_regions = regions.as_ptr(); self @@ -45382,14 +45949,14 @@ impl<'a> ResolveImageInfo2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> ResolveImageInfo2KHR { + pub fn build(self) -> ResolveImageInfo2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceShaderImageAtomicInt64FeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45456,7 +46023,7 @@ impl<'a> PhysicalDeviceShaderImageAtomicInt64FeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct FragmentShadingRateAttachmentInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -45524,7 +46091,7 @@ impl<'a> FragmentShadingRateAttachmentInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineFragmentShadingRateStateCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -45589,7 +46156,7 @@ impl<'a> PipelineFragmentShadingRateStateCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentShadingRateFeaturesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45668,7 +46235,7 @@ impl<'a> PhysicalDeviceFragmentShadingRateFeaturesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentShadingRatePropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45888,7 +46455,7 @@ impl<'a> PhysicalDeviceFragmentShadingRatePropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentShadingRateKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -45948,56 +46515,53 @@ impl<'a> PhysicalDeviceFragmentShadingRateKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceShaderTerminateInvocationFeaturesKHR { +#[doc = ""] +pub struct PhysicalDeviceShaderTerminateInvocationFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub shader_terminate_invocation: Bool32, } -impl ::std::default::Default for PhysicalDeviceShaderTerminateInvocationFeaturesKHR { +impl ::std::default::Default for PhysicalDeviceShaderTerminateInvocationFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR, + s_type: StructureType::PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES, p_next: ::std::ptr::null_mut(), shader_terminate_invocation: Bool32::default(), } } } -impl PhysicalDeviceShaderTerminateInvocationFeaturesKHR { - pub fn builder<'a>() -> PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'a> { - PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder { +impl PhysicalDeviceShaderTerminateInvocationFeatures { + pub fn builder<'a>() -> PhysicalDeviceShaderTerminateInvocationFeaturesBuilder<'a> { + PhysicalDeviceShaderTerminateInvocationFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'a> { - inner: PhysicalDeviceShaderTerminateInvocationFeaturesKHR, +pub struct PhysicalDeviceShaderTerminateInvocationFeaturesBuilder<'a> { + inner: PhysicalDeviceShaderTerminateInvocationFeatures, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceShaderTerminateInvocationFeaturesKHR {} -unsafe impl ExtendsDeviceCreateInfo - for PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'_> + for PhysicalDeviceShaderTerminateInvocationFeaturesBuilder<'_> { } -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderTerminateInvocationFeaturesKHR {} -impl<'a> ::std::ops::Deref for PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'a> { - type Target = PhysicalDeviceShaderTerminateInvocationFeaturesKHR; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceShaderTerminateInvocationFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderTerminateInvocationFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderTerminateInvocationFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceShaderTerminateInvocationFeaturesBuilder<'a> { + type Target = PhysicalDeviceShaderTerminateInvocationFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderTerminateInvocationFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'a> { +impl<'a> PhysicalDeviceShaderTerminateInvocationFeaturesBuilder<'a> { pub fn shader_terminate_invocation(mut self, shader_terminate_invocation: bool) -> Self { self.inner.shader_terminate_invocation = shader_terminate_invocation.into(); self @@ -46005,14 +46569,14 @@ impl<'a> PhysicalDeviceShaderTerminateInvocationFeaturesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceShaderTerminateInvocationFeaturesKHR { + pub fn build(self) -> PhysicalDeviceShaderTerminateInvocationFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentShadingRateEnumsFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46095,7 +46659,7 @@ impl<'a> PhysicalDeviceFragmentShadingRateEnumsFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceFragmentShadingRateEnumsPropertiesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46161,7 +46725,7 @@ impl<'a> PhysicalDeviceFragmentShadingRateEnumsPropertiesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineFragmentShadingRateEnumStateCreateInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -46232,7 +46796,7 @@ impl<'a> PipelineFragmentShadingRateEnumStateCreateInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureBuildSizesInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -46298,7 +46862,7 @@ impl<'a> AccelerationStructureBuildSizesInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceMutableDescriptorTypeFeaturesVALVE { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46362,7 +46926,7 @@ impl<'a> PhysicalDeviceMutableDescriptorTypeFeaturesVALVEBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MutableDescriptorTypeListVALVE { pub descriptor_type_count: u32, pub p_descriptor_types: *const DescriptorType, @@ -46415,7 +46979,7 @@ impl<'a> MutableDescriptorTypeListVALVEBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MutableDescriptorTypeCreateInfoVALVE { pub s_type: StructureType, pub p_next: *const c_void, @@ -46482,7 +47046,7 @@ impl<'a> MutableDescriptorTypeCreateInfoVALVEBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDepthClipControlFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46543,7 +47107,7 @@ impl<'a> PhysicalDeviceDepthClipControlFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineViewportDepthClipControlCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -46605,7 +47169,7 @@ impl<'a> PipelineViewportDepthClipControlCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVertexInputDynamicStateFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46669,7 +47233,7 @@ impl<'a> PhysicalDeviceVertexInputDynamicStateFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceExternalMemoryRDMAFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46730,7 +47294,7 @@ impl<'a> PhysicalDeviceExternalMemoryRDMAFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VertexInputBindingDescription2EXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46802,7 +47366,7 @@ impl<'a> VertexInputBindingDescription2EXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VertexInputAttributeDescription2EXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46874,7 +47438,7 @@ impl<'a> VertexInputAttributeDescription2EXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceColorWriteEnableFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -46935,7 +47499,7 @@ impl<'a> PhysicalDeviceColorWriteEnableFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineColorWriteCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -46997,88 +47561,88 @@ impl<'a> PipelineColorWriteCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct MemoryBarrier2KHR { +#[doc = ""] +pub struct MemoryBarrier2 { pub s_type: StructureType, pub p_next: *const c_void, - pub src_stage_mask: PipelineStageFlags2KHR, - pub src_access_mask: AccessFlags2KHR, - pub dst_stage_mask: PipelineStageFlags2KHR, - pub dst_access_mask: AccessFlags2KHR, + pub src_stage_mask: PipelineStageFlags2, + pub src_access_mask: AccessFlags2, + pub dst_stage_mask: PipelineStageFlags2, + pub dst_access_mask: AccessFlags2, } -impl ::std::default::Default for MemoryBarrier2KHR { +impl ::std::default::Default for MemoryBarrier2 { fn default() -> Self { Self { - s_type: StructureType::MEMORY_BARRIER_2_KHR, + s_type: StructureType::MEMORY_BARRIER_2, p_next: ::std::ptr::null(), - src_stage_mask: PipelineStageFlags2KHR::default(), - src_access_mask: AccessFlags2KHR::default(), - dst_stage_mask: PipelineStageFlags2KHR::default(), - dst_access_mask: AccessFlags2KHR::default(), + src_stage_mask: PipelineStageFlags2::default(), + src_access_mask: AccessFlags2::default(), + dst_stage_mask: PipelineStageFlags2::default(), + dst_access_mask: AccessFlags2::default(), } } } -impl MemoryBarrier2KHR { - pub fn builder<'a>() -> MemoryBarrier2KHRBuilder<'a> { - MemoryBarrier2KHRBuilder { +impl MemoryBarrier2 { + pub fn builder<'a>() -> MemoryBarrier2Builder<'a> { + MemoryBarrier2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct MemoryBarrier2KHRBuilder<'a> { - inner: MemoryBarrier2KHR, +pub struct MemoryBarrier2Builder<'a> { + inner: MemoryBarrier2, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsSubpassDependency2 for MemoryBarrier2KHRBuilder<'_> {} -unsafe impl ExtendsSubpassDependency2 for MemoryBarrier2KHR {} -impl<'a> ::std::ops::Deref for MemoryBarrier2KHRBuilder<'a> { - type Target = MemoryBarrier2KHR; +unsafe impl ExtendsSubpassDependency2 for MemoryBarrier2Builder<'_> {} +unsafe impl ExtendsSubpassDependency2 for MemoryBarrier2 {} +impl<'a> ::std::ops::Deref for MemoryBarrier2Builder<'a> { + type Target = MemoryBarrier2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for MemoryBarrier2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for MemoryBarrier2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> MemoryBarrier2KHRBuilder<'a> { - pub fn src_stage_mask(mut self, src_stage_mask: PipelineStageFlags2KHR) -> Self { +impl<'a> MemoryBarrier2Builder<'a> { + pub fn src_stage_mask(mut self, src_stage_mask: PipelineStageFlags2) -> Self { self.inner.src_stage_mask = src_stage_mask; self } - pub fn src_access_mask(mut self, src_access_mask: AccessFlags2KHR) -> Self { + pub fn src_access_mask(mut self, src_access_mask: AccessFlags2) -> Self { self.inner.src_access_mask = src_access_mask; self } - pub fn dst_stage_mask(mut self, dst_stage_mask: PipelineStageFlags2KHR) -> Self { + pub fn dst_stage_mask(mut self, dst_stage_mask: PipelineStageFlags2) -> Self { self.inner.dst_stage_mask = dst_stage_mask; self } - pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags2KHR) -> Self { + pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags2) -> Self { self.inner.dst_access_mask = dst_access_mask; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> MemoryBarrier2KHR { + pub fn build(self) -> MemoryBarrier2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct ImageMemoryBarrier2KHR { +#[doc = ""] +pub struct ImageMemoryBarrier2 { pub s_type: StructureType, pub p_next: *const c_void, - pub src_stage_mask: PipelineStageFlags2KHR, - pub src_access_mask: AccessFlags2KHR, - pub dst_stage_mask: PipelineStageFlags2KHR, - pub dst_access_mask: AccessFlags2KHR, + pub src_stage_mask: PipelineStageFlags2, + pub src_access_mask: AccessFlags2, + pub dst_stage_mask: PipelineStageFlags2, + pub dst_access_mask: AccessFlags2, pub old_layout: ImageLayout, pub new_layout: ImageLayout, pub src_queue_family_index: u32, @@ -47086,15 +47650,15 @@ pub struct ImageMemoryBarrier2KHR { pub image: Image, pub subresource_range: ImageSubresourceRange, } -impl ::std::default::Default for ImageMemoryBarrier2KHR { +impl ::std::default::Default for ImageMemoryBarrier2 { fn default() -> Self { Self { - s_type: StructureType::IMAGE_MEMORY_BARRIER_2_KHR, + s_type: StructureType::IMAGE_MEMORY_BARRIER_2, p_next: ::std::ptr::null(), - src_stage_mask: PipelineStageFlags2KHR::default(), - src_access_mask: AccessFlags2KHR::default(), - dst_stage_mask: PipelineStageFlags2KHR::default(), - dst_access_mask: AccessFlags2KHR::default(), + src_stage_mask: PipelineStageFlags2::default(), + src_access_mask: AccessFlags2::default(), + dst_stage_mask: PipelineStageFlags2::default(), + dst_access_mask: AccessFlags2::default(), old_layout: ImageLayout::default(), new_layout: ImageLayout::default(), src_queue_family_index: u32::default(), @@ -47104,45 +47668,45 @@ impl ::std::default::Default for ImageMemoryBarrier2KHR { } } } -impl ImageMemoryBarrier2KHR { - pub fn builder<'a>() -> ImageMemoryBarrier2KHRBuilder<'a> { - ImageMemoryBarrier2KHRBuilder { +impl ImageMemoryBarrier2 { + pub fn builder<'a>() -> ImageMemoryBarrier2Builder<'a> { + ImageMemoryBarrier2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct ImageMemoryBarrier2KHRBuilder<'a> { - inner: ImageMemoryBarrier2KHR, +pub struct ImageMemoryBarrier2Builder<'a> { + inner: ImageMemoryBarrier2, marker: ::std::marker::PhantomData<&'a ()>, } -pub unsafe trait ExtendsImageMemoryBarrier2KHR {} -impl<'a> ::std::ops::Deref for ImageMemoryBarrier2KHRBuilder<'a> { - type Target = ImageMemoryBarrier2KHR; +pub unsafe trait ExtendsImageMemoryBarrier2 {} +impl<'a> ::std::ops::Deref for ImageMemoryBarrier2Builder<'a> { + type Target = ImageMemoryBarrier2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for ImageMemoryBarrier2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for ImageMemoryBarrier2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> ImageMemoryBarrier2KHRBuilder<'a> { - pub fn src_stage_mask(mut self, src_stage_mask: PipelineStageFlags2KHR) -> Self { +impl<'a> ImageMemoryBarrier2Builder<'a> { + pub fn src_stage_mask(mut self, src_stage_mask: PipelineStageFlags2) -> Self { self.inner.src_stage_mask = src_stage_mask; self } - pub fn src_access_mask(mut self, src_access_mask: AccessFlags2KHR) -> Self { + pub fn src_access_mask(mut self, src_access_mask: AccessFlags2) -> Self { self.inner.src_access_mask = src_access_mask; self } - pub fn dst_stage_mask(mut self, dst_stage_mask: PipelineStageFlags2KHR) -> Self { + pub fn dst_stage_mask(mut self, dst_stage_mask: PipelineStageFlags2) -> Self { self.inner.dst_stage_mask = dst_stage_mask; self } - pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags2KHR) -> Self { + pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags2) -> Self { self.inner.dst_access_mask = dst_access_mask; self } @@ -47175,48 +47739,48 @@ impl<'a> ImageMemoryBarrier2KHRBuilder<'a> { #[doc = r" valid extension structs can be pushed into the chain."] #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] #[doc = r" chain will look like `A -> D -> B -> C`."] - pub fn push_next(mut self, next: &'a mut T) -> Self { + pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> ImageMemoryBarrier2KHR { + pub fn build(self) -> ImageMemoryBarrier2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct BufferMemoryBarrier2KHR { +#[doc = ""] +pub struct BufferMemoryBarrier2 { pub s_type: StructureType, pub p_next: *const c_void, - pub src_stage_mask: PipelineStageFlags2KHR, - pub src_access_mask: AccessFlags2KHR, - pub dst_stage_mask: PipelineStageFlags2KHR, - pub dst_access_mask: AccessFlags2KHR, + pub src_stage_mask: PipelineStageFlags2, + pub src_access_mask: AccessFlags2, + pub dst_stage_mask: PipelineStageFlags2, + pub dst_access_mask: AccessFlags2, pub src_queue_family_index: u32, pub dst_queue_family_index: u32, pub buffer: Buffer, pub offset: DeviceSize, pub size: DeviceSize, } -impl ::std::default::Default for BufferMemoryBarrier2KHR { +impl ::std::default::Default for BufferMemoryBarrier2 { fn default() -> Self { Self { - s_type: StructureType::BUFFER_MEMORY_BARRIER_2_KHR, + s_type: StructureType::BUFFER_MEMORY_BARRIER_2, p_next: ::std::ptr::null(), - src_stage_mask: PipelineStageFlags2KHR::default(), - src_access_mask: AccessFlags2KHR::default(), - dst_stage_mask: PipelineStageFlags2KHR::default(), - dst_access_mask: AccessFlags2KHR::default(), + src_stage_mask: PipelineStageFlags2::default(), + src_access_mask: AccessFlags2::default(), + dst_stage_mask: PipelineStageFlags2::default(), + dst_access_mask: AccessFlags2::default(), src_queue_family_index: u32::default(), dst_queue_family_index: u32::default(), buffer: Buffer::default(), @@ -47225,44 +47789,44 @@ impl ::std::default::Default for BufferMemoryBarrier2KHR { } } } -impl BufferMemoryBarrier2KHR { - pub fn builder<'a>() -> BufferMemoryBarrier2KHRBuilder<'a> { - BufferMemoryBarrier2KHRBuilder { +impl BufferMemoryBarrier2 { + pub fn builder<'a>() -> BufferMemoryBarrier2Builder<'a> { + BufferMemoryBarrier2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct BufferMemoryBarrier2KHRBuilder<'a> { - inner: BufferMemoryBarrier2KHR, +pub struct BufferMemoryBarrier2Builder<'a> { + inner: BufferMemoryBarrier2, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for BufferMemoryBarrier2KHRBuilder<'a> { - type Target = BufferMemoryBarrier2KHR; +impl<'a> ::std::ops::Deref for BufferMemoryBarrier2Builder<'a> { + type Target = BufferMemoryBarrier2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for BufferMemoryBarrier2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for BufferMemoryBarrier2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> BufferMemoryBarrier2KHRBuilder<'a> { - pub fn src_stage_mask(mut self, src_stage_mask: PipelineStageFlags2KHR) -> Self { +impl<'a> BufferMemoryBarrier2Builder<'a> { + pub fn src_stage_mask(mut self, src_stage_mask: PipelineStageFlags2) -> Self { self.inner.src_stage_mask = src_stage_mask; self } - pub fn src_access_mask(mut self, src_access_mask: AccessFlags2KHR) -> Self { + pub fn src_access_mask(mut self, src_access_mask: AccessFlags2) -> Self { self.inner.src_access_mask = src_access_mask; self } - pub fn dst_stage_mask(mut self, dst_stage_mask: PipelineStageFlags2KHR) -> Self { + pub fn dst_stage_mask(mut self, dst_stage_mask: PipelineStageFlags2) -> Self { self.inner.dst_stage_mask = dst_stage_mask; self } - pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags2KHR) -> Self { + pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags2) -> Self { self.inner.dst_access_mask = dst_access_mask; self } @@ -47289,29 +47853,29 @@ impl<'a> BufferMemoryBarrier2KHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> BufferMemoryBarrier2KHR { + pub fn build(self) -> BufferMemoryBarrier2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct DependencyInfoKHR { +#[doc = ""] +pub struct DependencyInfo { pub s_type: StructureType, pub p_next: *const c_void, pub dependency_flags: DependencyFlags, pub memory_barrier_count: u32, - pub p_memory_barriers: *const MemoryBarrier2KHR, + pub p_memory_barriers: *const MemoryBarrier2, pub buffer_memory_barrier_count: u32, - pub p_buffer_memory_barriers: *const BufferMemoryBarrier2KHR, + pub p_buffer_memory_barriers: *const BufferMemoryBarrier2, pub image_memory_barrier_count: u32, - pub p_image_memory_barriers: *const ImageMemoryBarrier2KHR, + pub p_image_memory_barriers: *const ImageMemoryBarrier2, } -impl ::std::default::Default for DependencyInfoKHR { +impl ::std::default::Default for DependencyInfo { fn default() -> Self { Self { - s_type: StructureType::DEPENDENCY_INFO_KHR, + s_type: StructureType::DEPENDENCY_INFO, p_next: ::std::ptr::null(), dependency_flags: DependencyFlags::default(), memory_barrier_count: u32::default(), @@ -47323,43 +47887,43 @@ impl ::std::default::Default for DependencyInfoKHR { } } } -impl DependencyInfoKHR { - pub fn builder<'a>() -> DependencyInfoKHRBuilder<'a> { - DependencyInfoKHRBuilder { +impl DependencyInfo { + pub fn builder<'a>() -> DependencyInfoBuilder<'a> { + DependencyInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct DependencyInfoKHRBuilder<'a> { - inner: DependencyInfoKHR, +pub struct DependencyInfoBuilder<'a> { + inner: DependencyInfo, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for DependencyInfoKHRBuilder<'a> { - type Target = DependencyInfoKHR; +impl<'a> ::std::ops::Deref for DependencyInfoBuilder<'a> { + type Target = DependencyInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for DependencyInfoKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for DependencyInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> DependencyInfoKHRBuilder<'a> { +impl<'a> DependencyInfoBuilder<'a> { pub fn dependency_flags(mut self, dependency_flags: DependencyFlags) -> Self { self.inner.dependency_flags = dependency_flags; self } - pub fn memory_barriers(mut self, memory_barriers: &'a [MemoryBarrier2KHR]) -> Self { + pub fn memory_barriers(mut self, memory_barriers: &'a [MemoryBarrier2]) -> Self { self.inner.memory_barrier_count = memory_barriers.len() as _; self.inner.p_memory_barriers = memory_barriers.as_ptr(); self } pub fn buffer_memory_barriers( mut self, - buffer_memory_barriers: &'a [BufferMemoryBarrier2KHR], + buffer_memory_barriers: &'a [BufferMemoryBarrier2], ) -> Self { self.inner.buffer_memory_barrier_count = buffer_memory_barriers.len() as _; self.inner.p_buffer_memory_barriers = buffer_memory_barriers.as_ptr(); @@ -47367,7 +47931,7 @@ impl<'a> DependencyInfoKHRBuilder<'a> { } pub fn image_memory_barriers( mut self, - image_memory_barriers: &'a [ImageMemoryBarrier2KHR], + image_memory_barriers: &'a [ImageMemoryBarrier2], ) -> Self { self.inner.image_memory_barrier_count = image_memory_barriers.len() as _; self.inner.p_image_memory_barriers = image_memory_barriers.as_ptr(); @@ -47376,59 +47940,59 @@ impl<'a> DependencyInfoKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> DependencyInfoKHR { + pub fn build(self) -> DependencyInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct SemaphoreSubmitInfoKHR { +#[doc = ""] +pub struct SemaphoreSubmitInfo { pub s_type: StructureType, pub p_next: *const c_void, pub semaphore: Semaphore, pub value: u64, - pub stage_mask: PipelineStageFlags2KHR, + pub stage_mask: PipelineStageFlags2, pub device_index: u32, } -impl ::std::default::Default for SemaphoreSubmitInfoKHR { +impl ::std::default::Default for SemaphoreSubmitInfo { fn default() -> Self { Self { - s_type: StructureType::SEMAPHORE_SUBMIT_INFO_KHR, + s_type: StructureType::SEMAPHORE_SUBMIT_INFO, p_next: ::std::ptr::null(), semaphore: Semaphore::default(), value: u64::default(), - stage_mask: PipelineStageFlags2KHR::default(), + stage_mask: PipelineStageFlags2::default(), device_index: u32::default(), } } } -impl SemaphoreSubmitInfoKHR { - pub fn builder<'a>() -> SemaphoreSubmitInfoKHRBuilder<'a> { - SemaphoreSubmitInfoKHRBuilder { +impl SemaphoreSubmitInfo { + pub fn builder<'a>() -> SemaphoreSubmitInfoBuilder<'a> { + SemaphoreSubmitInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct SemaphoreSubmitInfoKHRBuilder<'a> { - inner: SemaphoreSubmitInfoKHR, +pub struct SemaphoreSubmitInfoBuilder<'a> { + inner: SemaphoreSubmitInfo, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for SemaphoreSubmitInfoKHRBuilder<'a> { - type Target = SemaphoreSubmitInfoKHR; +impl<'a> ::std::ops::Deref for SemaphoreSubmitInfoBuilder<'a> { + type Target = SemaphoreSubmitInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for SemaphoreSubmitInfoKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for SemaphoreSubmitInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> SemaphoreSubmitInfoKHRBuilder<'a> { +impl<'a> SemaphoreSubmitInfoBuilder<'a> { pub fn semaphore(mut self, semaphore: Semaphore) -> Self { self.inner.semaphore = semaphore; self @@ -47437,7 +48001,7 @@ impl<'a> SemaphoreSubmitInfoKHRBuilder<'a> { self.inner.value = value; self } - pub fn stage_mask(mut self, stage_mask: PipelineStageFlags2KHR) -> Self { + pub fn stage_mask(mut self, stage_mask: PipelineStageFlags2) -> Self { self.inner.stage_mask = stage_mask; self } @@ -47448,55 +48012,55 @@ impl<'a> SemaphoreSubmitInfoKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> SemaphoreSubmitInfoKHR { + pub fn build(self) -> SemaphoreSubmitInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct CommandBufferSubmitInfoKHR { +#[doc = ""] +pub struct CommandBufferSubmitInfo { pub s_type: StructureType, pub p_next: *const c_void, pub command_buffer: CommandBuffer, pub device_mask: u32, } -impl ::std::default::Default for CommandBufferSubmitInfoKHR { +impl ::std::default::Default for CommandBufferSubmitInfo { fn default() -> Self { Self { - s_type: StructureType::COMMAND_BUFFER_SUBMIT_INFO_KHR, + s_type: StructureType::COMMAND_BUFFER_SUBMIT_INFO, p_next: ::std::ptr::null(), command_buffer: CommandBuffer::default(), device_mask: u32::default(), } } } -impl CommandBufferSubmitInfoKHR { - pub fn builder<'a>() -> CommandBufferSubmitInfoKHRBuilder<'a> { - CommandBufferSubmitInfoKHRBuilder { +impl CommandBufferSubmitInfo { + pub fn builder<'a>() -> CommandBufferSubmitInfoBuilder<'a> { + CommandBufferSubmitInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct CommandBufferSubmitInfoKHRBuilder<'a> { - inner: CommandBufferSubmitInfoKHR, +pub struct CommandBufferSubmitInfoBuilder<'a> { + inner: CommandBufferSubmitInfo, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for CommandBufferSubmitInfoKHRBuilder<'a> { - type Target = CommandBufferSubmitInfoKHR; +impl<'a> ::std::ops::Deref for CommandBufferSubmitInfoBuilder<'a> { + type Target = CommandBufferSubmitInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for CommandBufferSubmitInfoKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for CommandBufferSubmitInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> CommandBufferSubmitInfoKHRBuilder<'a> { +impl<'a> CommandBufferSubmitInfoBuilder<'a> { pub fn command_buffer(mut self, command_buffer: CommandBuffer) -> Self { self.inner.command_buffer = command_buffer; self @@ -47508,31 +48072,31 @@ impl<'a> CommandBufferSubmitInfoKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> CommandBufferSubmitInfoKHR { + pub fn build(self) -> CommandBufferSubmitInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct SubmitInfo2KHR { +#[doc = ""] +pub struct SubmitInfo2 { pub s_type: StructureType, pub p_next: *const c_void, - pub flags: SubmitFlagsKHR, + pub flags: SubmitFlags, pub wait_semaphore_info_count: u32, - pub p_wait_semaphore_infos: *const SemaphoreSubmitInfoKHR, + pub p_wait_semaphore_infos: *const SemaphoreSubmitInfo, pub command_buffer_info_count: u32, - pub p_command_buffer_infos: *const CommandBufferSubmitInfoKHR, + pub p_command_buffer_infos: *const CommandBufferSubmitInfo, pub signal_semaphore_info_count: u32, - pub p_signal_semaphore_infos: *const SemaphoreSubmitInfoKHR, + pub p_signal_semaphore_infos: *const SemaphoreSubmitInfo, } -impl ::std::default::Default for SubmitInfo2KHR { +impl ::std::default::Default for SubmitInfo2 { fn default() -> Self { Self { - s_type: StructureType::SUBMIT_INFO_2_KHR, + s_type: StructureType::SUBMIT_INFO_2, p_next: ::std::ptr::null(), - flags: SubmitFlagsKHR::default(), + flags: SubmitFlags::default(), wait_semaphore_info_count: u32::default(), p_wait_semaphore_infos: ::std::ptr::null(), command_buffer_info_count: u32::default(), @@ -47542,47 +48106,44 @@ impl ::std::default::Default for SubmitInfo2KHR { } } } -impl SubmitInfo2KHR { - pub fn builder<'a>() -> SubmitInfo2KHRBuilder<'a> { - SubmitInfo2KHRBuilder { +impl SubmitInfo2 { + pub fn builder<'a>() -> SubmitInfo2Builder<'a> { + SubmitInfo2Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct SubmitInfo2KHRBuilder<'a> { - inner: SubmitInfo2KHR, +pub struct SubmitInfo2Builder<'a> { + inner: SubmitInfo2, marker: ::std::marker::PhantomData<&'a ()>, } -pub unsafe trait ExtendsSubmitInfo2KHR {} -impl<'a> ::std::ops::Deref for SubmitInfo2KHRBuilder<'a> { - type Target = SubmitInfo2KHR; +pub unsafe trait ExtendsSubmitInfo2 {} +impl<'a> ::std::ops::Deref for SubmitInfo2Builder<'a> { + type Target = SubmitInfo2; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for SubmitInfo2KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for SubmitInfo2Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> SubmitInfo2KHRBuilder<'a> { - pub fn flags(mut self, flags: SubmitFlagsKHR) -> Self { +impl<'a> SubmitInfo2Builder<'a> { + pub fn flags(mut self, flags: SubmitFlags) -> Self { self.inner.flags = flags; self } - pub fn wait_semaphore_infos( - mut self, - wait_semaphore_infos: &'a [SemaphoreSubmitInfoKHR], - ) -> Self { + pub fn wait_semaphore_infos(mut self, wait_semaphore_infos: &'a [SemaphoreSubmitInfo]) -> Self { self.inner.wait_semaphore_info_count = wait_semaphore_infos.len() as _; self.inner.p_wait_semaphore_infos = wait_semaphore_infos.as_ptr(); self } pub fn command_buffer_infos( mut self, - command_buffer_infos: &'a [CommandBufferSubmitInfoKHR], + command_buffer_infos: &'a [CommandBufferSubmitInfo], ) -> Self { self.inner.command_buffer_info_count = command_buffer_infos.len() as _; self.inner.p_command_buffer_infos = command_buffer_infos.as_ptr(); @@ -47590,7 +48151,7 @@ impl<'a> SubmitInfo2KHRBuilder<'a> { } pub fn signal_semaphore_infos( mut self, - signal_semaphore_infos: &'a [SemaphoreSubmitInfoKHR], + signal_semaphore_infos: &'a [SemaphoreSubmitInfo], ) -> Self { self.inner.signal_semaphore_info_count = signal_semaphore_infos.len() as _; self.inner.p_signal_semaphore_infos = signal_semaphore_infos.as_ptr(); @@ -47601,37 +48162,37 @@ impl<'a> SubmitInfo2KHRBuilder<'a> { #[doc = r" valid extension structs can be pushed into the chain."] #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] #[doc = r" chain will look like `A -> D -> B -> C`."] - pub fn push_next(mut self, next: &'a mut T) -> Self { + pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> SubmitInfo2KHR { + pub fn build(self) -> SubmitInfo2 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct QueueFamilyCheckpointProperties2NV { pub s_type: StructureType, pub p_next: *mut c_void, - pub checkpoint_execution_stage_mask: PipelineStageFlags2KHR, + pub checkpoint_execution_stage_mask: PipelineStageFlags2, } impl ::std::default::Default for QueueFamilyCheckpointProperties2NV { fn default() -> Self { Self { s_type: StructureType::QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV, p_next: ::std::ptr::null_mut(), - checkpoint_execution_stage_mask: PipelineStageFlags2KHR::default(), + checkpoint_execution_stage_mask: PipelineStageFlags2::default(), } } } @@ -47664,7 +48225,7 @@ impl<'a> ::std::ops::DerefMut for QueueFamilyCheckpointProperties2NVBuilder<'a> impl<'a> QueueFamilyCheckpointProperties2NVBuilder<'a> { pub fn checkpoint_execution_stage_mask( mut self, - checkpoint_execution_stage_mask: PipelineStageFlags2KHR, + checkpoint_execution_stage_mask: PipelineStageFlags2, ) -> Self { self.inner.checkpoint_execution_stage_mask = checkpoint_execution_stage_mask; self @@ -47679,11 +48240,11 @@ impl<'a> QueueFamilyCheckpointProperties2NVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CheckpointData2NV { pub s_type: StructureType, pub p_next: *mut c_void, - pub stage: PipelineStageFlags2KHR, + pub stage: PipelineStageFlags2, pub p_checkpoint_marker: *mut c_void, } impl ::std::default::Default for CheckpointData2NV { @@ -47691,7 +48252,7 @@ impl ::std::default::Default for CheckpointData2NV { Self { s_type: StructureType::CHECKPOINT_DATA_2_NV, p_next: ::std::ptr::null_mut(), - stage: PipelineStageFlags2KHR::default(), + stage: PipelineStageFlags2::default(), p_checkpoint_marker: ::std::ptr::null_mut(), } } @@ -47721,7 +48282,7 @@ impl<'a> ::std::ops::DerefMut for CheckpointData2NVBuilder<'a> { } } impl<'a> CheckpointData2NVBuilder<'a> { - pub fn stage(mut self, stage: PipelineStageFlags2KHR) -> Self { + pub fn stage(mut self, stage: PipelineStageFlags2) -> Self { self.inner.stage = stage; self } @@ -47739,53 +48300,50 @@ impl<'a> CheckpointData2NVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceSynchronization2FeaturesKHR { +#[doc = ""] +pub struct PhysicalDeviceSynchronization2Features { pub s_type: StructureType, pub p_next: *mut c_void, pub synchronization2: Bool32, } -impl ::std::default::Default for PhysicalDeviceSynchronization2FeaturesKHR { +impl ::std::default::Default for PhysicalDeviceSynchronization2Features { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR, + s_type: StructureType::PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES, p_next: ::std::ptr::null_mut(), synchronization2: Bool32::default(), } } } -impl PhysicalDeviceSynchronization2FeaturesKHR { - pub fn builder<'a>() -> PhysicalDeviceSynchronization2FeaturesKHRBuilder<'a> { - PhysicalDeviceSynchronization2FeaturesKHRBuilder { +impl PhysicalDeviceSynchronization2Features { + pub fn builder<'a>() -> PhysicalDeviceSynchronization2FeaturesBuilder<'a> { + PhysicalDeviceSynchronization2FeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceSynchronization2FeaturesKHRBuilder<'a> { - inner: PhysicalDeviceSynchronization2FeaturesKHR, +pub struct PhysicalDeviceSynchronization2FeaturesBuilder<'a> { + inner: PhysicalDeviceSynchronization2Features, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceSynchronization2FeaturesKHRBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceSynchronization2FeaturesKHR {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSynchronization2FeaturesKHRBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSynchronization2FeaturesKHR {} -impl<'a> ::std::ops::Deref for PhysicalDeviceSynchronization2FeaturesKHRBuilder<'a> { - type Target = PhysicalDeviceSynchronization2FeaturesKHR; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceSynchronization2FeaturesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceSynchronization2Features {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSynchronization2FeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceSynchronization2Features {} +impl<'a> ::std::ops::Deref for PhysicalDeviceSynchronization2FeaturesBuilder<'a> { + type Target = PhysicalDeviceSynchronization2Features; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceSynchronization2FeaturesKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceSynchronization2FeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceSynchronization2FeaturesKHRBuilder<'a> { +impl<'a> PhysicalDeviceSynchronization2FeaturesBuilder<'a> { pub fn synchronization2(mut self, synchronization2: bool) -> Self { self.inner.synchronization2 = synchronization2.into(); self @@ -47793,14 +48351,14 @@ impl<'a> PhysicalDeviceSynchronization2FeaturesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceSynchronization2FeaturesKHR { + pub fn build(self) -> PhysicalDeviceSynchronization2Features { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoQueueFamilyProperties2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47859,7 +48417,7 @@ impl<'a> VideoQueueFamilyProperties2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct QueueFamilyQueryResultStatusProperties2KHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47918,7 +48476,7 @@ impl<'a> QueueFamilyQueryResultStatusProperties2KHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoProfilesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -47968,12 +48526,9 @@ impl<'a> ::std::ops::DerefMut for VideoProfilesKHRBuilder<'a> { } } impl<'a> VideoProfilesKHRBuilder<'a> { - pub fn profile_count(mut self, profile_count: u32) -> Self { - self.inner.profile_count = profile_count; - self - } - pub fn profiles(mut self, profiles: &'a VideoProfileKHR) -> Self { - self.inner.p_profiles = profiles; + pub fn profiles(mut self, profiles: &'a [VideoProfileKHR]) -> Self { + self.inner.profile_count = profiles.len() as _; + self.inner.p_profiles = profiles.as_ptr(); self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] @@ -47986,7 +48541,7 @@ impl<'a> VideoProfilesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceVideoFormatInfoKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48046,7 +48601,7 @@ impl<'a> PhysicalDeviceVideoFormatInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoFormatPropertiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48100,7 +48655,7 @@ impl<'a> VideoFormatPropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoProfileKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48186,10 +48741,10 @@ impl<'a> VideoProfileKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -48203,7 +48758,7 @@ impl<'a> VideoProfileKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoCapabilitiesKHR { pub s_type: StructureType, pub p_next: *mut c_void, @@ -48215,6 +48770,7 @@ pub struct VideoCapabilitiesKHR { pub max_extent: Extent2D, pub max_reference_pictures_slots_count: u32, pub max_reference_pictures_active_count: u32, + pub std_header_version: ExtensionProperties, } impl ::std::default::Default for VideoCapabilitiesKHR { fn default() -> Self { @@ -48229,6 +48785,7 @@ impl ::std::default::Default for VideoCapabilitiesKHR { max_extent: Extent2D::default(), max_reference_pictures_slots_count: u32::default(), max_reference_pictures_active_count: u32::default(), + std_header_version: ExtensionProperties::default(), } } } @@ -48305,6 +48862,10 @@ impl<'a> VideoCapabilitiesKHRBuilder<'a> { self.inner.max_reference_pictures_active_count = max_reference_pictures_active_count; self } + pub fn std_header_version(mut self, std_header_version: ExtensionProperties) -> Self { + self.inner.std_header_version = std_header_version; + self + } #[doc = r" Prepends the given extension struct between the root and the first pointer. This"] #[doc = r" method only exists on structs that can be passed to a function directly. Only"] #[doc = r" valid extension structs can be pushed into the chain."] @@ -48312,10 +48873,10 @@ impl<'a> VideoCapabilitiesKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + let next_ptr = <*mut 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 as _; + self.inner.p_next = next_ptr; } self } @@ -48329,7 +48890,7 @@ impl<'a> VideoCapabilitiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoGetMemoryPropertiesKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -48389,7 +48950,7 @@ impl<'a> VideoGetMemoryPropertiesKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoBindMemoryKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -48461,7 +49022,7 @@ impl<'a> VideoBindMemoryKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoPictureResourceKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -48533,7 +49094,7 @@ impl<'a> VideoPictureResourceKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoReferenceSlotKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -48591,10 +49152,10 @@ impl<'a> VideoReferenceSlotKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -48608,7 +49169,78 @@ impl<'a> VideoReferenceSlotKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] +pub struct VideoDecodeCapabilitiesKHR { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub flags: VideoDecodeCapabilityFlagsKHR, +} +impl ::std::default::Default for VideoDecodeCapabilitiesKHR { + fn default() -> Self { + Self { + s_type: StructureType::VIDEO_DECODE_CAPABILITIES_KHR, + p_next: ::std::ptr::null_mut(), + flags: VideoDecodeCapabilityFlagsKHR::default(), + } + } +} +impl VideoDecodeCapabilitiesKHR { + pub fn builder<'a>() -> VideoDecodeCapabilitiesKHRBuilder<'a> { + VideoDecodeCapabilitiesKHRBuilder { + inner: Self::default(), + marker: ::std::marker::PhantomData, + } + } +} +#[repr(transparent)] +pub struct VideoDecodeCapabilitiesKHRBuilder<'a> { + inner: VideoDecodeCapabilitiesKHR, + marker: ::std::marker::PhantomData<&'a ()>, +} +unsafe impl ExtendsVideoCapabilitiesKHR for VideoDecodeCapabilitiesKHRBuilder<'_> {} +unsafe impl ExtendsVideoCapabilitiesKHR for VideoDecodeCapabilitiesKHR {} +pub unsafe trait ExtendsVideoDecodeCapabilitiesKHR {} +impl<'a> ::std::ops::Deref for VideoDecodeCapabilitiesKHRBuilder<'a> { + type Target = VideoDecodeCapabilitiesKHR; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl<'a> ::std::ops::DerefMut for VideoDecodeCapabilitiesKHRBuilder<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} +impl<'a> VideoDecodeCapabilitiesKHRBuilder<'a> { + pub fn flags(mut self, flags: VideoDecodeCapabilityFlagsKHR) -> Self { + self.inner.flags = flags; + self + } + #[doc = r" Prepends the given extension struct between the root and the first pointer. This"] + #[doc = r" method only exists on structs that can be passed to a function directly. Only"] + #[doc = r" valid extension structs can be pushed into the chain."] + #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] + #[doc = r" chain will look like `A -> D -> B -> C`."] + pub fn push_next(mut self, next: &'a mut T) -> Self { + unsafe { + let next_ptr = <*mut 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 + } + #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] + #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] + #[doc = r" so references to builders can be passed directly to Vulkan functions."] + pub fn build(self) -> VideoDecodeCapabilitiesKHR { + self.inner + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] pub struct VideoDecodeInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -48711,10 +49343,10 @@ impl<'a> VideoDecodeInfoKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -48728,7 +49360,7 @@ impl<'a> VideoDecodeInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264ProfileEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -48800,13 +49432,12 @@ impl<'a> VideoDecodeH264ProfileEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264CapabilitiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, pub max_level: u32, pub field_offset_granularity: Offset2D, - pub std_extension_version: ExtensionProperties, } impl ::std::default::Default for VideoDecodeH264CapabilitiesEXT { fn default() -> Self { @@ -48815,7 +49446,6 @@ impl ::std::default::Default for VideoDecodeH264CapabilitiesEXT { p_next: ::std::ptr::null_mut(), max_level: u32::default(), field_offset_granularity: Offset2D::default(), - std_extension_version: ExtensionProperties::default(), } } } @@ -48832,8 +49462,8 @@ pub struct VideoDecodeH264CapabilitiesEXTBuilder<'a> { inner: VideoDecodeH264CapabilitiesEXT, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsVideoCapabilitiesKHR for VideoDecodeH264CapabilitiesEXTBuilder<'_> {} -unsafe impl ExtendsVideoCapabilitiesKHR for VideoDecodeH264CapabilitiesEXT {} +unsafe impl ExtendsVideoDecodeCapabilitiesKHR for VideoDecodeH264CapabilitiesEXTBuilder<'_> {} +unsafe impl ExtendsVideoDecodeCapabilitiesKHR for VideoDecodeH264CapabilitiesEXT {} impl<'a> ::std::ops::Deref for VideoDecodeH264CapabilitiesEXTBuilder<'a> { type Target = VideoDecodeH264CapabilitiesEXT; fn deref(&self) -> &Self::Target { @@ -48854,10 +49484,6 @@ impl<'a> VideoDecodeH264CapabilitiesEXTBuilder<'a> { self.inner.field_offset_granularity = field_offset_granularity; self } - pub fn std_extension_version(mut self, std_extension_version: ExtensionProperties) -> Self { - self.inner.std_extension_version = std_extension_version; - self - } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] @@ -48868,69 +49494,7 @@ impl<'a> VideoDecodeH264CapabilitiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoDecodeH264SessionCreateInfoEXT { - pub s_type: StructureType, - pub p_next: *const c_void, - pub flags: VideoDecodeH264CreateFlagsEXT, - pub p_std_extension_version: *const ExtensionProperties, -} -impl ::std::default::Default for VideoDecodeH264SessionCreateInfoEXT { - fn default() -> Self { - Self { - s_type: StructureType::VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT, - p_next: ::std::ptr::null(), - flags: VideoDecodeH264CreateFlagsEXT::default(), - p_std_extension_version: ::std::ptr::null(), - } - } -} -impl VideoDecodeH264SessionCreateInfoEXT { - pub fn builder<'a>() -> VideoDecodeH264SessionCreateInfoEXTBuilder<'a> { - VideoDecodeH264SessionCreateInfoEXTBuilder { - inner: Self::default(), - marker: ::std::marker::PhantomData, - } - } -} -#[repr(transparent)] -pub struct VideoDecodeH264SessionCreateInfoEXTBuilder<'a> { - inner: VideoDecodeH264SessionCreateInfoEXT, - marker: ::std::marker::PhantomData<&'a ()>, -} -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoDecodeH264SessionCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoDecodeH264SessionCreateInfoEXT {} -impl<'a> ::std::ops::Deref for VideoDecodeH264SessionCreateInfoEXTBuilder<'a> { - type Target = VideoDecodeH264SessionCreateInfoEXT; - fn deref(&self) -> &Self::Target { - &self.inner - } -} -impl<'a> ::std::ops::DerefMut for VideoDecodeH264SessionCreateInfoEXTBuilder<'a> { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.inner - } -} -impl<'a> VideoDecodeH264SessionCreateInfoEXTBuilder<'a> { - pub fn flags(mut self, flags: VideoDecodeH264CreateFlagsEXT) -> Self { - self.inner.flags = flags; - self - } - pub fn std_extension_version(mut self, std_extension_version: &'a ExtensionProperties) -> Self { - self.inner.p_std_extension_version = std_extension_version; - self - } - #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] - #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] - #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> VideoDecodeH264SessionCreateInfoEXT { - self.inner - } -} -#[repr(C)] -#[cfg_attr(feature = "debug", derive(Debug))] -#[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264SessionParametersAddInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49004,7 +49568,7 @@ impl<'a> VideoDecodeH264SessionParametersAddInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264SessionParametersCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49081,7 +49645,7 @@ impl<'a> VideoDecodeH264SessionParametersCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264PictureInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49144,10 +49708,10 @@ impl<'a> VideoDecodeH264PictureInfoEXTBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -49161,7 +49725,7 @@ impl<'a> VideoDecodeH264PictureInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264DpbSlotInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49220,7 +49784,7 @@ impl<'a> VideoDecodeH264DpbSlotInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH264MvcEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49276,7 +49840,7 @@ impl<'a> VideoDecodeH264MvcEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH265ProfileEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49342,12 +49906,11 @@ impl<'a> VideoDecodeH265ProfileEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH265CapabilitiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, pub max_level: u32, - pub std_extension_version: ExtensionProperties, } impl ::std::default::Default for VideoDecodeH265CapabilitiesEXT { fn default() -> Self { @@ -49355,7 +49918,6 @@ impl ::std::default::Default for VideoDecodeH265CapabilitiesEXT { s_type: StructureType::VIDEO_DECODE_H265_CAPABILITIES_EXT, p_next: ::std::ptr::null_mut(), max_level: u32::default(), - std_extension_version: ExtensionProperties::default(), } } } @@ -49372,8 +49934,8 @@ pub struct VideoDecodeH265CapabilitiesEXTBuilder<'a> { inner: VideoDecodeH265CapabilitiesEXT, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsVideoCapabilitiesKHR for VideoDecodeH265CapabilitiesEXTBuilder<'_> {} -unsafe impl ExtendsVideoCapabilitiesKHR for VideoDecodeH265CapabilitiesEXT {} +unsafe impl ExtendsVideoDecodeCapabilitiesKHR for VideoDecodeH265CapabilitiesEXTBuilder<'_> {} +unsafe impl ExtendsVideoDecodeCapabilitiesKHR for VideoDecodeH265CapabilitiesEXT {} impl<'a> ::std::ops::Deref for VideoDecodeH265CapabilitiesEXTBuilder<'a> { type Target = VideoDecodeH265CapabilitiesEXT; fn deref(&self) -> &Self::Target { @@ -49390,10 +49952,6 @@ impl<'a> VideoDecodeH265CapabilitiesEXTBuilder<'a> { self.inner.max_level = max_level; self } - pub fn std_extension_version(mut self, std_extension_version: ExtensionProperties) -> Self { - self.inner.std_extension_version = std_extension_version; - self - } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] @@ -49404,72 +49962,12 @@ impl<'a> VideoDecodeH265CapabilitiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoDecodeH265SessionCreateInfoEXT { - pub s_type: StructureType, - pub p_next: *const c_void, - pub flags: VideoDecodeH265CreateFlagsEXT, - pub p_std_extension_version: *const ExtensionProperties, -} -impl ::std::default::Default for VideoDecodeH265SessionCreateInfoEXT { - fn default() -> Self { - Self { - s_type: StructureType::VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT, - p_next: ::std::ptr::null(), - flags: VideoDecodeH265CreateFlagsEXT::default(), - p_std_extension_version: ::std::ptr::null(), - } - } -} -impl VideoDecodeH265SessionCreateInfoEXT { - pub fn builder<'a>() -> VideoDecodeH265SessionCreateInfoEXTBuilder<'a> { - VideoDecodeH265SessionCreateInfoEXTBuilder { - inner: Self::default(), - marker: ::std::marker::PhantomData, - } - } -} -#[repr(transparent)] -pub struct VideoDecodeH265SessionCreateInfoEXTBuilder<'a> { - inner: VideoDecodeH265SessionCreateInfoEXT, - marker: ::std::marker::PhantomData<&'a ()>, -} -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoDecodeH265SessionCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoDecodeH265SessionCreateInfoEXT {} -impl<'a> ::std::ops::Deref for VideoDecodeH265SessionCreateInfoEXTBuilder<'a> { - type Target = VideoDecodeH265SessionCreateInfoEXT; - fn deref(&self) -> &Self::Target { - &self.inner - } -} -impl<'a> ::std::ops::DerefMut for VideoDecodeH265SessionCreateInfoEXTBuilder<'a> { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.inner - } -} -impl<'a> VideoDecodeH265SessionCreateInfoEXTBuilder<'a> { - pub fn flags(mut self, flags: VideoDecodeH265CreateFlagsEXT) -> Self { - self.inner.flags = flags; - self - } - pub fn std_extension_version(mut self, std_extension_version: &'a ExtensionProperties) -> Self { - self.inner.p_std_extension_version = std_extension_version; - self - } - #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] - #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] - #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> VideoDecodeH265SessionCreateInfoEXT { - self.inner - } -} -#[repr(C)] -#[cfg_attr(feature = "debug", derive(Debug))] -#[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH265SessionParametersAddInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, + pub vps_std_count: u32, + pub p_vps_std: *const StdVideoH265VideoParameterSet, pub sps_std_count: u32, pub p_sps_std: *const StdVideoH265SequenceParameterSet, pub pps_std_count: u32, @@ -49480,6 +49978,8 @@ impl ::std::default::Default for VideoDecodeH265SessionParametersAddInfoEXT { Self { s_type: StructureType::VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT, p_next: ::std::ptr::null(), + vps_std_count: u32::default(), + p_vps_std: ::std::ptr::null(), sps_std_count: u32::default(), p_sps_std: ::std::ptr::null(), pps_std_count: u32::default(), @@ -49520,6 +50020,11 @@ impl<'a> ::std::ops::DerefMut for VideoDecodeH265SessionParametersAddInfoEXTBuil } } impl<'a> VideoDecodeH265SessionParametersAddInfoEXTBuilder<'a> { + pub fn vps_std(mut self, vps_std: &'a [StdVideoH265VideoParameterSet]) -> Self { + self.inner.vps_std_count = vps_std.len() as _; + self.inner.p_vps_std = vps_std.as_ptr(); + self + } pub fn sps_std(mut self, sps_std: &'a [StdVideoH265SequenceParameterSet]) -> Self { self.inner.sps_std_count = sps_std.len() as _; self.inner.p_sps_std = sps_std.as_ptr(); @@ -49540,10 +50045,11 @@ impl<'a> VideoDecodeH265SessionParametersAddInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH265SessionParametersCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, + pub max_vps_std_count: u32, pub max_sps_std_count: u32, pub max_pps_std_count: u32, pub p_parameters_add_info: *const VideoDecodeH265SessionParametersAddInfoEXT, @@ -49553,6 +50059,7 @@ impl ::std::default::Default for VideoDecodeH265SessionParametersCreateInfoEXT { Self { s_type: StructureType::VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT, p_next: ::std::ptr::null(), + max_vps_std_count: u32::default(), max_sps_std_count: u32::default(), max_pps_std_count: u32::default(), p_parameters_add_info: ::std::ptr::null(), @@ -49592,6 +50099,10 @@ impl<'a> ::std::ops::DerefMut for VideoDecodeH265SessionParametersCreateInfoEXTB } } impl<'a> VideoDecodeH265SessionParametersCreateInfoEXTBuilder<'a> { + pub fn max_vps_std_count(mut self, max_vps_std_count: u32) -> Self { + self.inner.max_vps_std_count = max_vps_std_count; + self + } pub fn max_sps_std_count(mut self, max_sps_std_count: u32) -> Self { self.inner.max_sps_std_count = max_sps_std_count; self @@ -49617,7 +50128,7 @@ impl<'a> VideoDecodeH265SessionParametersCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH265PictureInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49685,7 +50196,7 @@ impl<'a> VideoDecodeH265PictureInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoDecodeH265DpbSlotInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -49744,7 +50255,7 @@ impl<'a> VideoDecodeH265DpbSlotInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoSessionCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -49756,6 +50267,7 @@ pub struct VideoSessionCreateInfoKHR { pub reference_pictures_format: Format, pub max_reference_pictures_slots_count: u32, pub max_reference_pictures_active_count: u32, + pub p_std_header_version: *const ExtensionProperties, } impl ::std::default::Default for VideoSessionCreateInfoKHR { fn default() -> Self { @@ -49770,6 +50282,7 @@ impl ::std::default::Default for VideoSessionCreateInfoKHR { reference_pictures_format: Format::default(), max_reference_pictures_slots_count: u32::default(), max_reference_pictures_active_count: u32::default(), + p_std_header_version: ::std::ptr::null(), } } } @@ -49786,7 +50299,6 @@ pub struct VideoSessionCreateInfoKHRBuilder<'a> { inner: VideoSessionCreateInfoKHR, marker: ::std::marker::PhantomData<&'a ()>, } -pub unsafe trait ExtendsVideoSessionCreateInfoKHR {} impl<'a> ::std::ops::Deref for VideoSessionCreateInfoKHRBuilder<'a> { type Target = VideoSessionCreateInfoKHR; fn deref(&self) -> &Self::Target { @@ -49837,18 +50349,8 @@ impl<'a> VideoSessionCreateInfoKHRBuilder<'a> { self.inner.max_reference_pictures_active_count = max_reference_pictures_active_count; self } - #[doc = r" Prepends the given extension struct between the root and the first pointer. This"] - #[doc = r" method only exists on structs that can be passed to a function directly. Only"] - #[doc = r" valid extension structs can be pushed into the chain."] - #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] - #[doc = r" chain will look like `A -> D -> B -> C`."] - pub fn push_next(mut self, next: &'a mut T) -> Self { - unsafe { - 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 as _; - } + pub fn std_header_version(mut self, std_header_version: &'a ExtensionProperties) -> Self { + self.inner.p_std_header_version = std_header_version; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] @@ -49861,7 +50363,7 @@ impl<'a> VideoSessionCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoSessionParametersCreateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -49925,10 +50427,10 @@ impl<'a> VideoSessionParametersCreateInfoKHRBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -49942,7 +50444,7 @@ impl<'a> VideoSessionParametersCreateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoSessionParametersUpdateInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -49997,10 +50499,10 @@ impl<'a> VideoSessionParametersUpdateInfoKHRBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -50014,7 +50516,7 @@ impl<'a> VideoSessionParametersUpdateInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoBeginCodingInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -50101,7 +50603,7 @@ impl<'a> VideoBeginCodingInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEndCodingInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -50155,7 +50657,7 @@ impl<'a> VideoEndCodingInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoCodingControlInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -50207,10 +50709,10 @@ impl<'a> VideoCodingControlInfoKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -50224,7 +50726,7 @@ impl<'a> VideoCodingControlInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -50339,10 +50841,10 @@ impl<'a> VideoEncodeInfoKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -50356,7 +50858,7 @@ impl<'a> VideoEncodeInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeRateControlInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -50431,10 +50933,10 @@ impl<'a> VideoEncodeRateControlInfoKHRBuilder<'a> { #[doc = r" chain will look like `A -> D -> B -> C`."] pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -50448,7 +50950,7 @@ impl<'a> VideoEncodeRateControlInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeRateControlLayerInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -50538,10 +51040,10 @@ impl<'a> VideoEncodeRateControlLayerInfoKHRBuilder<'a> { next: &'a mut T, ) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } @@ -50555,194 +51057,237 @@ impl<'a> VideoEncodeRateControlLayerInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH264CapabilitiesEXT { +#[doc = ""] +pub struct VideoEncodeCapabilitiesKHR { pub s_type: StructureType, pub p_next: *const c_void, - pub flags: VideoEncodeH264CapabilityFlagsEXT, - pub input_mode_flags: VideoEncodeH264InputModeFlagsEXT, - pub output_mode_flags: VideoEncodeH264OutputModeFlagsEXT, - pub min_picture_size_in_mbs: Extent2D, - pub max_picture_size_in_mbs: Extent2D, - pub input_image_data_alignment: Extent2D, - pub max_num_l0_reference_for_p: u8, - pub max_num_l0_reference_for_b: u8, - pub max_num_l1_reference: u8, + pub flags: VideoEncodeCapabilityFlagsKHR, + pub rate_control_modes: VideoEncodeRateControlModeFlagsKHR, + pub rate_control_layer_count: u8, pub quality_level_count: u8, - pub std_extension_version: ExtensionProperties, + pub input_image_data_fill_alignment: Extent2D, } -impl ::std::default::Default for VideoEncodeH264CapabilitiesEXT { +impl ::std::default::Default for VideoEncodeCapabilitiesKHR { fn default() -> Self { Self { - s_type: StructureType::VIDEO_ENCODE_H264_CAPABILITIES_EXT, + s_type: StructureType::VIDEO_ENCODE_CAPABILITIES_KHR, p_next: ::std::ptr::null(), - flags: VideoEncodeH264CapabilityFlagsEXT::default(), - input_mode_flags: VideoEncodeH264InputModeFlagsEXT::default(), - output_mode_flags: VideoEncodeH264OutputModeFlagsEXT::default(), - min_picture_size_in_mbs: Extent2D::default(), - max_picture_size_in_mbs: Extent2D::default(), - input_image_data_alignment: Extent2D::default(), - max_num_l0_reference_for_p: u8::default(), - max_num_l0_reference_for_b: u8::default(), - max_num_l1_reference: u8::default(), + flags: VideoEncodeCapabilityFlagsKHR::default(), + rate_control_modes: VideoEncodeRateControlModeFlagsKHR::default(), + rate_control_layer_count: u8::default(), quality_level_count: u8::default(), - std_extension_version: ExtensionProperties::default(), + input_image_data_fill_alignment: Extent2D::default(), } } } -impl VideoEncodeH264CapabilitiesEXT { - pub fn builder<'a>() -> VideoEncodeH264CapabilitiesEXTBuilder<'a> { - VideoEncodeH264CapabilitiesEXTBuilder { +impl VideoEncodeCapabilitiesKHR { + pub fn builder<'a>() -> VideoEncodeCapabilitiesKHRBuilder<'a> { + VideoEncodeCapabilitiesKHRBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct VideoEncodeH264CapabilitiesEXTBuilder<'a> { - inner: VideoEncodeH264CapabilitiesEXT, +pub struct VideoEncodeCapabilitiesKHRBuilder<'a> { + inner: VideoEncodeCapabilitiesKHR, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsVideoCapabilitiesKHR for VideoEncodeH264CapabilitiesEXTBuilder<'_> {} -unsafe impl ExtendsVideoCapabilitiesKHR for VideoEncodeH264CapabilitiesEXT {} -impl<'a> ::std::ops::Deref for VideoEncodeH264CapabilitiesEXTBuilder<'a> { - type Target = VideoEncodeH264CapabilitiesEXT; +unsafe impl ExtendsVideoCapabilitiesKHR for VideoEncodeCapabilitiesKHRBuilder<'_> {} +unsafe impl ExtendsVideoCapabilitiesKHR for VideoEncodeCapabilitiesKHR {} +pub unsafe trait ExtendsVideoEncodeCapabilitiesKHR {} +impl<'a> ::std::ops::Deref for VideoEncodeCapabilitiesKHRBuilder<'a> { + type Target = VideoEncodeCapabilitiesKHR; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for VideoEncodeH264CapabilitiesEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for VideoEncodeCapabilitiesKHRBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> VideoEncodeH264CapabilitiesEXTBuilder<'a> { - pub fn flags(mut self, flags: VideoEncodeH264CapabilityFlagsEXT) -> Self { +impl<'a> VideoEncodeCapabilitiesKHRBuilder<'a> { + pub fn flags(mut self, flags: VideoEncodeCapabilityFlagsKHR) -> Self { self.inner.flags = flags; self } - pub fn input_mode_flags(mut self, input_mode_flags: VideoEncodeH264InputModeFlagsEXT) -> Self { - self.inner.input_mode_flags = input_mode_flags; - self - } - pub fn output_mode_flags( + pub fn rate_control_modes( mut self, - output_mode_flags: VideoEncodeH264OutputModeFlagsEXT, + rate_control_modes: VideoEncodeRateControlModeFlagsKHR, ) -> Self { - self.inner.output_mode_flags = output_mode_flags; + self.inner.rate_control_modes = rate_control_modes; self } - pub fn min_picture_size_in_mbs(mut self, min_picture_size_in_mbs: Extent2D) -> Self { - self.inner.min_picture_size_in_mbs = min_picture_size_in_mbs; - self - } - pub fn max_picture_size_in_mbs(mut self, max_picture_size_in_mbs: Extent2D) -> Self { - self.inner.max_picture_size_in_mbs = max_picture_size_in_mbs; - self - } - pub fn input_image_data_alignment(mut self, input_image_data_alignment: Extent2D) -> Self { - self.inner.input_image_data_alignment = input_image_data_alignment; - self - } - pub fn max_num_l0_reference_for_p(mut self, max_num_l0_reference_for_p: u8) -> Self { - self.inner.max_num_l0_reference_for_p = max_num_l0_reference_for_p; - self - } - pub fn max_num_l0_reference_for_b(mut self, max_num_l0_reference_for_b: u8) -> Self { - self.inner.max_num_l0_reference_for_b = max_num_l0_reference_for_b; - self - } - pub fn max_num_l1_reference(mut self, max_num_l1_reference: u8) -> Self { - self.inner.max_num_l1_reference = max_num_l1_reference; + pub fn rate_control_layer_count(mut self, rate_control_layer_count: u8) -> Self { + self.inner.rate_control_layer_count = rate_control_layer_count; self } pub fn quality_level_count(mut self, quality_level_count: u8) -> Self { self.inner.quality_level_count = quality_level_count; self } - pub fn std_extension_version(mut self, std_extension_version: ExtensionProperties) -> Self { - self.inner.std_extension_version = std_extension_version; + pub fn input_image_data_fill_alignment( + mut self, + input_image_data_fill_alignment: Extent2D, + ) -> Self { + self.inner.input_image_data_fill_alignment = input_image_data_fill_alignment; + self + } + #[doc = r" Prepends the given extension struct between the root and the first pointer. This"] + #[doc = r" method only exists on structs that can be passed to a function directly. Only"] + #[doc = r" valid extension structs can be pushed into the chain."] + #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] + #[doc = r" chain will look like `A -> D -> B -> C`."] + pub fn push_next(mut self, next: &'a mut T) -> Self { + 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 } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> VideoEncodeH264CapabilitiesEXT { + pub fn build(self) -> VideoEncodeCapabilitiesKHR { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH264SessionCreateInfoEXT { +#[doc = ""] +pub struct VideoEncodeH264CapabilitiesEXT { pub s_type: StructureType, pub p_next: *const c_void, - pub flags: VideoEncodeH264CreateFlagsEXT, - pub max_picture_size_in_mbs: Extent2D, - pub p_std_extension_version: *const ExtensionProperties, + pub flags: VideoEncodeH264CapabilityFlagsEXT, + pub input_mode_flags: VideoEncodeH264InputModeFlagsEXT, + pub output_mode_flags: VideoEncodeH264OutputModeFlagsEXT, + pub max_p_picture_l0_reference_count: u8, + pub max_b_picture_l0_reference_count: u8, + pub max_l1_reference_count: u8, + pub motion_vectors_over_pic_boundaries_flag: Bool32, + pub max_bytes_per_pic_denom: u32, + pub max_bits_per_mb_denom: u32, + pub log2_max_mv_length_horizontal: u32, + pub log2_max_mv_length_vertical: u32, } -impl ::std::default::Default for VideoEncodeH264SessionCreateInfoEXT { +impl ::std::default::Default for VideoEncodeH264CapabilitiesEXT { fn default() -> Self { Self { - s_type: StructureType::VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT, + s_type: StructureType::VIDEO_ENCODE_H264_CAPABILITIES_EXT, p_next: ::std::ptr::null(), - flags: VideoEncodeH264CreateFlagsEXT::default(), - max_picture_size_in_mbs: Extent2D::default(), - p_std_extension_version: ::std::ptr::null(), + flags: VideoEncodeH264CapabilityFlagsEXT::default(), + input_mode_flags: VideoEncodeH264InputModeFlagsEXT::default(), + output_mode_flags: VideoEncodeH264OutputModeFlagsEXT::default(), + max_p_picture_l0_reference_count: u8::default(), + max_b_picture_l0_reference_count: u8::default(), + max_l1_reference_count: u8::default(), + motion_vectors_over_pic_boundaries_flag: Bool32::default(), + max_bytes_per_pic_denom: u32::default(), + max_bits_per_mb_denom: u32::default(), + log2_max_mv_length_horizontal: u32::default(), + log2_max_mv_length_vertical: u32::default(), } } } -impl VideoEncodeH264SessionCreateInfoEXT { - pub fn builder<'a>() -> VideoEncodeH264SessionCreateInfoEXTBuilder<'a> { - VideoEncodeH264SessionCreateInfoEXTBuilder { +impl VideoEncodeH264CapabilitiesEXT { + pub fn builder<'a>() -> VideoEncodeH264CapabilitiesEXTBuilder<'a> { + VideoEncodeH264CapabilitiesEXTBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct VideoEncodeH264SessionCreateInfoEXTBuilder<'a> { - inner: VideoEncodeH264SessionCreateInfoEXT, +pub struct VideoEncodeH264CapabilitiesEXTBuilder<'a> { + inner: VideoEncodeH264CapabilitiesEXT, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoEncodeH264SessionCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoEncodeH264SessionCreateInfoEXT {} -impl<'a> ::std::ops::Deref for VideoEncodeH264SessionCreateInfoEXTBuilder<'a> { - type Target = VideoEncodeH264SessionCreateInfoEXT; +unsafe impl ExtendsVideoEncodeCapabilitiesKHR for VideoEncodeH264CapabilitiesEXTBuilder<'_> {} +unsafe impl ExtendsVideoEncodeCapabilitiesKHR for VideoEncodeH264CapabilitiesEXT {} +impl<'a> ::std::ops::Deref for VideoEncodeH264CapabilitiesEXTBuilder<'a> { + type Target = VideoEncodeH264CapabilitiesEXT; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for VideoEncodeH264SessionCreateInfoEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for VideoEncodeH264CapabilitiesEXTBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> VideoEncodeH264SessionCreateInfoEXTBuilder<'a> { - pub fn flags(mut self, flags: VideoEncodeH264CreateFlagsEXT) -> Self { +impl<'a> VideoEncodeH264CapabilitiesEXTBuilder<'a> { + pub fn flags(mut self, flags: VideoEncodeH264CapabilityFlagsEXT) -> Self { self.inner.flags = flags; self } - pub fn max_picture_size_in_mbs(mut self, max_picture_size_in_mbs: Extent2D) -> Self { - self.inner.max_picture_size_in_mbs = max_picture_size_in_mbs; + pub fn input_mode_flags(mut self, input_mode_flags: VideoEncodeH264InputModeFlagsEXT) -> Self { + self.inner.input_mode_flags = input_mode_flags; self } - pub fn std_extension_version(mut self, std_extension_version: &'a ExtensionProperties) -> Self { - self.inner.p_std_extension_version = std_extension_version; + pub fn output_mode_flags( + mut self, + output_mode_flags: VideoEncodeH264OutputModeFlagsEXT, + ) -> Self { + self.inner.output_mode_flags = output_mode_flags; + self + } + pub fn max_p_picture_l0_reference_count( + mut self, + max_p_picture_l0_reference_count: u8, + ) -> Self { + self.inner.max_p_picture_l0_reference_count = max_p_picture_l0_reference_count; + self + } + pub fn max_b_picture_l0_reference_count( + mut self, + max_b_picture_l0_reference_count: u8, + ) -> Self { + self.inner.max_b_picture_l0_reference_count = max_b_picture_l0_reference_count; + self + } + pub fn max_l1_reference_count(mut self, max_l1_reference_count: u8) -> Self { + self.inner.max_l1_reference_count = max_l1_reference_count; + self + } + pub fn motion_vectors_over_pic_boundaries_flag( + mut self, + motion_vectors_over_pic_boundaries_flag: bool, + ) -> Self { + self.inner.motion_vectors_over_pic_boundaries_flag = + motion_vectors_over_pic_boundaries_flag.into(); + self + } + pub fn max_bytes_per_pic_denom(mut self, max_bytes_per_pic_denom: u32) -> Self { + self.inner.max_bytes_per_pic_denom = max_bytes_per_pic_denom; + self + } + pub fn max_bits_per_mb_denom(mut self, max_bits_per_mb_denom: u32) -> Self { + self.inner.max_bits_per_mb_denom = max_bits_per_mb_denom; + self + } + pub fn log2_max_mv_length_horizontal(mut self, log2_max_mv_length_horizontal: u32) -> Self { + self.inner.log2_max_mv_length_horizontal = log2_max_mv_length_horizontal; + self + } + pub fn log2_max_mv_length_vertical(mut self, log2_max_mv_length_vertical: u32) -> Self { + self.inner.log2_max_mv_length_vertical = log2_max_mv_length_vertical; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> VideoEncodeH264SessionCreateInfoEXT { + pub fn build(self) -> VideoEncodeH264CapabilitiesEXT { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264SessionParametersAddInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -50816,7 +51361,7 @@ impl<'a> VideoEncodeH264SessionParametersAddInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264SessionParametersCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -50893,12 +51438,12 @@ impl<'a> VideoEncodeH264SessionParametersCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264DpbSlotInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, pub slot_index: i8, - pub p_std_picture_info: *const StdVideoEncodeH264PictureInfo, + pub p_std_reference_info: *const StdVideoEncodeH264ReferenceInfo, } impl ::std::default::Default for VideoEncodeH264DpbSlotInfoEXT { fn default() -> Self { @@ -50906,7 +51451,7 @@ impl ::std::default::Default for VideoEncodeH264DpbSlotInfoEXT { s_type: StructureType::VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT, p_next: ::std::ptr::null(), slot_index: i8::default(), - p_std_picture_info: ::std::ptr::null(), + p_std_reference_info: ::std::ptr::null(), } } } @@ -50939,8 +51484,11 @@ impl<'a> VideoEncodeH264DpbSlotInfoEXTBuilder<'a> { self.inner.slot_index = slot_index; self } - pub fn std_picture_info(mut self, std_picture_info: &'a StdVideoEncodeH264PictureInfo) -> Self { - self.inner.p_std_picture_info = std_picture_info; + pub fn std_reference_info( + mut self, + std_reference_info: &'a StdVideoEncodeH264ReferenceInfo, + ) -> Self { + self.inner.p_std_reference_info = std_reference_info; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] @@ -50953,27 +51501,21 @@ impl<'a> VideoEncodeH264DpbSlotInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264VclFrameInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, - pub ref_default_final_list0_entry_count: u8, - pub p_ref_default_final_list0_entries: *const VideoEncodeH264DpbSlotInfoEXT, - pub ref_default_final_list1_entry_count: u8, - pub p_ref_default_final_list1_entries: *const VideoEncodeH264DpbSlotInfoEXT, + pub p_reference_final_lists: *const VideoEncodeH264ReferenceListsEXT, pub nalu_slice_entry_count: u32, pub p_nalu_slice_entries: *const VideoEncodeH264NaluSliceEXT, - pub p_current_picture_info: *const VideoEncodeH264DpbSlotInfoEXT, + pub p_current_picture_info: *const StdVideoEncodeH264PictureInfo, } impl ::std::default::Default for VideoEncodeH264VclFrameInfoEXT { fn default() -> Self { Self { s_type: StructureType::VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT, p_next: ::std::ptr::null(), - ref_default_final_list0_entry_count: u8::default(), - p_ref_default_final_list0_entries: ::std::ptr::null(), - ref_default_final_list1_entry_count: u8::default(), - p_ref_default_final_list1_entries: ::std::ptr::null(), + p_reference_final_lists: ::std::ptr::null(), nalu_slice_entry_count: u32::default(), p_nalu_slice_entries: ::std::ptr::null(), p_current_picture_info: ::std::ptr::null(), @@ -51007,20 +51549,11 @@ impl<'a> ::std::ops::DerefMut for VideoEncodeH264VclFrameInfoEXTBuilder<'a> { } } impl<'a> VideoEncodeH264VclFrameInfoEXTBuilder<'a> { - pub fn ref_default_final_list0_entries( - mut self, - ref_default_final_list0_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], - ) -> Self { - self.inner.ref_default_final_list0_entry_count = ref_default_final_list0_entries.len() as _; - self.inner.p_ref_default_final_list0_entries = ref_default_final_list0_entries.as_ptr(); - self - } - pub fn ref_default_final_list1_entries( + pub fn reference_final_lists( mut self, - ref_default_final_list1_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], + reference_final_lists: &'a VideoEncodeH264ReferenceListsEXT, ) -> Self { - self.inner.ref_default_final_list1_entry_count = ref_default_final_list1_entries.len() as _; - self.inner.p_ref_default_final_list1_entries = ref_default_final_list1_entries.as_ptr(); + self.inner.p_reference_final_lists = reference_final_lists; self } pub fn nalu_slice_entries( @@ -51033,7 +51566,7 @@ impl<'a> VideoEncodeH264VclFrameInfoEXTBuilder<'a> { } pub fn current_picture_info( mut self, - current_picture_info: &'a VideoEncodeH264DpbSlotInfoEXT, + current_picture_info: &'a StdVideoEncodeH264PictureInfo, ) -> Self { self.inner.p_current_picture_info = current_picture_info; self @@ -51048,7 +51581,88 @@ impl<'a> VideoEncodeH264VclFrameInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] +pub struct VideoEncodeH264ReferenceListsEXT { + pub s_type: StructureType, + pub p_next: *const c_void, + pub reference_list0_entry_count: u8, + pub p_reference_list0_entries: *const VideoEncodeH264DpbSlotInfoEXT, + pub reference_list1_entry_count: u8, + pub p_reference_list1_entries: *const VideoEncodeH264DpbSlotInfoEXT, + pub p_mem_mgmt_ctrl_operations: *const StdVideoEncodeH264RefMemMgmtCtrlOperations, +} +impl ::std::default::Default for VideoEncodeH264ReferenceListsEXT { + fn default() -> Self { + Self { + s_type: StructureType::VIDEO_ENCODE_H264_REFERENCE_LISTS_EXT, + p_next: ::std::ptr::null(), + reference_list0_entry_count: u8::default(), + p_reference_list0_entries: ::std::ptr::null(), + reference_list1_entry_count: u8::default(), + p_reference_list1_entries: ::std::ptr::null(), + p_mem_mgmt_ctrl_operations: ::std::ptr::null(), + } + } +} +impl VideoEncodeH264ReferenceListsEXT { + pub fn builder<'a>() -> VideoEncodeH264ReferenceListsEXTBuilder<'a> { + VideoEncodeH264ReferenceListsEXTBuilder { + inner: Self::default(), + marker: ::std::marker::PhantomData, + } + } +} +#[repr(transparent)] +pub struct VideoEncodeH264ReferenceListsEXTBuilder<'a> { + inner: VideoEncodeH264ReferenceListsEXT, + marker: ::std::marker::PhantomData<&'a ()>, +} +impl<'a> ::std::ops::Deref for VideoEncodeH264ReferenceListsEXTBuilder<'a> { + type Target = VideoEncodeH264ReferenceListsEXT; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl<'a> ::std::ops::DerefMut for VideoEncodeH264ReferenceListsEXTBuilder<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} +impl<'a> VideoEncodeH264ReferenceListsEXTBuilder<'a> { + pub fn reference_list0_entries( + mut self, + reference_list0_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], + ) -> Self { + self.inner.reference_list0_entry_count = reference_list0_entries.len() as _; + self.inner.p_reference_list0_entries = reference_list0_entries.as_ptr(); + self + } + pub fn reference_list1_entries( + mut self, + reference_list1_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], + ) -> Self { + self.inner.reference_list1_entry_count = reference_list1_entries.len() as _; + self.inner.p_reference_list1_entries = reference_list1_entries.as_ptr(); + self + } + pub fn mem_mgmt_ctrl_operations( + mut self, + mem_mgmt_ctrl_operations: &'a StdVideoEncodeH264RefMemMgmtCtrlOperations, + ) -> Self { + self.inner.p_mem_mgmt_ctrl_operations = mem_mgmt_ctrl_operations; + self + } + #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] + #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] + #[doc = r" so references to builders can be passed directly to Vulkan functions."] + pub fn build(self) -> VideoEncodeH264ReferenceListsEXT { + self.inner + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] pub struct VideoEncodeH264EmitPictureParametersEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -51119,7 +51733,7 @@ impl<'a> VideoEncodeH264EmitPictureParametersEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264ProfileEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -51185,28 +51799,22 @@ impl<'a> VideoEncodeH264ProfileEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264NaluSliceEXT { pub s_type: StructureType, pub p_next: *const c_void, - pub p_slice_header_std: *const StdVideoEncodeH264SliceHeader, pub mb_count: u32, - pub ref_final_list0_entry_count: u8, - pub p_ref_final_list0_entries: *const VideoEncodeH264DpbSlotInfoEXT, - pub ref_final_list1_entry_count: u8, - pub p_ref_final_list1_entries: *const VideoEncodeH264DpbSlotInfoEXT, + pub p_reference_final_lists: *const VideoEncodeH264ReferenceListsEXT, + pub p_slice_header_std: *const StdVideoEncodeH264SliceHeader, } impl ::std::default::Default for VideoEncodeH264NaluSliceEXT { fn default() -> Self { Self { s_type: StructureType::VIDEO_ENCODE_H264_NALU_SLICE_EXT, p_next: ::std::ptr::null(), - p_slice_header_std: ::std::ptr::null(), mb_count: u32::default(), - ref_final_list0_entry_count: u8::default(), - p_ref_final_list0_entries: ::std::ptr::null(), - ref_final_list1_entry_count: u8::default(), - p_ref_final_list1_entries: ::std::ptr::null(), + p_reference_final_lists: ::std::ptr::null(), + p_slice_header_std: ::std::ptr::null(), } } } @@ -51235,28 +51843,19 @@ impl<'a> ::std::ops::DerefMut for VideoEncodeH264NaluSliceEXTBuilder<'a> { } } impl<'a> VideoEncodeH264NaluSliceEXTBuilder<'a> { - pub fn slice_header_std(mut self, slice_header_std: &'a StdVideoEncodeH264SliceHeader) -> Self { - self.inner.p_slice_header_std = slice_header_std; - self - } pub fn mb_count(mut self, mb_count: u32) -> Self { self.inner.mb_count = mb_count; self } - pub fn ref_final_list0_entries( + pub fn reference_final_lists( mut self, - ref_final_list0_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], + reference_final_lists: &'a VideoEncodeH264ReferenceListsEXT, ) -> Self { - self.inner.ref_final_list0_entry_count = ref_final_list0_entries.len() as _; - self.inner.p_ref_final_list0_entries = ref_final_list0_entries.as_ptr(); + self.inner.p_reference_final_lists = reference_final_lists; self } - pub fn ref_final_list1_entries( - mut self, - ref_final_list1_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], - ) -> Self { - self.inner.ref_final_list1_entry_count = ref_final_list1_entries.len() as _; - self.inner.p_ref_final_list1_entries = ref_final_list1_entries.as_ptr(); + pub fn slice_header_std(mut self, slice_header_std: &'a StdVideoEncodeH264SliceHeader) -> Self { + self.inner.p_slice_header_std = slice_header_std; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] @@ -51269,7 +51868,7 @@ impl<'a> VideoEncodeH264NaluSliceEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264RateControlInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -51352,7 +51951,7 @@ impl<'a> VideoEncodeH264RateControlInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264QpEXT { pub qp_i: i32, pub qp_p: i32, @@ -51405,7 +52004,7 @@ impl<'a> VideoEncodeH264QpEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264FrameSizeEXT { pub frame_i_size: u32, pub frame_p_size: u32, @@ -51458,7 +52057,7 @@ impl<'a> VideoEncodeH264FrameSizeEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH264RateControlLayerInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -51565,7 +52164,7 @@ impl<'a> VideoEncodeH264RateControlLayerInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265CapabilitiesEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -51573,13 +52172,22 @@ pub struct VideoEncodeH265CapabilitiesEXT { pub input_mode_flags: VideoEncodeH265InputModeFlagsEXT, pub output_mode_flags: VideoEncodeH265OutputModeFlagsEXT, pub ctb_sizes: VideoEncodeH265CtbSizeFlagsEXT, - pub input_image_data_alignment: Extent2D, - pub max_num_l0_reference_for_p: u8, - pub max_num_l0_reference_for_b: u8, - pub max_num_l1_reference: u8, - pub max_num_sub_layers: u8, - pub quality_level_count: u8, - pub std_extension_version: ExtensionProperties, + pub transform_block_sizes: VideoEncodeH265TransformBlockSizeFlagsEXT, + pub max_p_picture_l0_reference_count: u8, + pub max_b_picture_l0_reference_count: u8, + pub max_l1_reference_count: u8, + pub max_sub_layers_count: u8, + pub min_log2_min_luma_coding_block_size_minus3: u8, + pub max_log2_min_luma_coding_block_size_minus3: u8, + pub min_log2_min_luma_transform_block_size_minus2: u8, + pub max_log2_min_luma_transform_block_size_minus2: u8, + pub min_max_transform_hierarchy_depth_inter: u8, + pub max_max_transform_hierarchy_depth_inter: u8, + pub min_max_transform_hierarchy_depth_intra: u8, + pub max_max_transform_hierarchy_depth_intra: u8, + pub max_diff_cu_qp_delta_depth: u8, + pub min_max_num_merge_cand: u8, + pub max_max_num_merge_cand: u8, } impl ::std::default::Default for VideoEncodeH265CapabilitiesEXT { fn default() -> Self { @@ -51590,13 +52198,22 @@ impl ::std::default::Default for VideoEncodeH265CapabilitiesEXT { input_mode_flags: VideoEncodeH265InputModeFlagsEXT::default(), output_mode_flags: VideoEncodeH265OutputModeFlagsEXT::default(), ctb_sizes: VideoEncodeH265CtbSizeFlagsEXT::default(), - input_image_data_alignment: Extent2D::default(), - max_num_l0_reference_for_p: u8::default(), - max_num_l0_reference_for_b: u8::default(), - max_num_l1_reference: u8::default(), - max_num_sub_layers: u8::default(), - quality_level_count: u8::default(), - std_extension_version: ExtensionProperties::default(), + transform_block_sizes: VideoEncodeH265TransformBlockSizeFlagsEXT::default(), + max_p_picture_l0_reference_count: u8::default(), + max_b_picture_l0_reference_count: u8::default(), + max_l1_reference_count: u8::default(), + max_sub_layers_count: u8::default(), + min_log2_min_luma_coding_block_size_minus3: u8::default(), + max_log2_min_luma_coding_block_size_minus3: u8::default(), + min_log2_min_luma_transform_block_size_minus2: u8::default(), + max_log2_min_luma_transform_block_size_minus2: u8::default(), + min_max_transform_hierarchy_depth_inter: u8::default(), + max_max_transform_hierarchy_depth_inter: u8::default(), + min_max_transform_hierarchy_depth_intra: u8::default(), + max_max_transform_hierarchy_depth_intra: u8::default(), + max_diff_cu_qp_delta_depth: u8::default(), + min_max_num_merge_cand: u8::default(), + max_max_num_merge_cand: u8::default(), } } } @@ -51613,8 +52230,8 @@ pub struct VideoEncodeH265CapabilitiesEXTBuilder<'a> { inner: VideoEncodeH265CapabilitiesEXT, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsVideoCapabilitiesKHR for VideoEncodeH265CapabilitiesEXTBuilder<'_> {} -unsafe impl ExtendsVideoCapabilitiesKHR for VideoEncodeH265CapabilitiesEXT {} +unsafe impl ExtendsVideoEncodeCapabilitiesKHR for VideoEncodeH265CapabilitiesEXTBuilder<'_> {} +unsafe impl ExtendsVideoEncodeCapabilitiesKHR for VideoEncodeH265CapabilitiesEXT {} impl<'a> ::std::ops::Deref for VideoEncodeH265CapabilitiesEXTBuilder<'a> { type Target = VideoEncodeH265CapabilitiesEXT; fn deref(&self) -> &Self::Target { @@ -51646,107 +52263,122 @@ impl<'a> VideoEncodeH265CapabilitiesEXTBuilder<'a> { self.inner.ctb_sizes = ctb_sizes; self } - pub fn input_image_data_alignment(mut self, input_image_data_alignment: Extent2D) -> Self { - self.inner.input_image_data_alignment = input_image_data_alignment; + pub fn transform_block_sizes( + mut self, + transform_block_sizes: VideoEncodeH265TransformBlockSizeFlagsEXT, + ) -> Self { + self.inner.transform_block_sizes = transform_block_sizes; self } - pub fn max_num_l0_reference_for_p(mut self, max_num_l0_reference_for_p: u8) -> Self { - self.inner.max_num_l0_reference_for_p = max_num_l0_reference_for_p; + pub fn max_p_picture_l0_reference_count( + mut self, + max_p_picture_l0_reference_count: u8, + ) -> Self { + self.inner.max_p_picture_l0_reference_count = max_p_picture_l0_reference_count; self } - pub fn max_num_l0_reference_for_b(mut self, max_num_l0_reference_for_b: u8) -> Self { - self.inner.max_num_l0_reference_for_b = max_num_l0_reference_for_b; + pub fn max_b_picture_l0_reference_count( + mut self, + max_b_picture_l0_reference_count: u8, + ) -> Self { + self.inner.max_b_picture_l0_reference_count = max_b_picture_l0_reference_count; self } - pub fn max_num_l1_reference(mut self, max_num_l1_reference: u8) -> Self { - self.inner.max_num_l1_reference = max_num_l1_reference; + pub fn max_l1_reference_count(mut self, max_l1_reference_count: u8) -> Self { + self.inner.max_l1_reference_count = max_l1_reference_count; self } - pub fn max_num_sub_layers(mut self, max_num_sub_layers: u8) -> Self { - self.inner.max_num_sub_layers = max_num_sub_layers; + pub fn max_sub_layers_count(mut self, max_sub_layers_count: u8) -> Self { + self.inner.max_sub_layers_count = max_sub_layers_count; self } - pub fn quality_level_count(mut self, quality_level_count: u8) -> Self { - self.inner.quality_level_count = quality_level_count; + pub fn min_log2_min_luma_coding_block_size_minus3( + mut self, + min_log2_min_luma_coding_block_size_minus3: u8, + ) -> Self { + self.inner.min_log2_min_luma_coding_block_size_minus3 = + min_log2_min_luma_coding_block_size_minus3; self } - pub fn std_extension_version(mut self, std_extension_version: ExtensionProperties) -> Self { - self.inner.std_extension_version = std_extension_version; + pub fn max_log2_min_luma_coding_block_size_minus3( + mut self, + max_log2_min_luma_coding_block_size_minus3: u8, + ) -> Self { + self.inner.max_log2_min_luma_coding_block_size_minus3 = + max_log2_min_luma_coding_block_size_minus3; self } - #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] - #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] - #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> VideoEncodeH265CapabilitiesEXT { - self.inner + pub fn min_log2_min_luma_transform_block_size_minus2( + mut self, + min_log2_min_luma_transform_block_size_minus2: u8, + ) -> Self { + self.inner.min_log2_min_luma_transform_block_size_minus2 = + min_log2_min_luma_transform_block_size_minus2; + self } -} -#[repr(C)] -#[cfg_attr(feature = "debug", derive(Debug))] -#[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH265SessionCreateInfoEXT { - pub s_type: StructureType, - pub p_next: *const c_void, - pub flags: VideoEncodeH265CreateFlagsEXT, - pub p_std_extension_version: *const ExtensionProperties, -} -impl ::std::default::Default for VideoEncodeH265SessionCreateInfoEXT { - fn default() -> Self { - Self { - s_type: StructureType::VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT, - p_next: ::std::ptr::null(), - flags: VideoEncodeH265CreateFlagsEXT::default(), - p_std_extension_version: ::std::ptr::null(), - } + pub fn max_log2_min_luma_transform_block_size_minus2( + mut self, + max_log2_min_luma_transform_block_size_minus2: u8, + ) -> Self { + self.inner.max_log2_min_luma_transform_block_size_minus2 = + max_log2_min_luma_transform_block_size_minus2; + self } -} -impl VideoEncodeH265SessionCreateInfoEXT { - pub fn builder<'a>() -> VideoEncodeH265SessionCreateInfoEXTBuilder<'a> { - VideoEncodeH265SessionCreateInfoEXTBuilder { - inner: Self::default(), - marker: ::std::marker::PhantomData, - } + pub fn min_max_transform_hierarchy_depth_inter( + mut self, + min_max_transform_hierarchy_depth_inter: u8, + ) -> Self { + self.inner.min_max_transform_hierarchy_depth_inter = + min_max_transform_hierarchy_depth_inter; + self } -} -#[repr(transparent)] -pub struct VideoEncodeH265SessionCreateInfoEXTBuilder<'a> { - inner: VideoEncodeH265SessionCreateInfoEXT, - marker: ::std::marker::PhantomData<&'a ()>, -} -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoEncodeH265SessionCreateInfoEXTBuilder<'_> {} -unsafe impl ExtendsVideoSessionCreateInfoKHR for VideoEncodeH265SessionCreateInfoEXT {} -impl<'a> ::std::ops::Deref for VideoEncodeH265SessionCreateInfoEXTBuilder<'a> { - type Target = VideoEncodeH265SessionCreateInfoEXT; - fn deref(&self) -> &Self::Target { - &self.inner + pub fn max_max_transform_hierarchy_depth_inter( + mut self, + max_max_transform_hierarchy_depth_inter: u8, + ) -> Self { + self.inner.max_max_transform_hierarchy_depth_inter = + max_max_transform_hierarchy_depth_inter; + self } -} -impl<'a> ::std::ops::DerefMut for VideoEncodeH265SessionCreateInfoEXTBuilder<'a> { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.inner + pub fn min_max_transform_hierarchy_depth_intra( + mut self, + min_max_transform_hierarchy_depth_intra: u8, + ) -> Self { + self.inner.min_max_transform_hierarchy_depth_intra = + min_max_transform_hierarchy_depth_intra; + self } -} -impl<'a> VideoEncodeH265SessionCreateInfoEXTBuilder<'a> { - pub fn flags(mut self, flags: VideoEncodeH265CreateFlagsEXT) -> Self { - self.inner.flags = flags; + pub fn max_max_transform_hierarchy_depth_intra( + mut self, + max_max_transform_hierarchy_depth_intra: u8, + ) -> Self { + self.inner.max_max_transform_hierarchy_depth_intra = + max_max_transform_hierarchy_depth_intra; self } - pub fn std_extension_version(mut self, std_extension_version: &'a ExtensionProperties) -> Self { - self.inner.p_std_extension_version = std_extension_version; + pub fn max_diff_cu_qp_delta_depth(mut self, max_diff_cu_qp_delta_depth: u8) -> Self { + self.inner.max_diff_cu_qp_delta_depth = max_diff_cu_qp_delta_depth; + self + } + pub fn min_max_num_merge_cand(mut self, min_max_num_merge_cand: u8) -> Self { + self.inner.min_max_num_merge_cand = min_max_num_merge_cand; + self + } + pub fn max_max_num_merge_cand(mut self, max_max_num_merge_cand: u8) -> Self { + self.inner.max_max_num_merge_cand = max_max_num_merge_cand; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> VideoEncodeH265SessionCreateInfoEXT { + pub fn build(self) -> VideoEncodeH265CapabilitiesEXT { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265SessionParametersAddInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -51829,7 +52461,7 @@ impl<'a> VideoEncodeH265SessionParametersAddInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265SessionParametersCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -51912,13 +52544,13 @@ impl<'a> VideoEncodeH265SessionParametersCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265VclFrameInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, pub p_reference_final_lists: *const VideoEncodeH265ReferenceListsEXT, - pub nalu_slice_entry_count: u32, - pub p_nalu_slice_entries: *const VideoEncodeH265NaluSliceEXT, + pub nalu_slice_segment_entry_count: u32, + pub p_nalu_slice_segment_entries: *const VideoEncodeH265NaluSliceSegmentEXT, pub p_current_picture_info: *const StdVideoEncodeH265PictureInfo, } impl ::std::default::Default for VideoEncodeH265VclFrameInfoEXT { @@ -51927,8 +52559,8 @@ impl ::std::default::Default for VideoEncodeH265VclFrameInfoEXT { s_type: StructureType::VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT, p_next: ::std::ptr::null(), p_reference_final_lists: ::std::ptr::null(), - nalu_slice_entry_count: u32::default(), - p_nalu_slice_entries: ::std::ptr::null(), + nalu_slice_segment_entry_count: u32::default(), + p_nalu_slice_segment_entries: ::std::ptr::null(), p_current_picture_info: ::std::ptr::null(), } } @@ -51967,12 +52599,12 @@ impl<'a> VideoEncodeH265VclFrameInfoEXTBuilder<'a> { self.inner.p_reference_final_lists = reference_final_lists; self } - pub fn nalu_slice_entries( + pub fn nalu_slice_segment_entries( mut self, - nalu_slice_entries: &'a [VideoEncodeH265NaluSliceEXT], + nalu_slice_segment_entries: &'a [VideoEncodeH265NaluSliceSegmentEXT], ) -> Self { - self.inner.nalu_slice_entry_count = nalu_slice_entries.len() as _; - self.inner.p_nalu_slice_entries = nalu_slice_entries.as_ptr(); + self.inner.nalu_slice_segment_entry_count = nalu_slice_segment_entries.len() as _; + self.inner.p_nalu_slice_segment_entries = nalu_slice_segment_entries.as_ptr(); self } pub fn current_picture_info( @@ -51992,7 +52624,7 @@ impl<'a> VideoEncodeH265VclFrameInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265EmitPictureParametersEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -52075,50 +52707,50 @@ impl<'a> VideoEncodeH265EmitPictureParametersEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH265NaluSliceEXT { +#[doc = ""] +pub struct VideoEncodeH265NaluSliceSegmentEXT { pub s_type: StructureType, pub p_next: *const c_void, pub ctb_count: u32, pub p_reference_final_lists: *const VideoEncodeH265ReferenceListsEXT, - pub p_slice_header_std: *const StdVideoEncodeH265SliceHeader, + pub p_slice_segment_header_std: *const StdVideoEncodeH265SliceSegmentHeader, } -impl ::std::default::Default for VideoEncodeH265NaluSliceEXT { +impl ::std::default::Default for VideoEncodeH265NaluSliceSegmentEXT { fn default() -> Self { Self { - s_type: StructureType::VIDEO_ENCODE_H265_NALU_SLICE_EXT, + s_type: StructureType::VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_EXT, p_next: ::std::ptr::null(), ctb_count: u32::default(), p_reference_final_lists: ::std::ptr::null(), - p_slice_header_std: ::std::ptr::null(), + p_slice_segment_header_std: ::std::ptr::null(), } } } -impl VideoEncodeH265NaluSliceEXT { - pub fn builder<'a>() -> VideoEncodeH265NaluSliceEXTBuilder<'a> { - VideoEncodeH265NaluSliceEXTBuilder { +impl VideoEncodeH265NaluSliceSegmentEXT { + pub fn builder<'a>() -> VideoEncodeH265NaluSliceSegmentEXTBuilder<'a> { + VideoEncodeH265NaluSliceSegmentEXTBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct VideoEncodeH265NaluSliceEXTBuilder<'a> { - inner: VideoEncodeH265NaluSliceEXT, +pub struct VideoEncodeH265NaluSliceSegmentEXTBuilder<'a> { + inner: VideoEncodeH265NaluSliceSegmentEXT, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for VideoEncodeH265NaluSliceEXTBuilder<'a> { - type Target = VideoEncodeH265NaluSliceEXT; +impl<'a> ::std::ops::Deref for VideoEncodeH265NaluSliceSegmentEXTBuilder<'a> { + type Target = VideoEncodeH265NaluSliceSegmentEXT; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for VideoEncodeH265NaluSliceEXTBuilder<'a> { +impl<'a> ::std::ops::DerefMut for VideoEncodeH265NaluSliceSegmentEXTBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> VideoEncodeH265NaluSliceEXTBuilder<'a> { +impl<'a> VideoEncodeH265NaluSliceSegmentEXTBuilder<'a> { pub fn ctb_count(mut self, ctb_count: u32) -> Self { self.inner.ctb_count = ctb_count; self @@ -52130,21 +52762,24 @@ impl<'a> VideoEncodeH265NaluSliceEXTBuilder<'a> { self.inner.p_reference_final_lists = reference_final_lists; self } - pub fn slice_header_std(mut self, slice_header_std: &'a StdVideoEncodeH265SliceHeader) -> Self { - self.inner.p_slice_header_std = slice_header_std; + pub fn slice_segment_header_std( + mut self, + slice_segment_header_std: &'a StdVideoEncodeH265SliceSegmentHeader, + ) -> Self { + self.inner.p_slice_segment_header_std = slice_segment_header_std; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> VideoEncodeH265NaluSliceEXT { + pub fn build(self) -> VideoEncodeH265NaluSliceSegmentEXT { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265RateControlInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -52227,7 +52862,7 @@ impl<'a> VideoEncodeH265RateControlInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265QpEXT { pub qp_i: i32, pub qp_p: i32, @@ -52280,7 +52915,7 @@ impl<'a> VideoEncodeH265QpEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265FrameSizeEXT { pub frame_i_size: u32, pub frame_p_size: u32, @@ -52333,7 +52968,7 @@ impl<'a> VideoEncodeH265FrameSizeEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265RateControlLayerInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -52440,7 +53075,7 @@ impl<'a> VideoEncodeH265RateControlLayerInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265ProfileEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -52506,7 +53141,7 @@ impl<'a> VideoEncodeH265ProfileEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265DpbSlotInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -52569,7 +53204,7 @@ impl<'a> VideoEncodeH265DpbSlotInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct VideoEncodeH265ReferenceListsEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -52650,7 +53285,7 @@ impl<'a> VideoEncodeH265ReferenceListsEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceInheritedViewportScissorFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52714,7 +53349,7 @@ impl<'a> PhysicalDeviceInheritedViewportScissorFeaturesNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CommandBufferInheritanceViewportScissorInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -52785,7 +53420,7 @@ impl<'a> CommandBufferInheritanceViewportScissorInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52846,7 +53481,7 @@ impl<'a> PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceProvokingVertexFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52914,7 +53549,7 @@ impl<'a> PhysicalDeviceProvokingVertexFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceProvokingVertexPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -52987,7 +53622,7 @@ impl<'a> PhysicalDeviceProvokingVertexPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PipelineRasterizationProvokingVertexStateCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -53051,7 +53686,7 @@ impl<'a> PipelineRasterizationProvokingVertexStateCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CuModuleCreateInfoNVX { pub s_type: StructureType, pub p_next: *const c_void, @@ -53094,7 +53729,7 @@ impl<'a> ::std::ops::DerefMut for CuModuleCreateInfoNVXBuilder<'a> { } impl<'a> CuModuleCreateInfoNVXBuilder<'a> { pub fn data(mut self, data: &'a [u8]) -> Self { - self.inner.data_size = data.len() as _; + self.inner.data_size = data.len(); self.inner.p_data = data.as_ptr() as *const c_void; self } @@ -53108,7 +53743,7 @@ impl<'a> CuModuleCreateInfoNVXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CuFunctionCreateInfoNVX { pub s_type: StructureType, pub p_next: *const c_void, @@ -53168,7 +53803,7 @@ impl<'a> CuFunctionCreateInfoNVXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct CuLaunchInfoNVX { pub s_type: StructureType, pub p_next: *const c_void, @@ -53263,12 +53898,12 @@ impl<'a> CuLaunchInfoNVXBuilder<'a> { self } pub fn params(mut self, params: &'a [*const c_void]) -> Self { - self.inner.param_count = params.len() as _; + self.inner.param_count = params.len(); self.inner.p_params = params.as_ptr(); self } pub fn extras(mut self, extras: &'a [*const c_void]) -> Self { - self.inner.extra_count = extras.len() as _; + self.inner.extra_count = extras.len(); self.inner.p_extras = extras.as_ptr(); self } @@ -53282,56 +53917,53 @@ impl<'a> CuLaunchInfoNVXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceShaderIntegerDotProductFeaturesKHR { +#[doc = ""] +pub struct PhysicalDeviceShaderIntegerDotProductFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub shader_integer_dot_product: Bool32, } -impl ::std::default::Default for PhysicalDeviceShaderIntegerDotProductFeaturesKHR { +impl ::std::default::Default for PhysicalDeviceShaderIntegerDotProductFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR, + s_type: StructureType::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES, p_next: ::std::ptr::null_mut(), shader_integer_dot_product: Bool32::default(), } } } -impl PhysicalDeviceShaderIntegerDotProductFeaturesKHR { - pub fn builder<'a>() -> PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> { - PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder { +impl PhysicalDeviceShaderIntegerDotProductFeatures { + pub fn builder<'a>() -> PhysicalDeviceShaderIntegerDotProductFeaturesBuilder<'a> { + PhysicalDeviceShaderIntegerDotProductFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> { - inner: PhysicalDeviceShaderIntegerDotProductFeaturesKHR, +pub struct PhysicalDeviceShaderIntegerDotProductFeaturesBuilder<'a> { + inner: PhysicalDeviceShaderIntegerDotProductFeatures, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceShaderIntegerDotProductFeaturesKHR {} -unsafe impl ExtendsDeviceCreateInfo - for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'_> + for PhysicalDeviceShaderIntegerDotProductFeaturesBuilder<'_> { } -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderIntegerDotProductFeaturesKHR {} -impl<'a> ::std::ops::Deref for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> { - type Target = PhysicalDeviceShaderIntegerDotProductFeaturesKHR; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceShaderIntegerDotProductFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderIntegerDotProductFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderIntegerDotProductFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceShaderIntegerDotProductFeaturesBuilder<'a> { + type Target = PhysicalDeviceShaderIntegerDotProductFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderIntegerDotProductFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> { +impl<'a> PhysicalDeviceShaderIntegerDotProductFeaturesBuilder<'a> { pub fn shader_integer_dot_product(mut self, shader_integer_dot_product: bool) -> Self { self.inner.shader_integer_dot_product = shader_integer_dot_product.into(); self @@ -53339,15 +53971,15 @@ impl<'a> PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceShaderIntegerDotProductFeaturesKHR { + pub fn build(self) -> PhysicalDeviceShaderIntegerDotProductFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceShaderIntegerDotProductPropertiesKHR { +#[doc = ""] +pub struct PhysicalDeviceShaderIntegerDotProductProperties { pub s_type: StructureType, pub p_next: *mut c_void, pub integer_dot_product8_bit_unsigned_accelerated: Bool32, @@ -53382,44 +54014,41 @@ pub struct PhysicalDeviceShaderIntegerDotProductPropertiesKHR { pub integer_dot_product_accumulating_saturating64_bit_signed_accelerated: Bool32, pub integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated: Bool32, } -impl ::std::default::Default for PhysicalDeviceShaderIntegerDotProductPropertiesKHR { +impl ::std::default::Default for PhysicalDeviceShaderIntegerDotProductProperties { fn default() -> Self { - Self { s_type : StructureType :: PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR , p_next : :: std :: ptr :: null_mut () , integer_dot_product8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product64_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated : Bool32 :: default () } + Self { s_type : StructureType :: PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES , p_next : :: std :: ptr :: null_mut () , integer_dot_product8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product64_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated : Bool32 :: default () } } } -impl PhysicalDeviceShaderIntegerDotProductPropertiesKHR { - pub fn builder<'a>() -> PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> { - PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder { +impl PhysicalDeviceShaderIntegerDotProductProperties { + pub fn builder<'a>() -> PhysicalDeviceShaderIntegerDotProductPropertiesBuilder<'a> { + PhysicalDeviceShaderIntegerDotProductPropertiesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> { - inner: PhysicalDeviceShaderIntegerDotProductPropertiesKHR, +pub struct PhysicalDeviceShaderIntegerDotProductPropertiesBuilder<'a> { + inner: PhysicalDeviceShaderIntegerDotProductProperties, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsPhysicalDeviceProperties2 - for PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceProperties2 - for PhysicalDeviceShaderIntegerDotProductPropertiesKHR + for PhysicalDeviceShaderIntegerDotProductPropertiesBuilder<'_> { } -impl<'a> ::std::ops::Deref for PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> { - type Target = PhysicalDeviceShaderIntegerDotProductPropertiesKHR; +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceShaderIntegerDotProductProperties {} +impl<'a> ::std::ops::Deref for PhysicalDeviceShaderIntegerDotProductPropertiesBuilder<'a> { + type Target = PhysicalDeviceShaderIntegerDotProductProperties; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderIntegerDotProductPropertiesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> { +impl<'a> PhysicalDeviceShaderIntegerDotProductPropertiesBuilder<'a> { pub fn integer_dot_product8_bit_unsigned_accelerated( mut self, integer_dot_product8_bit_unsigned_accelerated: bool, @@ -53683,14 +54312,14 @@ impl<'a> PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceShaderIntegerDotProductPropertiesKHR { + pub fn build(self) -> PhysicalDeviceShaderIntegerDotProductProperties { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceDrmPropertiesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -53776,7 +54405,7 @@ impl<'a> PhysicalDeviceDrmPropertiesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRayTracingMotionBlurFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -53847,7 +54476,7 @@ impl<'a> PhysicalDeviceRayTracingMotionBlurFeaturesNVBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureGeometryMotionTrianglesDataNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -53919,7 +54548,7 @@ impl<'a> AccelerationStructureGeometryMotionTrianglesDataNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMotionInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -53984,7 +54613,7 @@ impl<'a> AccelerationStructureMotionInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct SRTDataNV { pub sx: f32, pub a: f32, @@ -54101,7 +54730,7 @@ impl<'a> SRTDataNVBuilder<'a> { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureSRTMotionInstanceNV { pub transform_t0: SRTDataNV, pub transform_t1: SRTDataNV, @@ -54113,7 +54742,7 @@ pub struct AccelerationStructureSRTMotionInstanceNV { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMatrixMotionInstanceNV { pub transform_t0: TransformMatrixKHR, pub transform_t1: TransformMatrixKHR, @@ -54125,7 +54754,7 @@ pub struct AccelerationStructureMatrixMotionInstanceNV { } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub union AccelerationStructureMotionInstanceDataNV { pub static_instance: AccelerationStructureInstanceKHR, pub matrix_motion_instance: AccelerationStructureMatrixMotionInstanceNV, @@ -54138,7 +54767,7 @@ impl ::std::default::Default for AccelerationStructureMotionInstanceDataNV { } #[repr(C)] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMotionInstanceNV { pub ty: AccelerationStructureMotionInstanceTypeNV, pub flags: AccelerationStructureMotionInstanceFlagsNV, @@ -54198,12 +54827,12 @@ impl<'a> AccelerationStructureMotionInstanceNVBuilder<'a> { self.inner } } -#[doc = ""] +#[doc = ""] pub type RemoteAddressNV = c_void; #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MemoryGetRemoteAddressInfoNV { pub s_type: StructureType, pub p_next: *const c_void, @@ -54263,7 +54892,7 @@ impl<'a> MemoryGetRemoteAddressInfoNVBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImportMemoryBufferCollectionFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54325,7 +54954,7 @@ impl<'a> ImportMemoryBufferCollectionFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferCollectionImageCreateInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54387,7 +55016,7 @@ impl<'a> BufferCollectionImageCreateInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferCollectionBufferCreateInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54449,7 +55078,7 @@ impl<'a> BufferCollectionBufferCreateInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferCollectionCreateInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54503,7 +55132,7 @@ impl<'a> BufferCollectionCreateInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferCollectionPropertiesFUCHSIA { pub s_type: StructureType, pub p_next: *mut c_void, @@ -54626,7 +55255,7 @@ impl<'a> BufferCollectionPropertiesFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferConstraintsInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54698,7 +55327,7 @@ impl<'a> BufferConstraintsInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct SysmemColorSpaceFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54752,7 +55381,7 @@ impl<'a> SysmemColorSpaceFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageFormatConstraintsInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54821,12 +55450,9 @@ impl<'a> ImageFormatConstraintsInfoFUCHSIABuilder<'a> { self.inner.sysmem_pixel_format = sysmem_pixel_format; self } - pub fn color_space_count(mut self, color_space_count: u32) -> Self { - self.inner.color_space_count = color_space_count; - self - } - pub fn color_spaces(mut self, color_spaces: &'a SysmemColorSpaceFUCHSIA) -> Self { - self.inner.p_color_spaces = color_spaces; + pub fn color_spaces(mut self, color_spaces: &'a [SysmemColorSpaceFUCHSIA]) -> Self { + self.inner.color_space_count = color_spaces.len() as _; + self.inner.p_color_spaces = color_spaces.as_ptr(); self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] @@ -54839,7 +55465,7 @@ impl<'a> ImageFormatConstraintsInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageConstraintsInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54914,7 +55540,7 @@ impl<'a> ImageConstraintsInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct BufferCollectionConstraintsInfoFUCHSIA { pub s_type: StructureType, pub p_next: *const c_void, @@ -54998,7 +55624,7 @@ impl<'a> BufferCollectionConstraintsInfoFUCHSIABuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRGBA10X6FormatsFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -55060,81 +55686,75 @@ impl<'a> PhysicalDeviceRGBA10X6FormatsFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct FormatProperties3KHR { +#[doc = ""] +pub struct FormatProperties3 { pub s_type: StructureType, pub p_next: *mut c_void, - pub linear_tiling_features: FormatFeatureFlags2KHR, - pub optimal_tiling_features: FormatFeatureFlags2KHR, - pub buffer_features: FormatFeatureFlags2KHR, + pub linear_tiling_features: FormatFeatureFlags2, + pub optimal_tiling_features: FormatFeatureFlags2, + pub buffer_features: FormatFeatureFlags2, } -impl ::std::default::Default for FormatProperties3KHR { +impl ::std::default::Default for FormatProperties3 { fn default() -> Self { Self { - s_type: StructureType::FORMAT_PROPERTIES_3_KHR, + s_type: StructureType::FORMAT_PROPERTIES_3, p_next: ::std::ptr::null_mut(), - linear_tiling_features: FormatFeatureFlags2KHR::default(), - optimal_tiling_features: FormatFeatureFlags2KHR::default(), - buffer_features: FormatFeatureFlags2KHR::default(), + linear_tiling_features: FormatFeatureFlags2::default(), + optimal_tiling_features: FormatFeatureFlags2::default(), + buffer_features: FormatFeatureFlags2::default(), } } } -impl FormatProperties3KHR { - pub fn builder<'a>() -> FormatProperties3KHRBuilder<'a> { - FormatProperties3KHRBuilder { +impl FormatProperties3 { + pub fn builder<'a>() -> FormatProperties3Builder<'a> { + FormatProperties3Builder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct FormatProperties3KHRBuilder<'a> { - inner: FormatProperties3KHR, +pub struct FormatProperties3Builder<'a> { + inner: FormatProperties3, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsFormatProperties2 for FormatProperties3KHRBuilder<'_> {} -unsafe impl ExtendsFormatProperties2 for FormatProperties3KHR {} -impl<'a> ::std::ops::Deref for FormatProperties3KHRBuilder<'a> { - type Target = FormatProperties3KHR; +unsafe impl ExtendsFormatProperties2 for FormatProperties3Builder<'_> {} +unsafe impl ExtendsFormatProperties2 for FormatProperties3 {} +impl<'a> ::std::ops::Deref for FormatProperties3Builder<'a> { + type Target = FormatProperties3; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for FormatProperties3KHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for FormatProperties3Builder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> FormatProperties3KHRBuilder<'a> { - pub fn linear_tiling_features( - mut self, - linear_tiling_features: FormatFeatureFlags2KHR, - ) -> Self { +impl<'a> FormatProperties3Builder<'a> { + pub fn linear_tiling_features(mut self, linear_tiling_features: FormatFeatureFlags2) -> Self { self.inner.linear_tiling_features = linear_tiling_features; self } - pub fn optimal_tiling_features( - mut self, - optimal_tiling_features: FormatFeatureFlags2KHR, - ) -> Self { + pub fn optimal_tiling_features(mut self, optimal_tiling_features: FormatFeatureFlags2) -> Self { self.inner.optimal_tiling_features = optimal_tiling_features; self } - pub fn buffer_features(mut self, buffer_features: FormatFeatureFlags2KHR) -> Self { + pub fn buffer_features(mut self, buffer_features: FormatFeatureFlags2) -> Self { self.inner.buffer_features = buffer_features; self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> FormatProperties3KHR { + pub fn build(self) -> FormatProperties3 { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct DrmFormatModifierPropertiesList2EXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -55196,11 +55816,11 @@ impl<'a> DrmFormatModifierPropertiesList2EXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] -#[doc = ""] +#[doc = ""] pub struct DrmFormatModifierProperties2EXT { pub drm_format_modifier: u64, pub drm_format_modifier_plane_count: u32, - pub drm_format_modifier_tiling_features: FormatFeatureFlags2KHR, + pub drm_format_modifier_tiling_features: FormatFeatureFlags2, } impl DrmFormatModifierProperties2EXT { pub fn builder<'a>() -> DrmFormatModifierProperties2EXTBuilder<'a> { @@ -55237,7 +55857,7 @@ impl<'a> DrmFormatModifierProperties2EXTBuilder<'a> { } pub fn drm_format_modifier_tiling_features( mut self, - drm_format_modifier_tiling_features: FormatFeatureFlags2KHR, + drm_format_modifier_tiling_features: FormatFeatureFlags2, ) -> Self { self.inner.drm_format_modifier_tiling_features = drm_format_modifier_tiling_features; self @@ -55252,13 +55872,13 @@ impl<'a> DrmFormatModifierProperties2EXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AndroidHardwareBufferFormatProperties2ANDROID { pub s_type: StructureType, pub p_next: *mut c_void, pub format: Format, pub external_format: u64, - pub format_features: FormatFeatureFlags2KHR, + pub format_features: FormatFeatureFlags2, pub sampler_ycbcr_conversion_components: ComponentMapping, pub suggested_ycbcr_model: SamplerYcbcrModelConversion, pub suggested_ycbcr_range: SamplerYcbcrRange, @@ -55272,7 +55892,7 @@ impl ::std::default::Default for AndroidHardwareBufferFormatProperties2ANDROID { p_next: ::std::ptr::null_mut(), format: Format::default(), external_format: u64::default(), - format_features: FormatFeatureFlags2KHR::default(), + format_features: FormatFeatureFlags2::default(), sampler_ycbcr_conversion_components: ComponentMapping::default(), suggested_ycbcr_model: SamplerYcbcrModelConversion::default(), suggested_ycbcr_range: SamplerYcbcrRange::default(), @@ -55322,7 +55942,7 @@ impl<'a> AndroidHardwareBufferFormatProperties2ANDROIDBuilder<'a> { self.inner.external_format = external_format; self } - pub fn format_features(mut self, format_features: FormatFeatureFlags2KHR) -> Self { + pub fn format_features(mut self, format_features: FormatFeatureFlags2) -> Self { self.inner.format_features = format_features; self } @@ -55362,8 +55982,8 @@ impl<'a> AndroidHardwareBufferFormatProperties2ANDROIDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PipelineRenderingCreateInfoKHR { +#[doc = ""] +pub struct PipelineRenderingCreateInfo { pub s_type: StructureType, pub p_next: *const c_void, pub view_mask: u32, @@ -55372,10 +55992,10 @@ pub struct PipelineRenderingCreateInfoKHR { pub depth_attachment_format: Format, pub stencil_attachment_format: Format, } -impl ::std::default::Default for PipelineRenderingCreateInfoKHR { +impl ::std::default::Default for PipelineRenderingCreateInfo { fn default() -> Self { Self { - s_type: StructureType::PIPELINE_RENDERING_CREATE_INFO_KHR, + s_type: StructureType::PIPELINE_RENDERING_CREATE_INFO, p_next: ::std::ptr::null(), view_mask: u32::default(), color_attachment_count: u32::default(), @@ -55385,33 +56005,33 @@ impl ::std::default::Default for PipelineRenderingCreateInfoKHR { } } } -impl PipelineRenderingCreateInfoKHR { - pub fn builder<'a>() -> PipelineRenderingCreateInfoKHRBuilder<'a> { - PipelineRenderingCreateInfoKHRBuilder { +impl PipelineRenderingCreateInfo { + pub fn builder<'a>() -> PipelineRenderingCreateInfoBuilder<'a> { + PipelineRenderingCreateInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PipelineRenderingCreateInfoKHRBuilder<'a> { - inner: PipelineRenderingCreateInfoKHR, +pub struct PipelineRenderingCreateInfoBuilder<'a> { + inner: PipelineRenderingCreateInfo, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineRenderingCreateInfoKHRBuilder<'_> {} -unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineRenderingCreateInfoKHR {} -impl<'a> ::std::ops::Deref for PipelineRenderingCreateInfoKHRBuilder<'a> { - type Target = PipelineRenderingCreateInfoKHR; +unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineRenderingCreateInfoBuilder<'_> {} +unsafe impl ExtendsGraphicsPipelineCreateInfo for PipelineRenderingCreateInfo {} +impl<'a> ::std::ops::Deref for PipelineRenderingCreateInfoBuilder<'a> { + type Target = PipelineRenderingCreateInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PipelineRenderingCreateInfoKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PipelineRenderingCreateInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PipelineRenderingCreateInfoKHRBuilder<'a> { +impl<'a> PipelineRenderingCreateInfoBuilder<'a> { pub fn view_mask(mut self, view_mask: u32) -> Self { self.inner.view_mask = view_mask; self @@ -55432,32 +56052,32 @@ impl<'a> PipelineRenderingCreateInfoKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PipelineRenderingCreateInfoKHR { + pub fn build(self) -> PipelineRenderingCreateInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct RenderingInfoKHR { +#[doc = ""] +pub struct RenderingInfo { pub s_type: StructureType, pub p_next: *const c_void, - pub flags: RenderingFlagsKHR, + pub flags: RenderingFlags, pub render_area: Rect2D, pub layer_count: u32, pub view_mask: u32, pub color_attachment_count: u32, - pub p_color_attachments: *const RenderingAttachmentInfoKHR, - pub p_depth_attachment: *const RenderingAttachmentInfoKHR, - pub p_stencil_attachment: *const RenderingAttachmentInfoKHR, + pub p_color_attachments: *const RenderingAttachmentInfo, + pub p_depth_attachment: *const RenderingAttachmentInfo, + pub p_stencil_attachment: *const RenderingAttachmentInfo, } -impl ::std::default::Default for RenderingInfoKHR { +impl ::std::default::Default for RenderingInfo { fn default() -> Self { Self { - s_type: StructureType::RENDERING_INFO_KHR, + s_type: StructureType::RENDERING_INFO, p_next: ::std::ptr::null(), - flags: RenderingFlagsKHR::default(), + flags: RenderingFlags::default(), render_area: Rect2D::default(), layer_count: u32::default(), view_mask: u32::default(), @@ -55468,33 +56088,33 @@ impl ::std::default::Default for RenderingInfoKHR { } } } -impl RenderingInfoKHR { - pub fn builder<'a>() -> RenderingInfoKHRBuilder<'a> { - RenderingInfoKHRBuilder { +impl RenderingInfo { + pub fn builder<'a>() -> RenderingInfoBuilder<'a> { + RenderingInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct RenderingInfoKHRBuilder<'a> { - inner: RenderingInfoKHR, +pub struct RenderingInfoBuilder<'a> { + inner: RenderingInfo, marker: ::std::marker::PhantomData<&'a ()>, } -pub unsafe trait ExtendsRenderingInfoKHR {} -impl<'a> ::std::ops::Deref for RenderingInfoKHRBuilder<'a> { - type Target = RenderingInfoKHR; +pub unsafe trait ExtendsRenderingInfo {} +impl<'a> ::std::ops::Deref for RenderingInfoBuilder<'a> { + type Target = RenderingInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for RenderingInfoKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for RenderingInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> RenderingInfoKHRBuilder<'a> { - pub fn flags(mut self, flags: RenderingFlagsKHR) -> Self { +impl<'a> RenderingInfoBuilder<'a> { + pub fn flags(mut self, flags: RenderingFlags) -> Self { self.inner.flags = flags; self } @@ -55510,22 +56130,16 @@ impl<'a> RenderingInfoKHRBuilder<'a> { self.inner.view_mask = view_mask; self } - pub fn color_attachments( - mut self, - color_attachments: &'a [RenderingAttachmentInfoKHR], - ) -> Self { + pub fn color_attachments(mut self, color_attachments: &'a [RenderingAttachmentInfo]) -> Self { self.inner.color_attachment_count = color_attachments.len() as _; self.inner.p_color_attachments = color_attachments.as_ptr(); self } - pub fn depth_attachment(mut self, depth_attachment: &'a RenderingAttachmentInfoKHR) -> Self { + pub fn depth_attachment(mut self, depth_attachment: &'a RenderingAttachmentInfo) -> Self { self.inner.p_depth_attachment = depth_attachment; self } - pub fn stencil_attachment( - mut self, - stencil_attachment: &'a RenderingAttachmentInfoKHR, - ) -> Self { + pub fn stencil_attachment(mut self, stencil_attachment: &'a RenderingAttachmentInfo) -> Self { self.inner.p_stencil_attachment = stencil_attachment; self } @@ -55534,26 +56148,26 @@ impl<'a> RenderingInfoKHRBuilder<'a> { #[doc = r" valid extension structs can be pushed into the chain."] #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"] #[doc = r" chain will look like `A -> D -> B -> C`."] - pub fn push_next(mut self, next: &'a mut T) -> Self { + pub fn push_next(mut self, next: &'a mut T) -> Self { unsafe { - let next_ptr = next as *mut T as *mut BaseOutStructure; + 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 as _; + self.inner.p_next = next_ptr; } self } #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> RenderingInfoKHR { + pub fn build(self) -> RenderingInfo { self.inner } } #[repr(C)] #[derive(Copy, Clone)] -#[doc = ""] -pub struct RenderingAttachmentInfoKHR { +#[doc = ""] +pub struct RenderingAttachmentInfo { pub s_type: StructureType, pub p_next: *const c_void, pub image_view: ImageView, @@ -55566,9 +56180,9 @@ pub struct RenderingAttachmentInfoKHR { pub clear_value: ClearValue, } #[cfg(feature = "debug")] -impl fmt::Debug for RenderingAttachmentInfoKHR { +impl fmt::Debug for RenderingAttachmentInfo { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - fmt.debug_struct("RenderingAttachmentInfoKHR") + fmt.debug_struct("RenderingAttachmentInfo") .field("s_type", &self.s_type) .field("p_next", &self.p_next) .field("image_view", &self.image_view) @@ -55582,10 +56196,10 @@ impl fmt::Debug for RenderingAttachmentInfoKHR { .finish() } } -impl ::std::default::Default for RenderingAttachmentInfoKHR { +impl ::std::default::Default for RenderingAttachmentInfo { fn default() -> Self { Self { - s_type: StructureType::RENDERING_ATTACHMENT_INFO_KHR, + s_type: StructureType::RENDERING_ATTACHMENT_INFO, p_next: ::std::ptr::null(), image_view: ImageView::default(), image_layout: ImageLayout::default(), @@ -55598,31 +56212,31 @@ impl ::std::default::Default for RenderingAttachmentInfoKHR { } } } -impl RenderingAttachmentInfoKHR { - pub fn builder<'a>() -> RenderingAttachmentInfoKHRBuilder<'a> { - RenderingAttachmentInfoKHRBuilder { +impl RenderingAttachmentInfo { + pub fn builder<'a>() -> RenderingAttachmentInfoBuilder<'a> { + RenderingAttachmentInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct RenderingAttachmentInfoKHRBuilder<'a> { - inner: RenderingAttachmentInfoKHR, +pub struct RenderingAttachmentInfoBuilder<'a> { + inner: RenderingAttachmentInfo, marker: ::std::marker::PhantomData<&'a ()>, } -impl<'a> ::std::ops::Deref for RenderingAttachmentInfoKHRBuilder<'a> { - type Target = RenderingAttachmentInfoKHR; +impl<'a> ::std::ops::Deref for RenderingAttachmentInfoBuilder<'a> { + type Target = RenderingAttachmentInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for RenderingAttachmentInfoKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for RenderingAttachmentInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> RenderingAttachmentInfoKHRBuilder<'a> { +impl<'a> RenderingAttachmentInfoBuilder<'a> { pub fn image_view(mut self, image_view: ImageView) -> Self { self.inner.image_view = image_view; self @@ -55658,14 +56272,14 @@ impl<'a> RenderingAttachmentInfoKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> RenderingAttachmentInfoKHR { + pub fn build(self) -> RenderingAttachmentInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderingFragmentShadingRateAttachmentInfoKHR { pub s_type: StructureType, pub p_next: *const c_void, @@ -55697,8 +56311,8 @@ pub struct RenderingFragmentShadingRateAttachmentInfoKHRBuilder<'a> { inner: RenderingFragmentShadingRateAttachmentInfoKHR, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsRenderingInfoKHR for RenderingFragmentShadingRateAttachmentInfoKHRBuilder<'_> {} -unsafe impl ExtendsRenderingInfoKHR for RenderingFragmentShadingRateAttachmentInfoKHR {} +unsafe impl ExtendsRenderingInfo for RenderingFragmentShadingRateAttachmentInfoKHRBuilder<'_> {} +unsafe impl ExtendsRenderingInfo for RenderingFragmentShadingRateAttachmentInfoKHR {} impl<'a> ::std::ops::Deref for RenderingFragmentShadingRateAttachmentInfoKHRBuilder<'a> { type Target = RenderingFragmentShadingRateAttachmentInfoKHR; fn deref(&self) -> &Self::Target { @@ -55736,7 +56350,7 @@ impl<'a> RenderingFragmentShadingRateAttachmentInfoKHRBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct RenderingFragmentDensityMapAttachmentInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -55766,8 +56380,8 @@ pub struct RenderingFragmentDensityMapAttachmentInfoEXTBuilder<'a> { inner: RenderingFragmentDensityMapAttachmentInfoEXT, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsRenderingInfoKHR for RenderingFragmentDensityMapAttachmentInfoEXTBuilder<'_> {} -unsafe impl ExtendsRenderingInfoKHR for RenderingFragmentDensityMapAttachmentInfoEXT {} +unsafe impl ExtendsRenderingInfo for RenderingFragmentDensityMapAttachmentInfoEXTBuilder<'_> {} +unsafe impl ExtendsRenderingInfo for RenderingFragmentDensityMapAttachmentInfoEXT {} impl<'a> ::std::ops::Deref for RenderingFragmentDensityMapAttachmentInfoEXTBuilder<'a> { type Target = RenderingFragmentDensityMapAttachmentInfoEXT; fn deref(&self) -> &Self::Target { @@ -55798,53 +56412,50 @@ impl<'a> RenderingFragmentDensityMapAttachmentInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct PhysicalDeviceDynamicRenderingFeaturesKHR { +#[doc = ""] +pub struct PhysicalDeviceDynamicRenderingFeatures { pub s_type: StructureType, pub p_next: *mut c_void, pub dynamic_rendering: Bool32, } -impl ::std::default::Default for PhysicalDeviceDynamicRenderingFeaturesKHR { +impl ::std::default::Default for PhysicalDeviceDynamicRenderingFeatures { fn default() -> Self { Self { - s_type: StructureType::PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR, + s_type: StructureType::PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES, p_next: ::std::ptr::null_mut(), dynamic_rendering: Bool32::default(), } } } -impl PhysicalDeviceDynamicRenderingFeaturesKHR { - pub fn builder<'a>() -> PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'a> { - PhysicalDeviceDynamicRenderingFeaturesKHRBuilder { +impl PhysicalDeviceDynamicRenderingFeatures { + pub fn builder<'a>() -> PhysicalDeviceDynamicRenderingFeaturesBuilder<'a> { + PhysicalDeviceDynamicRenderingFeaturesBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'a> { - inner: PhysicalDeviceDynamicRenderingFeaturesKHR, +pub struct PhysicalDeviceDynamicRenderingFeaturesBuilder<'a> { + inner: PhysicalDeviceDynamicRenderingFeatures, marker: ::std::marker::PhantomData<&'a ()>, } -unsafe impl ExtendsPhysicalDeviceFeatures2 - for PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'_> -{ -} -unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceDynamicRenderingFeaturesKHR {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'_> {} -unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceDynamicRenderingFeaturesKHR {} -impl<'a> ::std::ops::Deref for PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'a> { - type Target = PhysicalDeviceDynamicRenderingFeaturesKHR; +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceDynamicRenderingFeaturesBuilder<'_> {} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceDynamicRenderingFeatures {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceDynamicRenderingFeaturesBuilder<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceDynamicRenderingFeatures {} +impl<'a> ::std::ops::Deref for PhysicalDeviceDynamicRenderingFeaturesBuilder<'a> { + type Target = PhysicalDeviceDynamicRenderingFeatures; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for PhysicalDeviceDynamicRenderingFeaturesBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'a> { +impl<'a> PhysicalDeviceDynamicRenderingFeaturesBuilder<'a> { pub fn dynamic_rendering(mut self, dynamic_rendering: bool) -> Self { self.inner.dynamic_rendering = dynamic_rendering.into(); self @@ -55852,18 +56463,18 @@ impl<'a> PhysicalDeviceDynamicRenderingFeaturesKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> PhysicalDeviceDynamicRenderingFeaturesKHR { + pub fn build(self) -> PhysicalDeviceDynamicRenderingFeatures { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct CommandBufferInheritanceRenderingInfoKHR { +#[doc = ""] +pub struct CommandBufferInheritanceRenderingInfo { pub s_type: StructureType, pub p_next: *const c_void, - pub flags: RenderingFlagsKHR, + pub flags: RenderingFlags, pub view_mask: u32, pub color_attachment_count: u32, pub p_color_attachment_formats: *const Format, @@ -55871,12 +56482,12 @@ pub struct CommandBufferInheritanceRenderingInfoKHR { pub stencil_attachment_format: Format, pub rasterization_samples: SampleCountFlags, } -impl ::std::default::Default for CommandBufferInheritanceRenderingInfoKHR { +impl ::std::default::Default for CommandBufferInheritanceRenderingInfo { fn default() -> Self { Self { - s_type: StructureType::COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR, + s_type: StructureType::COMMAND_BUFFER_INHERITANCE_RENDERING_INFO, p_next: ::std::ptr::null(), - flags: RenderingFlagsKHR::default(), + flags: RenderingFlags::default(), view_mask: u32::default(), color_attachment_count: u32::default(), p_color_attachment_formats: ::std::ptr::null(), @@ -55886,37 +56497,37 @@ impl ::std::default::Default for CommandBufferInheritanceRenderingInfoKHR { } } } -impl CommandBufferInheritanceRenderingInfoKHR { - pub fn builder<'a>() -> CommandBufferInheritanceRenderingInfoKHRBuilder<'a> { - CommandBufferInheritanceRenderingInfoKHRBuilder { +impl CommandBufferInheritanceRenderingInfo { + pub fn builder<'a>() -> CommandBufferInheritanceRenderingInfoBuilder<'a> { + CommandBufferInheritanceRenderingInfoBuilder { inner: Self::default(), marker: ::std::marker::PhantomData, } } } #[repr(transparent)] -pub struct CommandBufferInheritanceRenderingInfoKHRBuilder<'a> { - inner: CommandBufferInheritanceRenderingInfoKHR, +pub struct CommandBufferInheritanceRenderingInfoBuilder<'a> { + inner: CommandBufferInheritanceRenderingInfo, marker: ::std::marker::PhantomData<&'a ()>, } unsafe impl ExtendsCommandBufferInheritanceInfo - for CommandBufferInheritanceRenderingInfoKHRBuilder<'_> + for CommandBufferInheritanceRenderingInfoBuilder<'_> { } -unsafe impl ExtendsCommandBufferInheritanceInfo for CommandBufferInheritanceRenderingInfoKHR {} -impl<'a> ::std::ops::Deref for CommandBufferInheritanceRenderingInfoKHRBuilder<'a> { - type Target = CommandBufferInheritanceRenderingInfoKHR; +unsafe impl ExtendsCommandBufferInheritanceInfo for CommandBufferInheritanceRenderingInfo {} +impl<'a> ::std::ops::Deref for CommandBufferInheritanceRenderingInfoBuilder<'a> { + type Target = CommandBufferInheritanceRenderingInfo; fn deref(&self) -> &Self::Target { &self.inner } } -impl<'a> ::std::ops::DerefMut for CommandBufferInheritanceRenderingInfoKHRBuilder<'a> { +impl<'a> ::std::ops::DerefMut for CommandBufferInheritanceRenderingInfoBuilder<'a> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } -impl<'a> CommandBufferInheritanceRenderingInfoKHRBuilder<'a> { - pub fn flags(mut self, flags: RenderingFlagsKHR) -> Self { +impl<'a> CommandBufferInheritanceRenderingInfoBuilder<'a> { + pub fn flags(mut self, flags: RenderingFlags) -> Self { self.inner.flags = flags; self } @@ -55944,14 +56555,14 @@ impl<'a> CommandBufferInheritanceRenderingInfoKHRBuilder<'a> { #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] #[doc = r" so references to builders can be passed directly to Vulkan functions."] - pub fn build(self) -> CommandBufferInheritanceRenderingInfoKHR { + pub fn build(self) -> CommandBufferInheritanceRenderingInfo { self.inner } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct AttachmentSampleCountInfoAMD { pub s_type: StructureType, pub p_next: *const c_void, @@ -56024,7 +56635,7 @@ impl<'a> AttachmentSampleCountInfoAMDBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct MultiviewPerViewAttributesInfoNVX { pub s_type: StructureType, pub p_next: *const c_void, @@ -56058,8 +56669,8 @@ unsafe impl ExtendsCommandBufferInheritanceInfo for MultiviewPerViewAttributesIn unsafe impl ExtendsCommandBufferInheritanceInfo for MultiviewPerViewAttributesInfoNVX {} unsafe impl ExtendsGraphicsPipelineCreateInfo for MultiviewPerViewAttributesInfoNVXBuilder<'_> {} unsafe impl ExtendsGraphicsPipelineCreateInfo for MultiviewPerViewAttributesInfoNVX {} -unsafe impl ExtendsRenderingInfoKHR for MultiviewPerViewAttributesInfoNVXBuilder<'_> {} -unsafe impl ExtendsRenderingInfoKHR for MultiviewPerViewAttributesInfoNVX {} +unsafe impl ExtendsRenderingInfo for MultiviewPerViewAttributesInfoNVXBuilder<'_> {} +unsafe impl ExtendsRenderingInfo for MultiviewPerViewAttributesInfoNVX {} impl<'a> ::std::ops::Deref for MultiviewPerViewAttributesInfoNVXBuilder<'a> { type Target = MultiviewPerViewAttributesInfoNVX; fn deref(&self) -> &Self::Target { @@ -56093,7 +56704,7 @@ impl<'a> MultiviewPerViewAttributesInfoNVXBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceImageViewMinLodFeaturesEXT { pub s_type: StructureType, pub p_next: *mut c_void, @@ -56151,7 +56762,7 @@ impl<'a> PhysicalDeviceImageViewMinLodFeaturesEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct ImageViewMinLodCreateInfoEXT { pub s_type: StructureType, pub p_next: *const c_void, @@ -56207,10 +56818,10 @@ impl<'a> ImageViewMinLodCreateInfoEXTBuilder<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM { pub s_type: StructureType, - pub p_next: *const c_void, + pub p_next: *mut c_void, pub rasterization_order_color_attachment_access: Bool32, pub rasterization_order_depth_attachment_access: Bool32, pub rasterization_order_stencil_attachment_access: Bool32, @@ -56220,7 +56831,7 @@ impl ::std::default::Default for PhysicalDeviceRasterizationOrderAttachmentAcces Self { s_type: StructureType::PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM, - p_next: ::std::ptr::null(), + p_next: ::std::ptr::null_mut(), rasterization_order_color_attachment_access: Bool32::default(), rasterization_order_depth_attachment_access: Bool32::default(), rasterization_order_stencil_attachment_access: Bool32::default(), @@ -56306,7 +56917,7 @@ impl<'a> PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARMBuilder<'a> #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] +#[doc = ""] pub struct PhysicalDeviceLinearColorAttachmentFeaturesNV { pub s_type: StructureType, pub p_next: *mut c_void, @@ -56364,3 +56975,187 @@ impl<'a> PhysicalDeviceLinearColorAttachmentFeaturesNVBuilder<'a> { self.inner } } +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub descriptor_set_host_mapping: Bool32, +} +impl ::std::default::Default for PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE { + fn default() -> Self { + Self { + s_type: StructureType::PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE, + p_next: ::std::ptr::null_mut(), + descriptor_set_host_mapping: Bool32::default(), + } + } +} +impl PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE { + pub fn builder<'a>() -> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder<'a> { + PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder { + inner: Self::default(), + marker: ::std::marker::PhantomData, + } + } +} +#[repr(transparent)] +pub struct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder<'a> { + inner: PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE, + marker: ::std::marker::PhantomData<&'a ()>, +} +unsafe impl ExtendsPhysicalDeviceFeatures2 + for PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder<'_> +{ +} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE {} +unsafe impl ExtendsDeviceCreateInfo + for PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder<'_> +{ +} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE {} +impl<'a> ::std::ops::Deref for PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder<'a> { + type Target = PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl<'a> ::std::ops::DerefMut for PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} +impl<'a> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVEBuilder<'a> { + pub fn descriptor_set_host_mapping(mut self, descriptor_set_host_mapping: bool) -> Self { + self.inner.descriptor_set_host_mapping = descriptor_set_host_mapping.into(); + self + } + #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] + #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] + #[doc = r" so references to builders can be passed directly to Vulkan functions."] + pub fn build(self) -> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE { + self.inner + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct DescriptorSetBindingReferenceVALVE { + pub s_type: StructureType, + pub p_next: *const c_void, + pub descriptor_set_layout: DescriptorSetLayout, + pub binding: u32, +} +impl ::std::default::Default for DescriptorSetBindingReferenceVALVE { + fn default() -> Self { + Self { + s_type: StructureType::DESCRIPTOR_SET_BINDING_REFERENCE_VALVE, + p_next: ::std::ptr::null(), + descriptor_set_layout: DescriptorSetLayout::default(), + binding: u32::default(), + } + } +} +impl DescriptorSetBindingReferenceVALVE { + pub fn builder<'a>() -> DescriptorSetBindingReferenceVALVEBuilder<'a> { + DescriptorSetBindingReferenceVALVEBuilder { + inner: Self::default(), + marker: ::std::marker::PhantomData, + } + } +} +#[repr(transparent)] +pub struct DescriptorSetBindingReferenceVALVEBuilder<'a> { + inner: DescriptorSetBindingReferenceVALVE, + marker: ::std::marker::PhantomData<&'a ()>, +} +impl<'a> ::std::ops::Deref for DescriptorSetBindingReferenceVALVEBuilder<'a> { + type Target = DescriptorSetBindingReferenceVALVE; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl<'a> ::std::ops::DerefMut for DescriptorSetBindingReferenceVALVEBuilder<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} +impl<'a> DescriptorSetBindingReferenceVALVEBuilder<'a> { + pub fn descriptor_set_layout(mut self, descriptor_set_layout: DescriptorSetLayout) -> Self { + self.inner.descriptor_set_layout = descriptor_set_layout; + self + } + pub fn binding(mut self, binding: u32) -> Self { + self.inner.binding = binding; + self + } + #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] + #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] + #[doc = r" so references to builders can be passed directly to Vulkan functions."] + pub fn build(self) -> DescriptorSetBindingReferenceVALVE { + self.inner + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct DescriptorSetLayoutHostMappingInfoVALVE { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub descriptor_offset: usize, + pub descriptor_size: u32, +} +impl ::std::default::Default for DescriptorSetLayoutHostMappingInfoVALVE { + fn default() -> Self { + Self { + s_type: StructureType::DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE, + p_next: ::std::ptr::null_mut(), + descriptor_offset: usize::default(), + descriptor_size: u32::default(), + } + } +} +impl DescriptorSetLayoutHostMappingInfoVALVE { + pub fn builder<'a>() -> DescriptorSetLayoutHostMappingInfoVALVEBuilder<'a> { + DescriptorSetLayoutHostMappingInfoVALVEBuilder { + inner: Self::default(), + marker: ::std::marker::PhantomData, + } + } +} +#[repr(transparent)] +pub struct DescriptorSetLayoutHostMappingInfoVALVEBuilder<'a> { + inner: DescriptorSetLayoutHostMappingInfoVALVE, + marker: ::std::marker::PhantomData<&'a ()>, +} +impl<'a> ::std::ops::Deref for DescriptorSetLayoutHostMappingInfoVALVEBuilder<'a> { + type Target = DescriptorSetLayoutHostMappingInfoVALVE; + fn deref(&self) -> &Self::Target { + &self.inner + } +} +impl<'a> ::std::ops::DerefMut for DescriptorSetLayoutHostMappingInfoVALVEBuilder<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} +impl<'a> DescriptorSetLayoutHostMappingInfoVALVEBuilder<'a> { + pub fn descriptor_offset(mut self, descriptor_offset: usize) -> Self { + self.inner.descriptor_offset = descriptor_offset; + self + } + pub fn descriptor_size(mut self, descriptor_size: u32) -> Self { + self.inner.descriptor_size = descriptor_size; + self + } + #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"] + #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"] + #[doc = r" so references to builders can be passed directly to Vulkan functions."] + pub fn build(self) -> DescriptorSetLayoutHostMappingInfoVALVE { + self.inner + } +} diff --git a/third_party/rust/ash/src/vk/enums.rs b/third_party/rust/ash/src/vk/enums.rs index dda54dd73dc6e..6878b6c21f25b 100644 --- a/third_party/rust/ash/src/vk/enums.rs +++ b/third_party/rust/ash/src/vk/enums.rs @@ -1,7 +1,7 @@ use std::fmt; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] #[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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] +#[doc = ""] 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 = ""] -pub struct QueueGlobalPriorityEXT(pub(crate) i32); -impl QueueGlobalPriorityEXT { +#[doc = ""] +pub struct QueueGlobalPriorityKHR(pub(crate) i32); +impl QueueGlobalPriorityKHR { pub const fn from_raw(x: i32) -> Self { Self(x) } @@ -1555,15 +1555,19 @@ impl QueueGlobalPriorityEXT { self.0 } } -impl QueueGlobalPriorityEXT { +impl QueueGlobalPriorityKHR { 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 = ""] +#[doc = ""] pub struct ConservativeRasterizationModeEXT(pub(crate) i32); impl ConservativeRasterizationModeEXT { pub const fn from_raw(x: i32) -> Self { @@ -1580,7 +1584,7 @@ impl ConservativeRasterizationModeEXT { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct VendorId(pub(crate) i32); impl VendorId { pub const fn from_raw(x: i32) -> Self { @@ -1606,7 +1610,7 @@ impl VendorId { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct DriverId(pub(crate) i32); impl DriverId { pub const fn from_raw(x: i32) -> Self { @@ -1659,10 +1663,12 @@ 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 = ""] +#[doc = ""] pub struct ShadingRatePaletteEntryNV(pub(crate) i32); impl ShadingRatePaletteEntryNV { pub const fn from_raw(x: i32) -> Self { @@ -1688,7 +1694,7 @@ impl ShadingRatePaletteEntryNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct CoarseSampleOrderTypeNV(pub(crate) i32); impl CoarseSampleOrderTypeNV { pub const fn from_raw(x: i32) -> Self { @@ -1706,7 +1712,7 @@ impl CoarseSampleOrderTypeNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct CopyAccelerationStructureModeKHR(pub(crate) i32); impl CopyAccelerationStructureModeKHR { pub const fn from_raw(x: i32) -> Self { @@ -1724,7 +1730,7 @@ impl CopyAccelerationStructureModeKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct BuildAccelerationStructureModeKHR(pub(crate) i32); impl BuildAccelerationStructureModeKHR { pub const fn from_raw(x: i32) -> Self { @@ -1740,7 +1746,7 @@ impl BuildAccelerationStructureModeKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureTypeKHR(pub(crate) i32); impl AccelerationStructureTypeKHR { pub const fn from_raw(x: i32) -> Self { @@ -1757,7 +1763,7 @@ impl AccelerationStructureTypeKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct GeometryTypeKHR(pub(crate) i32); impl GeometryTypeKHR { pub const fn from_raw(x: i32) -> Self { @@ -1774,7 +1780,7 @@ impl GeometryTypeKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMemoryRequirementsTypeNV(pub(crate) i32); impl AccelerationStructureMemoryRequirementsTypeNV { pub const fn from_raw(x: i32) -> Self { @@ -1791,7 +1797,7 @@ impl AccelerationStructureMemoryRequirementsTypeNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureBuildTypeKHR(pub(crate) i32); impl AccelerationStructureBuildTypeKHR { pub const fn from_raw(x: i32) -> Self { @@ -1808,7 +1814,7 @@ impl AccelerationStructureBuildTypeKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct RayTracingShaderGroupTypeKHR(pub(crate) i32); impl RayTracingShaderGroupTypeKHR { pub const fn from_raw(x: i32) -> Self { @@ -1825,7 +1831,7 @@ impl RayTracingShaderGroupTypeKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureCompatibilityKHR(pub(crate) i32); impl AccelerationStructureCompatibilityKHR { pub const fn from_raw(x: i32) -> Self { @@ -1841,7 +1847,7 @@ impl AccelerationStructureCompatibilityKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct ShaderGroupShaderKHR(pub(crate) i32); impl ShaderGroupShaderKHR { pub const fn from_raw(x: i32) -> Self { @@ -1859,7 +1865,7 @@ impl ShaderGroupShaderKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct MemoryOverallocationBehaviorAMD(pub(crate) i32); impl MemoryOverallocationBehaviorAMD { pub const fn from_raw(x: i32) -> Self { @@ -1876,7 +1882,7 @@ impl MemoryOverallocationBehaviorAMD { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct ScopeNV(pub(crate) i32); impl ScopeNV { pub const fn from_raw(x: i32) -> Self { @@ -1894,7 +1900,7 @@ impl ScopeNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct ComponentTypeNV(pub(crate) i32); impl ComponentTypeNV { pub const fn from_raw(x: i32) -> Self { @@ -1919,7 +1925,7 @@ impl ComponentTypeNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct FullScreenExclusiveEXT(pub(crate) i32); impl FullScreenExclusiveEXT { pub const fn from_raw(x: i32) -> Self { @@ -1937,7 +1943,7 @@ impl FullScreenExclusiveEXT { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PerformanceCounterScopeKHR(pub(crate) i32); impl PerformanceCounterScopeKHR { pub const fn from_raw(x: i32) -> Self { @@ -1954,7 +1960,7 @@ impl PerformanceCounterScopeKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PerformanceCounterUnitKHR(pub(crate) i32); impl PerformanceCounterUnitKHR { pub const fn from_raw(x: i32) -> Self { @@ -1979,7 +1985,7 @@ impl PerformanceCounterUnitKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PerformanceCounterStorageKHR(pub(crate) i32); impl PerformanceCounterStorageKHR { pub const fn from_raw(x: i32) -> Self { @@ -1999,7 +2005,7 @@ impl PerformanceCounterStorageKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PerformanceConfigurationTypeINTEL(pub(crate) i32); impl PerformanceConfigurationTypeINTEL { pub const fn from_raw(x: i32) -> Self { @@ -2014,7 +2020,7 @@ impl PerformanceConfigurationTypeINTEL { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct QueryPoolSamplingModeINTEL(pub(crate) i32); impl QueryPoolSamplingModeINTEL { pub const fn from_raw(x: i32) -> Self { @@ -2029,7 +2035,7 @@ impl QueryPoolSamplingModeINTEL { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PerformanceOverrideTypeINTEL(pub(crate) i32); impl PerformanceOverrideTypeINTEL { pub const fn from_raw(x: i32) -> Self { @@ -2045,7 +2051,7 @@ impl PerformanceOverrideTypeINTEL { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PerformanceParameterTypeINTEL(pub(crate) i32); impl PerformanceParameterTypeINTEL { pub const fn from_raw(x: i32) -> Self { @@ -2061,7 +2067,7 @@ impl PerformanceParameterTypeINTEL { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PerformanceValueTypeINTEL(pub(crate) i32); impl PerformanceValueTypeINTEL { pub const fn from_raw(x: i32) -> Self { @@ -2080,7 +2086,7 @@ impl PerformanceValueTypeINTEL { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct ShaderFloatControlsIndependence(pub(crate) i32); impl ShaderFloatControlsIndependence { pub const fn from_raw(x: i32) -> Self { @@ -2097,7 +2103,7 @@ impl ShaderFloatControlsIndependence { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct PipelineExecutableStatisticFormatKHR(pub(crate) i32); impl PipelineExecutableStatisticFormatKHR { pub const fn from_raw(x: i32) -> Self { @@ -2115,7 +2121,7 @@ impl PipelineExecutableStatisticFormatKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct LineRasterizationModeEXT(pub(crate) i32); impl LineRasterizationModeEXT { pub const fn from_raw(x: i32) -> Self { @@ -2133,7 +2139,7 @@ impl LineRasterizationModeEXT { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct FragmentShadingRateCombinerOpKHR(pub(crate) i32); impl FragmentShadingRateCombinerOpKHR { pub const fn from_raw(x: i32) -> Self { @@ -2152,7 +2158,7 @@ impl FragmentShadingRateCombinerOpKHR { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct FragmentShadingRateNV(pub(crate) i32); impl FragmentShadingRateNV { pub const fn from_raw(x: i32) -> Self { @@ -2178,7 +2184,7 @@ impl FragmentShadingRateNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct FragmentShadingRateTypeNV(pub(crate) i32); impl FragmentShadingRateTypeNV { pub const fn from_raw(x: i32) -> Self { @@ -2194,7 +2200,7 @@ impl FragmentShadingRateTypeNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct ProvokingVertexModeEXT(pub(crate) i32); impl ProvokingVertexModeEXT { pub const fn from_raw(x: i32) -> Self { @@ -2210,7 +2216,7 @@ impl ProvokingVertexModeEXT { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct AccelerationStructureMotionInstanceTypeNV(pub(crate) i32); impl AccelerationStructureMotionInstanceTypeNV { pub const fn from_raw(x: i32) -> Self { @@ -2227,7 +2233,7 @@ impl AccelerationStructureMotionInstanceTypeNV { } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] -#[doc = ""] +#[doc = ""] pub struct QueryResultStatusKHR(pub(crate) i32); impl QueryResultStatusKHR { pub const fn from_raw(x: i32) -> Self { @@ -2287,10 +2293,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 { @@ -2332,7 +2338,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_EXT => Some("ERROR_NOT_PERMITTED_EXT"), + Self::ERROR_NOT_PERMITTED_KHR => Some("ERROR_NOT_PERMITTED_KHR"), Self::ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT => { Some("ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT") } @@ -2340,13 +2346,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 { diff --git a/third_party/rust/ash/src/vk/extensions.rs b/third_party/rust/ash/src/vk/extensions.rs index 041695428325f..805378b830f89 100644 --- a/third_party/rust/ash/src/vk/extensions.rs +++ b/third_party/rust/ash/src/vk/extensions.rs @@ -5,7 +5,7 @@ use crate::vk::enums::*; use crate::vk::platform_types::*; use std::os::raw::*; impl KhrSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_surface\0") } } pub const SPEC_VERSION: u32 = 25u32; @@ -166,73 +166,6 @@ impl KhrSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn destroy_surface_khr( - &self, - instance: Instance, - surface: SurfaceKHR, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_surface_khr)(instance, surface, p_allocator) - } - #[doc = ""] - pub unsafe fn get_physical_device_surface_support_khr( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - surface: SurfaceKHR, - p_supported: *mut Bool32, - ) -> Result { - (self.get_physical_device_surface_support_khr)( - physical_device, - queue_family_index, - surface, - p_supported, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_surface_capabilities_khr( - &self, - physical_device: PhysicalDevice, - surface: SurfaceKHR, - p_surface_capabilities: *mut SurfaceCapabilitiesKHR, - ) -> Result { - (self.get_physical_device_surface_capabilities_khr)( - physical_device, - surface, - p_surface_capabilities, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_surface_formats_khr( - &self, - physical_device: PhysicalDevice, - surface: SurfaceKHR, - p_surface_format_count: *mut u32, - p_surface_formats: *mut SurfaceFormatKHR, - ) -> Result { - (self.get_physical_device_surface_formats_khr)( - physical_device, - surface, - p_surface_format_count, - p_surface_formats, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_surface_present_modes_khr( - &self, - physical_device: PhysicalDevice, - surface: SurfaceKHR, - p_present_mode_count: *mut u32, - p_present_modes: *mut PresentModeKHR, - ) -> Result { - (self.get_physical_device_surface_present_modes_khr)( - physical_device, - surface, - p_present_mode_count, - p_present_modes, - ) - } } #[doc = "Generated from 'VK_KHR_surface'"] impl ObjectType { @@ -244,7 +177,7 @@ impl Result { pub const ERROR_NATIVE_WINDOW_IN_USE_KHR: Self = Self(-1_000_000_001); } impl KhrSwapchainFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_swapchain\0") } } pub const SPEC_VERSION: u32 = 70u32; @@ -507,104 +440,6 @@ impl KhrSwapchainFn { }, } } - #[doc = ""] - pub unsafe fn create_swapchain_khr( - &self, - device: Device, - p_create_info: *const SwapchainCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_swapchain: *mut SwapchainKHR, - ) -> Result { - (self.create_swapchain_khr)(device, p_create_info, p_allocator, p_swapchain) - } - #[doc = ""] - pub unsafe fn destroy_swapchain_khr( - &self, - device: Device, - swapchain: SwapchainKHR, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_swapchain_khr)(device, swapchain, p_allocator) - } - #[doc = ""] - pub unsafe fn get_swapchain_images_khr( - &self, - device: Device, - swapchain: SwapchainKHR, - p_swapchain_image_count: *mut u32, - p_swapchain_images: *mut Image, - ) -> Result { - (self.get_swapchain_images_khr)( - device, - swapchain, - p_swapchain_image_count, - p_swapchain_images, - ) - } - #[doc = ""] - pub unsafe fn acquire_next_image_khr( - &self, - device: Device, - swapchain: SwapchainKHR, - timeout: u64, - semaphore: Semaphore, - fence: Fence, - p_image_index: *mut u32, - ) -> Result { - (self.acquire_next_image_khr)(device, swapchain, timeout, semaphore, fence, p_image_index) - } - #[doc = ""] - pub unsafe fn queue_present_khr( - &self, - queue: Queue, - p_present_info: *const PresentInfoKHR, - ) -> Result { - (self.queue_present_khr)(queue, p_present_info) - } - #[doc = ""] - pub unsafe fn get_device_group_present_capabilities_khr( - &self, - device: Device, - p_device_group_present_capabilities: *mut DeviceGroupPresentCapabilitiesKHR, - ) -> Result { - (self.get_device_group_present_capabilities_khr)( - device, - p_device_group_present_capabilities, - ) - } - #[doc = ""] - pub unsafe fn get_device_group_surface_present_modes_khr( - &self, - device: Device, - surface: SurfaceKHR, - p_modes: *mut DeviceGroupPresentModeFlagsKHR, - ) -> Result { - (self.get_device_group_surface_present_modes_khr)(device, surface, p_modes) - } - #[doc = ""] - pub unsafe fn get_physical_device_present_rectangles_khr( - &self, - physical_device: PhysicalDevice, - surface: SurfaceKHR, - p_rect_count: *mut u32, - p_rects: *mut Rect2D, - ) -> Result { - (self.get_physical_device_present_rectangles_khr)( - physical_device, - surface, - p_rect_count, - p_rects, - ) - } - #[doc = ""] - pub unsafe fn acquire_next_image2_khr( - &self, - device: Device, - p_acquire_info: *const AcquireNextImageInfoKHR, - p_image_index: *mut u32, - ) -> Result { - (self.acquire_next_image2_khr)(device, p_acquire_info, p_image_index) - } } #[doc = "Generated from 'VK_KHR_swapchain'"] impl ImageLayout { @@ -638,7 +473,7 @@ impl SwapchainCreateFlagsKHR { pub const PROTECTED: Self = Self(0b10); } impl KhrDisplayFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_display\0") } } pub const SPEC_VERSION: u32 = 23u32; @@ -864,98 +699,6 @@ impl KhrDisplayFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_display_properties_khr( - &self, - physical_device: PhysicalDevice, - p_property_count: *mut u32, - p_properties: *mut DisplayPropertiesKHR, - ) -> Result { - (self.get_physical_device_display_properties_khr)( - physical_device, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_display_plane_properties_khr( - &self, - physical_device: PhysicalDevice, - p_property_count: *mut u32, - p_properties: *mut DisplayPlanePropertiesKHR, - ) -> Result { - (self.get_physical_device_display_plane_properties_khr)( - physical_device, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn get_display_plane_supported_displays_khr( - &self, - physical_device: PhysicalDevice, - plane_index: u32, - p_display_count: *mut u32, - p_displays: *mut DisplayKHR, - ) -> Result { - (self.get_display_plane_supported_displays_khr)( - physical_device, - plane_index, - p_display_count, - p_displays, - ) - } - #[doc = ""] - pub unsafe fn get_display_mode_properties_khr( - &self, - physical_device: PhysicalDevice, - display: DisplayKHR, - p_property_count: *mut u32, - p_properties: *mut DisplayModePropertiesKHR, - ) -> Result { - (self.get_display_mode_properties_khr)( - physical_device, - display, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn create_display_mode_khr( - &self, - physical_device: PhysicalDevice, - display: DisplayKHR, - p_create_info: *const DisplayModeCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_mode: *mut DisplayModeKHR, - ) -> Result { - (self.create_display_mode_khr)(physical_device, display, p_create_info, p_allocator, p_mode) - } - #[doc = ""] - pub unsafe fn get_display_plane_capabilities_khr( - &self, - physical_device: PhysicalDevice, - mode: DisplayModeKHR, - plane_index: u32, - p_capabilities: *mut DisplayPlaneCapabilitiesKHR, - ) -> Result { - (self.get_display_plane_capabilities_khr)( - physical_device, - mode, - plane_index, - p_capabilities, - ) - } - #[doc = ""] - pub unsafe fn create_display_plane_surface_khr( - &self, - instance: Instance, - p_create_info: *const DisplaySurfaceCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_display_plane_surface_khr)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_KHR_display'"] impl ObjectType { @@ -968,7 +711,7 @@ impl StructureType { pub const DISPLAY_SURFACE_CREATE_INFO_KHR: Self = Self(1_000_002_001); } impl KhrDisplaySwapchainFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_display_swapchain\0") } } pub const SPEC_VERSION: u32 = 10u32; @@ -1018,23 +761,6 @@ impl KhrDisplaySwapchainFn { }, } } - #[doc = ""] - pub unsafe fn create_shared_swapchains_khr( - &self, - device: Device, - swapchain_count: u32, - p_create_infos: *const SwapchainCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_swapchains: *mut SwapchainKHR, - ) -> Result { - (self.create_shared_swapchains_khr)( - device, - swapchain_count, - p_create_infos, - p_allocator, - p_swapchains, - ) - } } #[doc = "Generated from 'VK_KHR_display_swapchain'"] impl Result { @@ -1045,7 +771,7 @@ impl StructureType { pub const DISPLAY_PRESENT_INFO_KHR: Self = Self(1_000_003_000); } impl KhrXlibSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_xlib_surface\0") } } pub const SPEC_VERSION: u32 = 6u32; @@ -1123,38 +849,13 @@ impl KhrXlibSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_xlib_surface_khr( - &self, - instance: Instance, - p_create_info: *const XlibSurfaceCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_xlib_surface_khr)(instance, p_create_info, p_allocator, p_surface) - } - #[doc = ""] - pub unsafe fn get_physical_device_xlib_presentation_support_khr( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - dpy: *mut Display, - visual_id: VisualID, - ) -> Bool32 { - (self.get_physical_device_xlib_presentation_support_khr)( - physical_device, - queue_family_index, - dpy, - visual_id, - ) - } } #[doc = "Generated from 'VK_KHR_xlib_surface'"] impl StructureType { pub const XLIB_SURFACE_CREATE_INFO_KHR: Self = Self(1_000_004_000); } impl KhrXcbSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_xcb_surface\0") } } pub const SPEC_VERSION: u32 = 6u32; @@ -1232,38 +933,13 @@ impl KhrXcbSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_xcb_surface_khr( - &self, - instance: Instance, - p_create_info: *const XcbSurfaceCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_xcb_surface_khr)(instance, p_create_info, p_allocator, p_surface) - } - #[doc = ""] - pub unsafe fn get_physical_device_xcb_presentation_support_khr( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - connection: *mut xcb_connection_t, - visual_id: xcb_visualid_t, - ) -> Bool32 { - (self.get_physical_device_xcb_presentation_support_khr)( - physical_device, - queue_family_index, - connection, - visual_id, - ) - } } #[doc = "Generated from 'VK_KHR_xcb_surface'"] impl StructureType { pub const XCB_SURFACE_CREATE_INFO_KHR: Self = Self(1_000_005_000); } impl KhrWaylandSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_wayland_surface\0") } } pub const SPEC_VERSION: u32 = 6u32; @@ -1340,36 +1016,13 @@ impl KhrWaylandSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_wayland_surface_khr( - &self, - instance: Instance, - p_create_info: *const WaylandSurfaceCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_wayland_surface_khr)(instance, p_create_info, p_allocator, p_surface) - } - #[doc = ""] - pub unsafe fn get_physical_device_wayland_presentation_support_khr( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - display: *mut wl_display, - ) -> Bool32 { - (self.get_physical_device_wayland_presentation_support_khr)( - physical_device, - queue_family_index, - display, - ) - } } #[doc = "Generated from 'VK_KHR_wayland_surface'"] impl StructureType { pub const WAYLAND_SURFACE_CREATE_INFO_KHR: Self = Self(1_000_006_000); } impl KhrMirSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_mir_surface\0") } } pub const SPEC_VERSION: u32 = 4u32; @@ -1387,7 +1040,7 @@ impl KhrMirSurfaceFn { } } impl KhrAndroidSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_android_surface\0") } } pub const SPEC_VERSION: u32 = 6u32; @@ -1434,23 +1087,13 @@ impl KhrAndroidSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_android_surface_khr( - &self, - instance: Instance, - p_create_info: *const AndroidSurfaceCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_android_surface_khr)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_KHR_android_surface'"] impl StructureType { pub const ANDROID_SURFACE_CREATE_INFO_KHR: Self = Self(1_000_008_000); } impl KhrWin32SurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_win32_surface\0") } } pub const SPEC_VERSION: u32 = 6u32; @@ -1522,34 +1165,13 @@ impl KhrWin32SurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_win32_surface_khr( - &self, - instance: Instance, - p_create_info: *const Win32SurfaceCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_win32_surface_khr)(instance, p_create_info, p_allocator, p_surface) - } - #[doc = ""] - pub unsafe fn get_physical_device_win32_presentation_support_khr( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - ) -> Bool32 { - (self.get_physical_device_win32_presentation_support_khr)( - physical_device, - queue_family_index, - ) - } } #[doc = "Generated from 'VK_KHR_win32_surface'"] impl StructureType { pub const WIN32_SURFACE_CREATE_INFO_KHR: Self = Self(1_000_009_000); } impl AndroidNativeBufferFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ANDROID_native_buffer\0") } } pub const SPEC_VERSION: u32 = 8u32; @@ -1694,63 +1316,6 @@ impl AndroidNativeBufferFn { }, } } - #[doc = ""] - pub unsafe fn get_swapchain_gralloc_usage_android( - &self, - device: Device, - format: Format, - image_usage: ImageUsageFlags, - gralloc_usage: *mut c_int, - ) -> Result { - (self.get_swapchain_gralloc_usage_android)(device, format, image_usage, gralloc_usage) - } - #[doc = ""] - pub unsafe fn acquire_image_android( - &self, - device: Device, - image: Image, - native_fence_fd: c_int, - semaphore: Semaphore, - fence: Fence, - ) -> Result { - (self.acquire_image_android)(device, image, native_fence_fd, semaphore, fence) - } - #[doc = ""] - pub unsafe fn queue_signal_release_image_android( - &self, - queue: Queue, - wait_semaphore_count: u32, - p_wait_semaphores: *const Semaphore, - image: Image, - p_native_fence_fd: *mut c_int, - ) -> Result { - (self.queue_signal_release_image_android)( - queue, - wait_semaphore_count, - p_wait_semaphores, - image, - p_native_fence_fd, - ) - } - #[doc = ""] - pub unsafe fn get_swapchain_gralloc_usage2_android( - &self, - device: Device, - format: Format, - image_usage: ImageUsageFlags, - swapchain_image_usage: SwapchainImageUsageFlagsANDROID, - gralloc_consumer_usage: *mut u64, - gralloc_producer_usage: *mut u64, - ) -> Result { - (self.get_swapchain_gralloc_usage2_android)( - device, - format, - image_usage, - swapchain_image_usage, - gralloc_consumer_usage, - gralloc_producer_usage, - ) - } } #[doc = "Generated from 'VK_ANDROID_native_buffer'"] impl StructureType { @@ -1759,7 +1324,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID: Self = Self(1_000_010_002); } impl ExtDebugReportFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_debug_report\0") } } pub const SPEC_VERSION: u32 = 10u32; @@ -1872,48 +1437,6 @@ impl ExtDebugReportFn { }, } } - #[doc = ""] - pub unsafe fn create_debug_report_callback_ext( - &self, - instance: Instance, - p_create_info: *const DebugReportCallbackCreateInfoEXT, - p_allocator: *const AllocationCallbacks, - p_callback: *mut DebugReportCallbackEXT, - ) -> Result { - (self.create_debug_report_callback_ext)(instance, p_create_info, p_allocator, p_callback) - } - #[doc = ""] - pub unsafe fn destroy_debug_report_callback_ext( - &self, - instance: Instance, - callback: DebugReportCallbackEXT, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_debug_report_callback_ext)(instance, callback, p_allocator) - } - #[doc = ""] - pub unsafe fn debug_report_message_ext( - &self, - instance: Instance, - flags: DebugReportFlagsEXT, - object_type: DebugReportObjectTypeEXT, - object: u64, - location: usize, - message_code: i32, - p_layer_prefix: *const c_char, - p_message: *const c_char, - ) { - (self.debug_report_message_ext)( - instance, - flags, - object_type, - object, - location, - message_code, - p_layer_prefix, - p_message, - ) - } } #[doc = "Generated from 'VK_EXT_debug_report'"] impl DebugReportObjectTypeEXT { @@ -1933,7 +1456,7 @@ impl StructureType { pub const DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: Self = Self(1_000_011_000); } impl NvGlslShaderFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_glsl_shader\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -1955,7 +1478,7 @@ impl Result { pub const ERROR_INVALID_SHADER_NV: Self = Self(-1_000_012_000); } impl ExtDepthRangeUnrestrictedFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_depth_range_unrestricted\0") } @@ -1975,7 +1498,7 @@ impl ExtDepthRangeUnrestrictedFn { } } impl KhrSamplerMirrorClampToEdgeFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_sampler_mirror_clamp_to_edge\0", @@ -2004,7 +1527,7 @@ impl SamplerAddressMode { pub const MIRROR_CLAMP_TO_EDGE_KHR: Self = Self::MIRROR_CLAMP_TO_EDGE; } impl ImgFilterCubicFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_filter_cubic\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -2031,7 +1554,7 @@ impl FormatFeatureFlags { pub const SAMPLED_IMAGE_FILTER_CUBIC_IMG: Self = Self(0b10_0000_0000_0000); } impl AmdExtension17Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_17\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -2049,7 +1572,7 @@ impl AmdExtension17Fn { } } impl AmdExtension18Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_18\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -2067,7 +1590,7 @@ impl AmdExtension18Fn { } } impl AmdRasterizationOrderFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_rasterization_order\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -2089,7 +1612,7 @@ impl StructureType { pub const PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: Self = Self(1_000_018_000); } impl AmdExtension20Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_20\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -2107,7 +1630,7 @@ impl AmdExtension20Fn { } } impl AmdShaderTrinaryMinmaxFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_trinary_minmax\0") } @@ -2127,7 +1650,7 @@ impl AmdShaderTrinaryMinmaxFn { } } impl AmdShaderExplicitVertexParameterFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_AMD_shader_explicit_vertex_parameter\0", @@ -2149,7 +1672,7 @@ impl AmdShaderExplicitVertexParameterFn { } } impl ExtDebugMarkerFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_debug_marker\0") } } pub const SPEC_VERSION: u32 = 4u32; @@ -2288,42 +1811,6 @@ impl ExtDebugMarkerFn { }, } } - #[doc = ""] - pub unsafe fn debug_marker_set_object_tag_ext( - &self, - device: Device, - p_tag_info: *const DebugMarkerObjectTagInfoEXT, - ) -> Result { - (self.debug_marker_set_object_tag_ext)(device, p_tag_info) - } - #[doc = ""] - pub unsafe fn debug_marker_set_object_name_ext( - &self, - device: Device, - p_name_info: *const DebugMarkerObjectNameInfoEXT, - ) -> Result { - (self.debug_marker_set_object_name_ext)(device, p_name_info) - } - #[doc = ""] - pub unsafe fn cmd_debug_marker_begin_ext( - &self, - command_buffer: CommandBuffer, - p_marker_info: *const DebugMarkerMarkerInfoEXT, - ) { - (self.cmd_debug_marker_begin_ext)(command_buffer, p_marker_info) - } - #[doc = ""] - pub unsafe fn cmd_debug_marker_end_ext(&self, command_buffer: CommandBuffer) { - (self.cmd_debug_marker_end_ext)(command_buffer) - } - #[doc = ""] - pub unsafe fn cmd_debug_marker_insert_ext( - &self, - command_buffer: CommandBuffer, - p_marker_info: *const DebugMarkerMarkerInfoEXT, - ) { - (self.cmd_debug_marker_insert_ext)(command_buffer, p_marker_info) - } } #[doc = "Generated from 'VK_EXT_debug_marker'"] impl StructureType { @@ -2332,10 +1819,10 @@ impl StructureType { pub const DEBUG_MARKER_MARKER_INFO_EXT: Self = Self(1_000_022_002); } impl KhrVideoQueueFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_video_queue\0") } } - pub const SPEC_VERSION: u32 = 2u32; + pub const SPEC_VERSION: u32 = 3u32; } #[allow(non_camel_case_types)] pub type PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR = unsafe extern "system" fn( @@ -2687,140 +2174,6 @@ impl KhrVideoQueueFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_video_capabilities_khr( - &self, - physical_device: PhysicalDevice, - p_video_profile: *const VideoProfileKHR, - p_capabilities: *mut VideoCapabilitiesKHR, - ) -> Result { - (self.get_physical_device_video_capabilities_khr)( - physical_device, - p_video_profile, - p_capabilities, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_video_format_properties_khr( - &self, - physical_device: PhysicalDevice, - p_video_format_info: *const PhysicalDeviceVideoFormatInfoKHR, - p_video_format_property_count: *mut u32, - p_video_format_properties: *mut VideoFormatPropertiesKHR, - ) -> Result { - (self.get_physical_device_video_format_properties_khr)( - physical_device, - p_video_format_info, - p_video_format_property_count, - p_video_format_properties, - ) - } - #[doc = ""] - pub unsafe fn create_video_session_khr( - &self, - device: Device, - p_create_info: *const VideoSessionCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_video_session: *mut VideoSessionKHR, - ) -> Result { - (self.create_video_session_khr)(device, p_create_info, p_allocator, p_video_session) - } - #[doc = ""] - pub unsafe fn destroy_video_session_khr( - &self, - device: Device, - video_session: VideoSessionKHR, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_video_session_khr)(device, video_session, p_allocator) - } - #[doc = ""] - pub unsafe fn get_video_session_memory_requirements_khr( - &self, - device: Device, - video_session: VideoSessionKHR, - p_video_session_memory_requirements_count: *mut u32, - p_video_session_memory_requirements: *mut VideoGetMemoryPropertiesKHR, - ) -> Result { - (self.get_video_session_memory_requirements_khr)( - device, - video_session, - p_video_session_memory_requirements_count, - p_video_session_memory_requirements, - ) - } - #[doc = ""] - pub unsafe fn bind_video_session_memory_khr( - &self, - device: Device, - video_session: VideoSessionKHR, - video_session_bind_memory_count: u32, - p_video_session_bind_memories: *const VideoBindMemoryKHR, - ) -> Result { - (self.bind_video_session_memory_khr)( - device, - video_session, - video_session_bind_memory_count, - p_video_session_bind_memories, - ) - } - #[doc = ""] - pub unsafe fn create_video_session_parameters_khr( - &self, - device: Device, - p_create_info: *const VideoSessionParametersCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_video_session_parameters: *mut VideoSessionParametersKHR, - ) -> Result { - (self.create_video_session_parameters_khr)( - device, - p_create_info, - p_allocator, - p_video_session_parameters, - ) - } - #[doc = ""] - pub unsafe fn update_video_session_parameters_khr( - &self, - device: Device, - video_session_parameters: VideoSessionParametersKHR, - p_update_info: *const VideoSessionParametersUpdateInfoKHR, - ) -> Result { - (self.update_video_session_parameters_khr)(device, video_session_parameters, p_update_info) - } - #[doc = ""] - pub unsafe fn destroy_video_session_parameters_khr( - &self, - device: Device, - video_session_parameters: VideoSessionParametersKHR, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_video_session_parameters_khr)(device, video_session_parameters, p_allocator) - } - #[doc = ""] - pub unsafe fn cmd_begin_video_coding_khr( - &self, - command_buffer: CommandBuffer, - p_begin_info: *const VideoBeginCodingInfoKHR, - ) { - (self.cmd_begin_video_coding_khr)(command_buffer, p_begin_info) - } - #[doc = ""] - pub unsafe fn cmd_end_video_coding_khr( - &self, - command_buffer: CommandBuffer, - p_end_coding_info: *const VideoEndCodingInfoKHR, - ) { - (self.cmd_end_video_coding_khr)(command_buffer, p_end_coding_info) - } - #[doc = ""] - pub unsafe fn cmd_control_video_coding_khr( - &self, - command_buffer: CommandBuffer, - p_coding_control_info: *const VideoCodingControlInfoKHR, - ) { - (self.cmd_control_video_coding_khr)(command_buffer, p_coding_control_info) - } } #[doc = "Generated from 'VK_KHR_video_queue'"] impl ObjectType { @@ -2858,10 +2211,10 @@ impl StructureType { pub const QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_2_KHR: Self = Self(1_000_023_016); } impl KhrVideoDecodeQueueFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_video_decode_queue\0") } } - pub const SPEC_VERSION: u32 = 2u32; + pub const SPEC_VERSION: u32 = 3u32; } #[allow(non_camel_case_types)] pub type PFN_vkCmdDecodeVideoKHR = unsafe extern "system" fn( @@ -2898,19 +2251,11 @@ impl KhrVideoDecodeQueueFn { }, } } - #[doc = ""] - pub unsafe fn cmd_decode_video_khr( - &self, - command_buffer: CommandBuffer, - p_frame_info: *const VideoDecodeInfoKHR, - ) { - (self.cmd_decode_video_khr)(command_buffer, p_frame_info) - } } #[doc = "Generated from 'VK_KHR_video_decode_queue'"] -impl AccessFlags2KHR { - pub const VIDEO_DECODE_READ: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000); - pub const VIDEO_DECODE_WRITE: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000); +impl AccessFlags2 { + pub const VIDEO_DECODE_READ_KHR: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000); + pub const VIDEO_DECODE_WRITE_KHR: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_decode_queue'"] impl BufferUsageFlags { @@ -2923,9 +2268,9 @@ impl FormatFeatureFlags { pub const VIDEO_DECODE_DPB_KHR: Self = Self(0b100_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_decode_queue'"] -impl FormatFeatureFlags2KHR { - pub const VIDEO_DECODE_OUTPUT: Self = Self(0b10_0000_0000_0000_0000_0000_0000); - pub const VIDEO_DECODE_DPB: Self = Self(0b100_0000_0000_0000_0000_0000_0000); +impl FormatFeatureFlags2 { + pub const VIDEO_DECODE_OUTPUT_KHR: Self = Self(0b10_0000_0000_0000_0000_0000_0000); + pub const VIDEO_DECODE_DPB_KHR: Self = Self(0b100_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_decode_queue'"] impl ImageLayout { @@ -2940,8 +2285,8 @@ impl ImageUsageFlags { pub const VIDEO_DECODE_DPB_KHR: Self = Self(0b1_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_decode_queue'"] -impl PipelineStageFlags2KHR { - pub const VIDEO_DECODE: Self = Self(0b100_0000_0000_0000_0000_0000_0000); +impl PipelineStageFlags2 { + pub const VIDEO_DECODE_KHR: Self = Self(0b100_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_decode_queue'"] impl QueueFlags { @@ -2950,9 +2295,10 @@ impl QueueFlags { #[doc = "Generated from 'VK_KHR_video_decode_queue'"] impl StructureType { pub const VIDEO_DECODE_INFO_KHR: Self = Self(1_000_024_000); + pub const VIDEO_DECODE_CAPABILITIES_KHR: Self = Self(1_000_024_001); } impl AmdGcnShaderFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_gcn_shader\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -2970,7 +2316,7 @@ impl AmdGcnShaderFn { } } impl NvDedicatedAllocationFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_dedicated_allocation\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -2994,7 +2340,7 @@ impl StructureType { pub const DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: Self = Self(1_000_026_002); } impl ExtExtension28Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_28\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -3012,7 +2358,7 @@ impl ExtExtension28Fn { } } impl ExtTransformFeedbackFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_transform_feedback\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -3224,101 +2570,6 @@ impl ExtTransformFeedbackFn { }, } } - #[doc = ""] - pub unsafe fn cmd_bind_transform_feedback_buffers_ext( - &self, - command_buffer: CommandBuffer, - first_binding: u32, - binding_count: u32, - p_buffers: *const Buffer, - p_offsets: *const DeviceSize, - p_sizes: *const DeviceSize, - ) { - (self.cmd_bind_transform_feedback_buffers_ext)( - command_buffer, - first_binding, - binding_count, - p_buffers, - p_offsets, - p_sizes, - ) - } - #[doc = ""] - pub unsafe fn cmd_begin_transform_feedback_ext( - &self, - command_buffer: CommandBuffer, - first_counter_buffer: u32, - counter_buffer_count: u32, - p_counter_buffers: *const Buffer, - p_counter_buffer_offsets: *const DeviceSize, - ) { - (self.cmd_begin_transform_feedback_ext)( - command_buffer, - first_counter_buffer, - counter_buffer_count, - p_counter_buffers, - p_counter_buffer_offsets, - ) - } - #[doc = ""] - pub unsafe fn cmd_end_transform_feedback_ext( - &self, - command_buffer: CommandBuffer, - first_counter_buffer: u32, - counter_buffer_count: u32, - p_counter_buffers: *const Buffer, - p_counter_buffer_offsets: *const DeviceSize, - ) { - (self.cmd_end_transform_feedback_ext)( - command_buffer, - first_counter_buffer, - counter_buffer_count, - p_counter_buffers, - p_counter_buffer_offsets, - ) - } - #[doc = ""] - pub unsafe fn cmd_begin_query_indexed_ext( - &self, - command_buffer: CommandBuffer, - query_pool: QueryPool, - query: u32, - flags: QueryControlFlags, - index: u32, - ) { - (self.cmd_begin_query_indexed_ext)(command_buffer, query_pool, query, flags, index) - } - #[doc = ""] - pub unsafe fn cmd_end_query_indexed_ext( - &self, - command_buffer: CommandBuffer, - query_pool: QueryPool, - query: u32, - index: u32, - ) { - (self.cmd_end_query_indexed_ext)(command_buffer, query_pool, query, index) - } - #[doc = ""] - pub unsafe fn cmd_draw_indirect_byte_count_ext( - &self, - command_buffer: CommandBuffer, - instance_count: u32, - first_instance: u32, - counter_buffer: Buffer, - counter_buffer_offset: DeviceSize, - counter_offset: u32, - vertex_stride: u32, - ) { - (self.cmd_draw_indirect_byte_count_ext)( - command_buffer, - instance_count, - first_instance, - counter_buffer, - counter_buffer_offset, - counter_offset, - vertex_stride, - ) - } } #[doc = "Generated from 'VK_EXT_transform_feedback'"] impl AccessFlags { @@ -3347,7 +2598,7 @@ impl StructureType { pub const PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: Self = Self(1_000_028_002); } impl NvxBinaryImportFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NVX_binary_import\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -3497,52 +2748,6 @@ impl NvxBinaryImportFn { }, } } - #[doc = ""] - pub unsafe fn create_cu_module_nvx( - &self, - device: Device, - p_create_info: *const CuModuleCreateInfoNVX, - p_allocator: *const AllocationCallbacks, - p_module: *mut CuModuleNVX, - ) -> Result { - (self.create_cu_module_nvx)(device, p_create_info, p_allocator, p_module) - } - #[doc = ""] - pub unsafe fn create_cu_function_nvx( - &self, - device: Device, - p_create_info: *const CuFunctionCreateInfoNVX, - p_allocator: *const AllocationCallbacks, - p_function: *mut CuFunctionNVX, - ) -> Result { - (self.create_cu_function_nvx)(device, p_create_info, p_allocator, p_function) - } - #[doc = ""] - pub unsafe fn destroy_cu_module_nvx( - &self, - device: Device, - module: CuModuleNVX, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_cu_module_nvx)(device, module, p_allocator) - } - #[doc = ""] - pub unsafe fn destroy_cu_function_nvx( - &self, - device: Device, - function: CuFunctionNVX, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_cu_function_nvx)(device, function, p_allocator) - } - #[doc = ""] - pub unsafe fn cmd_cu_launch_kernel_nvx( - &self, - command_buffer: CommandBuffer, - p_launch_info: *const CuLaunchInfoNVX, - ) { - (self.cmd_cu_launch_kernel_nvx)(command_buffer, p_launch_info) - } } #[doc = "Generated from 'VK_NVX_binary_import'"] impl DebugReportObjectTypeEXT { @@ -3561,7 +2766,7 @@ impl StructureType { pub const CU_LAUNCH_INFO_NVX: Self = Self(1_000_029_002); } impl NvxImageViewHandleFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NVX_image_view_handle\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -3629,23 +2834,6 @@ impl NvxImageViewHandleFn { }, } } - #[doc = ""] - pub unsafe fn get_image_view_handle_nvx( - &self, - device: Device, - p_info: *const ImageViewHandleInfoNVX, - ) -> u32 { - (self.get_image_view_handle_nvx)(device, p_info) - } - #[doc = ""] - pub unsafe fn get_image_view_address_nvx( - &self, - device: Device, - image_view: ImageView, - p_properties: *mut ImageViewAddressPropertiesNVX, - ) -> Result { - (self.get_image_view_address_nvx)(device, image_view, p_properties) - } } #[doc = "Generated from 'VK_NVX_image_view_handle'"] impl StructureType { @@ -3653,7 +2841,7 @@ impl StructureType { pub const IMAGE_VIEW_ADDRESS_PROPERTIES_NVX: Self = Self(1_000_030_001); } impl AmdExtension32Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_32\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -3671,7 +2859,7 @@ impl AmdExtension32Fn { } } impl AmdExtension33Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_33\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -3689,7 +2877,7 @@ impl AmdExtension33Fn { } } impl AmdDrawIndirectCountFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_draw_indirect_count\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -3778,51 +2966,9 @@ impl AmdDrawIndirectCountFn { }, } } - #[doc = ""] - pub unsafe fn cmd_draw_indirect_count_amd( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - count_buffer: Buffer, - count_buffer_offset: DeviceSize, - max_draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indirect_count_amd)( - command_buffer, - buffer, - offset, - count_buffer, - count_buffer_offset, - max_draw_count, - stride, - ) - } - #[doc = ""] - pub unsafe fn cmd_draw_indexed_indirect_count_amd( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - count_buffer: Buffer, - count_buffer_offset: DeviceSize, - max_draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indexed_indirect_count_amd)( - command_buffer, - buffer, - offset, - count_buffer, - count_buffer_offset, - max_draw_count, - stride, - ) - } } impl AmdExtension35Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_35\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -3840,7 +2986,7 @@ impl AmdExtension35Fn { } } impl AmdNegativeViewportHeightFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_negative_viewport_height\0") } @@ -3860,7 +3006,7 @@ impl AmdNegativeViewportHeightFn { } } impl AmdGpuShaderHalfFloatFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_gpu_shader_half_float\0") } @@ -3880,7 +3026,7 @@ impl AmdGpuShaderHalfFloatFn { } } impl AmdShaderBallotFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_ballot\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -3898,10 +3044,10 @@ impl AmdShaderBallotFn { } } impl ExtVideoEncodeH264Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_video_encode_h264\0") } } - pub const SPEC_VERSION: u32 = 3u32; + pub const SPEC_VERSION: u32 = 6u32; } #[derive(Clone)] pub struct ExtVideoEncodeH264Fn {} @@ -3918,26 +3064,26 @@ impl ExtVideoEncodeH264Fn { #[doc = "Generated from 'VK_EXT_video_encode_h264'"] impl StructureType { pub const VIDEO_ENCODE_H264_CAPABILITIES_EXT: Self = Self(1_000_038_000); - pub const VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: Self = Self(1_000_038_001); - pub const VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_038_002); - pub const VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_038_003); - pub const VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: Self = Self(1_000_038_004); - pub const VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT: Self = Self(1_000_038_005); - pub const VIDEO_ENCODE_H264_NALU_SLICE_EXT: Self = Self(1_000_038_006); - pub const VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: Self = Self(1_000_038_007); - pub const VIDEO_ENCODE_H264_PROFILE_EXT: Self = Self(1_000_038_008); - pub const VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT: Self = Self(1_000_038_009); - pub const VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT: Self = Self(1_000_038_010); + pub const VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_038_001); + pub const VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_038_002); + pub const VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: Self = Self(1_000_038_003); + pub const VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT: Self = Self(1_000_038_004); + pub const VIDEO_ENCODE_H264_NALU_SLICE_EXT: Self = Self(1_000_038_005); + pub const VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: Self = Self(1_000_038_006); + pub const VIDEO_ENCODE_H264_PROFILE_EXT: Self = Self(1_000_038_007); + pub const VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT: Self = Self(1_000_038_008); + pub const VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT: Self = Self(1_000_038_009); + pub const VIDEO_ENCODE_H264_REFERENCE_LISTS_EXT: Self = Self(1_000_038_010); } #[doc = "Generated from 'VK_EXT_video_encode_h264'"] impl VideoCodecOperationFlagsKHR { pub const ENCODE_H264_EXT: Self = Self(0b1_0000_0000_0000_0000); } impl ExtVideoEncodeH265Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_video_encode_h265\0") } } - pub const SPEC_VERSION: u32 = 3u32; + pub const SPEC_VERSION: u32 = 6u32; } #[derive(Clone)] pub struct ExtVideoEncodeH265Fn {} @@ -3954,27 +3100,26 @@ impl ExtVideoEncodeH265Fn { #[doc = "Generated from 'VK_EXT_video_encode_h265'"] impl StructureType { pub const VIDEO_ENCODE_H265_CAPABILITIES_EXT: Self = Self(1_000_039_000); - pub const VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: Self = Self(1_000_039_001); - pub const VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_039_002); - pub const VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_039_003); - pub const VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: Self = Self(1_000_039_004); - pub const VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT: Self = Self(1_000_039_005); - pub const VIDEO_ENCODE_H265_NALU_SLICE_EXT: Self = Self(1_000_039_006); - pub const VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: Self = Self(1_000_039_007); - pub const VIDEO_ENCODE_H265_PROFILE_EXT: Self = Self(1_000_039_008); - pub const VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT: Self = Self(1_000_039_009); - pub const VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT: Self = Self(1_000_039_010); - pub const VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT: Self = Self(1_000_039_011); + pub const VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_039_001); + pub const VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_039_002); + pub const VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: Self = Self(1_000_039_003); + pub const VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT: Self = Self(1_000_039_004); + pub const VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_EXT: Self = Self(1_000_039_005); + pub const VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: Self = Self(1_000_039_006); + pub const VIDEO_ENCODE_H265_PROFILE_EXT: Self = Self(1_000_039_007); + pub const VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT: Self = Self(1_000_039_008); + pub const VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT: Self = Self(1_000_039_009); + pub const VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT: Self = Self(1_000_039_010); } #[doc = "Generated from 'VK_EXT_video_encode_h265'"] impl VideoCodecOperationFlagsKHR { pub const ENCODE_H265_EXT: Self = Self(0b10_0000_0000_0000_0000); } impl ExtVideoDecodeH264Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_video_decode_h264\0") } } - pub const SPEC_VERSION: u32 = 3u32; + pub const SPEC_VERSION: u32 = 4u32; } #[derive(Clone)] pub struct ExtVideoDecodeH264Fn {} @@ -3991,20 +3136,19 @@ impl ExtVideoDecodeH264Fn { #[doc = "Generated from 'VK_EXT_video_decode_h264'"] impl StructureType { pub const VIDEO_DECODE_H264_CAPABILITIES_EXT: Self = Self(1_000_040_000); - pub const VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: Self = Self(1_000_040_001); - pub const VIDEO_DECODE_H264_PICTURE_INFO_EXT: Self = Self(1_000_040_002); - pub const VIDEO_DECODE_H264_MVC_EXT: Self = Self(1_000_040_003); - pub const VIDEO_DECODE_H264_PROFILE_EXT: Self = Self(1_000_040_004); - pub const VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_040_005); - pub const VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_040_006); - pub const VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: Self = Self(1_000_040_007); + pub const VIDEO_DECODE_H264_PICTURE_INFO_EXT: Self = Self(1_000_040_001); + pub const VIDEO_DECODE_H264_MVC_EXT: Self = Self(1_000_040_002); + pub const VIDEO_DECODE_H264_PROFILE_EXT: Self = Self(1_000_040_003); + pub const VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_040_004); + pub const VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_040_005); + pub const VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: Self = Self(1_000_040_006); } #[doc = "Generated from 'VK_EXT_video_decode_h264'"] impl VideoCodecOperationFlagsKHR { pub const DECODE_H264_EXT: Self = Self(0b1); } impl AmdTextureGatherBiasLodFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_texture_gather_bias_lod\0") } @@ -4028,7 +3172,7 @@ impl StructureType { pub const TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: Self = Self(1_000_041_000); } impl AmdShaderInfoFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_info\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -4076,28 +3220,9 @@ impl AmdShaderInfoFn { }, } } - #[doc = ""] - pub unsafe fn get_shader_info_amd( - &self, - device: Device, - pipeline: Pipeline, - shader_stage: ShaderStageFlags, - info_type: ShaderInfoTypeAMD, - p_info_size: *mut usize, - p_info: *mut c_void, - ) -> Result { - (self.get_shader_info_amd)( - device, - pipeline, - shader_stage, - info_type, - p_info_size, - p_info, - ) - } } impl AmdExtension44Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_44\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -4115,22 +3240,22 @@ impl AmdExtension44Fn { } } impl KhrDynamicRenderingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_dynamic_rendering\0") } } pub const SPEC_VERSION: u32 = 1u32; } #[allow(non_camel_case_types)] -pub type PFN_vkCmdBeginRenderingKHR = unsafe extern "system" fn( +pub type PFN_vkCmdBeginRendering = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_rendering_info: *const RenderingInfoKHR, + p_rendering_info: *const RenderingInfo, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdEndRenderingKHR = unsafe extern "system" fn(command_buffer: CommandBuffer); +pub type PFN_vkCmdEndRendering = unsafe extern "system" fn(command_buffer: CommandBuffer); #[derive(Clone)] pub struct KhrDynamicRenderingFn { - pub cmd_begin_rendering_khr: PFN_vkCmdBeginRenderingKHR, - pub cmd_end_rendering_khr: PFN_vkCmdEndRenderingKHR, + pub cmd_begin_rendering_khr: PFN_vkCmdBeginRendering, + pub cmd_end_rendering_khr: PFN_vkCmdEndRendering, } unsafe impl Send for KhrDynamicRenderingFn {} unsafe impl Sync for KhrDynamicRenderingFn {} @@ -4143,7 +3268,7 @@ impl KhrDynamicRenderingFn { cmd_begin_rendering_khr: unsafe { unsafe extern "system" fn cmd_begin_rendering_khr( _command_buffer: CommandBuffer, - _p_rendering_info: *const RenderingInfoKHR, + _p_rendering_info: *const RenderingInfo, ) { panic!(concat!( "Unable to load ", @@ -4177,22 +3302,10 @@ impl KhrDynamicRenderingFn { }, } } - #[doc = ""] - pub unsafe fn cmd_begin_rendering_khr( - &self, - command_buffer: CommandBuffer, - p_rendering_info: *const RenderingInfoKHR, - ) { - (self.cmd_begin_rendering_khr)(command_buffer, p_rendering_info) - } - #[doc = ""] - pub unsafe fn cmd_end_rendering_khr(&self, command_buffer: CommandBuffer) { - (self.cmd_end_rendering_khr)(command_buffer) - } } #[doc = "Generated from 'VK_KHR_dynamic_rendering'"] impl AttachmentStoreOp { - pub const NONE_KHR: Self = Self(1_000_301_000); + pub const NONE_KHR: Self = Self::NONE; } #[doc = "Generated from 'VK_KHR_dynamic_rendering'"] impl PipelineCreateFlags { @@ -4203,11 +3316,13 @@ impl PipelineCreateFlags { } #[doc = "Generated from 'VK_KHR_dynamic_rendering'"] impl StructureType { - pub const RENDERING_INFO_KHR: Self = Self(1_000_044_000); - pub const RENDERING_ATTACHMENT_INFO_KHR: Self = Self(1_000_044_001); - pub const PIPELINE_RENDERING_CREATE_INFO_KHR: Self = Self(1_000_044_002); - pub const PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: Self = Self(1_000_044_003); - pub const COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: Self = Self(1_000_044_004); + pub const RENDERING_INFO_KHR: Self = Self::RENDERING_INFO; + pub const RENDERING_ATTACHMENT_INFO_KHR: Self = Self::RENDERING_ATTACHMENT_INFO; + pub const PIPELINE_RENDERING_CREATE_INFO_KHR: Self = Self::PIPELINE_RENDERING_CREATE_INFO; + pub const PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: Self = + Self::PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; + pub const COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: Self = + Self::COMMAND_BUFFER_INHERITANCE_RENDERING_INFO; pub const RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: Self = Self(1_000_044_006); pub const RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: Self = Self(1_000_044_007); pub const ATTACHMENT_SAMPLE_COUNT_INFO_AMD: Self = Self(1_000_044_008); @@ -4215,7 +3330,7 @@ impl StructureType { pub const MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: Self = Self(1_000_044_009); } impl AmdExtension46Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_46\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -4233,7 +3348,7 @@ impl AmdExtension46Fn { } } impl AmdShaderImageLoadStoreLodFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_image_load_store_lod\0") } @@ -4253,7 +3368,7 @@ impl AmdShaderImageLoadStoreLodFn { } } impl NvxExtension48Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NVX_extension_48\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -4271,7 +3386,7 @@ impl NvxExtension48Fn { } } impl GoogleExtension49Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_49\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -4289,7 +3404,7 @@ impl GoogleExtension49Fn { } } impl GgpStreamDescriptorSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_stream_descriptor_surface\0") } @@ -4339,23 +3454,13 @@ impl GgpStreamDescriptorSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_stream_descriptor_surface_ggp( - &self, - instance: Instance, - p_create_info: *const StreamDescriptorSurfaceCreateInfoGGP, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_stream_descriptor_surface_ggp)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_GGP_stream_descriptor_surface'"] impl StructureType { pub const STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP: Self = Self(1_000_049_000); } impl NvCornerSampledImageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_corner_sampled_image\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -4381,7 +3486,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: Self = Self(1_000_050_000); } impl NvExtension52Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_52\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -4407,7 +3512,7 @@ impl ShaderModuleCreateFlags { pub const RESERVED_0_NV: Self = Self(0b1); } impl NvExtension53Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_53\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -4425,7 +3530,7 @@ impl NvExtension53Fn { } } impl KhrMultiviewFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_multiview\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -4455,7 +3560,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES; } impl ImgFormatPvrtcFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_format_pvrtc\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -4484,7 +3589,7 @@ impl Format { pub const PVRTC2_4BPP_SRGB_BLOCK_IMG: Self = Self(1_000_054_007); } impl NvExternalMemoryCapabilitiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_external_memory_capabilities\0") } @@ -4544,32 +3649,9 @@ impl NvExternalMemoryCapabilitiesFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_external_image_format_properties_nv( - &self, - physical_device: PhysicalDevice, - format: Format, - ty: ImageType, - tiling: ImageTiling, - usage: ImageUsageFlags, - flags: ImageCreateFlags, - external_handle_type: ExternalMemoryHandleTypeFlagsNV, - p_external_image_format_properties: *mut ExternalImageFormatPropertiesNV, - ) -> Result { - (self.get_physical_device_external_image_format_properties_nv)( - physical_device, - format, - ty, - tiling, - usage, - flags, - external_handle_type, - p_external_image_format_properties, - ) - } } impl NvExternalMemoryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_external_memory\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -4592,7 +3674,7 @@ impl StructureType { pub const EXPORT_MEMORY_ALLOCATE_INFO_NV: Self = Self(1_000_056_001); } impl NvExternalMemoryWin32Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_external_memory_win32\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -4639,16 +3721,6 @@ impl NvExternalMemoryWin32Fn { }, } } - #[doc = ""] - pub unsafe fn get_memory_win32_handle_nv( - &self, - device: Device, - memory: DeviceMemory, - handle_type: ExternalMemoryHandleTypeFlagsNV, - p_handle: *mut HANDLE, - ) -> Result { - (self.get_memory_win32_handle_nv)(device, memory, handle_type, p_handle) - } } #[doc = "Generated from 'VK_NV_external_memory_win32'"] impl StructureType { @@ -4656,7 +3728,7 @@ impl StructureType { pub const EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: Self = Self(1_000_057_001); } impl NvWin32KeyedMutexFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_win32_keyed_mutex\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -4678,7 +3750,7 @@ impl StructureType { pub const WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: Self = Self(1_000_058_000); } impl KhrGetPhysicalDeviceProperties2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_get_physical_device_properties2\0", @@ -4895,84 +3967,6 @@ impl KhrGetPhysicalDeviceProperties2Fn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_features2_khr( - &self, - physical_device: PhysicalDevice, - p_features: *mut PhysicalDeviceFeatures2, - ) { - (self.get_physical_device_features2_khr)(physical_device, p_features) - } - #[doc = ""] - pub unsafe fn get_physical_device_properties2_khr( - &self, - physical_device: PhysicalDevice, - p_properties: *mut PhysicalDeviceProperties2, - ) { - (self.get_physical_device_properties2_khr)(physical_device, p_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_format_properties2_khr( - &self, - physical_device: PhysicalDevice, - format: Format, - p_format_properties: *mut FormatProperties2, - ) { - (self.get_physical_device_format_properties2_khr)( - physical_device, - format, - p_format_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_image_format_properties2_khr( - &self, - physical_device: PhysicalDevice, - p_image_format_info: *const PhysicalDeviceImageFormatInfo2, - p_image_format_properties: *mut ImageFormatProperties2, - ) -> Result { - (self.get_physical_device_image_format_properties2_khr)( - physical_device, - p_image_format_info, - p_image_format_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_queue_family_properties2_khr( - &self, - physical_device: PhysicalDevice, - p_queue_family_property_count: *mut u32, - p_queue_family_properties: *mut QueueFamilyProperties2, - ) { - (self.get_physical_device_queue_family_properties2_khr)( - physical_device, - p_queue_family_property_count, - p_queue_family_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_memory_properties2_khr( - &self, - physical_device: PhysicalDevice, - p_memory_properties: *mut PhysicalDeviceMemoryProperties2, - ) { - (self.get_physical_device_memory_properties2_khr)(physical_device, p_memory_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_sparse_image_format_properties2_khr( - &self, - physical_device: PhysicalDevice, - p_format_info: *const PhysicalDeviceSparseImageFormatInfo2, - p_property_count: *mut u32, - p_properties: *mut SparseImageFormatProperties2, - ) { - (self.get_physical_device_sparse_image_format_properties2_khr)( - physical_device, - p_format_info, - p_property_count, - p_properties, - ) - } } #[doc = "Generated from 'VK_KHR_get_physical_device_properties2'"] impl StructureType { @@ -4990,7 +3984,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2; } impl KhrDeviceGroupFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_device_group\0") } } pub const SPEC_VERSION: u32 = 4u32; @@ -5188,92 +4182,6 @@ impl KhrDeviceGroupFn { }, } } - #[doc = ""] - pub unsafe fn get_device_group_peer_memory_features_khr( - &self, - device: Device, - heap_index: u32, - local_device_index: u32, - remote_device_index: u32, - p_peer_memory_features: *mut PeerMemoryFeatureFlags, - ) { - (self.get_device_group_peer_memory_features_khr)( - device, - heap_index, - local_device_index, - remote_device_index, - p_peer_memory_features, - ) - } - #[doc = ""] - pub unsafe fn cmd_set_device_mask_khr(&self, command_buffer: CommandBuffer, device_mask: u32) { - (self.cmd_set_device_mask_khr)(command_buffer, device_mask) - } - #[doc = ""] - pub unsafe fn cmd_dispatch_base_khr( - &self, - command_buffer: CommandBuffer, - base_group_x: u32, - base_group_y: u32, - base_group_z: u32, - group_count_x: u32, - group_count_y: u32, - group_count_z: u32, - ) { - (self.cmd_dispatch_base_khr)( - command_buffer, - base_group_x, - base_group_y, - base_group_z, - group_count_x, - group_count_y, - group_count_z, - ) - } - #[doc = ""] - pub unsafe fn get_device_group_present_capabilities_khr( - &self, - device: Device, - p_device_group_present_capabilities: *mut DeviceGroupPresentCapabilitiesKHR, - ) -> Result { - (self.get_device_group_present_capabilities_khr)( - device, - p_device_group_present_capabilities, - ) - } - #[doc = ""] - pub unsafe fn get_device_group_surface_present_modes_khr( - &self, - device: Device, - surface: SurfaceKHR, - p_modes: *mut DeviceGroupPresentModeFlagsKHR, - ) -> Result { - (self.get_device_group_surface_present_modes_khr)(device, surface, p_modes) - } - #[doc = ""] - pub unsafe fn get_physical_device_present_rectangles_khr( - &self, - physical_device: PhysicalDevice, - surface: SurfaceKHR, - p_rect_count: *mut u32, - p_rects: *mut Rect2D, - ) -> Result { - (self.get_physical_device_present_rectangles_khr)( - physical_device, - surface, - p_rect_count, - p_rects, - ) - } - #[doc = ""] - pub unsafe fn acquire_next_image2_khr( - &self, - device: Device, - p_acquire_info: *const AcquireNextImageInfoKHR, - p_image_index: *mut u32, - ) -> Result { - (self.acquire_next_image2_khr)(device, p_acquire_info, p_image_index) - } } #[doc = "Generated from 'VK_KHR_device_group'"] impl DependencyFlags { @@ -5313,7 +4221,7 @@ impl StructureType { Self::BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO; } impl ExtValidationFlagsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_validation_flags\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -5335,7 +4243,7 @@ impl StructureType { pub const VALIDATION_FLAGS_EXT: Self = Self(1_000_061_000); } impl NnViSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NN_vi_surface\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -5379,23 +4287,13 @@ impl NnViSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_vi_surface_nn( - &self, - instance: Instance, - p_create_info: *const ViSurfaceCreateInfoNN, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_vi_surface_nn)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_NN_vi_surface'"] impl StructureType { pub const VI_SURFACE_CREATE_INFO_NN: Self = Self(1_000_062_000); } impl KhrShaderDrawParametersFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_draw_parameters\0") } @@ -5415,7 +4313,7 @@ impl KhrShaderDrawParametersFn { } } impl ExtShaderSubgroupBallotFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_subgroup_ballot\0") } @@ -5435,7 +4333,7 @@ impl ExtShaderSubgroupBallotFn { } } impl ExtShaderSubgroupVoteFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_subgroup_vote\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -5453,7 +4351,7 @@ impl ExtShaderSubgroupVoteFn { } } impl ExtTextureCompressionAstcHdrFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_EXT_texture_compression_astc_hdr\0", @@ -5476,27 +4374,28 @@ impl ExtTextureCompressionAstcHdrFn { } #[doc = "Generated from 'VK_EXT_texture_compression_astc_hdr'"] impl Format { - pub const ASTC_4X4_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_000); - pub const ASTC_5X4_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_001); - pub const ASTC_5X5_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_002); - pub const ASTC_6X5_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_003); - pub const ASTC_6X6_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_004); - pub const ASTC_8X5_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_005); - pub const ASTC_8X6_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_006); - pub const ASTC_8X8_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_007); - pub const ASTC_10X5_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_008); - pub const ASTC_10X6_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_009); - pub const ASTC_10X8_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_010); - pub const ASTC_10X10_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_011); - pub const ASTC_12X10_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_012); - pub const ASTC_12X12_SFLOAT_BLOCK_EXT: Self = Self(1_000_066_013); + pub const ASTC_4X4_SFLOAT_BLOCK_EXT: Self = Self::ASTC_4X4_SFLOAT_BLOCK; + pub const ASTC_5X4_SFLOAT_BLOCK_EXT: Self = Self::ASTC_5X4_SFLOAT_BLOCK; + pub const ASTC_5X5_SFLOAT_BLOCK_EXT: Self = Self::ASTC_5X5_SFLOAT_BLOCK; + pub const ASTC_6X5_SFLOAT_BLOCK_EXT: Self = Self::ASTC_6X5_SFLOAT_BLOCK; + pub const ASTC_6X6_SFLOAT_BLOCK_EXT: Self = Self::ASTC_6X6_SFLOAT_BLOCK; + pub const ASTC_8X5_SFLOAT_BLOCK_EXT: Self = Self::ASTC_8X5_SFLOAT_BLOCK; + pub const ASTC_8X6_SFLOAT_BLOCK_EXT: Self = Self::ASTC_8X6_SFLOAT_BLOCK; + pub const ASTC_8X8_SFLOAT_BLOCK_EXT: Self = Self::ASTC_8X8_SFLOAT_BLOCK; + pub const ASTC_10X5_SFLOAT_BLOCK_EXT: Self = Self::ASTC_10X5_SFLOAT_BLOCK; + pub const ASTC_10X6_SFLOAT_BLOCK_EXT: Self = Self::ASTC_10X6_SFLOAT_BLOCK; + pub const ASTC_10X8_SFLOAT_BLOCK_EXT: Self = Self::ASTC_10X8_SFLOAT_BLOCK; + pub const ASTC_10X10_SFLOAT_BLOCK_EXT: Self = Self::ASTC_10X10_SFLOAT_BLOCK; + pub const ASTC_12X10_SFLOAT_BLOCK_EXT: Self = Self::ASTC_12X10_SFLOAT_BLOCK; + pub const ASTC_12X12_SFLOAT_BLOCK_EXT: Self = Self::ASTC_12X12_SFLOAT_BLOCK; } #[doc = "Generated from 'VK_EXT_texture_compression_astc_hdr'"] impl StructureType { - pub const PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: Self = Self(1_000_066_000); + pub const PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: Self = + Self::PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES; } impl ExtAstcDecodeModeFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_astc_decode_mode\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -5519,7 +4418,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: Self = Self(1_000_067_001); } impl ImgExtension69Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_extension_69\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -5537,7 +4436,7 @@ impl ImgExtension69Fn { } } impl KhrMaintenance1Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_maintenance1\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -5582,15 +4481,6 @@ impl KhrMaintenance1Fn { }, } } - #[doc = ""] - pub unsafe fn trim_command_pool_khr( - &self, - device: Device, - command_pool: CommandPool, - flags: CommandPoolTrimFlags, - ) { - (self.trim_command_pool_khr)(device, command_pool, flags) - } } #[doc = "Generated from 'VK_KHR_maintenance1'"] impl FormatFeatureFlags { @@ -5606,7 +4496,7 @@ impl Result { pub const ERROR_OUT_OF_POOL_MEMORY_KHR: Self = Self::ERROR_OUT_OF_POOL_MEMORY; } impl KhrDeviceGroupCreationFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_device_group_creation\0") } @@ -5654,19 +4544,6 @@ impl KhrDeviceGroupCreationFn { }, } } - #[doc = ""] - pub unsafe fn enumerate_physical_device_groups_khr( - &self, - instance: Instance, - p_physical_device_group_count: *mut u32, - p_physical_device_group_properties: *mut PhysicalDeviceGroupProperties, - ) -> Result { - (self.enumerate_physical_device_groups_khr)( - instance, - p_physical_device_group_count, - p_physical_device_group_properties, - ) - } } #[doc = "Generated from 'VK_KHR_device_group_creation'"] impl MemoryHeapFlags { @@ -5678,7 +4555,7 @@ impl StructureType { pub const DEVICE_GROUP_DEVICE_CREATE_INFO_KHR: Self = Self::DEVICE_GROUP_DEVICE_CREATE_INFO; } impl KhrExternalMemoryCapabilitiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_external_memory_capabilities\0", @@ -5729,19 +4606,6 @@ impl KhrExternalMemoryCapabilitiesFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_external_buffer_properties_khr( - &self, - physical_device: PhysicalDevice, - p_external_buffer_info: *const PhysicalDeviceExternalBufferInfo, - p_external_buffer_properties: *mut ExternalBufferProperties, - ) { - (self.get_physical_device_external_buffer_properties_khr)( - physical_device, - p_external_buffer_info, - p_external_buffer_properties, - ) - } } #[doc = "Generated from 'VK_KHR_external_memory_capabilities'"] impl ExternalMemoryFeatureFlags { @@ -5770,7 +4634,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_ID_PROPERTIES_KHR: Self = Self::PHYSICAL_DEVICE_ID_PROPERTIES; } impl KhrExternalMemoryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_memory\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -5799,7 +4663,7 @@ impl StructureType { pub const EXPORT_MEMORY_ALLOCATE_INFO_KHR: Self = Self::EXPORT_MEMORY_ALLOCATE_INFO; } impl KhrExternalMemoryWin32Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_memory_win32\0") } @@ -5876,30 +4740,6 @@ impl KhrExternalMemoryWin32Fn { }, } } - #[doc = ""] - pub unsafe fn get_memory_win32_handle_khr( - &self, - device: Device, - p_get_win32_handle_info: *const MemoryGetWin32HandleInfoKHR, - p_handle: *mut HANDLE, - ) -> Result { - (self.get_memory_win32_handle_khr)(device, p_get_win32_handle_info, p_handle) - } - #[doc = ""] - pub unsafe fn get_memory_win32_handle_properties_khr( - &self, - device: Device, - handle_type: ExternalMemoryHandleTypeFlags, - handle: HANDLE, - p_memory_win32_handle_properties: *mut MemoryWin32HandlePropertiesKHR, - ) -> Result { - (self.get_memory_win32_handle_properties_khr)( - device, - handle_type, - handle, - p_memory_win32_handle_properties, - ) - } } #[doc = "Generated from 'VK_KHR_external_memory_win32'"] impl StructureType { @@ -5909,7 +4749,7 @@ impl StructureType { pub const MEMORY_GET_WIN32_HANDLE_INFO_KHR: Self = Self(1_000_073_003); } impl KhrExternalMemoryFdFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_memory_fd\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -5980,25 +4820,6 @@ impl KhrExternalMemoryFdFn { }, } } - #[doc = ""] - pub unsafe fn get_memory_fd_khr( - &self, - device: Device, - p_get_fd_info: *const MemoryGetFdInfoKHR, - p_fd: *mut c_int, - ) -> Result { - (self.get_memory_fd_khr)(device, p_get_fd_info, p_fd) - } - #[doc = ""] - pub unsafe fn get_memory_fd_properties_khr( - &self, - device: Device, - handle_type: ExternalMemoryHandleTypeFlags, - fd: c_int, - p_memory_fd_properties: *mut MemoryFdPropertiesKHR, - ) -> Result { - (self.get_memory_fd_properties_khr)(device, handle_type, fd, p_memory_fd_properties) - } } #[doc = "Generated from 'VK_KHR_external_memory_fd'"] impl StructureType { @@ -6007,7 +4828,7 @@ impl StructureType { pub const MEMORY_GET_FD_INFO_KHR: Self = Self(1_000_074_002); } impl KhrWin32KeyedMutexFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_win32_keyed_mutex\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -6029,7 +4850,7 @@ impl StructureType { pub const WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: Self = Self(1_000_075_000); } impl KhrExternalSemaphoreCapabilitiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_external_semaphore_capabilities\0", @@ -6080,19 +4901,6 @@ impl KhrExternalSemaphoreCapabilitiesFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_external_semaphore_properties_khr( - &self, - physical_device: PhysicalDevice, - p_external_semaphore_info: *const PhysicalDeviceExternalSemaphoreInfo, - p_external_semaphore_properties: *mut ExternalSemaphoreProperties, - ) { - (self.get_physical_device_external_semaphore_properties_khr)( - physical_device, - p_external_semaphore_info, - p_external_semaphore_properties, - ) - } } #[doc = "Generated from 'VK_KHR_external_semaphore_capabilities'"] impl ExternalSemaphoreFeatureFlags { @@ -6114,7 +4922,7 @@ impl StructureType { pub const EXTERNAL_SEMAPHORE_PROPERTIES_KHR: Self = Self::EXTERNAL_SEMAPHORE_PROPERTIES; } impl KhrExternalSemaphoreFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_semaphore\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -6140,7 +4948,7 @@ impl StructureType { pub const EXPORT_SEMAPHORE_CREATE_INFO_KHR: Self = Self::EXPORT_SEMAPHORE_CREATE_INFO; } impl KhrExternalSemaphoreWin32Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_semaphore_win32\0") } @@ -6214,23 +5022,6 @@ impl KhrExternalSemaphoreWin32Fn { }, } } - #[doc = ""] - pub unsafe fn import_semaphore_win32_handle_khr( - &self, - device: Device, - p_import_semaphore_win32_handle_info: *const ImportSemaphoreWin32HandleInfoKHR, - ) -> Result { - (self.import_semaphore_win32_handle_khr)(device, p_import_semaphore_win32_handle_info) - } - #[doc = ""] - pub unsafe fn get_semaphore_win32_handle_khr( - &self, - device: Device, - p_get_win32_handle_info: *const SemaphoreGetWin32HandleInfoKHR, - p_handle: *mut HANDLE, - ) -> Result { - (self.get_semaphore_win32_handle_khr)(device, p_get_win32_handle_info, p_handle) - } } #[doc = "Generated from 'VK_KHR_external_semaphore_win32'"] impl StructureType { @@ -6240,7 +5031,7 @@ impl StructureType { pub const SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR: Self = Self(1_000_078_003); } impl KhrExternalSemaphoreFdFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_semaphore_fd\0") } @@ -6309,23 +5100,6 @@ impl KhrExternalSemaphoreFdFn { }, } } - #[doc = ""] - pub unsafe fn import_semaphore_fd_khr( - &self, - device: Device, - p_import_semaphore_fd_info: *const ImportSemaphoreFdInfoKHR, - ) -> Result { - (self.import_semaphore_fd_khr)(device, p_import_semaphore_fd_info) - } - #[doc = ""] - pub unsafe fn get_semaphore_fd_khr( - &self, - device: Device, - p_get_fd_info: *const SemaphoreGetFdInfoKHR, - p_fd: *mut c_int, - ) -> Result { - (self.get_semaphore_fd_khr)(device, p_get_fd_info, p_fd) - } } #[doc = "Generated from 'VK_KHR_external_semaphore_fd'"] impl StructureType { @@ -6333,7 +5107,7 @@ impl StructureType { pub const SEMAPHORE_GET_FD_INFO_KHR: Self = Self(1_000_079_001); } impl KhrPushDescriptorFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_push_descriptor\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -6416,42 +5190,6 @@ impl KhrPushDescriptorFn { }, } } - #[doc = ""] - pub unsafe fn cmd_push_descriptor_set_khr( - &self, - command_buffer: CommandBuffer, - pipeline_bind_point: PipelineBindPoint, - layout: PipelineLayout, - set: u32, - descriptor_write_count: u32, - p_descriptor_writes: *const WriteDescriptorSet, - ) { - (self.cmd_push_descriptor_set_khr)( - command_buffer, - pipeline_bind_point, - layout, - set, - descriptor_write_count, - p_descriptor_writes, - ) - } - #[doc = ""] - pub unsafe fn cmd_push_descriptor_set_with_template_khr( - &self, - command_buffer: CommandBuffer, - descriptor_update_template: DescriptorUpdateTemplate, - layout: PipelineLayout, - set: u32, - p_data: *const c_void, - ) { - (self.cmd_push_descriptor_set_with_template_khr)( - command_buffer, - descriptor_update_template, - layout, - set, - p_data, - ) - } } #[doc = "Generated from 'VK_KHR_push_descriptor'"] impl DescriptorSetLayoutCreateFlags { @@ -6468,7 +5206,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: Self = Self(1_000_080_000); } impl ExtConditionalRenderingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_conditional_rendering\0") } @@ -6537,18 +5275,6 @@ impl ExtConditionalRenderingFn { }, } } - #[doc = ""] - pub unsafe fn cmd_begin_conditional_rendering_ext( - &self, - command_buffer: CommandBuffer, - p_conditional_rendering_begin: *const ConditionalRenderingBeginInfoEXT, - ) { - (self.cmd_begin_conditional_rendering_ext)(command_buffer, p_conditional_rendering_begin) - } - #[doc = ""] - pub unsafe fn cmd_end_conditional_rendering_ext(&self, command_buffer: CommandBuffer) { - (self.cmd_end_conditional_rendering_ext)(command_buffer) - } } #[doc = "Generated from 'VK_EXT_conditional_rendering'"] impl AccessFlags { @@ -6572,7 +5298,7 @@ impl StructureType { pub const CONDITIONAL_RENDERING_BEGIN_INFO_EXT: Self = Self(1_000_081_002); } impl KhrShaderFloat16Int8Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_float16_int8\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -6597,7 +5323,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; } impl Khr16bitStorageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_16bit_storage\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -6620,7 +5346,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; } impl KhrIncrementalPresentFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_incremental_present\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -6642,7 +5368,7 @@ impl StructureType { pub const PRESENT_REGIONS_KHR: Self = Self(1_000_084_000); } impl KhrDescriptorUpdateTemplateFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_descriptor_update_template\0") } @@ -6775,66 +5501,6 @@ impl KhrDescriptorUpdateTemplateFn { }, } } - #[doc = ""] - pub unsafe fn create_descriptor_update_template_khr( - &self, - device: Device, - p_create_info: *const DescriptorUpdateTemplateCreateInfo, - p_allocator: *const AllocationCallbacks, - p_descriptor_update_template: *mut DescriptorUpdateTemplate, - ) -> Result { - (self.create_descriptor_update_template_khr)( - device, - p_create_info, - p_allocator, - p_descriptor_update_template, - ) - } - #[doc = ""] - pub unsafe fn destroy_descriptor_update_template_khr( - &self, - device: Device, - descriptor_update_template: DescriptorUpdateTemplate, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_descriptor_update_template_khr)( - device, - descriptor_update_template, - p_allocator, - ) - } - #[doc = ""] - pub unsafe fn update_descriptor_set_with_template_khr( - &self, - device: Device, - descriptor_set: DescriptorSet, - descriptor_update_template: DescriptorUpdateTemplate, - p_data: *const c_void, - ) { - (self.update_descriptor_set_with_template_khr)( - device, - descriptor_set, - descriptor_update_template, - p_data, - ) - } - #[doc = ""] - pub unsafe fn cmd_push_descriptor_set_with_template_khr( - &self, - command_buffer: CommandBuffer, - descriptor_update_template: DescriptorUpdateTemplate, - layout: PipelineLayout, - set: u32, - p_data: *const c_void, - ) { - (self.cmd_push_descriptor_set_with_template_khr)( - command_buffer, - descriptor_update_template, - layout, - set, - p_data, - ) - } } #[doc = "Generated from 'VK_KHR_descriptor_update_template'"] impl DebugReportObjectTypeEXT { @@ -6854,7 +5520,7 @@ impl StructureType { Self::DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO; } impl NvxDeviceGeneratedCommandsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NVX_device_generated_commands\0") } @@ -6874,7 +5540,7 @@ impl NvxDeviceGeneratedCommandsFn { } } impl NvClipSpaceWScalingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_clip_space_w_scaling\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -6922,21 +5588,6 @@ impl NvClipSpaceWScalingFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_viewport_w_scaling_nv( - &self, - command_buffer: CommandBuffer, - first_viewport: u32, - viewport_count: u32, - p_viewport_w_scalings: *const ViewportWScalingNV, - ) { - (self.cmd_set_viewport_w_scaling_nv)( - command_buffer, - first_viewport, - viewport_count, - p_viewport_w_scalings, - ) - } } #[doc = "Generated from 'VK_NV_clip_space_w_scaling'"] impl DynamicState { @@ -6947,7 +5598,7 @@ impl StructureType { pub const PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: Self = Self(1_000_087_000); } impl ExtDirectModeDisplayFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_direct_mode_display\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -6985,17 +5636,9 @@ impl ExtDirectModeDisplayFn { }, } } - #[doc = ""] - pub unsafe fn release_display_ext( - &self, - physical_device: PhysicalDevice, - display: DisplayKHR, - ) -> Result { - (self.release_display_ext)(physical_device, display) - } } impl ExtAcquireXlibDisplayFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_acquire_xlib_display\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -7070,28 +5713,9 @@ impl ExtAcquireXlibDisplayFn { }, } } - #[doc = ""] - pub unsafe fn acquire_xlib_display_ext( - &self, - physical_device: PhysicalDevice, - dpy: *mut Display, - display: DisplayKHR, - ) -> Result { - (self.acquire_xlib_display_ext)(physical_device, dpy, display) - } - #[doc = ""] - pub unsafe fn get_rand_r_output_display_ext( - &self, - physical_device: PhysicalDevice, - dpy: *mut Display, - rr_output: RROutput, - p_display: *mut DisplayKHR, - ) -> Result { - (self.get_rand_r_output_display_ext)(physical_device, dpy, rr_output, p_display) - } } impl ExtDisplaySurfaceCounterFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_display_surface_counter\0") } @@ -7140,26 +5764,13 @@ impl ExtDisplaySurfaceCounterFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_surface_capabilities2_ext( - &self, - physical_device: PhysicalDevice, - surface: SurfaceKHR, - p_surface_capabilities: *mut SurfaceCapabilities2EXT, - ) -> Result { - (self.get_physical_device_surface_capabilities2_ext)( - physical_device, - surface, - p_surface_capabilities, - ) - } } #[doc = "Generated from 'VK_EXT_display_surface_counter'"] impl StructureType { pub const SURFACE_CAPABILITIES_2_EXT: Self = Self(1_000_090_000); } impl ExtDisplayControlFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_display_control\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -7293,52 +5904,6 @@ impl ExtDisplayControlFn { }, } } - #[doc = ""] - pub unsafe fn display_power_control_ext( - &self, - device: Device, - display: DisplayKHR, - p_display_power_info: *const DisplayPowerInfoEXT, - ) -> Result { - (self.display_power_control_ext)(device, display, p_display_power_info) - } - #[doc = ""] - pub unsafe fn register_device_event_ext( - &self, - device: Device, - p_device_event_info: *const DeviceEventInfoEXT, - p_allocator: *const AllocationCallbacks, - p_fence: *mut Fence, - ) -> Result { - (self.register_device_event_ext)(device, p_device_event_info, p_allocator, p_fence) - } - #[doc = ""] - pub unsafe fn register_display_event_ext( - &self, - device: Device, - display: DisplayKHR, - p_display_event_info: *const DisplayEventInfoEXT, - p_allocator: *const AllocationCallbacks, - p_fence: *mut Fence, - ) -> Result { - (self.register_display_event_ext)( - device, - display, - p_display_event_info, - p_allocator, - p_fence, - ) - } - #[doc = ""] - pub unsafe fn get_swapchain_counter_ext( - &self, - device: Device, - swapchain: SwapchainKHR, - counter: SurfaceCounterFlagsEXT, - p_counter_value: *mut u64, - ) -> Result { - (self.get_swapchain_counter_ext)(device, swapchain, counter, p_counter_value) - } } #[doc = "Generated from 'VK_EXT_display_control'"] impl StructureType { @@ -7348,7 +5913,7 @@ impl StructureType { pub const SWAPCHAIN_COUNTER_CREATE_INFO_EXT: Self = Self(1_000_091_003); } impl GoogleDisplayTimingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_display_timing\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -7424,37 +5989,13 @@ impl GoogleDisplayTimingFn { }, } } - #[doc = ""] - pub unsafe fn get_refresh_cycle_duration_google( - &self, - device: Device, - swapchain: SwapchainKHR, - p_display_timing_properties: *mut RefreshCycleDurationGOOGLE, - ) -> Result { - (self.get_refresh_cycle_duration_google)(device, swapchain, p_display_timing_properties) - } - #[doc = ""] - pub unsafe fn get_past_presentation_timing_google( - &self, - device: Device, - swapchain: SwapchainKHR, - p_presentation_timing_count: *mut u32, - p_presentation_timings: *mut PastPresentationTimingGOOGLE, - ) -> Result { - (self.get_past_presentation_timing_google)( - device, - swapchain, - p_presentation_timing_count, - p_presentation_timings, - ) - } } #[doc = "Generated from 'VK_GOOGLE_display_timing'"] impl StructureType { pub const PRESENT_TIMES_INFO_GOOGLE: Self = Self(1_000_092_000); } impl NvSampleMaskOverrideCoverageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_NV_sample_mask_override_coverage\0", @@ -7476,7 +6017,7 @@ impl NvSampleMaskOverrideCoverageFn { } } impl NvGeometryShaderPassthroughFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_geometry_shader_passthrough\0") } @@ -7496,7 +6037,7 @@ impl NvGeometryShaderPassthroughFn { } } impl NvViewportArray2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_viewport_array2\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -7514,7 +6055,7 @@ impl NvViewportArray2Fn { } } impl NvxMultiviewPerViewAttributesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_NVX_multiview_per_view_attributes\0", @@ -7546,7 +6087,7 @@ impl SubpassDescriptionFlags { pub const PER_VIEW_POSITION_X_ONLY_NVX: Self = Self(0b10); } impl NvViewportSwizzleFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_viewport_swizzle\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -7568,7 +6109,7 @@ impl StructureType { pub const PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: Self = Self(1_000_098_000); } impl ExtDiscardRectanglesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_discard_rectangles\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -7616,21 +6157,6 @@ impl ExtDiscardRectanglesFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_discard_rectangle_ext( - &self, - command_buffer: CommandBuffer, - first_discard_rectangle: u32, - discard_rectangle_count: u32, - p_discard_rectangles: *const Rect2D, - ) { - (self.cmd_set_discard_rectangle_ext)( - command_buffer, - first_discard_rectangle, - discard_rectangle_count, - p_discard_rectangles, - ) - } } #[doc = "Generated from 'VK_EXT_discard_rectangles'"] impl DynamicState { @@ -7642,7 +6168,7 @@ impl StructureType { pub const PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: Self = Self(1_000_099_001); } impl NvExtension101Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_101\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -7660,7 +6186,7 @@ impl NvExtension101Fn { } } impl ExtConservativeRasterizationFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_conservative_rasterization\0") } @@ -7685,7 +6211,7 @@ impl StructureType { pub const PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: Self = Self(1_000_101_001); } impl ExtDepthClipEnableFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_depth_clip_enable\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -7708,7 +6234,7 @@ impl StructureType { pub const PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: Self = Self(1_000_102_001); } impl NvExtension104Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_104\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -7726,7 +6252,7 @@ impl NvExtension104Fn { } } impl ExtSwapchainColorspaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_swapchain_colorspace\0") } } pub const SPEC_VERSION: u32 = 4u32; @@ -7761,7 +6287,7 @@ impl ColorSpaceKHR { pub const EXTENDED_SRGB_NONLINEAR_EXT: Self = Self(1_000_104_014); } impl ExtHdrMetadataFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_hdr_metadata\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -7805,23 +6331,13 @@ impl ExtHdrMetadataFn { }, } } - #[doc = ""] - pub unsafe fn set_hdr_metadata_ext( - &self, - device: Device, - swapchain_count: u32, - p_swapchains: *const SwapchainKHR, - p_metadata: *const HdrMetadataEXT, - ) { - (self.set_hdr_metadata_ext)(device, swapchain_count, p_swapchains, p_metadata) - } } #[doc = "Generated from 'VK_EXT_hdr_metadata'"] impl StructureType { pub const HDR_METADATA_EXT: Self = Self(1_000_105_000); } impl ImgExtension107Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_extension_107\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -7839,7 +6355,7 @@ impl ImgExtension107Fn { } } impl ImgExtension108Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_extension_108\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -7857,7 +6373,7 @@ impl ImgExtension108Fn { } } impl KhrImagelessFramebufferFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_imageless_framebuffer\0") } @@ -7890,7 +6406,7 @@ impl StructureType { pub const RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR: Self = Self::RENDER_PASS_ATTACHMENT_BEGIN_INFO; } impl KhrCreateRenderpass2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_create_renderpass2\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -8016,42 +6532,6 @@ impl KhrCreateRenderpass2Fn { }, } } - #[doc = ""] - pub unsafe fn create_render_pass2_khr( - &self, - device: Device, - p_create_info: *const RenderPassCreateInfo2, - p_allocator: *const AllocationCallbacks, - p_render_pass: *mut RenderPass, - ) -> Result { - (self.create_render_pass2_khr)(device, p_create_info, p_allocator, p_render_pass) - } - #[doc = ""] - pub unsafe fn cmd_begin_render_pass2_khr( - &self, - command_buffer: CommandBuffer, - p_render_pass_begin: *const RenderPassBeginInfo, - p_subpass_begin_info: *const SubpassBeginInfo, - ) { - (self.cmd_begin_render_pass2_khr)(command_buffer, p_render_pass_begin, p_subpass_begin_info) - } - #[doc = ""] - pub unsafe fn cmd_next_subpass2_khr( - &self, - command_buffer: CommandBuffer, - p_subpass_begin_info: *const SubpassBeginInfo, - p_subpass_end_info: *const SubpassEndInfo, - ) { - (self.cmd_next_subpass2_khr)(command_buffer, p_subpass_begin_info, p_subpass_end_info) - } - #[doc = ""] - pub unsafe fn cmd_end_render_pass2_khr( - &self, - command_buffer: CommandBuffer, - p_subpass_end_info: *const SubpassEndInfo, - ) { - (self.cmd_end_render_pass2_khr)(command_buffer, p_subpass_end_info) - } } #[doc = "Generated from 'VK_KHR_create_renderpass2'"] impl StructureType { @@ -8064,7 +6544,7 @@ impl StructureType { pub const SUBPASS_END_INFO_KHR: Self = Self::SUBPASS_END_INFO; } impl ImgExtension111Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_extension_111\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -8082,7 +6562,7 @@ impl ImgExtension111Fn { } } impl KhrSharedPresentableImageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shared_presentable_image\0") } @@ -8125,14 +6605,6 @@ impl KhrSharedPresentableImageFn { }, } } - #[doc = ""] - pub unsafe fn get_swapchain_status_khr( - &self, - device: Device, - swapchain: SwapchainKHR, - ) -> Result { - (self.get_swapchain_status_khr)(device, swapchain) - } } #[doc = "Generated from 'VK_KHR_shared_presentable_image'"] impl ImageLayout { @@ -8148,7 +6620,7 @@ impl StructureType { pub const SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: Self = Self(1_000_111_000); } impl KhrExternalFenceCapabilitiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_fence_capabilities\0") } @@ -8197,19 +6669,6 @@ impl KhrExternalFenceCapabilitiesFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_external_fence_properties_khr( - &self, - physical_device: PhysicalDevice, - p_external_fence_info: *const PhysicalDeviceExternalFenceInfo, - p_external_fence_properties: *mut ExternalFenceProperties, - ) { - (self.get_physical_device_external_fence_properties_khr)( - physical_device, - p_external_fence_info, - p_external_fence_properties, - ) - } } #[doc = "Generated from 'VK_KHR_external_fence_capabilities'"] impl ExternalFenceFeatureFlags { @@ -8230,7 +6689,7 @@ impl StructureType { pub const EXTERNAL_FENCE_PROPERTIES_KHR: Self = Self::EXTERNAL_FENCE_PROPERTIES; } impl KhrExternalFenceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_fence\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -8256,7 +6715,7 @@ impl StructureType { pub const EXPORT_FENCE_CREATE_INFO_KHR: Self = Self::EXPORT_FENCE_CREATE_INFO; } impl KhrExternalFenceWin32Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_fence_win32\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -8327,23 +6786,6 @@ impl KhrExternalFenceWin32Fn { }, } } - #[doc = ""] - pub unsafe fn import_fence_win32_handle_khr( - &self, - device: Device, - p_import_fence_win32_handle_info: *const ImportFenceWin32HandleInfoKHR, - ) -> Result { - (self.import_fence_win32_handle_khr)(device, p_import_fence_win32_handle_info) - } - #[doc = ""] - pub unsafe fn get_fence_win32_handle_khr( - &self, - device: Device, - p_get_win32_handle_info: *const FenceGetWin32HandleInfoKHR, - p_handle: *mut HANDLE, - ) -> Result { - (self.get_fence_win32_handle_khr)(device, p_get_win32_handle_info, p_handle) - } } #[doc = "Generated from 'VK_KHR_external_fence_win32'"] impl StructureType { @@ -8352,7 +6794,7 @@ impl StructureType { pub const FENCE_GET_WIN32_HANDLE_INFO_KHR: Self = Self(1_000_114_002); } impl KhrExternalFenceFdFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_fence_fd\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -8415,23 +6857,6 @@ impl KhrExternalFenceFdFn { }, } } - #[doc = ""] - pub unsafe fn import_fence_fd_khr( - &self, - device: Device, - p_import_fence_fd_info: *const ImportFenceFdInfoKHR, - ) -> Result { - (self.import_fence_fd_khr)(device, p_import_fence_fd_info) - } - #[doc = ""] - pub unsafe fn get_fence_fd_khr( - &self, - device: Device, - p_get_fd_info: *const FenceGetFdInfoKHR, - p_fd: *mut c_int, - ) -> Result { - (self.get_fence_fd_khr)(device, p_get_fd_info, p_fd) - } } #[doc = "Generated from 'VK_KHR_external_fence_fd'"] impl StructureType { @@ -8439,7 +6864,7 @@ impl StructureType { pub const FENCE_GET_FD_INFO_KHR: Self = Self(1_000_115_001); } impl KhrPerformanceQueryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_performance_query\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -8565,48 +6990,6 @@ impl KhrPerformanceQueryFn { }, } } - #[doc = ""] - pub unsafe fn enumerate_physical_device_queue_family_performance_query_counters_khr( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - p_counter_count: *mut u32, - p_counters: *mut PerformanceCounterKHR, - p_counter_descriptions: *mut PerformanceCounterDescriptionKHR, - ) -> Result { - (self.enumerate_physical_device_queue_family_performance_query_counters_khr)( - physical_device, - queue_family_index, - p_counter_count, - p_counters, - p_counter_descriptions, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_queue_family_performance_query_passes_khr( - &self, - physical_device: PhysicalDevice, - p_performance_query_create_info: *const QueryPoolPerformanceCreateInfoKHR, - p_num_passes: *mut u32, - ) { - (self.get_physical_device_queue_family_performance_query_passes_khr)( - physical_device, - p_performance_query_create_info, - p_num_passes, - ) - } - #[doc = ""] - pub unsafe fn acquire_profiling_lock_khr( - &self, - device: Device, - p_info: *const AcquireProfilingLockInfoKHR, - ) -> Result { - (self.acquire_profiling_lock_khr)(device, p_info) - } - #[doc = ""] - pub unsafe fn release_profiling_lock_khr(&self, device: Device) { - (self.release_profiling_lock_khr)(device) - } } #[doc = "Generated from 'VK_KHR_performance_query'"] impl QueryType { @@ -8623,7 +7006,7 @@ impl StructureType { pub const PERFORMANCE_COUNTER_DESCRIPTION_KHR: Self = Self(1_000_116_006); } impl KhrMaintenance2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_maintenance2\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -8673,7 +7056,7 @@ impl TessellationDomainOrigin { pub const LOWER_LEFT_KHR: Self = Self::LOWER_LEFT; } impl KhrExtension119Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_119\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -8691,7 +7074,7 @@ impl KhrExtension119Fn { } } impl KhrGetSurfaceCapabilities2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_get_surface_capabilities2\0") } @@ -8770,34 +7153,6 @@ impl KhrGetSurfaceCapabilities2Fn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_surface_capabilities2_khr( - &self, - physical_device: PhysicalDevice, - p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, - p_surface_capabilities: *mut SurfaceCapabilities2KHR, - ) -> Result { - (self.get_physical_device_surface_capabilities2_khr)( - physical_device, - p_surface_info, - p_surface_capabilities, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_surface_formats2_khr( - &self, - physical_device: PhysicalDevice, - p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, - p_surface_format_count: *mut u32, - p_surface_formats: *mut SurfaceFormat2KHR, - ) -> Result { - (self.get_physical_device_surface_formats2_khr)( - physical_device, - p_surface_info, - p_surface_format_count, - p_surface_formats, - ) - } } #[doc = "Generated from 'VK_KHR_get_surface_capabilities2'"] impl StructureType { @@ -8806,7 +7161,7 @@ impl StructureType { pub const SURFACE_FORMAT_2_KHR: Self = Self(1_000_119_002); } impl KhrVariablePointersFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_variable_pointers\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -8831,7 +7186,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR; } impl KhrGetDisplayProperties2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_get_display_properties2\0") } @@ -8966,60 +7321,6 @@ impl KhrGetDisplayProperties2Fn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_display_properties2_khr( - &self, - physical_device: PhysicalDevice, - p_property_count: *mut u32, - p_properties: *mut DisplayProperties2KHR, - ) -> Result { - (self.get_physical_device_display_properties2_khr)( - physical_device, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_display_plane_properties2_khr( - &self, - physical_device: PhysicalDevice, - p_property_count: *mut u32, - p_properties: *mut DisplayPlaneProperties2KHR, - ) -> Result { - (self.get_physical_device_display_plane_properties2_khr)( - physical_device, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn get_display_mode_properties2_khr( - &self, - physical_device: PhysicalDevice, - display: DisplayKHR, - p_property_count: *mut u32, - p_properties: *mut DisplayModeProperties2KHR, - ) -> Result { - (self.get_display_mode_properties2_khr)( - physical_device, - display, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn get_display_plane_capabilities2_khr( - &self, - physical_device: PhysicalDevice, - p_display_plane_info: *const DisplayPlaneInfo2KHR, - p_capabilities: *mut DisplayPlaneCapabilities2KHR, - ) -> Result { - (self.get_display_plane_capabilities2_khr)( - physical_device, - p_display_plane_info, - p_capabilities, - ) - } } #[doc = "Generated from 'VK_KHR_get_display_properties2'"] impl StructureType { @@ -9030,7 +7331,7 @@ impl StructureType { pub const DISPLAY_PLANE_CAPABILITIES_2_KHR: Self = Self(1_000_121_004); } impl MvkIosSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_MVK_ios_surface\0") } } pub const SPEC_VERSION: u32 = 3u32; @@ -9077,23 +7378,13 @@ impl MvkIosSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_ios_surface_mvk( - &self, - instance: Instance, - p_create_info: *const IOSSurfaceCreateInfoMVK, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_ios_surface_mvk)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_MVK_ios_surface'"] impl StructureType { pub const IOS_SURFACE_CREATE_INFO_MVK: Self = Self(1_000_122_000); } impl MvkMacosSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_MVK_macos_surface\0") } } pub const SPEC_VERSION: u32 = 3u32; @@ -9140,23 +7431,13 @@ impl MvkMacosSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_mac_os_surface_mvk( - &self, - instance: Instance, - p_create_info: *const MacOSSurfaceCreateInfoMVK, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_mac_os_surface_mvk)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_MVK_macos_surface'"] impl StructureType { pub const MACOS_SURFACE_CREATE_INFO_MVK: Self = Self(1_000_123_000); } impl MvkMoltenvkFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_MVK_moltenvk\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -9174,7 +7455,7 @@ impl MvkMoltenvkFn { } } impl ExtExternalMemoryDmaBufFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_external_memory_dma_buf\0") } @@ -9198,7 +7479,7 @@ impl ExternalMemoryHandleTypeFlags { pub const DMA_BUF_EXT: Self = Self(0b10_0000_0000); } impl ExtQueueFamilyForeignFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_queue_family_foreign\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -9216,7 +7497,7 @@ impl ExtQueueFamilyForeignFn { } } impl KhrDedicatedAllocationFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_dedicated_allocation\0") } } pub const SPEC_VERSION: u32 = 3u32; @@ -9239,7 +7520,7 @@ impl StructureType { pub const MEMORY_DEDICATED_ALLOCATE_INFO_KHR: Self = Self::MEMORY_DEDICATED_ALLOCATE_INFO; } impl ExtDebugUtilsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_debug_utils\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -9539,96 +7820,6 @@ impl ExtDebugUtilsFn { }, } } - #[doc = ""] - pub unsafe fn set_debug_utils_object_name_ext( - &self, - device: Device, - p_name_info: *const DebugUtilsObjectNameInfoEXT, - ) -> Result { - (self.set_debug_utils_object_name_ext)(device, p_name_info) - } - #[doc = ""] - pub unsafe fn set_debug_utils_object_tag_ext( - &self, - device: Device, - p_tag_info: *const DebugUtilsObjectTagInfoEXT, - ) -> Result { - (self.set_debug_utils_object_tag_ext)(device, p_tag_info) - } - #[doc = ""] - pub unsafe fn queue_begin_debug_utils_label_ext( - &self, - queue: Queue, - p_label_info: *const DebugUtilsLabelEXT, - ) { - (self.queue_begin_debug_utils_label_ext)(queue, p_label_info) - } - #[doc = ""] - pub unsafe fn queue_end_debug_utils_label_ext(&self, queue: Queue) { - (self.queue_end_debug_utils_label_ext)(queue) - } - #[doc = ""] - pub unsafe fn queue_insert_debug_utils_label_ext( - &self, - queue: Queue, - p_label_info: *const DebugUtilsLabelEXT, - ) { - (self.queue_insert_debug_utils_label_ext)(queue, p_label_info) - } - #[doc = ""] - pub unsafe fn cmd_begin_debug_utils_label_ext( - &self, - command_buffer: CommandBuffer, - p_label_info: *const DebugUtilsLabelEXT, - ) { - (self.cmd_begin_debug_utils_label_ext)(command_buffer, p_label_info) - } - #[doc = ""] - pub unsafe fn cmd_end_debug_utils_label_ext(&self, command_buffer: CommandBuffer) { - (self.cmd_end_debug_utils_label_ext)(command_buffer) - } - #[doc = ""] - pub unsafe fn cmd_insert_debug_utils_label_ext( - &self, - command_buffer: CommandBuffer, - p_label_info: *const DebugUtilsLabelEXT, - ) { - (self.cmd_insert_debug_utils_label_ext)(command_buffer, p_label_info) - } - #[doc = ""] - pub unsafe fn create_debug_utils_messenger_ext( - &self, - instance: Instance, - p_create_info: *const DebugUtilsMessengerCreateInfoEXT, - p_allocator: *const AllocationCallbacks, - p_messenger: *mut DebugUtilsMessengerEXT, - ) -> Result { - (self.create_debug_utils_messenger_ext)(instance, p_create_info, p_allocator, p_messenger) - } - #[doc = ""] - pub unsafe fn destroy_debug_utils_messenger_ext( - &self, - instance: Instance, - messenger: DebugUtilsMessengerEXT, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_debug_utils_messenger_ext)(instance, messenger, p_allocator) - } - #[doc = ""] - pub unsafe fn submit_debug_utils_message_ext( - &self, - instance: Instance, - message_severity: DebugUtilsMessageSeverityFlagsEXT, - message_types: DebugUtilsMessageTypeFlagsEXT, - p_callback_data: *const DebugUtilsMessengerCallbackDataEXT, - ) { - (self.submit_debug_utils_message_ext)( - instance, - message_severity, - message_types, - p_callback_data, - ) - } } #[doc = "Generated from 'VK_EXT_debug_utils'"] impl ObjectType { @@ -9643,14 +7834,14 @@ impl StructureType { pub const DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: Self = Self(1_000_128_004); } impl AndroidExternalMemoryAndroidHardwareBufferFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_ANDROID_external_memory_android_hardware_buffer\0", ) } } - pub const SPEC_VERSION: u32 = 4u32; + pub const SPEC_VERSION: u32 = 5u32; } #[allow(non_camel_case_types)] pub type PFN_vkGetAndroidHardwareBufferPropertiesANDROID = unsafe extern "system" fn( @@ -9722,24 +7913,6 @@ impl AndroidExternalMemoryAndroidHardwareBufferFn { }, } } - #[doc = ""] - pub unsafe fn get_android_hardware_buffer_properties_android( - &self, - device: Device, - buffer: *const AHardwareBuffer, - p_properties: *mut AndroidHardwareBufferPropertiesANDROID, - ) -> Result { - (self.get_android_hardware_buffer_properties_android)(device, buffer, p_properties) - } - #[doc = ""] - pub unsafe fn get_memory_android_hardware_buffer_android( - &self, - device: Device, - p_info: *const MemoryGetAndroidHardwareBufferInfoANDROID, - p_buffer: *mut *mut AHardwareBuffer, - ) -> Result { - (self.get_memory_android_hardware_buffer_android)(device, p_info, p_buffer) - } } #[doc = "Generated from 'VK_ANDROID_external_memory_android_hardware_buffer'"] impl ExternalMemoryHandleTypeFlags { @@ -9756,7 +7929,7 @@ impl StructureType { pub const ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: Self = Self(1_000_129_006); } impl ExtSamplerFilterMinmaxFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_sampler_filter_minmax\0") } @@ -9793,7 +7966,7 @@ impl StructureType { Self::SAMPLER_REDUCTION_MODE_CREATE_INFO; } impl KhrStorageBufferStorageClassFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_storage_buffer_storage_class\0", @@ -9815,7 +7988,7 @@ impl KhrStorageBufferStorageClassFn { } } impl AmdGpuShaderInt16Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_gpu_shader_int16\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -9833,7 +8006,7 @@ impl AmdGpuShaderInt16Fn { } } impl AmdExtension134Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_134\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -9851,7 +8024,7 @@ impl AmdExtension134Fn { } } impl AmdExtension135Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_135\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -9869,7 +8042,7 @@ impl AmdExtension135Fn { } } impl AmdExtension136Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_136\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -9887,7 +8060,7 @@ impl AmdExtension136Fn { } } impl AmdMixedAttachmentSamplesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_mixed_attachment_samples\0") } @@ -9907,7 +8080,7 @@ impl AmdMixedAttachmentSamplesFn { } } impl AmdShaderFragmentMaskFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_fragment_mask\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -9925,7 +8098,7 @@ impl AmdShaderFragmentMaskFn { } } impl ExtInlineUniformBlockFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_inline_uniform_block\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -9944,17 +8117,21 @@ impl ExtInlineUniformBlockFn { } #[doc = "Generated from 'VK_EXT_inline_uniform_block'"] impl DescriptorType { - pub const INLINE_UNIFORM_BLOCK_EXT: Self = Self(1_000_138_000); + pub const INLINE_UNIFORM_BLOCK_EXT: Self = Self::INLINE_UNIFORM_BLOCK; } #[doc = "Generated from 'VK_EXT_inline_uniform_block'"] impl StructureType { - pub const PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: Self = Self(1_000_138_000); - pub const PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: Self = Self(1_000_138_001); - pub const WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: Self = Self(1_000_138_002); - pub const DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: Self = Self(1_000_138_003); + pub const PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: Self = + Self::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; + pub const PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: Self = + Self::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES; + pub const WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: Self = + Self::WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK; + pub const DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: Self = + Self::DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO; } impl AmdExtension140Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_140\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -9972,7 +8149,7 @@ impl AmdExtension140Fn { } } impl ExtShaderStencilExportFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_stencil_export\0") } @@ -9992,7 +8169,7 @@ impl ExtShaderStencilExportFn { } } impl AmdExtension142Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_142\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -10010,7 +8187,7 @@ impl AmdExtension142Fn { } } impl AmdExtension143Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_143\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -10028,7 +8205,7 @@ impl AmdExtension143Fn { } } impl ExtSampleLocationsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_sample_locations\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -10101,27 +8278,6 @@ impl ExtSampleLocationsFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_sample_locations_ext( - &self, - command_buffer: CommandBuffer, - p_sample_locations_info: *const SampleLocationsInfoEXT, - ) { - (self.cmd_set_sample_locations_ext)(command_buffer, p_sample_locations_info) - } - #[doc = ""] - pub unsafe fn get_physical_device_multisample_properties_ext( - &self, - physical_device: PhysicalDevice, - samples: SampleCountFlags, - p_multisample_properties: *mut MultisamplePropertiesEXT, - ) { - (self.get_physical_device_multisample_properties_ext)( - physical_device, - samples, - p_multisample_properties, - ) - } } #[doc = "Generated from 'VK_EXT_sample_locations'"] impl DynamicState { @@ -10140,7 +8296,7 @@ impl StructureType { pub const MULTISAMPLE_PROPERTIES_EXT: Self = Self(1_000_143_004); } impl KhrRelaxedBlockLayoutFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_relaxed_block_layout\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -10158,7 +8314,7 @@ impl KhrRelaxedBlockLayoutFn { } } impl KhrGetMemoryRequirements2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_get_memory_requirements2\0") } @@ -10264,39 +8420,6 @@ impl KhrGetMemoryRequirements2Fn { }, } } - #[doc = ""] - pub unsafe fn get_image_memory_requirements2_khr( - &self, - device: Device, - p_info: *const ImageMemoryRequirementsInfo2, - p_memory_requirements: *mut MemoryRequirements2, - ) { - (self.get_image_memory_requirements2_khr)(device, p_info, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_buffer_memory_requirements2_khr( - &self, - device: Device, - p_info: *const BufferMemoryRequirementsInfo2, - p_memory_requirements: *mut MemoryRequirements2, - ) { - (self.get_buffer_memory_requirements2_khr)(device, p_info, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_image_sparse_memory_requirements2_khr( - &self, - device: Device, - p_info: *const ImageSparseMemoryRequirementsInfo2, - p_sparse_memory_requirement_count: *mut u32, - p_sparse_memory_requirements: *mut SparseImageMemoryRequirements2, - ) { - (self.get_image_sparse_memory_requirements2_khr)( - device, - p_info, - p_sparse_memory_requirement_count, - p_sparse_memory_requirements, - ) - } } #[doc = "Generated from 'VK_KHR_get_memory_requirements2'"] impl StructureType { @@ -10309,7 +8432,7 @@ impl StructureType { Self::SPARSE_IMAGE_MEMORY_REQUIREMENTS_2; } impl KhrImageFormatListFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_image_format_list\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -10331,7 +8454,7 @@ impl StructureType { pub const IMAGE_FORMAT_LIST_CREATE_INFO_KHR: Self = Self::IMAGE_FORMAT_LIST_CREATE_INFO; } impl ExtBlendOperationAdvancedFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_blend_operation_advanced\0") } @@ -10410,7 +8533,7 @@ impl StructureType { pub const PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: Self = Self(1_000_148_002); } impl NvFragmentCoverageToColorFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_fragment_coverage_to_color\0") } @@ -10434,7 +8557,7 @@ impl StructureType { pub const PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: Self = Self(1_000_149_000); } impl KhrAccelerationStructureFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_acceleration_structure\0") } @@ -10934,210 +9057,6 @@ impl KhrAccelerationStructureFn { }, } } - #[doc = ""] - pub unsafe fn create_acceleration_structure_khr( - &self, - device: Device, - p_create_info: *const AccelerationStructureCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_acceleration_structure: *mut AccelerationStructureKHR, - ) -> Result { - (self.create_acceleration_structure_khr)( - device, - p_create_info, - p_allocator, - p_acceleration_structure, - ) - } - #[doc = ""] - pub unsafe fn destroy_acceleration_structure_khr( - &self, - device: Device, - acceleration_structure: AccelerationStructureKHR, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_acceleration_structure_khr)(device, acceleration_structure, p_allocator) - } - #[doc = ""] - pub unsafe fn cmd_build_acceleration_structures_khr( - &self, - command_buffer: CommandBuffer, - info_count: u32, - p_infos: *const AccelerationStructureBuildGeometryInfoKHR, - pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR, - ) { - (self.cmd_build_acceleration_structures_khr)( - command_buffer, - info_count, - p_infos, - pp_build_range_infos, - ) - } - #[doc = ""] - pub unsafe fn cmd_build_acceleration_structures_indirect_khr( - &self, - command_buffer: CommandBuffer, - info_count: u32, - p_infos: *const AccelerationStructureBuildGeometryInfoKHR, - p_indirect_device_addresses: *const DeviceAddress, - p_indirect_strides: *const u32, - pp_max_primitive_counts: *const *const u32, - ) { - (self.cmd_build_acceleration_structures_indirect_khr)( - command_buffer, - info_count, - p_infos, - p_indirect_device_addresses, - p_indirect_strides, - pp_max_primitive_counts, - ) - } - #[doc = ""] - pub unsafe fn build_acceleration_structures_khr( - &self, - device: Device, - deferred_operation: DeferredOperationKHR, - info_count: u32, - p_infos: *const AccelerationStructureBuildGeometryInfoKHR, - pp_build_range_infos: *const *const AccelerationStructureBuildRangeInfoKHR, - ) -> Result { - (self.build_acceleration_structures_khr)( - device, - deferred_operation, - info_count, - p_infos, - pp_build_range_infos, - ) - } - #[doc = ""] - pub unsafe fn copy_acceleration_structure_khr( - &self, - device: Device, - deferred_operation: DeferredOperationKHR, - p_info: *const CopyAccelerationStructureInfoKHR, - ) -> Result { - (self.copy_acceleration_structure_khr)(device, deferred_operation, p_info) - } - #[doc = ""] - pub unsafe fn copy_acceleration_structure_to_memory_khr( - &self, - device: Device, - deferred_operation: DeferredOperationKHR, - p_info: *const CopyAccelerationStructureToMemoryInfoKHR, - ) -> Result { - (self.copy_acceleration_structure_to_memory_khr)(device, deferred_operation, p_info) - } - #[doc = ""] - pub unsafe fn copy_memory_to_acceleration_structure_khr( - &self, - device: Device, - deferred_operation: DeferredOperationKHR, - p_info: *const CopyMemoryToAccelerationStructureInfoKHR, - ) -> Result { - (self.copy_memory_to_acceleration_structure_khr)(device, deferred_operation, p_info) - } - #[doc = ""] - pub unsafe fn write_acceleration_structures_properties_khr( - &self, - device: Device, - acceleration_structure_count: u32, - p_acceleration_structures: *const AccelerationStructureKHR, - query_type: QueryType, - data_size: usize, - p_data: *mut c_void, - stride: usize, - ) -> Result { - (self.write_acceleration_structures_properties_khr)( - device, - acceleration_structure_count, - p_acceleration_structures, - query_type, - data_size, - p_data, - stride, - ) - } - #[doc = ""] - pub unsafe fn cmd_copy_acceleration_structure_khr( - &self, - command_buffer: CommandBuffer, - p_info: *const CopyAccelerationStructureInfoKHR, - ) { - (self.cmd_copy_acceleration_structure_khr)(command_buffer, p_info) - } - #[doc = ""] - pub unsafe fn cmd_copy_acceleration_structure_to_memory_khr( - &self, - command_buffer: CommandBuffer, - p_info: *const CopyAccelerationStructureToMemoryInfoKHR, - ) { - (self.cmd_copy_acceleration_structure_to_memory_khr)(command_buffer, p_info) - } - #[doc = ""] - pub unsafe fn cmd_copy_memory_to_acceleration_structure_khr( - &self, - command_buffer: CommandBuffer, - p_info: *const CopyMemoryToAccelerationStructureInfoKHR, - ) { - (self.cmd_copy_memory_to_acceleration_structure_khr)(command_buffer, p_info) - } - #[doc = ""] - pub unsafe fn get_acceleration_structure_device_address_khr( - &self, - device: Device, - p_info: *const AccelerationStructureDeviceAddressInfoKHR, - ) -> DeviceAddress { - (self.get_acceleration_structure_device_address_khr)(device, p_info) - } - #[doc = ""] - pub unsafe fn cmd_write_acceleration_structures_properties_khr( - &self, - command_buffer: CommandBuffer, - acceleration_structure_count: u32, - p_acceleration_structures: *const AccelerationStructureKHR, - query_type: QueryType, - query_pool: QueryPool, - first_query: u32, - ) { - (self.cmd_write_acceleration_structures_properties_khr)( - command_buffer, - acceleration_structure_count, - p_acceleration_structures, - query_type, - query_pool, - first_query, - ) - } - #[doc = ""] - pub unsafe fn get_device_acceleration_structure_compatibility_khr( - &self, - device: Device, - p_version_info: *const AccelerationStructureVersionInfoKHR, - p_compatibility: *mut AccelerationStructureCompatibilityKHR, - ) { - (self.get_device_acceleration_structure_compatibility_khr)( - device, - p_version_info, - p_compatibility, - ) - } - #[doc = ""] - pub unsafe fn get_acceleration_structure_build_sizes_khr( - &self, - device: Device, - build_type: AccelerationStructureBuildTypeKHR, - p_build_info: *const AccelerationStructureBuildGeometryInfoKHR, - p_max_primitive_counts: *const u32, - p_size_info: *mut AccelerationStructureBuildSizesInfoKHR, - ) { - (self.get_acceleration_structure_build_sizes_khr)( - device, - build_type, - p_build_info, - p_max_primitive_counts, - p_size_info, - ) - } } #[doc = "Generated from 'VK_KHR_acceleration_structure'"] impl AccessFlags { @@ -11164,8 +9083,8 @@ impl FormatFeatureFlags { Self(0b10_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_acceleration_structure'"] -impl FormatFeatureFlags2KHR { - pub const ACCELERATION_STRUCTURE_VERTEX_BUFFER: Self = +impl FormatFeatureFlags2 { + pub const ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_acceleration_structure'"] @@ -11204,7 +9123,7 @@ impl StructureType { pub const ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR: Self = Self(1_000_150_020); } impl KhrRayTracingPipelineFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_ray_tracing_pipeline\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -11448,125 +9367,6 @@ impl KhrRayTracingPipelineFn { }, } } - #[doc = ""] - pub unsafe fn cmd_trace_rays_khr( - &self, - command_buffer: CommandBuffer, - p_raygen_shader_binding_table: *const StridedDeviceAddressRegionKHR, - p_miss_shader_binding_table: *const StridedDeviceAddressRegionKHR, - p_hit_shader_binding_table: *const StridedDeviceAddressRegionKHR, - p_callable_shader_binding_table: *const StridedDeviceAddressRegionKHR, - width: u32, - height: u32, - depth: u32, - ) { - (self.cmd_trace_rays_khr)( - command_buffer, - p_raygen_shader_binding_table, - p_miss_shader_binding_table, - p_hit_shader_binding_table, - p_callable_shader_binding_table, - width, - height, - depth, - ) - } - #[doc = ""] - pub unsafe fn create_ray_tracing_pipelines_khr( - &self, - device: Device, - deferred_operation: DeferredOperationKHR, - pipeline_cache: PipelineCache, - create_info_count: u32, - p_create_infos: *const RayTracingPipelineCreateInfoKHR, - p_allocator: *const AllocationCallbacks, - p_pipelines: *mut Pipeline, - ) -> Result { - (self.create_ray_tracing_pipelines_khr)( - device, - deferred_operation, - pipeline_cache, - create_info_count, - p_create_infos, - p_allocator, - p_pipelines, - ) - } - #[doc = ""] - pub unsafe fn get_ray_tracing_shader_group_handles_khr( - &self, - device: Device, - pipeline: Pipeline, - first_group: u32, - group_count: u32, - data_size: usize, - p_data: *mut c_void, - ) -> Result { - (self.get_ray_tracing_shader_group_handles_khr)( - device, - pipeline, - first_group, - group_count, - data_size, - p_data, - ) - } - #[doc = ""] - pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles_khr( - &self, - device: Device, - pipeline: Pipeline, - first_group: u32, - group_count: u32, - data_size: usize, - p_data: *mut c_void, - ) -> Result { - (self.get_ray_tracing_capture_replay_shader_group_handles_khr)( - device, - pipeline, - first_group, - group_count, - data_size, - p_data, - ) - } - #[doc = ""] - pub unsafe fn cmd_trace_rays_indirect_khr( - &self, - command_buffer: CommandBuffer, - p_raygen_shader_binding_table: *const StridedDeviceAddressRegionKHR, - p_miss_shader_binding_table: *const StridedDeviceAddressRegionKHR, - p_hit_shader_binding_table: *const StridedDeviceAddressRegionKHR, - p_callable_shader_binding_table: *const StridedDeviceAddressRegionKHR, - indirect_device_address: DeviceAddress, - ) { - (self.cmd_trace_rays_indirect_khr)( - command_buffer, - p_raygen_shader_binding_table, - p_miss_shader_binding_table, - p_hit_shader_binding_table, - p_callable_shader_binding_table, - indirect_device_address, - ) - } - #[doc = ""] - pub unsafe fn get_ray_tracing_shader_group_stack_size_khr( - &self, - device: Device, - pipeline: Pipeline, - group: u32, - group_shader: ShaderGroupShaderKHR, - ) -> DeviceSize { - (self.get_ray_tracing_shader_group_stack_size_khr)(device, pipeline, group, group_shader) - } - #[doc = ""] - pub unsafe fn cmd_set_ray_tracing_pipeline_stack_size_khr( - &self, - command_buffer: CommandBuffer, - pipeline_stack_size: u32, - ) { - (self.cmd_set_ray_tracing_pipeline_stack_size_khr)(command_buffer, pipeline_stack_size) - } } #[doc = "Generated from 'VK_KHR_ray_tracing_pipeline'"] impl BufferUsageFlags { @@ -11613,7 +9413,7 @@ impl StructureType { pub const RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR: Self = Self(1_000_150_018); } impl KhrRayQueryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_ray_query\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -11635,7 +9435,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: Self = Self(1_000_348_013); } impl NvExtension152Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_152\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -11653,7 +9453,7 @@ impl NvExtension152Fn { } } impl NvFramebufferMixedSamplesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_framebuffer_mixed_samples\0") } @@ -11677,7 +9477,7 @@ impl StructureType { pub const PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: Self = Self(1_000_152_000); } impl NvFillRectangleFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_fill_rectangle\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -11699,7 +9499,7 @@ impl PolygonMode { pub const FILL_RECTANGLE_NV: Self = Self(1_000_153_000); } impl NvShaderSmBuiltinsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_shader_sm_builtins\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -11722,7 +9522,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: Self = Self(1_000_154_001); } impl ExtPostDepthCoverageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_post_depth_coverage\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -11740,7 +9540,7 @@ impl ExtPostDepthCoverageFn { } } impl KhrSamplerYcbcrConversionFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_sampler_ycbcr_conversion\0") } @@ -11818,30 +9618,6 @@ impl KhrSamplerYcbcrConversionFn { }, } } - #[doc = ""] - pub unsafe fn create_sampler_ycbcr_conversion_khr( - &self, - device: Device, - p_create_info: *const SamplerYcbcrConversionCreateInfo, - p_allocator: *const AllocationCallbacks, - p_ycbcr_conversion: *mut SamplerYcbcrConversion, - ) -> Result { - (self.create_sampler_ycbcr_conversion_khr)( - device, - p_create_info, - p_allocator, - p_ycbcr_conversion, - ) - } - #[doc = ""] - pub unsafe fn destroy_sampler_ycbcr_conversion_khr( - &self, - device: Device, - ycbcr_conversion: SamplerYcbcrConversion, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_sampler_ycbcr_conversion_khr)(device, ycbcr_conversion, p_allocator) - } } #[doc = "Generated from 'VK_KHR_sampler_ycbcr_conversion'"] impl ChromaLocation { @@ -11960,7 +9736,7 @@ impl StructureType { Self::SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES; } impl KhrBindMemory2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_bind_memory2\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -12032,24 +9808,6 @@ impl KhrBindMemory2Fn { }, } } - #[doc = ""] - pub unsafe fn bind_buffer_memory2_khr( - &self, - device: Device, - bind_info_count: u32, - p_bind_infos: *const BindBufferMemoryInfo, - ) -> Result { - (self.bind_buffer_memory2_khr)(device, bind_info_count, p_bind_infos) - } - #[doc = ""] - pub unsafe fn bind_image_memory2_khr( - &self, - device: Device, - bind_info_count: u32, - p_bind_infos: *const BindImageMemoryInfo, - ) -> Result { - (self.bind_image_memory2_khr)(device, bind_info_count, p_bind_infos) - } } #[doc = "Generated from 'VK_KHR_bind_memory2'"] impl ImageCreateFlags { @@ -12061,7 +9819,7 @@ impl StructureType { pub const BIND_IMAGE_MEMORY_INFO_KHR: Self = Self::BIND_IMAGE_MEMORY_INFO; } impl ExtImageDrmFormatModifierFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_image_drm_format_modifier\0") } @@ -12109,15 +9867,6 @@ impl ExtImageDrmFormatModifierFn { }, } } - #[doc = ""] - pub unsafe fn get_image_drm_format_modifier_properties_ext( - &self, - device: Device, - image: Image, - p_properties: *mut ImageDrmFormatModifierPropertiesEXT, - ) -> Result { - (self.get_image_drm_format_modifier_properties_ext)(device, image, p_properties) - } } #[doc = "Generated from 'VK_EXT_image_drm_format_modifier'"] impl ImageAspectFlags { @@ -12144,7 +9893,7 @@ impl StructureType { pub const DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: Self = Self(1_000_158_006); } impl ExtExtension160Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_160\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -12162,7 +9911,7 @@ impl ExtExtension160Fn { } } impl ExtValidationCacheFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_validation_cache\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -12298,45 +10047,6 @@ impl ExtValidationCacheFn { }, } } - #[doc = ""] - pub unsafe fn create_validation_cache_ext( - &self, - device: Device, - p_create_info: *const ValidationCacheCreateInfoEXT, - p_allocator: *const AllocationCallbacks, - p_validation_cache: *mut ValidationCacheEXT, - ) -> Result { - (self.create_validation_cache_ext)(device, p_create_info, p_allocator, p_validation_cache) - } - #[doc = ""] - pub unsafe fn destroy_validation_cache_ext( - &self, - device: Device, - validation_cache: ValidationCacheEXT, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_validation_cache_ext)(device, validation_cache, p_allocator) - } - #[doc = ""] - pub unsafe fn merge_validation_caches_ext( - &self, - device: Device, - dst_cache: ValidationCacheEXT, - src_cache_count: u32, - p_src_caches: *const ValidationCacheEXT, - ) -> Result { - (self.merge_validation_caches_ext)(device, dst_cache, src_cache_count, p_src_caches) - } - #[doc = ""] - pub unsafe fn get_validation_cache_data_ext( - &self, - device: Device, - validation_cache: ValidationCacheEXT, - p_data_size: *mut usize, - p_data: *mut c_void, - ) -> Result { - (self.get_validation_cache_data_ext)(device, validation_cache, p_data_size, p_data) - } } #[doc = "Generated from 'VK_EXT_validation_cache'"] impl ObjectType { @@ -12348,7 +10058,7 @@ impl StructureType { pub const SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: Self = Self(1_000_160_001); } impl ExtDescriptorIndexingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_descriptor_indexing\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -12398,7 +10108,7 @@ impl StructureType { Self::DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT; } impl ExtShaderViewportIndexLayerFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_viewport_index_layer\0") } @@ -12418,7 +10128,7 @@ impl ExtShaderViewportIndexLayerFn { } } impl KhrPortabilitySubsetFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_portability_subset\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -12441,7 +10151,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: Self = Self(1_000_163_001); } impl NvShadingRateImageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_shading_rate_image\0") } } pub const SPEC_VERSION: u32 = 3u32; @@ -12547,45 +10257,6 @@ impl NvShadingRateImageFn { }, } } - #[doc = ""] - pub unsafe fn cmd_bind_shading_rate_image_nv( - &self, - command_buffer: CommandBuffer, - image_view: ImageView, - image_layout: ImageLayout, - ) { - (self.cmd_bind_shading_rate_image_nv)(command_buffer, image_view, image_layout) - } - #[doc = ""] - pub unsafe fn cmd_set_viewport_shading_rate_palette_nv( - &self, - command_buffer: CommandBuffer, - first_viewport: u32, - viewport_count: u32, - p_shading_rate_palettes: *const ShadingRatePaletteNV, - ) { - (self.cmd_set_viewport_shading_rate_palette_nv)( - command_buffer, - first_viewport, - viewport_count, - p_shading_rate_palettes, - ) - } - #[doc = ""] - pub unsafe fn cmd_set_coarse_sample_order_nv( - &self, - command_buffer: CommandBuffer, - sample_order_type: CoarseSampleOrderTypeNV, - custom_sample_order_count: u32, - p_custom_sample_orders: *const CoarseSampleOrderCustomNV, - ) { - (self.cmd_set_coarse_sample_order_nv)( - command_buffer, - sample_order_type, - custom_sample_order_count, - p_custom_sample_orders, - ) - } } #[doc = "Generated from 'VK_NV_shading_rate_image'"] impl AccessFlags { @@ -12617,7 +10288,7 @@ impl StructureType { Self(1_000_164_005); } impl NvRayTracingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_ray_tracing\0") } } pub const SPEC_VERSION: u32 = 3u32; @@ -13013,205 +10684,6 @@ impl NvRayTracingFn { }, } } - #[doc = ""] - pub unsafe fn create_acceleration_structure_nv( - &self, - device: Device, - p_create_info: *const AccelerationStructureCreateInfoNV, - p_allocator: *const AllocationCallbacks, - p_acceleration_structure: *mut AccelerationStructureNV, - ) -> Result { - (self.create_acceleration_structure_nv)( - device, - p_create_info, - p_allocator, - p_acceleration_structure, - ) - } - #[doc = ""] - pub unsafe fn destroy_acceleration_structure_nv( - &self, - device: Device, - acceleration_structure: AccelerationStructureNV, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_acceleration_structure_nv)(device, acceleration_structure, p_allocator) - } - #[doc = ""] - pub unsafe fn get_acceleration_structure_memory_requirements_nv( - &self, - device: Device, - p_info: *const AccelerationStructureMemoryRequirementsInfoNV, - p_memory_requirements: *mut MemoryRequirements2KHR, - ) { - (self.get_acceleration_structure_memory_requirements_nv)( - device, - p_info, - p_memory_requirements, - ) - } - #[doc = ""] - pub unsafe fn bind_acceleration_structure_memory_nv( - &self, - device: Device, - bind_info_count: u32, - p_bind_infos: *const BindAccelerationStructureMemoryInfoNV, - ) -> Result { - (self.bind_acceleration_structure_memory_nv)(device, bind_info_count, p_bind_infos) - } - #[doc = ""] - pub unsafe fn cmd_build_acceleration_structure_nv( - &self, - command_buffer: CommandBuffer, - p_info: *const AccelerationStructureInfoNV, - instance_data: Buffer, - instance_offset: DeviceSize, - update: Bool32, - dst: AccelerationStructureNV, - src: AccelerationStructureNV, - scratch: Buffer, - scratch_offset: DeviceSize, - ) { - (self.cmd_build_acceleration_structure_nv)( - command_buffer, - p_info, - instance_data, - instance_offset, - update, - dst, - src, - scratch, - scratch_offset, - ) - } - #[doc = ""] - pub unsafe fn cmd_copy_acceleration_structure_nv( - &self, - command_buffer: CommandBuffer, - dst: AccelerationStructureNV, - src: AccelerationStructureNV, - mode: CopyAccelerationStructureModeKHR, - ) { - (self.cmd_copy_acceleration_structure_nv)(command_buffer, dst, src, mode) - } - #[doc = ""] - pub unsafe fn cmd_trace_rays_nv( - &self, - command_buffer: CommandBuffer, - raygen_shader_binding_table_buffer: Buffer, - raygen_shader_binding_offset: DeviceSize, - miss_shader_binding_table_buffer: Buffer, - miss_shader_binding_offset: DeviceSize, - miss_shader_binding_stride: DeviceSize, - hit_shader_binding_table_buffer: Buffer, - hit_shader_binding_offset: DeviceSize, - hit_shader_binding_stride: DeviceSize, - callable_shader_binding_table_buffer: Buffer, - callable_shader_binding_offset: DeviceSize, - callable_shader_binding_stride: DeviceSize, - width: u32, - height: u32, - depth: u32, - ) { - (self.cmd_trace_rays_nv)( - command_buffer, - raygen_shader_binding_table_buffer, - raygen_shader_binding_offset, - miss_shader_binding_table_buffer, - miss_shader_binding_offset, - miss_shader_binding_stride, - hit_shader_binding_table_buffer, - hit_shader_binding_offset, - hit_shader_binding_stride, - callable_shader_binding_table_buffer, - callable_shader_binding_offset, - callable_shader_binding_stride, - width, - height, - depth, - ) - } - #[doc = ""] - pub unsafe fn create_ray_tracing_pipelines_nv( - &self, - device: Device, - pipeline_cache: PipelineCache, - create_info_count: u32, - p_create_infos: *const RayTracingPipelineCreateInfoNV, - p_allocator: *const AllocationCallbacks, - p_pipelines: *mut Pipeline, - ) -> Result { - (self.create_ray_tracing_pipelines_nv)( - device, - pipeline_cache, - create_info_count, - p_create_infos, - p_allocator, - p_pipelines, - ) - } - #[doc = ""] - pub unsafe fn get_ray_tracing_shader_group_handles_nv( - &self, - device: Device, - pipeline: Pipeline, - first_group: u32, - group_count: u32, - data_size: usize, - p_data: *mut c_void, - ) -> Result { - (self.get_ray_tracing_shader_group_handles_nv)( - device, - pipeline, - first_group, - group_count, - data_size, - p_data, - ) - } - #[doc = ""] - pub unsafe fn get_acceleration_structure_handle_nv( - &self, - device: Device, - acceleration_structure: AccelerationStructureNV, - data_size: usize, - p_data: *mut c_void, - ) -> Result { - (self.get_acceleration_structure_handle_nv)( - device, - acceleration_structure, - data_size, - p_data, - ) - } - #[doc = ""] - pub unsafe fn cmd_write_acceleration_structures_properties_nv( - &self, - command_buffer: CommandBuffer, - acceleration_structure_count: u32, - p_acceleration_structures: *const AccelerationStructureNV, - query_type: QueryType, - query_pool: QueryPool, - first_query: u32, - ) { - (self.cmd_write_acceleration_structures_properties_nv)( - command_buffer, - acceleration_structure_count, - p_acceleration_structures, - query_type, - query_pool, - first_query, - ) - } - #[doc = ""] - pub unsafe fn compile_deferred_nv( - &self, - device: Device, - pipeline: Pipeline, - shader: u32, - ) -> Result { - (self.compile_deferred_nv)(device, pipeline, shader) - } } #[doc = "Generated from 'VK_NV_ray_tracing'"] impl AccelerationStructureTypeKHR { @@ -13320,7 +10792,7 @@ impl StructureType { pub const ACCELERATION_STRUCTURE_INFO_NV: Self = Self(1_000_165_012); } impl NvRepresentativeFragmentTestFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_representative_fragment_test\0") } @@ -13346,7 +10818,7 @@ impl StructureType { Self(1_000_166_001); } impl NvExtension168Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_168\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -13364,7 +10836,7 @@ impl NvExtension168Fn { } } impl KhrMaintenance3Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_maintenance3\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -13410,15 +10882,6 @@ impl KhrMaintenance3Fn { }, } } - #[doc = ""] - pub unsafe fn get_descriptor_set_layout_support_khr( - &self, - device: Device, - p_create_info: *const DescriptorSetLayoutCreateInfo, - p_support: *mut DescriptorSetLayoutSupport, - ) { - (self.get_descriptor_set_layout_support_khr)(device, p_create_info, p_support) - } } #[doc = "Generated from 'VK_KHR_maintenance3'"] impl StructureType { @@ -13427,7 +10890,7 @@ impl StructureType { pub const DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR: Self = Self::DESCRIPTOR_SET_LAYOUT_SUPPORT; } impl KhrDrawIndirectCountFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_draw_indirect_count\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -13496,51 +10959,9 @@ impl KhrDrawIndirectCountFn { }, } } - #[doc = ""] - pub unsafe fn cmd_draw_indirect_count_khr( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - count_buffer: Buffer, - count_buffer_offset: DeviceSize, - max_draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indirect_count_khr)( - command_buffer, - buffer, - offset, - count_buffer, - count_buffer_offset, - max_draw_count, - stride, - ) - } - #[doc = ""] - pub unsafe fn cmd_draw_indexed_indirect_count_khr( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - count_buffer: Buffer, - count_buffer_offset: DeviceSize, - max_draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indexed_indirect_count_khr)( - command_buffer, - buffer, - offset, - count_buffer, - count_buffer_offset, - max_draw_count, - stride, - ) - } } impl ExtFilterCubicFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_filter_cubic\0") } } pub const SPEC_VERSION: u32 = 3u32; @@ -13571,7 +10992,7 @@ impl StructureType { pub const FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: Self = Self(1_000_170_001); } impl QcomRenderPassShaderResolveFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_render_pass_shader_resolve\0") } @@ -13596,7 +11017,7 @@ impl SubpassDescriptionFlags { pub const SHADER_RESOLVE_QCOM: Self = Self(0b1000); } impl QcomExtension173Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_173\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -13623,7 +11044,7 @@ impl ImageUsageFlags { pub const RESERVED_17_QCOM: Self = Self(0b10_0000_0000_0000_0000); } impl QcomExtension174Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_174\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -13641,7 +11062,7 @@ impl QcomExtension174Fn { } } impl ExtGlobalPriorityFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_global_priority\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -13660,14 +11081,15 @@ impl ExtGlobalPriorityFn { } #[doc = "Generated from 'VK_EXT_global_priority'"] impl Result { - pub const ERROR_NOT_PERMITTED_EXT: Self = Self(-1_000_174_001); + pub const ERROR_NOT_PERMITTED_EXT: Self = Self::ERROR_NOT_PERMITTED_KHR; } #[doc = "Generated from 'VK_EXT_global_priority'"] impl StructureType { - pub const DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: Self = Self(1_000_174_000); + pub const DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: Self = + Self::DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR; } impl KhrShaderSubgroupExtendedTypesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_shader_subgroup_extended_types\0", @@ -13694,7 +11116,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES; } impl ExtExtension177Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_177\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -13712,7 +11134,7 @@ impl ExtExtension177Fn { } } impl Khr8bitStorageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_8bit_storage\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -13735,7 +11157,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; } impl ExtExternalMemoryHostFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_external_memory_host\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -13783,21 +11205,6 @@ impl ExtExternalMemoryHostFn { }, } } - #[doc = ""] - pub unsafe fn get_memory_host_pointer_properties_ext( - &self, - device: Device, - handle_type: ExternalMemoryHandleTypeFlags, - p_host_pointer: *const c_void, - p_memory_host_pointer_properties: *mut MemoryHostPointerPropertiesEXT, - ) -> Result { - (self.get_memory_host_pointer_properties_ext)( - device, - handle_type, - p_host_pointer, - p_memory_host_pointer_properties, - ) - } } #[doc = "Generated from 'VK_EXT_external_memory_host'"] impl ExternalMemoryHandleTypeFlags { @@ -13811,7 +11218,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: Self = Self(1_000_178_002); } impl AmdBufferMarkerFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_buffer_marker\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -13860,26 +11267,9 @@ impl AmdBufferMarkerFn { }, } } - #[doc = ""] - pub unsafe fn cmd_write_buffer_marker_amd( - &self, - command_buffer: CommandBuffer, - pipeline_stage: PipelineStageFlags, - dst_buffer: Buffer, - dst_offset: DeviceSize, - marker: u32, - ) { - (self.cmd_write_buffer_marker_amd)( - command_buffer, - pipeline_stage, - dst_buffer, - dst_offset, - marker, - ) - } } impl KhrShaderAtomicInt64Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_atomic_int64\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -13902,7 +11292,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; } impl KhrShaderClockFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_clock\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -13924,7 +11314,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: Self = Self(1_000_181_000); } impl AmdExtension183Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_183\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -13942,7 +11332,7 @@ impl AmdExtension183Fn { } } impl AmdPipelineCompilerControlFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_pipeline_compiler_control\0") } @@ -13966,7 +11356,7 @@ impl StructureType { pub const PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: Self = Self(1_000_183_000); } impl ExtCalibratedTimestampsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_calibrated_timestamps\0") } @@ -14047,43 +11437,13 @@ impl ExtCalibratedTimestampsFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_calibrateable_time_domains_ext( - &self, - physical_device: PhysicalDevice, - p_time_domain_count: *mut u32, - p_time_domains: *mut TimeDomainEXT, - ) -> Result { - (self.get_physical_device_calibrateable_time_domains_ext)( - physical_device, - p_time_domain_count, - p_time_domains, - ) - } - #[doc = ""] - pub unsafe fn get_calibrated_timestamps_ext( - &self, - device: Device, - timestamp_count: u32, - p_timestamp_infos: *const CalibratedTimestampInfoEXT, - p_timestamps: *mut u64, - p_max_deviation: *mut u64, - ) -> Result { - (self.get_calibrated_timestamps_ext)( - device, - timestamp_count, - p_timestamp_infos, - p_timestamps, - p_max_deviation, - ) - } } #[doc = "Generated from 'VK_EXT_calibrated_timestamps'"] impl StructureType { pub const CALIBRATED_TIMESTAMP_INFO_EXT: Self = Self(1_000_184_000); } impl AmdShaderCorePropertiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_core_properties\0") } @@ -14107,7 +11467,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: Self = Self(1_000_185_000); } impl AmdExtension187Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_187\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -14125,10 +11485,10 @@ impl AmdExtension187Fn { } } impl ExtVideoDecodeH265Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_video_decode_h265\0") } } - pub const SPEC_VERSION: u32 = 1u32; + pub const SPEC_VERSION: u32 = 2u32; } #[derive(Clone)] pub struct ExtVideoDecodeH265Fn {} @@ -14145,28 +11505,27 @@ impl ExtVideoDecodeH265Fn { #[doc = "Generated from 'VK_EXT_video_decode_h265'"] impl StructureType { pub const VIDEO_DECODE_H265_CAPABILITIES_EXT: Self = Self(1_000_187_000); - pub const VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: Self = Self(1_000_187_001); - pub const VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_187_002); - pub const VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_187_003); - pub const VIDEO_DECODE_H265_PROFILE_EXT: Self = Self(1_000_187_004); - pub const VIDEO_DECODE_H265_PICTURE_INFO_EXT: Self = Self(1_000_187_005); - pub const VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: Self = Self(1_000_187_006); + pub const VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: Self = Self(1_000_187_001); + pub const VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: Self = Self(1_000_187_002); + pub const VIDEO_DECODE_H265_PROFILE_EXT: Self = Self(1_000_187_003); + pub const VIDEO_DECODE_H265_PICTURE_INFO_EXT: Self = Self(1_000_187_004); + pub const VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: Self = Self(1_000_187_005); } #[doc = "Generated from 'VK_EXT_video_decode_h265'"] impl VideoCodecOperationFlagsKHR { pub const DECODE_H265_EXT: Self = Self(0b10); } -impl AmdExtension189Fn { - pub fn name() -> &'static ::std::ffi::CStr { - unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_189\0") } +impl KhrGlobalPriorityFn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_global_priority\0") } } - pub const SPEC_VERSION: u32 = 0u32; + pub const SPEC_VERSION: u32 = 1u32; } #[derive(Clone)] -pub struct AmdExtension189Fn {} -unsafe impl Send for AmdExtension189Fn {} -unsafe impl Sync for AmdExtension189Fn {} -impl AmdExtension189Fn { +pub struct KhrGlobalPriorityFn {} +unsafe impl Send for KhrGlobalPriorityFn {} +unsafe impl Sync for KhrGlobalPriorityFn {} +impl KhrGlobalPriorityFn { pub fn load(mut _f: F) -> Self where F: FnMut(&::std::ffi::CStr) -> *const c_void, @@ -14174,8 +11533,18 @@ impl AmdExtension189Fn { Self {} } } +#[doc = "Generated from 'VK_KHR_global_priority'"] +impl Result { + pub const ERROR_NOT_PERMITTED_KHR: Self = Self(-1_000_174_001); +} +#[doc = "Generated from 'VK_KHR_global_priority'"] +impl StructureType { + pub const DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR: Self = Self(1_000_174_000); + pub const PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR: Self = Self(1_000_388_000); + pub const QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR: Self = Self(1_000_388_001); +} impl AmdMemoryOverallocationBehaviorFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_AMD_memory_overallocation_behavior\0", @@ -14201,7 +11570,7 @@ impl StructureType { pub const DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: Self = Self(1_000_189_000); } impl ExtVertexAttributeDivisorFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_vertex_attribute_divisor\0") } @@ -14227,7 +11596,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: Self = Self(1_000_190_002); } impl GgpFrameTokenFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_frame_token\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -14249,7 +11618,7 @@ impl StructureType { pub const PRESENT_FRAME_TOKEN_GGP: Self = Self(1_000_191_000); } impl ExtPipelineCreationFeedbackFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_pipeline_creation_feedback\0") } @@ -14270,10 +11639,11 @@ impl ExtPipelineCreationFeedbackFn { } #[doc = "Generated from 'VK_EXT_pipeline_creation_feedback'"] impl StructureType { - pub const PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: Self = Self(1_000_192_000); + pub const PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: Self = + Self::PIPELINE_CREATION_FEEDBACK_CREATE_INFO; } impl GoogleExtension194Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_194\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -14291,7 +11661,7 @@ impl GoogleExtension194Fn { } } impl GoogleExtension195Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_195\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -14309,7 +11679,7 @@ impl GoogleExtension195Fn { } } impl GoogleExtension196Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_196\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -14331,7 +11701,7 @@ impl PipelineCacheCreateFlags { pub const RESERVED_1_EXT: Self = Self(0b10); } impl KhrDriverPropertiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_driver_properties\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -14368,7 +11738,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR: Self = Self::PHYSICAL_DEVICE_DRIVER_PROPERTIES; } impl KhrShaderFloatControlsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_float_controls\0") } @@ -14399,7 +11769,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES; } impl NvShaderSubgroupPartitionedFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_shader_subgroup_partitioned\0") } @@ -14423,7 +11793,7 @@ impl SubgroupFeatureFlags { pub const PARTITIONED_NV: Self = Self(0b1_0000_0000); } impl KhrDepthStencilResolveFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_depth_stencil_resolve\0") } @@ -14458,7 +11828,7 @@ impl StructureType { Self::SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE; } impl KhrSwapchainMutableFormatFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_swapchain_mutable_format\0") } @@ -14482,7 +11852,7 @@ impl SwapchainCreateFlagsKHR { pub const MUTABLE_FORMAT: Self = Self(0b100); } impl NvComputeShaderDerivativesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_compute_shader_derivatives\0") } @@ -14506,7 +11876,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: Self = Self(1_000_201_000); } impl NvMeshShaderFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_mesh_shader\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -14616,47 +11986,6 @@ impl NvMeshShaderFn { }, } } - #[doc = ""] - pub unsafe fn cmd_draw_mesh_tasks_nv( - &self, - command_buffer: CommandBuffer, - task_count: u32, - first_task: u32, - ) { - (self.cmd_draw_mesh_tasks_nv)(command_buffer, task_count, first_task) - } - #[doc = ""] - pub unsafe fn cmd_draw_mesh_tasks_indirect_nv( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_mesh_tasks_indirect_nv)(command_buffer, buffer, offset, draw_count, stride) - } - #[doc = ""] - pub unsafe fn cmd_draw_mesh_tasks_indirect_count_nv( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - count_buffer: Buffer, - count_buffer_offset: DeviceSize, - max_draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_mesh_tasks_indirect_count_nv)( - command_buffer, - buffer, - offset, - count_buffer, - count_buffer_offset, - max_draw_count, - stride, - ) - } } #[doc = "Generated from 'VK_NV_mesh_shader'"] impl PipelineStageFlags { @@ -14674,7 +12003,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: Self = Self(1_000_202_001); } impl NvFragmentShaderBarycentricFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_fragment_shader_barycentric\0") } @@ -14698,7 +12027,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: Self = Self(1_000_203_000); } impl NvShaderImageFootprintFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_shader_image_footprint\0") } @@ -14722,7 +12051,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: Self = Self(1_000_204_000); } impl NvScissorExclusiveFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_scissor_exclusive\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -14770,21 +12099,6 @@ impl NvScissorExclusiveFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_exclusive_scissor_nv( - &self, - command_buffer: CommandBuffer, - first_exclusive_scissor: u32, - exclusive_scissor_count: u32, - p_exclusive_scissors: *const Rect2D, - ) { - (self.cmd_set_exclusive_scissor_nv)( - command_buffer, - first_exclusive_scissor, - exclusive_scissor_count, - p_exclusive_scissors, - ) - } } #[doc = "Generated from 'VK_NV_scissor_exclusive'"] impl DynamicState { @@ -14796,7 +12110,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: Self = Self(1_000_205_002); } impl NvDeviceDiagnosticCheckpointsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_NV_device_diagnostic_checkpoints\0", @@ -14869,23 +12183,6 @@ impl NvDeviceDiagnosticCheckpointsFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_checkpoint_nv( - &self, - command_buffer: CommandBuffer, - p_checkpoint_marker: *const c_void, - ) { - (self.cmd_set_checkpoint_nv)(command_buffer, p_checkpoint_marker) - } - #[doc = ""] - pub unsafe fn get_queue_checkpoint_data_nv( - &self, - queue: Queue, - p_checkpoint_data_count: *mut u32, - p_checkpoint_data: *mut CheckpointDataNV, - ) { - (self.get_queue_checkpoint_data_nv)(queue, p_checkpoint_data_count, p_checkpoint_data) - } } #[doc = "Generated from 'VK_NV_device_diagnostic_checkpoints'"] impl StructureType { @@ -14893,7 +12190,7 @@ impl StructureType { pub const QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: Self = Self(1_000_206_001); } impl KhrTimelineSemaphoreFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_timeline_semaphore\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -14980,32 +12277,6 @@ impl KhrTimelineSemaphoreFn { }, } } - #[doc = ""] - pub unsafe fn get_semaphore_counter_value_khr( - &self, - device: Device, - semaphore: Semaphore, - p_value: *mut u64, - ) -> Result { - (self.get_semaphore_counter_value_khr)(device, semaphore, p_value) - } - #[doc = ""] - pub unsafe fn wait_semaphores_khr( - &self, - device: Device, - p_wait_info: *const SemaphoreWaitInfo, - timeout: u64, - ) -> Result { - (self.wait_semaphores_khr)(device, p_wait_info, timeout) - } - #[doc = ""] - pub unsafe fn signal_semaphore_khr( - &self, - device: Device, - p_signal_info: *const SemaphoreSignalInfo, - ) -> Result { - (self.signal_semaphore_khr)(device, p_signal_info) - } } #[doc = "Generated from 'VK_KHR_timeline_semaphore'"] impl SemaphoreType { @@ -15028,7 +12299,7 @@ impl StructureType { pub const SEMAPHORE_SIGNAL_INFO_KHR: Self = Self::SEMAPHORE_SIGNAL_INFO; } impl KhrExtension209Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_209\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -15046,7 +12317,7 @@ impl KhrExtension209Fn { } } impl IntelShaderIntegerFunctions2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_INTEL_shader_integer_functions2\0") } @@ -15070,7 +12341,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: Self = Self(1_000_209_000); } impl IntelPerformanceQueryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_INTEL_performance_query\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -15318,76 +12589,6 @@ impl IntelPerformanceQueryFn { }, } } - #[doc = ""] - pub unsafe fn initialize_performance_api_intel( - &self, - device: Device, - p_initialize_info: *const InitializePerformanceApiInfoINTEL, - ) -> Result { - (self.initialize_performance_api_intel)(device, p_initialize_info) - } - #[doc = ""] - pub unsafe fn uninitialize_performance_api_intel(&self, device: Device) { - (self.uninitialize_performance_api_intel)(device) - } - #[doc = ""] - pub unsafe fn cmd_set_performance_marker_intel( - &self, - command_buffer: CommandBuffer, - p_marker_info: *const PerformanceMarkerInfoINTEL, - ) -> Result { - (self.cmd_set_performance_marker_intel)(command_buffer, p_marker_info) - } - #[doc = ""] - pub unsafe fn cmd_set_performance_stream_marker_intel( - &self, - command_buffer: CommandBuffer, - p_marker_info: *const PerformanceStreamMarkerInfoINTEL, - ) -> Result { - (self.cmd_set_performance_stream_marker_intel)(command_buffer, p_marker_info) - } - #[doc = ""] - pub unsafe fn cmd_set_performance_override_intel( - &self, - command_buffer: CommandBuffer, - p_override_info: *const PerformanceOverrideInfoINTEL, - ) -> Result { - (self.cmd_set_performance_override_intel)(command_buffer, p_override_info) - } - #[doc = ""] - pub unsafe fn acquire_performance_configuration_intel( - &self, - device: Device, - p_acquire_info: *const PerformanceConfigurationAcquireInfoINTEL, - p_configuration: *mut PerformanceConfigurationINTEL, - ) -> Result { - (self.acquire_performance_configuration_intel)(device, p_acquire_info, p_configuration) - } - #[doc = ""] - pub unsafe fn release_performance_configuration_intel( - &self, - device: Device, - configuration: PerformanceConfigurationINTEL, - ) -> Result { - (self.release_performance_configuration_intel)(device, configuration) - } - #[doc = ""] - pub unsafe fn queue_set_performance_configuration_intel( - &self, - queue: Queue, - configuration: PerformanceConfigurationINTEL, - ) -> Result { - (self.queue_set_performance_configuration_intel)(queue, configuration) - } - #[doc = ""] - pub unsafe fn get_performance_parameter_intel( - &self, - device: Device, - parameter: PerformanceParameterTypeINTEL, - p_value: *mut PerformanceValueINTEL, - ) -> Result { - (self.get_performance_parameter_intel)(device, parameter, p_value) - } } #[doc = "Generated from 'VK_INTEL_performance_query'"] impl ObjectType { @@ -15407,7 +12608,7 @@ impl StructureType { pub const PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL: Self = Self(1_000_210_005); } impl KhrVulkanMemoryModelFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_vulkan_memory_model\0") } } pub const SPEC_VERSION: u32 = 3u32; @@ -15430,7 +12631,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES; } impl ExtPciBusInfoFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_pci_bus_info\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -15452,7 +12653,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: Self = Self(1_000_212_000); } impl AmdDisplayNativeHdrFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_display_native_hdr\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -15497,15 +12698,6 @@ impl AmdDisplayNativeHdrFn { }, } } - #[doc = ""] - pub unsafe fn set_local_dimming_amd( - &self, - device: Device, - swap_chain: SwapchainKHR, - local_dimming_enable: Bool32, - ) { - (self.set_local_dimming_amd)(device, swap_chain, local_dimming_enable) - } } #[doc = "Generated from 'VK_AMD_display_native_hdr'"] impl ColorSpaceKHR { @@ -15517,7 +12709,7 @@ impl StructureType { pub const SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: Self = Self(1_000_213_001); } impl FuchsiaImagepipeSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FUCHSIA_imagepipe_surface\0") } @@ -15567,23 +12759,13 @@ impl FuchsiaImagepipeSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_image_pipe_surface_fuchsia( - &self, - instance: Instance, - p_create_info: *const ImagePipeSurfaceCreateInfoFUCHSIA, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_image_pipe_surface_fuchsia)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_FUCHSIA_imagepipe_surface'"] impl StructureType { pub const IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA: Self = Self(1_000_214_000); } impl KhrShaderTerminateInvocationFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_terminate_invocation\0") } @@ -15604,10 +12786,11 @@ impl KhrShaderTerminateInvocationFn { } #[doc = "Generated from 'VK_KHR_shader_terminate_invocation'"] impl StructureType { - pub const PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: Self = Self(1_000_215_000); + pub const PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: Self = + Self::PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES; } impl GoogleExtension217Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_217\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -15625,7 +12808,7 @@ impl GoogleExtension217Fn { } } impl ExtMetalSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_metal_surface\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -15672,23 +12855,13 @@ impl ExtMetalSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_metal_surface_ext( - &self, - instance: Instance, - p_create_info: *const MetalSurfaceCreateInfoEXT, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_metal_surface_ext)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_EXT_metal_surface'"] impl StructureType { pub const METAL_SURFACE_CREATE_INFO_EXT: Self = Self(1_000_217_000); } impl ExtFragmentDensityMapFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_fragment_density_map\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -15714,7 +12887,7 @@ impl FormatFeatureFlags { pub const FRAGMENT_DENSITY_MAP_EXT: Self = Self(0b1_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_EXT_fragment_density_map'"] -impl FormatFeatureFlags2KHR { +impl FormatFeatureFlags2 { pub const FRAGMENT_DENSITY_MAP_EXT: Self = Self(0b1_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_EXT_fragment_density_map'"] @@ -15749,7 +12922,7 @@ impl StructureType { pub const RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: Self = Self(1_000_218_002); } impl ExtExtension220Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_220\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -15767,7 +12940,7 @@ impl ExtExtension220Fn { } } impl KhrExtension221Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_221\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -15789,7 +12962,7 @@ impl RenderPassCreateFlags { pub const RESERVED_0_KHR: Self = Self(0b1); } impl ExtScalarBlockLayoutFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_scalar_block_layout\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -15812,7 +12985,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES; } impl ExtExtension223Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_223\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -15830,7 +13003,7 @@ impl ExtExtension223Fn { } } impl GoogleHlslFunctionality1Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_hlsl_functionality1\0") } @@ -15850,7 +13023,7 @@ impl GoogleHlslFunctionality1Fn { } } impl GoogleDecorateStringFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_decorate_string\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -15868,7 +13041,7 @@ impl GoogleDecorateStringFn { } } impl ExtSubgroupSizeControlFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_subgroup_size_control\0") } @@ -15889,18 +13062,20 @@ impl ExtSubgroupSizeControlFn { } #[doc = "Generated from 'VK_EXT_subgroup_size_control'"] impl PipelineShaderStageCreateFlags { - pub const ALLOW_VARYING_SUBGROUP_SIZE_EXT: Self = Self(0b1); - pub const REQUIRE_FULL_SUBGROUPS_EXT: Self = Self(0b10); + pub const ALLOW_VARYING_SUBGROUP_SIZE_EXT: Self = Self::ALLOW_VARYING_SUBGROUP_SIZE; + pub const REQUIRE_FULL_SUBGROUPS_EXT: Self = Self::REQUIRE_FULL_SUBGROUPS; } #[doc = "Generated from 'VK_EXT_subgroup_size_control'"] impl StructureType { - pub const PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: Self = Self(1_000_225_000); + pub const PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: Self = + Self::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; pub const PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: Self = - Self(1_000_225_001); - pub const PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: Self = Self(1_000_225_002); + Self::PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; + pub const PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: Self = + Self::PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; } impl KhrFragmentShadingRateFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_fragment_shading_rate\0") } @@ -15977,28 +13152,6 @@ impl KhrFragmentShadingRateFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_fragment_shading_rates_khr( - &self, - physical_device: PhysicalDevice, - p_fragment_shading_rate_count: *mut u32, - p_fragment_shading_rates: *mut PhysicalDeviceFragmentShadingRateKHR, - ) -> Result { - (self.get_physical_device_fragment_shading_rates_khr)( - physical_device, - p_fragment_shading_rate_count, - p_fragment_shading_rates, - ) - } - #[doc = ""] - pub unsafe fn cmd_set_fragment_shading_rate_khr( - &self, - command_buffer: CommandBuffer, - p_fragment_size: *const Extent2D, - combiner_ops: *const [FragmentShadingRateCombinerOpKHR; 2], - ) { - (self.cmd_set_fragment_shading_rate_khr)(command_buffer, p_fragment_size, combiner_ops) - } } #[doc = "Generated from 'VK_KHR_fragment_shading_rate'"] impl AccessFlags { @@ -16015,8 +13168,8 @@ impl FormatFeatureFlags { Self(0b100_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_fragment_shading_rate'"] -impl FormatFeatureFlags2KHR { - pub const FRAGMENT_SHADING_RATE_ATTACHMENT: Self = +impl FormatFeatureFlags2 { + pub const FRAGMENT_SHADING_RATE_ATTACHMENT_KHR: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_fragment_shading_rate'"] @@ -16040,7 +13193,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR: Self = Self(1_000_226_004); } impl AmdShaderCoreProperties2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_core_properties2\0") } @@ -16064,7 +13217,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: Self = Self(1_000_227_000); } impl AmdExtension229Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_229\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16082,7 +13235,7 @@ impl AmdExtension229Fn { } } impl AmdDeviceCoherentMemoryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_device_coherent_memory\0") } @@ -16111,7 +13264,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: Self = Self(1_000_229_000); } impl AmdExtension231Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_231\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16129,7 +13282,7 @@ impl AmdExtension231Fn { } } impl AmdExtension232Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_232\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16147,7 +13300,7 @@ impl AmdExtension232Fn { } } impl AmdExtension233Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_233\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16165,7 +13318,7 @@ impl AmdExtension233Fn { } } impl AmdExtension234Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_234\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16183,7 +13336,7 @@ impl AmdExtension234Fn { } } impl ExtShaderImageAtomicInt64Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_image_atomic_int64\0") } @@ -16207,7 +13360,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: Self = Self(1_000_234_000); } impl AmdExtension236Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_236\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16225,7 +13378,7 @@ impl AmdExtension236Fn { } } impl KhrSpirv14Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_spirv_1_4\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -16243,7 +13396,7 @@ impl KhrSpirv14Fn { } } impl ExtMemoryBudgetFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_memory_budget\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -16265,7 +13418,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: Self = Self(1_000_237_000); } impl ExtMemoryPriorityFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_memory_priority\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -16288,7 +13441,7 @@ impl StructureType { pub const MEMORY_PRIORITY_ALLOCATE_INFO_EXT: Self = Self(1_000_238_001); } impl KhrSurfaceProtectedCapabilitiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_surface_protected_capabilities\0", @@ -16314,7 +13467,7 @@ impl StructureType { pub const SURFACE_PROTECTED_CAPABILITIES_KHR: Self = Self(1_000_239_000); } impl NvDedicatedAllocationImageAliasingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_NV_dedicated_allocation_image_aliasing\0", @@ -16341,7 +13494,7 @@ impl StructureType { Self(1_000_240_000); } impl KhrSeparateDepthStencilLayoutsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_separate_depth_stencil_layouts\0", @@ -16379,7 +13532,7 @@ impl StructureType { Self::ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT; } impl IntelExtension243Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_INTEL_extension_243\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16397,7 +13550,7 @@ impl IntelExtension243Fn { } } impl MesaExtension244Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_MESA_extension_244\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -16415,7 +13568,7 @@ impl MesaExtension244Fn { } } impl ExtBufferDeviceAddressFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_buffer_device_address\0") } @@ -16461,14 +13614,6 @@ impl ExtBufferDeviceAddressFn { }, } } - #[doc = ""] - pub unsafe fn get_buffer_device_address_ext( - &self, - device: Device, - p_info: *const BufferDeviceAddressInfo, - ) -> DeviceAddress { - (self.get_buffer_device_address_ext)(device, p_info) - } } #[doc = "Generated from 'VK_EXT_buffer_device_address'"] impl BufferCreateFlags { @@ -16491,20 +13636,20 @@ impl StructureType { pub const BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: Self = Self(1_000_244_002); } impl ExtToolingInfoFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_tooling_info\0") } } pub const SPEC_VERSION: u32 = 1u32; } #[allow(non_camel_case_types)] -pub type PFN_vkGetPhysicalDeviceToolPropertiesEXT = unsafe extern "system" fn( +pub type PFN_vkGetPhysicalDeviceToolProperties = unsafe extern "system" fn( physical_device: PhysicalDevice, p_tool_count: *mut u32, - p_tool_properties: *mut PhysicalDeviceToolPropertiesEXT, + p_tool_properties: *mut PhysicalDeviceToolProperties, ) -> Result; #[derive(Clone)] pub struct ExtToolingInfoFn { - pub get_physical_device_tool_properties_ext: PFN_vkGetPhysicalDeviceToolPropertiesEXT, + pub get_physical_device_tool_properties_ext: PFN_vkGetPhysicalDeviceToolProperties, } unsafe impl Send for ExtToolingInfoFn {} unsafe impl Sync for ExtToolingInfoFn {} @@ -16518,7 +13663,7 @@ impl ExtToolingInfoFn { unsafe extern "system" fn get_physical_device_tool_properties_ext( _physical_device: PhysicalDevice, _p_tool_count: *mut u32, - _p_tool_properties: *mut PhysicalDeviceToolPropertiesEXT, + _p_tool_properties: *mut PhysicalDeviceToolProperties, ) -> Result { panic!(concat!( "Unable to load ", @@ -16537,31 +13682,18 @@ impl ExtToolingInfoFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_tool_properties_ext( - &self, - physical_device: PhysicalDevice, - p_tool_count: *mut u32, - p_tool_properties: *mut PhysicalDeviceToolPropertiesEXT, - ) -> Result { - (self.get_physical_device_tool_properties_ext)( - physical_device, - p_tool_count, - p_tool_properties, - ) - } } #[doc = "Generated from 'VK_EXT_tooling_info'"] impl StructureType { - pub const PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT: Self = Self(1_000_245_000); + pub const PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT: Self = Self::PHYSICAL_DEVICE_TOOL_PROPERTIES; } #[doc = "Generated from 'VK_EXT_tooling_info'"] -impl ToolPurposeFlagsEXT { - pub const DEBUG_REPORTING: Self = Self(0b10_0000); - pub const DEBUG_MARKERS: Self = Self(0b100_0000); +impl ToolPurposeFlags { + pub const DEBUG_REPORTING_EXT: Self = Self(0b10_0000); + pub const DEBUG_MARKERS_EXT: Self = Self(0b100_0000); } impl ExtSeparateStencilUsageFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_separate_stencil_usage\0") } @@ -16585,7 +13717,7 @@ impl StructureType { pub const IMAGE_STENCIL_USAGE_CREATE_INFO_EXT: Self = Self::IMAGE_STENCIL_USAGE_CREATE_INFO; } impl ExtValidationFeaturesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_validation_features\0") } } pub const SPEC_VERSION: u32 = 5u32; @@ -16607,7 +13739,7 @@ impl StructureType { pub const VALIDATION_FEATURES_EXT: Self = Self(1_000_247_000); } impl KhrPresentWaitFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_present_wait\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -16651,23 +13783,13 @@ impl KhrPresentWaitFn { }, } } - #[doc = ""] - pub unsafe fn wait_for_present_khr( - &self, - device: Device, - swapchain: SwapchainKHR, - present_id: u64, - timeout: u64, - ) -> Result { - (self.wait_for_present_khr)(device, swapchain, present_id, timeout) - } } #[doc = "Generated from 'VK_KHR_present_wait'"] impl StructureType { pub const PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: Self = Self(1_000_248_000); } impl NvCooperativeMatrixFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_cooperative_matrix\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -16715,19 +13837,6 @@ impl NvCooperativeMatrixFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_cooperative_matrix_properties_nv( - &self, - physical_device: PhysicalDevice, - p_property_count: *mut u32, - p_properties: *mut CooperativeMatrixPropertiesNV, - ) -> Result { - (self.get_physical_device_cooperative_matrix_properties_nv)( - physical_device, - p_property_count, - p_properties, - ) - } } #[doc = "Generated from 'VK_NV_cooperative_matrix'"] impl StructureType { @@ -16736,7 +13845,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: Self = Self(1_000_249_002); } impl NvCoverageReductionModeFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_coverage_reduction_mode\0") } @@ -16788,19 +13897,6 @@ impl NvCoverageReductionModeFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_supported_framebuffer_mixed_samples_combinations_nv( - &self, - physical_device: PhysicalDevice, - p_combination_count: *mut u32, - p_combinations: *mut FramebufferMixedSamplesCombinationNV, - ) -> Result { - (self.get_physical_device_supported_framebuffer_mixed_samples_combinations_nv)( - physical_device, - p_combination_count, - p_combinations, - ) - } } #[doc = "Generated from 'VK_NV_coverage_reduction_mode'"] impl StructureType { @@ -16809,7 +13905,7 @@ impl StructureType { pub const FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV: Self = Self(1_000_250_002); } impl ExtFragmentShaderInterlockFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_fragment_shader_interlock\0") } @@ -16833,7 +13929,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: Self = Self(1_000_251_000); } impl ExtYcbcrImageArraysFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_ycbcr_image_arrays\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -16855,7 +13951,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: Self = Self(1_000_252_000); } impl KhrUniformBufferStandardLayoutFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_uniform_buffer_standard_layout\0", @@ -16882,7 +13978,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES; } impl ExtProvokingVertexFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_provoking_vertex\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -16907,7 +14003,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: Self = Self(1_000_254_002); } impl ExtFullScreenExclusiveFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_full_screen_exclusive\0") } @@ -17034,46 +14130,6 @@ impl ExtFullScreenExclusiveFn { }, } } - #[doc = ""] - pub unsafe fn get_physical_device_surface_present_modes2_ext( - &self, - physical_device: PhysicalDevice, - p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, - p_present_mode_count: *mut u32, - p_present_modes: *mut PresentModeKHR, - ) -> Result { - (self.get_physical_device_surface_present_modes2_ext)( - physical_device, - p_surface_info, - p_present_mode_count, - p_present_modes, - ) - } - #[doc = ""] - pub unsafe fn acquire_full_screen_exclusive_mode_ext( - &self, - device: Device, - swapchain: SwapchainKHR, - ) -> Result { - (self.acquire_full_screen_exclusive_mode_ext)(device, swapchain) - } - #[doc = ""] - pub unsafe fn release_full_screen_exclusive_mode_ext( - &self, - device: Device, - swapchain: SwapchainKHR, - ) -> Result { - (self.release_full_screen_exclusive_mode_ext)(device, swapchain) - } - #[doc = ""] - pub unsafe fn get_device_group_surface_present_modes2_ext( - &self, - device: Device, - p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, - p_modes: *mut DeviceGroupPresentModeFlagsKHR, - ) -> Result { - (self.get_device_group_surface_present_modes2_ext)(device, p_surface_info, p_modes) - } } #[doc = "Generated from 'VK_EXT_full_screen_exclusive'"] impl Result { @@ -17086,7 +14142,7 @@ impl StructureType { pub const SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: Self = Self(1_000_255_001); } impl ExtHeadlessSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_headless_surface\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -17134,23 +14190,13 @@ impl ExtHeadlessSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_headless_surface_ext( - &self, - instance: Instance, - p_create_info: *const HeadlessSurfaceCreateInfoEXT, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_headless_surface_ext)(instance, p_create_info, p_allocator, p_surface) - } } #[doc = "Generated from 'VK_EXT_headless_surface'"] impl StructureType { pub const HEADLESS_SURFACE_CREATE_INFO_EXT: Self = Self(1_000_256_000); } impl KhrBufferDeviceAddressFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_buffer_device_address\0") } @@ -17241,30 +14287,6 @@ impl KhrBufferDeviceAddressFn { }, } } - #[doc = ""] - pub unsafe fn get_buffer_device_address_khr( - &self, - device: Device, - p_info: *const BufferDeviceAddressInfo, - ) -> DeviceAddress { - (self.get_buffer_device_address_khr)(device, p_info) - } - #[doc = ""] - pub unsafe fn get_buffer_opaque_capture_address_khr( - &self, - device: Device, - p_info: *const BufferDeviceAddressInfo, - ) -> u64 { - (self.get_buffer_opaque_capture_address_khr)(device, p_info) - } - #[doc = ""] - pub unsafe fn get_device_memory_opaque_capture_address_khr( - &self, - device: Device, - p_info: *const DeviceMemoryOpaqueCaptureAddressInfo, - ) -> u64 { - (self.get_device_memory_opaque_capture_address_khr)(device, p_info) - } } #[doc = "Generated from 'VK_KHR_buffer_device_address'"] impl BufferCreateFlags { @@ -17297,7 +14319,7 @@ impl StructureType { Self::DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO; } impl ExtExtension259Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_259\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -17315,7 +14337,7 @@ impl ExtExtension259Fn { } } impl ExtLineRasterizationFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_line_rasterization\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -17360,15 +14382,6 @@ impl ExtLineRasterizationFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_line_stipple_ext( - &self, - command_buffer: CommandBuffer, - line_stipple_factor: u32, - line_stipple_pattern: u16, - ) { - (self.cmd_set_line_stipple_ext)(command_buffer, line_stipple_factor, line_stipple_pattern) - } } #[doc = "Generated from 'VK_EXT_line_rasterization'"] impl DynamicState { @@ -17381,7 +14394,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: Self = Self(1_000_259_002); } impl ExtShaderAtomicFloatFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_atomic_float\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -17403,7 +14416,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: Self = Self(1_000_260_000); } impl ExtHostQueryResetFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_host_query_reset\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -17447,16 +14460,6 @@ impl ExtHostQueryResetFn { }, } } - #[doc = ""] - pub unsafe fn reset_query_pool_ext( - &self, - device: Device, - query_pool: QueryPool, - first_query: u32, - query_count: u32, - ) { - (self.reset_query_pool_ext)(device, query_pool, first_query, query_count) - } } #[doc = "Generated from 'VK_EXT_host_query_reset'"] impl StructureType { @@ -17464,7 +14467,7 @@ impl StructureType { Self::PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; } impl GgpExtension263Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_extension_263\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -17482,7 +14485,7 @@ impl GgpExtension263Fn { } } impl BrcmExtension264Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_BRCM_extension_264\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -17500,7 +14503,7 @@ impl BrcmExtension264Fn { } } impl BrcmExtension265Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_BRCM_extension_265\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -17518,7 +14521,7 @@ impl BrcmExtension265Fn { } } impl ExtIndexTypeUint8Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_index_type_uint8\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -17544,7 +14547,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: Self = Self(1_000_265_000); } impl ExtExtension267Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_267\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -17562,7 +14565,7 @@ impl ExtExtension267Fn { } } impl ExtExtendedDynamicStateFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extended_dynamic_state\0") } @@ -17570,28 +14573,28 @@ impl ExtExtendedDynamicStateFn { pub const SPEC_VERSION: u32 = 1u32; } #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetCullModeEXT = +pub type PFN_vkCmdSetCullMode = unsafe extern "system" fn(command_buffer: CommandBuffer, cull_mode: CullModeFlags); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetFrontFaceEXT = +pub type PFN_vkCmdSetFrontFace = unsafe extern "system" fn(command_buffer: CommandBuffer, front_face: FrontFace); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetPrimitiveTopologyEXT = +pub type PFN_vkCmdSetPrimitiveTopology = unsafe extern "system" fn(command_buffer: CommandBuffer, primitive_topology: PrimitiveTopology); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetViewportWithCountEXT = unsafe extern "system" fn( +pub type PFN_vkCmdSetViewportWithCount = unsafe extern "system" fn( command_buffer: CommandBuffer, viewport_count: u32, p_viewports: *const Viewport, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetScissorWithCountEXT = unsafe extern "system" fn( +pub type PFN_vkCmdSetScissorWithCount = unsafe extern "system" fn( command_buffer: CommandBuffer, scissor_count: u32, p_scissors: *const Rect2D, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdBindVertexBuffers2EXT = unsafe extern "system" fn( +pub type PFN_vkCmdBindVertexBuffers2 = unsafe extern "system" fn( command_buffer: CommandBuffer, first_binding: u32, binding_count: u32, @@ -17601,22 +14604,22 @@ pub type PFN_vkCmdBindVertexBuffers2EXT = unsafe extern "system" fn( p_strides: *const DeviceSize, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetDepthTestEnableEXT = +pub type PFN_vkCmdSetDepthTestEnable = unsafe extern "system" fn(command_buffer: CommandBuffer, depth_test_enable: Bool32); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetDepthWriteEnableEXT = +pub type PFN_vkCmdSetDepthWriteEnable = unsafe extern "system" fn(command_buffer: CommandBuffer, depth_write_enable: Bool32); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetDepthCompareOpEXT = +pub type PFN_vkCmdSetDepthCompareOp = unsafe extern "system" fn(command_buffer: CommandBuffer, depth_compare_op: CompareOp); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetDepthBoundsTestEnableEXT = +pub type PFN_vkCmdSetDepthBoundsTestEnable = unsafe extern "system" fn(command_buffer: CommandBuffer, depth_bounds_test_enable: Bool32); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetStencilTestEnableEXT = +pub type PFN_vkCmdSetStencilTestEnable = unsafe extern "system" fn(command_buffer: CommandBuffer, stencil_test_enable: Bool32); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetStencilOpEXT = unsafe extern "system" fn( +pub type PFN_vkCmdSetStencilOp = unsafe extern "system" fn( command_buffer: CommandBuffer, face_mask: StencilFaceFlags, fail_op: StencilOp, @@ -17626,18 +14629,18 @@ pub type PFN_vkCmdSetStencilOpEXT = unsafe extern "system" fn( ); #[derive(Clone)] pub struct ExtExtendedDynamicStateFn { - pub cmd_set_cull_mode_ext: PFN_vkCmdSetCullModeEXT, - pub cmd_set_front_face_ext: PFN_vkCmdSetFrontFaceEXT, - pub cmd_set_primitive_topology_ext: PFN_vkCmdSetPrimitiveTopologyEXT, - pub cmd_set_viewport_with_count_ext: PFN_vkCmdSetViewportWithCountEXT, - pub cmd_set_scissor_with_count_ext: PFN_vkCmdSetScissorWithCountEXT, - pub cmd_bind_vertex_buffers2_ext: PFN_vkCmdBindVertexBuffers2EXT, - pub cmd_set_depth_test_enable_ext: PFN_vkCmdSetDepthTestEnableEXT, - pub cmd_set_depth_write_enable_ext: PFN_vkCmdSetDepthWriteEnableEXT, - pub cmd_set_depth_compare_op_ext: PFN_vkCmdSetDepthCompareOpEXT, - pub cmd_set_depth_bounds_test_enable_ext: PFN_vkCmdSetDepthBoundsTestEnableEXT, - pub cmd_set_stencil_test_enable_ext: PFN_vkCmdSetStencilTestEnableEXT, - pub cmd_set_stencil_op_ext: PFN_vkCmdSetStencilOpEXT, + pub cmd_set_cull_mode_ext: PFN_vkCmdSetCullMode, + pub cmd_set_front_face_ext: PFN_vkCmdSetFrontFace, + pub cmd_set_primitive_topology_ext: PFN_vkCmdSetPrimitiveTopology, + pub cmd_set_viewport_with_count_ext: PFN_vkCmdSetViewportWithCount, + pub cmd_set_scissor_with_count_ext: PFN_vkCmdSetScissorWithCount, + pub cmd_bind_vertex_buffers2_ext: PFN_vkCmdBindVertexBuffers2, + pub cmd_set_depth_test_enable_ext: PFN_vkCmdSetDepthTestEnable, + pub cmd_set_depth_write_enable_ext: PFN_vkCmdSetDepthWriteEnable, + pub cmd_set_depth_compare_op_ext: PFN_vkCmdSetDepthCompareOp, + pub cmd_set_depth_bounds_test_enable_ext: PFN_vkCmdSetDepthBoundsTestEnable, + pub cmd_set_stencil_test_enable_ext: PFN_vkCmdSetStencilTestEnable, + pub cmd_set_stencil_op_ext: PFN_vkCmdSetStencilOp, } unsafe impl Send for ExtExtendedDynamicStateFn {} unsafe impl Sync for ExtExtendedDynamicStateFn {} @@ -17896,150 +14899,29 @@ impl ExtExtendedDynamicStateFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_cull_mode_ext( - &self, - command_buffer: CommandBuffer, - cull_mode: CullModeFlags, - ) { - (self.cmd_set_cull_mode_ext)(command_buffer, cull_mode) - } - #[doc = ""] - pub unsafe fn cmd_set_front_face_ext( - &self, - command_buffer: CommandBuffer, - front_face: FrontFace, - ) { - (self.cmd_set_front_face_ext)(command_buffer, front_face) - } - #[doc = ""] - pub unsafe fn cmd_set_primitive_topology_ext( - &self, - command_buffer: CommandBuffer, - primitive_topology: PrimitiveTopology, - ) { - (self.cmd_set_primitive_topology_ext)(command_buffer, primitive_topology) - } - #[doc = ""] - pub unsafe fn cmd_set_viewport_with_count_ext( - &self, - command_buffer: CommandBuffer, - viewport_count: u32, - p_viewports: *const Viewport, - ) { - (self.cmd_set_viewport_with_count_ext)(command_buffer, viewport_count, p_viewports) - } - #[doc = ""] - pub unsafe fn cmd_set_scissor_with_count_ext( - &self, - command_buffer: CommandBuffer, - scissor_count: u32, - p_scissors: *const Rect2D, - ) { - (self.cmd_set_scissor_with_count_ext)(command_buffer, scissor_count, p_scissors) - } - #[doc = ""] - pub unsafe fn cmd_bind_vertex_buffers2_ext( - &self, - command_buffer: CommandBuffer, - first_binding: u32, - binding_count: u32, - p_buffers: *const Buffer, - p_offsets: *const DeviceSize, - p_sizes: *const DeviceSize, - p_strides: *const DeviceSize, - ) { - (self.cmd_bind_vertex_buffers2_ext)( - command_buffer, - first_binding, - binding_count, - p_buffers, - p_offsets, - p_sizes, - p_strides, - ) - } - #[doc = ""] - pub unsafe fn cmd_set_depth_test_enable_ext( - &self, - command_buffer: CommandBuffer, - depth_test_enable: Bool32, - ) { - (self.cmd_set_depth_test_enable_ext)(command_buffer, depth_test_enable) - } - #[doc = ""] - pub unsafe fn cmd_set_depth_write_enable_ext( - &self, - command_buffer: CommandBuffer, - depth_write_enable: Bool32, - ) { - (self.cmd_set_depth_write_enable_ext)(command_buffer, depth_write_enable) - } - #[doc = ""] - pub unsafe fn cmd_set_depth_compare_op_ext( - &self, - command_buffer: CommandBuffer, - depth_compare_op: CompareOp, - ) { - (self.cmd_set_depth_compare_op_ext)(command_buffer, depth_compare_op) - } - #[doc = ""] - pub unsafe fn cmd_set_depth_bounds_test_enable_ext( - &self, - command_buffer: CommandBuffer, - depth_bounds_test_enable: Bool32, - ) { - (self.cmd_set_depth_bounds_test_enable_ext)(command_buffer, depth_bounds_test_enable) - } - #[doc = ""] - pub unsafe fn cmd_set_stencil_test_enable_ext( - &self, - command_buffer: CommandBuffer, - stencil_test_enable: Bool32, - ) { - (self.cmd_set_stencil_test_enable_ext)(command_buffer, stencil_test_enable) - } - #[doc = ""] - pub unsafe fn cmd_set_stencil_op_ext( - &self, - command_buffer: CommandBuffer, - face_mask: StencilFaceFlags, - fail_op: StencilOp, - pass_op: StencilOp, - depth_fail_op: StencilOp, - compare_op: CompareOp, - ) { - (self.cmd_set_stencil_op_ext)( - command_buffer, - face_mask, - fail_op, - pass_op, - depth_fail_op, - compare_op, - ) - } } #[doc = "Generated from 'VK_EXT_extended_dynamic_state'"] impl DynamicState { - pub const CULL_MODE_EXT: Self = Self(1_000_267_000); - pub const FRONT_FACE_EXT: Self = Self(1_000_267_001); - pub const PRIMITIVE_TOPOLOGY_EXT: Self = Self(1_000_267_002); - pub const VIEWPORT_WITH_COUNT_EXT: Self = Self(1_000_267_003); - pub const SCISSOR_WITH_COUNT_EXT: Self = Self(1_000_267_004); - pub const VERTEX_INPUT_BINDING_STRIDE_EXT: Self = Self(1_000_267_005); - pub const DEPTH_TEST_ENABLE_EXT: Self = Self(1_000_267_006); - pub const DEPTH_WRITE_ENABLE_EXT: Self = Self(1_000_267_007); - pub const DEPTH_COMPARE_OP_EXT: Self = Self(1_000_267_008); - pub const DEPTH_BOUNDS_TEST_ENABLE_EXT: Self = Self(1_000_267_009); - pub const STENCIL_TEST_ENABLE_EXT: Self = Self(1_000_267_010); - pub const STENCIL_OP_EXT: Self = Self(1_000_267_011); + pub const CULL_MODE_EXT: Self = Self::CULL_MODE; + pub const FRONT_FACE_EXT: Self = Self::FRONT_FACE; + pub const PRIMITIVE_TOPOLOGY_EXT: Self = Self::PRIMITIVE_TOPOLOGY; + pub const VIEWPORT_WITH_COUNT_EXT: Self = Self::VIEWPORT_WITH_COUNT; + pub const SCISSOR_WITH_COUNT_EXT: Self = Self::SCISSOR_WITH_COUNT; + pub const VERTEX_INPUT_BINDING_STRIDE_EXT: Self = Self::VERTEX_INPUT_BINDING_STRIDE; + pub const DEPTH_TEST_ENABLE_EXT: Self = Self::DEPTH_TEST_ENABLE; + pub const DEPTH_WRITE_ENABLE_EXT: Self = Self::DEPTH_WRITE_ENABLE; + pub const DEPTH_COMPARE_OP_EXT: Self = Self::DEPTH_COMPARE_OP; + pub const DEPTH_BOUNDS_TEST_ENABLE_EXT: Self = Self::DEPTH_BOUNDS_TEST_ENABLE; + pub const STENCIL_TEST_ENABLE_EXT: Self = Self::STENCIL_TEST_ENABLE; + pub const STENCIL_OP_EXT: Self = Self::STENCIL_OP; } #[doc = "Generated from 'VK_EXT_extended_dynamic_state'"] impl StructureType { + #[doc = "Not promoted to 1.3"] pub const PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: Self = Self(1_000_267_000); } impl KhrDeferredHostOperationsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_deferred_host_operations\0") } @@ -18187,48 +15069,6 @@ impl KhrDeferredHostOperationsFn { }, } } - #[doc = ""] - pub unsafe fn create_deferred_operation_khr( - &self, - device: Device, - p_allocator: *const AllocationCallbacks, - p_deferred_operation: *mut DeferredOperationKHR, - ) -> Result { - (self.create_deferred_operation_khr)(device, p_allocator, p_deferred_operation) - } - #[doc = ""] - pub unsafe fn destroy_deferred_operation_khr( - &self, - device: Device, - operation: DeferredOperationKHR, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_deferred_operation_khr)(device, operation, p_allocator) - } - #[doc = ""] - pub unsafe fn get_deferred_operation_max_concurrency_khr( - &self, - device: Device, - operation: DeferredOperationKHR, - ) -> u32 { - (self.get_deferred_operation_max_concurrency_khr)(device, operation) - } - #[doc = ""] - pub unsafe fn get_deferred_operation_result_khr( - &self, - device: Device, - operation: DeferredOperationKHR, - ) -> Result { - (self.get_deferred_operation_result_khr)(device, operation) - } - #[doc = ""] - pub unsafe fn deferred_operation_join_khr( - &self, - device: Device, - operation: DeferredOperationKHR, - ) -> Result { - (self.deferred_operation_join_khr)(device, operation) - } } #[doc = "Generated from 'VK_KHR_deferred_host_operations'"] impl ObjectType { @@ -18242,7 +15082,7 @@ impl Result { pub const OPERATION_NOT_DEFERRED_KHR: Self = Self(1_000_268_003); } impl KhrPipelineExecutablePropertiesFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_pipeline_executable_properties\0", @@ -18356,51 +15196,6 @@ impl KhrPipelineExecutablePropertiesFn { }, } } - #[doc = ""] - pub unsafe fn get_pipeline_executable_properties_khr( - &self, - device: Device, - p_pipeline_info: *const PipelineInfoKHR, - p_executable_count: *mut u32, - p_properties: *mut PipelineExecutablePropertiesKHR, - ) -> Result { - (self.get_pipeline_executable_properties_khr)( - device, - p_pipeline_info, - p_executable_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn get_pipeline_executable_statistics_khr( - &self, - device: Device, - p_executable_info: *const PipelineExecutableInfoKHR, - p_statistic_count: *mut u32, - p_statistics: *mut PipelineExecutableStatisticKHR, - ) -> Result { - (self.get_pipeline_executable_statistics_khr)( - device, - p_executable_info, - p_statistic_count, - p_statistics, - ) - } - #[doc = ""] - pub unsafe fn get_pipeline_executable_internal_representations_khr( - &self, - device: Device, - p_executable_info: *const PipelineExecutableInfoKHR, - p_internal_representation_count: *mut u32, - p_internal_representations: *mut PipelineExecutableInternalRepresentationKHR, - ) -> Result { - (self.get_pipeline_executable_internal_representations_khr)( - device, - p_executable_info, - p_internal_representation_count, - p_internal_representations, - ) - } } #[doc = "Generated from 'VK_KHR_pipeline_executable_properties'"] impl PipelineCreateFlags { @@ -18418,7 +15213,7 @@ impl StructureType { pub const PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR: Self = Self(1_000_269_005); } impl IntelExtension271Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_INTEL_extension_271\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -18435,8 +15230,12 @@ impl IntelExtension271Fn { Self {} } } +#[doc = "Generated from 'VK_INTEL_extension_271'"] +impl ImageUsageFlags { + pub const RESERVED_22_EXT: Self = Self(0b100_0000_0000_0000_0000_0000); +} impl IntelExtension272Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_INTEL_extension_272\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -18454,7 +15253,7 @@ impl IntelExtension272Fn { } } impl IntelExtension273Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_INTEL_extension_273\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -18472,7 +15271,7 @@ impl IntelExtension273Fn { } } impl ExtShaderAtomicFloat2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_atomic_float2\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -18494,7 +15293,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: Self = Self(1_000_273_000); } impl KhrExtension275Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_275\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -18512,7 +15311,7 @@ impl KhrExtension275Fn { } } impl KhrExtension276Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_276\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -18530,7 +15329,7 @@ impl KhrExtension276Fn { } } impl ExtShaderDemoteToHelperInvocationFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_EXT_shader_demote_to_helper_invocation\0", @@ -18554,10 +15353,10 @@ impl ExtShaderDemoteToHelperInvocationFn { #[doc = "Generated from 'VK_EXT_shader_demote_to_helper_invocation'"] impl StructureType { pub const PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: Self = - Self(1_000_276_000); + Self::PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; } impl NvDeviceGeneratedCommandsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_device_generated_commands\0") } @@ -18748,75 +15547,6 @@ impl NvDeviceGeneratedCommandsFn { }, } } - #[doc = ""] - pub unsafe fn get_generated_commands_memory_requirements_nv( - &self, - device: Device, - p_info: *const GeneratedCommandsMemoryRequirementsInfoNV, - p_memory_requirements: *mut MemoryRequirements2, - ) { - (self.get_generated_commands_memory_requirements_nv)(device, p_info, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn cmd_preprocess_generated_commands_nv( - &self, - command_buffer: CommandBuffer, - p_generated_commands_info: *const GeneratedCommandsInfoNV, - ) { - (self.cmd_preprocess_generated_commands_nv)(command_buffer, p_generated_commands_info) - } - #[doc = ""] - pub unsafe fn cmd_execute_generated_commands_nv( - &self, - command_buffer: CommandBuffer, - is_preprocessed: Bool32, - p_generated_commands_info: *const GeneratedCommandsInfoNV, - ) { - (self.cmd_execute_generated_commands_nv)( - command_buffer, - is_preprocessed, - p_generated_commands_info, - ) - } - #[doc = ""] - pub unsafe fn cmd_bind_pipeline_shader_group_nv( - &self, - command_buffer: CommandBuffer, - pipeline_bind_point: PipelineBindPoint, - pipeline: Pipeline, - group_index: u32, - ) { - (self.cmd_bind_pipeline_shader_group_nv)( - command_buffer, - pipeline_bind_point, - pipeline, - group_index, - ) - } - #[doc = ""] - pub unsafe fn create_indirect_commands_layout_nv( - &self, - device: Device, - p_create_info: *const IndirectCommandsLayoutCreateInfoNV, - p_allocator: *const AllocationCallbacks, - p_indirect_commands_layout: *mut IndirectCommandsLayoutNV, - ) -> Result { - (self.create_indirect_commands_layout_nv)( - device, - p_create_info, - p_allocator, - p_indirect_commands_layout, - ) - } - #[doc = ""] - pub unsafe fn destroy_indirect_commands_layout_nv( - &self, - device: Device, - indirect_commands_layout: IndirectCommandsLayoutNV, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_indirect_commands_layout_nv)(device, indirect_commands_layout, p_allocator) - } } #[doc = "Generated from 'VK_NV_device_generated_commands'"] impl AccessFlags { @@ -18847,7 +15577,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: Self = Self(1_000_277_007); } impl NvInheritedViewportScissorFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_inherited_viewport_scissor\0") } @@ -18872,7 +15602,7 @@ impl StructureType { pub const COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: Self = Self(1_000_278_001); } impl KhrExtension280Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_280\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -18890,7 +15620,7 @@ impl KhrExtension280Fn { } } impl KhrShaderIntegerDotProductFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_integer_dot_product\0") } @@ -18911,11 +15641,13 @@ impl KhrShaderIntegerDotProductFn { } #[doc = "Generated from 'VK_KHR_shader_integer_dot_product'"] impl StructureType { - pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: Self = Self(1_000_280_000); - pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: Self = Self(1_000_280_001); + pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: Self = + Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES; + pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: Self = + Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES; } impl ExtTexelBufferAlignmentFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_texel_buffer_alignment\0") } @@ -18936,11 +15668,13 @@ impl ExtTexelBufferAlignmentFn { } #[doc = "Generated from 'VK_EXT_texel_buffer_alignment'"] impl StructureType { + #[doc = "Not promoted to 1.3"] pub const PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: Self = Self(1_000_281_000); - pub const PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: Self = Self(1_000_281_001); + pub const PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: Self = + Self::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES; } impl QcomRenderPassTransformFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_render_pass_transform\0") } @@ -18970,7 +15704,7 @@ impl StructureType { pub const RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: Self = Self(1_000_282_001); } impl ExtExtension284Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_284\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -18988,7 +15722,7 @@ impl ExtExtension284Fn { } } impl ExtDeviceMemoryReportFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_device_memory_report\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -19012,7 +15746,7 @@ impl StructureType { pub const DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT: Self = Self(1_000_284_002); } impl ExtAcquireDrmDisplayFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_acquire_drm_display\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -19083,28 +15817,9 @@ impl ExtAcquireDrmDisplayFn { }, } } - #[doc = ""] - pub unsafe fn acquire_drm_display_ext( - &self, - physical_device: PhysicalDevice, - drm_fd: i32, - display: DisplayKHR, - ) -> Result { - (self.acquire_drm_display_ext)(physical_device, drm_fd, display) - } - #[doc = ""] - pub unsafe fn get_drm_display_ext( - &self, - physical_device: PhysicalDevice, - drm_fd: i32, - connector_id: u32, - display: *mut DisplayKHR, - ) -> Result { - (self.get_drm_display_ext)(physical_device, drm_fd, connector_id, display) - } } impl ExtRobustness2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_robustness2\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -19127,7 +15842,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: Self = Self(1_000_286_001); } impl ExtCustomBorderColorFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_custom_border_color\0") } } pub const SPEC_VERSION: u32 = 12u32; @@ -19156,7 +15871,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: Self = Self(1_000_287_002); } impl ExtExtension289Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_289\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19207,7 +15922,7 @@ impl Format { pub const ASTC_6X6X6_SFLOAT_BLOCK_EXT: Self = Self(1_000_288_029); } impl GoogleUserTypeFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_user_type\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -19225,7 +15940,7 @@ impl GoogleUserTypeFn { } } impl KhrPipelineLibraryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_pipeline_library\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -19251,7 +15966,7 @@ impl StructureType { pub const PIPELINE_LIBRARY_CREATE_INFO_KHR: Self = Self(1_000_290_000); } impl NvExtension292Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_292\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19269,7 +15984,7 @@ impl NvExtension292Fn { } } impl NvExtension293Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_293\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19287,7 +16002,7 @@ impl NvExtension293Fn { } } impl KhrShaderNonSemanticInfoFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shader_non_semantic_info\0") } @@ -19307,7 +16022,7 @@ impl KhrShaderNonSemanticInfoFn { } } impl KhrPresentIdFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_present_id\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -19330,46 +16045,46 @@ impl StructureType { pub const PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: Self = Self(1_000_294_001); } impl ExtPrivateDataFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_private_data\0") } } pub const SPEC_VERSION: u32 = 1u32; } #[allow(non_camel_case_types)] -pub type PFN_vkCreatePrivateDataSlotEXT = unsafe extern "system" fn( +pub type PFN_vkCreatePrivateDataSlot = unsafe extern "system" fn( device: Device, - p_create_info: *const PrivateDataSlotCreateInfoEXT, + p_create_info: *const PrivateDataSlotCreateInfo, p_allocator: *const AllocationCallbacks, - p_private_data_slot: *mut PrivateDataSlotEXT, + p_private_data_slot: *mut PrivateDataSlot, ) -> Result; #[allow(non_camel_case_types)] -pub type PFN_vkDestroyPrivateDataSlotEXT = unsafe extern "system" fn( +pub type PFN_vkDestroyPrivateDataSlot = unsafe extern "system" fn( device: Device, - private_data_slot: PrivateDataSlotEXT, + private_data_slot: PrivateDataSlot, p_allocator: *const AllocationCallbacks, ); #[allow(non_camel_case_types)] -pub type PFN_vkSetPrivateDataEXT = unsafe extern "system" fn( +pub type PFN_vkSetPrivateData = unsafe extern "system" fn( device: Device, object_type: ObjectType, object_handle: u64, - private_data_slot: PrivateDataSlotEXT, + private_data_slot: PrivateDataSlot, data: u64, ) -> Result; #[allow(non_camel_case_types)] -pub type PFN_vkGetPrivateDataEXT = unsafe extern "system" fn( +pub type PFN_vkGetPrivateData = unsafe extern "system" fn( device: Device, object_type: ObjectType, object_handle: u64, - private_data_slot: PrivateDataSlotEXT, + private_data_slot: PrivateDataSlot, p_data: *mut u64, ); #[derive(Clone)] pub struct ExtPrivateDataFn { - pub create_private_data_slot_ext: PFN_vkCreatePrivateDataSlotEXT, - pub destroy_private_data_slot_ext: PFN_vkDestroyPrivateDataSlotEXT, - pub set_private_data_ext: PFN_vkSetPrivateDataEXT, - pub get_private_data_ext: PFN_vkGetPrivateDataEXT, + pub create_private_data_slot_ext: PFN_vkCreatePrivateDataSlot, + pub destroy_private_data_slot_ext: PFN_vkDestroyPrivateDataSlot, + pub set_private_data_ext: PFN_vkSetPrivateData, + pub get_private_data_ext: PFN_vkGetPrivateData, } unsafe impl Send for ExtPrivateDataFn {} unsafe impl Sync for ExtPrivateDataFn {} @@ -19382,9 +16097,9 @@ impl ExtPrivateDataFn { create_private_data_slot_ext: unsafe { unsafe extern "system" fn create_private_data_slot_ext( _device: Device, - _p_create_info: *const PrivateDataSlotCreateInfoEXT, + _p_create_info: *const PrivateDataSlotCreateInfo, _p_allocator: *const AllocationCallbacks, - _p_private_data_slot: *mut PrivateDataSlotEXT, + _p_private_data_slot: *mut PrivateDataSlot, ) -> Result { panic!(concat!( "Unable to load ", @@ -19404,7 +16119,7 @@ impl ExtPrivateDataFn { destroy_private_data_slot_ext: unsafe { unsafe extern "system" fn destroy_private_data_slot_ext( _device: Device, - _private_data_slot: PrivateDataSlotEXT, + _private_data_slot: PrivateDataSlot, _p_allocator: *const AllocationCallbacks, ) { panic!(concat!( @@ -19427,7 +16142,7 @@ impl ExtPrivateDataFn { _device: Device, _object_type: ObjectType, _object_handle: u64, - _private_data_slot: PrivateDataSlotEXT, + _private_data_slot: PrivateDataSlot, _data: u64, ) -> Result { panic!(concat!("Unable to load ", stringify!(set_private_data_ext))) @@ -19446,7 +16161,7 @@ impl ExtPrivateDataFn { _device: Device, _object_type: ObjectType, _object_handle: u64, - _private_data_slot: PrivateDataSlotEXT, + _private_data_slot: PrivateDataSlot, _p_data: *mut u64, ) { panic!(concat!("Unable to load ", stringify!(get_private_data_ext))) @@ -19462,66 +16177,20 @@ impl ExtPrivateDataFn { }, } } - #[doc = ""] - pub unsafe fn create_private_data_slot_ext( - &self, - device: Device, - p_create_info: *const PrivateDataSlotCreateInfoEXT, - p_allocator: *const AllocationCallbacks, - p_private_data_slot: *mut PrivateDataSlotEXT, - ) -> Result { - (self.create_private_data_slot_ext)(device, p_create_info, p_allocator, p_private_data_slot) - } - #[doc = ""] - pub unsafe fn destroy_private_data_slot_ext( - &self, - device: Device, - private_data_slot: PrivateDataSlotEXT, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_private_data_slot_ext)(device, private_data_slot, p_allocator) - } - #[doc = ""] - pub unsafe fn set_private_data_ext( - &self, - device: Device, - object_type: ObjectType, - object_handle: u64, - private_data_slot: PrivateDataSlotEXT, - data: u64, - ) -> Result { - (self.set_private_data_ext)(device, object_type, object_handle, private_data_slot, data) - } - #[doc = ""] - pub unsafe fn get_private_data_ext( - &self, - device: Device, - object_type: ObjectType, - object_handle: u64, - private_data_slot: PrivateDataSlotEXT, - p_data: *mut u64, - ) { - (self.get_private_data_ext)( - device, - object_type, - object_handle, - private_data_slot, - p_data, - ) - } } #[doc = "Generated from 'VK_EXT_private_data'"] impl ObjectType { - pub const PRIVATE_DATA_SLOT_EXT: Self = Self(1_000_295_000); + pub const PRIVATE_DATA_SLOT_EXT: Self = Self::PRIVATE_DATA_SLOT; } #[doc = "Generated from 'VK_EXT_private_data'"] impl StructureType { - pub const PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: Self = Self(1_000_295_000); - pub const DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: Self = Self(1_000_295_001); - pub const PRIVATE_DATA_SLOT_CREATE_INFO_EXT: Self = Self(1_000_295_002); + pub const PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: Self = + Self::PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES; + pub const DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: Self = Self::DEVICE_PRIVATE_DATA_CREATE_INFO; + pub const PRIVATE_DATA_SLOT_CREATE_INFO_EXT: Self = Self::PRIVATE_DATA_SLOT_CREATE_INFO; } impl KhrExtension297Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_297\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19543,7 +16212,7 @@ impl PipelineShaderStageCreateFlags { pub const RESERVED_3_KHR: Self = Self(0b1000); } impl ExtPipelineCreationCacheControlFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_EXT_pipeline_creation_cache_control\0", @@ -19566,25 +16235,25 @@ impl ExtPipelineCreationCacheControlFn { } #[doc = "Generated from 'VK_EXT_pipeline_creation_cache_control'"] impl PipelineCacheCreateFlags { - pub const EXTERNALLY_SYNCHRONIZED_EXT: Self = Self(0b1); + pub const EXTERNALLY_SYNCHRONIZED_EXT: Self = Self::EXTERNALLY_SYNCHRONIZED; } #[doc = "Generated from 'VK_EXT_pipeline_creation_cache_control'"] impl PipelineCreateFlags { - pub const FAIL_ON_PIPELINE_COMPILE_REQUIRED_EXT: Self = Self(0b1_0000_0000); - pub const EARLY_RETURN_ON_FAILURE_EXT: Self = Self(0b10_0000_0000); + pub const FAIL_ON_PIPELINE_COMPILE_REQUIRED_EXT: Self = Self::FAIL_ON_PIPELINE_COMPILE_REQUIRED; + pub const EARLY_RETURN_ON_FAILURE_EXT: Self = Self::EARLY_RETURN_ON_FAILURE; } #[doc = "Generated from 'VK_EXT_pipeline_creation_cache_control'"] impl Result { - pub const PIPELINE_COMPILE_REQUIRED_EXT: Self = Self(1_000_297_000); - pub const ERROR_PIPELINE_COMPILE_REQUIRED_EXT: Self = Self::PIPELINE_COMPILE_REQUIRED_EXT; + pub const PIPELINE_COMPILE_REQUIRED_EXT: Self = Self::PIPELINE_COMPILE_REQUIRED; + pub const ERROR_PIPELINE_COMPILE_REQUIRED_EXT: Self = Self::PIPELINE_COMPILE_REQUIRED; } #[doc = "Generated from 'VK_EXT_pipeline_creation_cache_control'"] impl StructureType { pub const PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: Self = - Self(1_000_297_000); + Self::PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES; } impl KhrExtension299Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_299\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19611,10 +16280,10 @@ impl PipelineCacheCreateFlags { pub const RESERVED_2_KHR: Self = Self(0b100); } impl KhrVideoEncodeQueueFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_video_encode_queue\0") } } - pub const SPEC_VERSION: u32 = 3u32; + pub const SPEC_VERSION: u32 = 4u32; } #[allow(non_camel_case_types)] pub type PFN_vkCmdEncodeVideoKHR = unsafe extern "system" fn( @@ -19651,19 +16320,12 @@ impl KhrVideoEncodeQueueFn { }, } } - #[doc = ""] - pub unsafe fn cmd_encode_video_khr( - &self, - command_buffer: CommandBuffer, - p_encode_info: *const VideoEncodeInfoKHR, - ) { - (self.cmd_encode_video_khr)(command_buffer, p_encode_info) - } } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] -impl AccessFlags2KHR { - pub const VIDEO_ENCODE_READ: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000_0000); - pub const VIDEO_ENCODE_WRITE: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000_0000); +impl AccessFlags2 { + pub const VIDEO_ENCODE_READ_KHR: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000_0000); + pub const VIDEO_ENCODE_WRITE_KHR: Self = + Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] impl BufferUsageFlags { @@ -19676,9 +16338,9 @@ impl FormatFeatureFlags { pub const VIDEO_ENCODE_DPB_KHR: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] -impl FormatFeatureFlags2KHR { - pub const VIDEO_ENCODE_INPUT: Self = Self(0b1000_0000_0000_0000_0000_0000_0000); - pub const VIDEO_ENCODE_DPB: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000); +impl FormatFeatureFlags2 { + pub const VIDEO_ENCODE_INPUT_KHR: Self = Self(0b1000_0000_0000_0000_0000_0000_0000); + pub const VIDEO_ENCODE_DPB_KHR: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] impl ImageLayout { @@ -19693,8 +16355,8 @@ impl ImageUsageFlags { pub const VIDEO_ENCODE_DPB_KHR: Self = Self(0b1000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] -impl PipelineStageFlags2KHR { - pub const VIDEO_ENCODE: Self = Self(0b1000_0000_0000_0000_0000_0000_0000); +impl PipelineStageFlags2 { + pub const VIDEO_ENCODE_KHR: Self = Self(0b1000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] impl QueryType { @@ -19709,9 +16371,10 @@ impl StructureType { pub const VIDEO_ENCODE_INFO_KHR: Self = Self(1_000_299_000); pub const VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: Self = Self(1_000_299_001); pub const VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR: Self = Self(1_000_299_002); + pub const VIDEO_ENCODE_CAPABILITIES_KHR: Self = Self(1_000_299_003); } impl NvDeviceDiagnosticsConfigFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_device_diagnostics_config\0") } @@ -19736,7 +16399,7 @@ impl StructureType { pub const DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: Self = Self(1_000_300_001); } impl QcomRenderPassStoreOpsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_render_pass_store_ops\0") } @@ -19757,10 +16420,10 @@ impl QcomRenderPassStoreOpsFn { } #[doc = "Generated from 'VK_QCOM_render_pass_store_ops'"] impl AttachmentStoreOp { - pub const NONE_QCOM: Self = Self::NONE_KHR; + pub const NONE_QCOM: Self = Self::NONE; } impl QcomExtension303Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_303\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19778,7 +16441,7 @@ impl QcomExtension303Fn { } } impl QcomExtension304Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_304\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19796,7 +16459,7 @@ impl QcomExtension304Fn { } } impl QcomExtension305Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_305\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19814,7 +16477,7 @@ impl QcomExtension305Fn { } } impl QcomExtension306Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_306\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19832,7 +16495,7 @@ impl QcomExtension306Fn { } } impl QcomExtension307Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_307\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19850,7 +16513,7 @@ impl QcomExtension307Fn { } } impl NvExtension308Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_308\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19868,7 +16531,7 @@ impl NvExtension308Fn { } } impl KhrExtension309Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_309\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19886,7 +16549,7 @@ impl KhrExtension309Fn { } } impl QcomExtension310Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_310\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19908,7 +16571,7 @@ impl StructureType { pub const RESERVED_QCOM: Self = Self(1_000_309_000); } impl NvExtension311Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_311\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19926,7 +16589,7 @@ impl NvExtension311Fn { } } impl ExtExtension312Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_312\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19944,7 +16607,7 @@ impl ExtExtension312Fn { } } impl ExtExtension313Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_313\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19962,7 +16625,7 @@ impl ExtExtension313Fn { } } impl AmdExtension314Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_314\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -19980,53 +16643,53 @@ impl AmdExtension314Fn { } } impl KhrSynchronization2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_synchronization2\0") } } pub const SPEC_VERSION: u32 = 1u32; } #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetEvent2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdSetEvent2 = unsafe extern "system" fn( command_buffer: CommandBuffer, event: Event, - p_dependency_info: *const DependencyInfoKHR, + p_dependency_info: *const DependencyInfo, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdResetEvent2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdResetEvent2 = unsafe extern "system" fn( command_buffer: CommandBuffer, event: Event, - stage_mask: PipelineStageFlags2KHR, + stage_mask: PipelineStageFlags2, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdWaitEvents2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdWaitEvents2 = unsafe extern "system" fn( command_buffer: CommandBuffer, event_count: u32, p_events: *const Event, - p_dependency_infos: *const DependencyInfoKHR, + p_dependency_infos: *const DependencyInfo, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdPipelineBarrier2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdPipelineBarrier2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_dependency_info: *const DependencyInfoKHR, + p_dependency_info: *const DependencyInfo, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdWriteTimestamp2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdWriteTimestamp2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - stage: PipelineStageFlags2KHR, + stage: PipelineStageFlags2, query_pool: QueryPool, query: u32, ); #[allow(non_camel_case_types)] -pub type PFN_vkQueueSubmit2KHR = unsafe extern "system" fn( +pub type PFN_vkQueueSubmit2 = unsafe extern "system" fn( queue: Queue, submit_count: u32, - p_submits: *const SubmitInfo2KHR, + p_submits: *const SubmitInfo2, fence: Fence, ) -> Result; #[allow(non_camel_case_types)] pub type PFN_vkCmdWriteBufferMarker2AMD = unsafe extern "system" fn( command_buffer: CommandBuffer, - stage: PipelineStageFlags2KHR, + stage: PipelineStageFlags2, dst_buffer: Buffer, dst_offset: DeviceSize, marker: u32, @@ -20039,12 +16702,12 @@ pub type PFN_vkGetQueueCheckpointData2NV = unsafe extern "system" fn( ); #[derive(Clone)] pub struct KhrSynchronization2Fn { - pub cmd_set_event2_khr: PFN_vkCmdSetEvent2KHR, - pub cmd_reset_event2_khr: PFN_vkCmdResetEvent2KHR, - pub cmd_wait_events2_khr: PFN_vkCmdWaitEvents2KHR, - pub cmd_pipeline_barrier2_khr: PFN_vkCmdPipelineBarrier2KHR, - pub cmd_write_timestamp2_khr: PFN_vkCmdWriteTimestamp2KHR, - pub queue_submit2_khr: PFN_vkQueueSubmit2KHR, + pub cmd_set_event2_khr: PFN_vkCmdSetEvent2, + pub cmd_reset_event2_khr: PFN_vkCmdResetEvent2, + pub cmd_wait_events2_khr: PFN_vkCmdWaitEvents2, + pub cmd_pipeline_barrier2_khr: PFN_vkCmdPipelineBarrier2, + pub cmd_write_timestamp2_khr: PFN_vkCmdWriteTimestamp2, + pub queue_submit2_khr: PFN_vkQueueSubmit2, pub cmd_write_buffer_marker2_amd: PFN_vkCmdWriteBufferMarker2AMD, pub get_queue_checkpoint_data2_nv: PFN_vkGetQueueCheckpointData2NV, } @@ -20060,7 +16723,7 @@ impl KhrSynchronization2Fn { unsafe extern "system" fn cmd_set_event2_khr( _command_buffer: CommandBuffer, _event: Event, - _p_dependency_info: *const DependencyInfoKHR, + _p_dependency_info: *const DependencyInfo, ) { panic!(concat!("Unable to load ", stringify!(cmd_set_event2_khr))) } @@ -20076,7 +16739,7 @@ impl KhrSynchronization2Fn { unsafe extern "system" fn cmd_reset_event2_khr( _command_buffer: CommandBuffer, _event: Event, - _stage_mask: PipelineStageFlags2KHR, + _stage_mask: PipelineStageFlags2, ) { panic!(concat!("Unable to load ", stringify!(cmd_reset_event2_khr))) } @@ -20094,7 +16757,7 @@ impl KhrSynchronization2Fn { _command_buffer: CommandBuffer, _event_count: u32, _p_events: *const Event, - _p_dependency_infos: *const DependencyInfoKHR, + _p_dependency_infos: *const DependencyInfo, ) { panic!(concat!("Unable to load ", stringify!(cmd_wait_events2_khr))) } @@ -20110,7 +16773,7 @@ impl KhrSynchronization2Fn { cmd_pipeline_barrier2_khr: unsafe { unsafe extern "system" fn cmd_pipeline_barrier2_khr( _command_buffer: CommandBuffer, - _p_dependency_info: *const DependencyInfoKHR, + _p_dependency_info: *const DependencyInfo, ) { panic!(concat!( "Unable to load ", @@ -20129,7 +16792,7 @@ impl KhrSynchronization2Fn { cmd_write_timestamp2_khr: unsafe { unsafe extern "system" fn cmd_write_timestamp2_khr( _command_buffer: CommandBuffer, - _stage: PipelineStageFlags2KHR, + _stage: PipelineStageFlags2, _query_pool: QueryPool, _query: u32, ) { @@ -20151,7 +16814,7 @@ impl KhrSynchronization2Fn { unsafe extern "system" fn queue_submit2_khr( _queue: Queue, _submit_count: u32, - _p_submits: *const SubmitInfo2KHR, + _p_submits: *const SubmitInfo2, _fence: Fence, ) -> Result { panic!(concat!("Unable to load ", stringify!(queue_submit2_khr))) @@ -20167,7 +16830,7 @@ impl KhrSynchronization2Fn { cmd_write_buffer_marker2_amd: unsafe { unsafe extern "system" fn cmd_write_buffer_marker2_amd( _command_buffer: CommandBuffer, - _stage: PipelineStageFlags2KHR, + _stage: PipelineStageFlags2, _dst_buffer: Buffer, _dst_offset: DeviceSize, _marker: u32, @@ -20210,89 +16873,13 @@ impl KhrSynchronization2Fn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_event2_khr( - &self, - command_buffer: CommandBuffer, - event: Event, - p_dependency_info: *const DependencyInfoKHR, - ) { - (self.cmd_set_event2_khr)(command_buffer, event, p_dependency_info) - } - #[doc = ""] - pub unsafe fn cmd_reset_event2_khr( - &self, - command_buffer: CommandBuffer, - event: Event, - stage_mask: PipelineStageFlags2KHR, - ) { - (self.cmd_reset_event2_khr)(command_buffer, event, stage_mask) - } - #[doc = ""] - pub unsafe fn cmd_wait_events2_khr( - &self, - command_buffer: CommandBuffer, - event_count: u32, - p_events: *const Event, - p_dependency_infos: *const DependencyInfoKHR, - ) { - (self.cmd_wait_events2_khr)(command_buffer, event_count, p_events, p_dependency_infos) - } - #[doc = ""] - pub unsafe fn cmd_pipeline_barrier2_khr( - &self, - command_buffer: CommandBuffer, - p_dependency_info: *const DependencyInfoKHR, - ) { - (self.cmd_pipeline_barrier2_khr)(command_buffer, p_dependency_info) - } - #[doc = ""] - pub unsafe fn cmd_write_timestamp2_khr( - &self, - command_buffer: CommandBuffer, - stage: PipelineStageFlags2KHR, - query_pool: QueryPool, - query: u32, - ) { - (self.cmd_write_timestamp2_khr)(command_buffer, stage, query_pool, query) - } - #[doc = ""] - pub unsafe fn queue_submit2_khr( - &self, - queue: Queue, - submit_count: u32, - p_submits: *const SubmitInfo2KHR, - fence: Fence, - ) -> Result { - (self.queue_submit2_khr)(queue, submit_count, p_submits, fence) - } - #[doc = ""] - pub unsafe fn cmd_write_buffer_marker2_amd( - &self, - command_buffer: CommandBuffer, - stage: PipelineStageFlags2KHR, - dst_buffer: Buffer, - dst_offset: DeviceSize, - marker: u32, - ) { - (self.cmd_write_buffer_marker2_amd)(command_buffer, stage, dst_buffer, dst_offset, marker) - } - #[doc = ""] - pub unsafe fn get_queue_checkpoint_data2_nv( - &self, - queue: Queue, - p_checkpoint_data_count: *mut u32, - p_checkpoint_data: *mut CheckpointData2NV, - ) { - (self.get_queue_checkpoint_data2_nv)(queue, p_checkpoint_data_count, p_checkpoint_data) - } } #[doc = "Generated from 'VK_KHR_synchronization2'"] impl AccessFlags { - pub const NONE_KHR: Self = Self(0); + pub const NONE_KHR: Self = Self::NONE; } #[doc = "Generated from 'VK_KHR_synchronization2'"] -impl AccessFlags2KHR { +impl AccessFlags2 { pub const TRANSFORM_FEEDBACK_WRITE_EXT: Self = Self(0b10_0000_0000_0000_0000_0000_0000); pub const TRANSFORM_FEEDBACK_COUNTER_READ_EXT: Self = Self(0b100_0000_0000_0000_0000_0000_0000); pub const TRANSFORM_FEEDBACK_COUNTER_WRITE_EXT: Self = @@ -20301,59 +16888,61 @@ impl AccessFlags2KHR { pub const CONDITIONAL_RENDERING_READ_EXT: Self = Self(0b1_0000_0000_0000_0000_0000); pub const COMMAND_PREPROCESS_READ_NV: Self = Self(0b10_0000_0000_0000_0000); pub const COMMAND_PREPROCESS_WRITE_NV: Self = Self(0b100_0000_0000_0000_0000); - pub const FRAGMENT_SHADING_RATE_ATTACHMENT_READ: Self = Self(0b1000_0000_0000_0000_0000_0000); - pub const SHADING_RATE_IMAGE_READ_NV: Self = Self::FRAGMENT_SHADING_RATE_ATTACHMENT_READ; - pub const ACCELERATION_STRUCTURE_READ: Self = Self(0b10_0000_0000_0000_0000_0000); - pub const ACCELERATION_STRUCTURE_WRITE: Self = Self(0b100_0000_0000_0000_0000_0000); - pub const ACCELERATION_STRUCTURE_READ_NV: Self = Self::ACCELERATION_STRUCTURE_READ; - pub const ACCELERATION_STRUCTURE_WRITE_NV: Self = Self::ACCELERATION_STRUCTURE_WRITE; + pub const FRAGMENT_SHADING_RATE_ATTACHMENT_READ_KHR: Self = + Self(0b1000_0000_0000_0000_0000_0000); + pub const SHADING_RATE_IMAGE_READ_NV: Self = Self::FRAGMENT_SHADING_RATE_ATTACHMENT_READ_KHR; + pub const ACCELERATION_STRUCTURE_READ_KHR: Self = Self(0b10_0000_0000_0000_0000_0000); + pub const ACCELERATION_STRUCTURE_WRITE_KHR: Self = Self(0b100_0000_0000_0000_0000_0000); + pub const ACCELERATION_STRUCTURE_READ_NV: Self = Self::ACCELERATION_STRUCTURE_READ_KHR; + pub const ACCELERATION_STRUCTURE_WRITE_NV: Self = Self::ACCELERATION_STRUCTURE_WRITE_KHR; pub const FRAGMENT_DENSITY_MAP_READ_EXT: Self = Self(0b1_0000_0000_0000_0000_0000_0000); pub const COLOR_ATTACHMENT_READ_NONCOHERENT_EXT: Self = Self(0b1000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_synchronization2'"] impl EventCreateFlags { - pub const DEVICE_ONLY_KHR: Self = Self(0b1); + pub const DEVICE_ONLY_KHR: Self = Self::DEVICE_ONLY; } #[doc = "Generated from 'VK_KHR_synchronization2'"] impl ImageLayout { - pub const READ_ONLY_OPTIMAL_KHR: Self = Self(1_000_314_000); - pub const ATTACHMENT_OPTIMAL_KHR: Self = Self(1_000_314_001); + pub const READ_ONLY_OPTIMAL_KHR: Self = Self::READ_ONLY_OPTIMAL; + pub const ATTACHMENT_OPTIMAL_KHR: Self = Self::ATTACHMENT_OPTIMAL; } #[doc = "Generated from 'VK_KHR_synchronization2'"] impl PipelineStageFlags { - pub const NONE_KHR: Self = Self(0); + pub const NONE_KHR: Self = Self::NONE; } #[doc = "Generated from 'VK_KHR_synchronization2'"] -impl PipelineStageFlags2KHR { +impl PipelineStageFlags2 { pub const TRANSFORM_FEEDBACK_EXT: Self = Self(0b1_0000_0000_0000_0000_0000_0000); #[doc = "A pipeline stage for conditional rendering predicate fetch"] pub const CONDITIONAL_RENDERING_EXT: Self = Self(0b100_0000_0000_0000_0000); pub const COMMAND_PREPROCESS_NV: Self = Self(0b10_0000_0000_0000_0000); - pub const FRAGMENT_SHADING_RATE_ATTACHMENT: Self = Self(0b100_0000_0000_0000_0000_0000); - pub const SHADING_RATE_IMAGE_NV: Self = Self::FRAGMENT_SHADING_RATE_ATTACHMENT; - pub const ACCELERATION_STRUCTURE_BUILD: Self = Self(0b10_0000_0000_0000_0000_0000_0000); - pub const RAY_TRACING_SHADER: Self = Self(0b10_0000_0000_0000_0000_0000); - pub const RAY_TRACING_SHADER_NV: Self = Self::RAY_TRACING_SHADER; - pub const ACCELERATION_STRUCTURE_BUILD_NV: Self = Self::ACCELERATION_STRUCTURE_BUILD; + pub const FRAGMENT_SHADING_RATE_ATTACHMENT_KHR: Self = Self(0b100_0000_0000_0000_0000_0000); + pub const SHADING_RATE_IMAGE_NV: Self = Self::FRAGMENT_SHADING_RATE_ATTACHMENT_KHR; + pub const ACCELERATION_STRUCTURE_BUILD_KHR: Self = Self(0b10_0000_0000_0000_0000_0000_0000); + pub const RAY_TRACING_SHADER_KHR: Self = Self(0b10_0000_0000_0000_0000_0000); + pub const RAY_TRACING_SHADER_NV: Self = Self::RAY_TRACING_SHADER_KHR; + pub const ACCELERATION_STRUCTURE_BUILD_NV: Self = Self::ACCELERATION_STRUCTURE_BUILD_KHR; pub const FRAGMENT_DENSITY_PROCESS_EXT: Self = Self(0b1000_0000_0000_0000_0000_0000); pub const TASK_SHADER_NV: Self = Self(0b1000_0000_0000_0000_0000); pub const MESH_SHADER_NV: Self = Self(0b1_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_synchronization2'"] impl StructureType { - pub const MEMORY_BARRIER_2_KHR: Self = Self(1_000_314_000); - pub const BUFFER_MEMORY_BARRIER_2_KHR: Self = Self(1_000_314_001); - pub const IMAGE_MEMORY_BARRIER_2_KHR: Self = Self(1_000_314_002); - pub const DEPENDENCY_INFO_KHR: Self = Self(1_000_314_003); - pub const SUBMIT_INFO_2_KHR: Self = Self(1_000_314_004); - pub const SEMAPHORE_SUBMIT_INFO_KHR: Self = Self(1_000_314_005); - pub const COMMAND_BUFFER_SUBMIT_INFO_KHR: Self = Self(1_000_314_006); - pub const PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: Self = Self(1_000_314_007); + pub const MEMORY_BARRIER_2_KHR: Self = Self::MEMORY_BARRIER_2; + pub const BUFFER_MEMORY_BARRIER_2_KHR: Self = Self::BUFFER_MEMORY_BARRIER_2; + pub const IMAGE_MEMORY_BARRIER_2_KHR: Self = Self::IMAGE_MEMORY_BARRIER_2; + pub const DEPENDENCY_INFO_KHR: Self = Self::DEPENDENCY_INFO; + pub const SUBMIT_INFO_2_KHR: Self = Self::SUBMIT_INFO_2; + pub const SEMAPHORE_SUBMIT_INFO_KHR: Self = Self::SEMAPHORE_SUBMIT_INFO; + pub const COMMAND_BUFFER_SUBMIT_INFO_KHR: Self = Self::COMMAND_BUFFER_SUBMIT_INFO; + pub const PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: Self = + Self::PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; pub const QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: Self = Self(1_000_314_008); pub const CHECKPOINT_DATA_2_NV: Self = Self(1_000_314_009); } impl AmdExtension316Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_316\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20371,7 +16960,7 @@ impl AmdExtension316Fn { } } impl AmdExtension317Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_317\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20389,7 +16978,7 @@ impl AmdExtension317Fn { } } #[doc = "Generated from 'VK_AMD_extension_317'"] -impl AccessFlags2KHR { +impl AccessFlags2 { pub const RESERVED_41_AMD: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_AMD_extension_317'"] @@ -20410,11 +16999,15 @@ impl ImageCreateFlags { pub const RESERVED_16_AMD: Self = Self(0b1_0000_0000_0000_0000); } #[doc = "Generated from 'VK_AMD_extension_317'"] +impl ImageViewCreateFlags { + pub const RESERVED_2_AMD: Self = Self(0b100); +} +#[doc = "Generated from 'VK_AMD_extension_317'"] impl SamplerCreateFlags { pub const RESERVED_3_AMD: Self = Self(0b1000); } impl AmdExtension318Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_318\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20432,7 +17025,7 @@ impl AmdExtension318Fn { } } impl AmdExtension319Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_319\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20458,7 +17051,7 @@ impl PipelineLayoutCreateFlags { pub const RESERVED_0_AMD: Self = Self(0b1); } impl AmdExtension320Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_320\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20476,7 +17069,7 @@ impl AmdExtension320Fn { } } impl AmdExtension321Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_321\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20503,7 +17096,7 @@ impl PipelineLayoutCreateFlags { pub const RESERVED_1_AMD: Self = Self(0b10); } impl AmdExtension322Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_322\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20521,7 +17114,7 @@ impl AmdExtension322Fn { } } impl AmdExtension323Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_AMD_extension_323\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20539,7 +17132,7 @@ impl AmdExtension323Fn { } } impl KhrShaderSubgroupUniformControlFlowFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_shader_subgroup_uniform_control_flow\0", @@ -20566,7 +17159,7 @@ impl StructureType { Self(1_000_323_000); } impl KhrExtension325Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_325\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20584,7 +17177,7 @@ impl KhrExtension325Fn { } } impl KhrZeroInitializeWorkgroupMemoryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_zero_initialize_workgroup_memory\0", @@ -20608,10 +17201,10 @@ impl KhrZeroInitializeWorkgroupMemoryFn { #[doc = "Generated from 'VK_KHR_zero_initialize_workgroup_memory'"] impl StructureType { pub const PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: Self = - Self(1_000_325_000); + Self::PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES; } impl NvFragmentShadingRateEnumsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_fragment_shading_rate_enums\0") } @@ -20659,15 +17252,6 @@ impl NvFragmentShadingRateEnumsFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_fragment_shading_rate_enum_nv( - &self, - command_buffer: CommandBuffer, - shading_rate: FragmentShadingRateNV, - combiner_ops: *const [FragmentShadingRateCombinerOpKHR; 2], - ) { - (self.cmd_set_fragment_shading_rate_enum_nv)(command_buffer, shading_rate, combiner_ops) - } } #[doc = "Generated from 'VK_NV_fragment_shading_rate_enums'"] impl StructureType { @@ -20676,7 +17260,7 @@ impl StructureType { pub const PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: Self = Self(1_000_326_002); } impl NvRayTracingMotionBlurFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_ray_tracing_motion_blur\0") } @@ -20714,7 +17298,7 @@ impl StructureType { pub const ACCELERATION_STRUCTURE_MOTION_INFO_NV: Self = Self(1_000_327_002); } impl NvExtension329Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_329\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20732,7 +17316,7 @@ impl NvExtension329Fn { } } impl NvExtension330Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_330\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20750,7 +17334,7 @@ impl NvExtension330Fn { } } impl ExtYcbcr2plane444FormatsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_ycbcr_2plane_444_formats\0") } @@ -20771,17 +17355,19 @@ impl ExtYcbcr2plane444FormatsFn { } #[doc = "Generated from 'VK_EXT_ycbcr_2plane_444_formats'"] impl Format { - pub const G8_B8R8_2PLANE_444_UNORM_EXT: Self = Self(1_000_330_000); - pub const G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT: Self = Self(1_000_330_001); - pub const G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT: Self = Self(1_000_330_002); - pub const G16_B16R16_2PLANE_444_UNORM_EXT: Self = Self(1_000_330_003); + pub const G8_B8R8_2PLANE_444_UNORM_EXT: Self = Self::G8_B8R8_2PLANE_444_UNORM; + pub const G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT: Self = + Self::G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16; + pub const G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT: Self = + Self::G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16; + pub const G16_B16R16_2PLANE_444_UNORM_EXT: Self = Self::G16_B16R16_2PLANE_444_UNORM; } #[doc = "Generated from 'VK_EXT_ycbcr_2plane_444_formats'"] impl StructureType { pub const PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: Self = Self(1_000_330_000); } impl NvExtension332Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_332\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20799,7 +17385,7 @@ impl NvExtension332Fn { } } impl ExtFragmentDensityMap2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_fragment_density_map2\0") } @@ -20828,7 +17414,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: Self = Self(1_000_332_001); } impl QcomRotatedCopyCommandsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_rotated_copy_commands\0") } @@ -20852,7 +17438,7 @@ impl StructureType { pub const COPY_COMMAND_TRANSFORM_INFO_QCOM: Self = Self(1_000_333_000); } impl KhrExtension335Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_335\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -20870,7 +17456,7 @@ impl KhrExtension335Fn { } } impl ExtImageRobustnessFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_image_robustness\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -20889,10 +17475,11 @@ impl ExtImageRobustnessFn { } #[doc = "Generated from 'VK_EXT_image_robustness'"] impl StructureType { - pub const PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: Self = Self(1_000_335_000); + pub const PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: Self = + Self::PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; } impl KhrWorkgroupMemoryExplicitLayoutFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_KHR_workgroup_memory_explicit_layout\0", @@ -20919,49 +17506,49 @@ impl StructureType { Self(1_000_336_000); } impl KhrCopyCommands2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_copy_commands2\0") } } pub const SPEC_VERSION: u32 = 1u32; } #[allow(non_camel_case_types)] -pub type PFN_vkCmdCopyBuffer2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdCopyBuffer2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_copy_buffer_info: *const CopyBufferInfo2KHR, + p_copy_buffer_info: *const CopyBufferInfo2, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdCopyImage2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdCopyImage2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_copy_image_info: *const CopyImageInfo2KHR, + p_copy_image_info: *const CopyImageInfo2, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdCopyBufferToImage2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdCopyBufferToImage2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_copy_buffer_to_image_info: *const CopyBufferToImageInfo2KHR, + p_copy_buffer_to_image_info: *const CopyBufferToImageInfo2, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdCopyImageToBuffer2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdCopyImageToBuffer2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_copy_image_to_buffer_info: *const CopyImageToBufferInfo2KHR, + p_copy_image_to_buffer_info: *const CopyImageToBufferInfo2, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdBlitImage2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdBlitImage2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_blit_image_info: *const BlitImageInfo2KHR, + p_blit_image_info: *const BlitImageInfo2, ); #[allow(non_camel_case_types)] -pub type PFN_vkCmdResolveImage2KHR = unsafe extern "system" fn( +pub type PFN_vkCmdResolveImage2 = unsafe extern "system" fn( command_buffer: CommandBuffer, - p_resolve_image_info: *const ResolveImageInfo2KHR, + p_resolve_image_info: *const ResolveImageInfo2, ); #[derive(Clone)] pub struct KhrCopyCommands2Fn { - pub cmd_copy_buffer2_khr: PFN_vkCmdCopyBuffer2KHR, - pub cmd_copy_image2_khr: PFN_vkCmdCopyImage2KHR, - pub cmd_copy_buffer_to_image2_khr: PFN_vkCmdCopyBufferToImage2KHR, - pub cmd_copy_image_to_buffer2_khr: PFN_vkCmdCopyImageToBuffer2KHR, - pub cmd_blit_image2_khr: PFN_vkCmdBlitImage2KHR, - pub cmd_resolve_image2_khr: PFN_vkCmdResolveImage2KHR, + pub cmd_copy_buffer2_khr: PFN_vkCmdCopyBuffer2, + pub cmd_copy_image2_khr: PFN_vkCmdCopyImage2, + pub cmd_copy_buffer_to_image2_khr: PFN_vkCmdCopyBufferToImage2, + pub cmd_copy_image_to_buffer2_khr: PFN_vkCmdCopyImageToBuffer2, + pub cmd_blit_image2_khr: PFN_vkCmdBlitImage2, + pub cmd_resolve_image2_khr: PFN_vkCmdResolveImage2, } unsafe impl Send for KhrCopyCommands2Fn {} unsafe impl Sync for KhrCopyCommands2Fn {} @@ -20974,7 +17561,7 @@ impl KhrCopyCommands2Fn { cmd_copy_buffer2_khr: unsafe { unsafe extern "system" fn cmd_copy_buffer2_khr( _command_buffer: CommandBuffer, - _p_copy_buffer_info: *const CopyBufferInfo2KHR, + _p_copy_buffer_info: *const CopyBufferInfo2, ) { panic!(concat!("Unable to load ", stringify!(cmd_copy_buffer2_khr))) } @@ -20990,7 +17577,7 @@ impl KhrCopyCommands2Fn { cmd_copy_image2_khr: unsafe { unsafe extern "system" fn cmd_copy_image2_khr( _command_buffer: CommandBuffer, - _p_copy_image_info: *const CopyImageInfo2KHR, + _p_copy_image_info: *const CopyImageInfo2, ) { panic!(concat!("Unable to load ", stringify!(cmd_copy_image2_khr))) } @@ -21006,7 +17593,7 @@ impl KhrCopyCommands2Fn { cmd_copy_buffer_to_image2_khr: unsafe { unsafe extern "system" fn cmd_copy_buffer_to_image2_khr( _command_buffer: CommandBuffer, - _p_copy_buffer_to_image_info: *const CopyBufferToImageInfo2KHR, + _p_copy_buffer_to_image_info: *const CopyBufferToImageInfo2, ) { panic!(concat!( "Unable to load ", @@ -21026,7 +17613,7 @@ impl KhrCopyCommands2Fn { cmd_copy_image_to_buffer2_khr: unsafe { unsafe extern "system" fn cmd_copy_image_to_buffer2_khr( _command_buffer: CommandBuffer, - _p_copy_image_to_buffer_info: *const CopyImageToBufferInfo2KHR, + _p_copy_image_to_buffer_info: *const CopyImageToBufferInfo2, ) { panic!(concat!( "Unable to load ", @@ -21046,7 +17633,7 @@ impl KhrCopyCommands2Fn { cmd_blit_image2_khr: unsafe { unsafe extern "system" fn cmd_blit_image2_khr( _command_buffer: CommandBuffer, - _p_blit_image_info: *const BlitImageInfo2KHR, + _p_blit_image_info: *const BlitImageInfo2, ) { panic!(concat!("Unable to load ", stringify!(cmd_blit_image2_khr))) } @@ -21062,7 +17649,7 @@ impl KhrCopyCommands2Fn { cmd_resolve_image2_khr: unsafe { unsafe extern "system" fn cmd_resolve_image2_khr( _command_buffer: CommandBuffer, - _p_resolve_image_info: *const ResolveImageInfo2KHR, + _p_resolve_image_info: *const ResolveImageInfo2, ) { panic!(concat!( "Unable to load ", @@ -21080,71 +17667,23 @@ impl KhrCopyCommands2Fn { }, } } - #[doc = ""] - pub unsafe fn cmd_copy_buffer2_khr( - &self, - command_buffer: CommandBuffer, - p_copy_buffer_info: *const CopyBufferInfo2KHR, - ) { - (self.cmd_copy_buffer2_khr)(command_buffer, p_copy_buffer_info) - } - #[doc = ""] - pub unsafe fn cmd_copy_image2_khr( - &self, - command_buffer: CommandBuffer, - p_copy_image_info: *const CopyImageInfo2KHR, - ) { - (self.cmd_copy_image2_khr)(command_buffer, p_copy_image_info) - } - #[doc = ""] - pub unsafe fn cmd_copy_buffer_to_image2_khr( - &self, - command_buffer: CommandBuffer, - p_copy_buffer_to_image_info: *const CopyBufferToImageInfo2KHR, - ) { - (self.cmd_copy_buffer_to_image2_khr)(command_buffer, p_copy_buffer_to_image_info) - } - #[doc = ""] - pub unsafe fn cmd_copy_image_to_buffer2_khr( - &self, - command_buffer: CommandBuffer, - p_copy_image_to_buffer_info: *const CopyImageToBufferInfo2KHR, - ) { - (self.cmd_copy_image_to_buffer2_khr)(command_buffer, p_copy_image_to_buffer_info) - } - #[doc = ""] - pub unsafe fn cmd_blit_image2_khr( - &self, - command_buffer: CommandBuffer, - p_blit_image_info: *const BlitImageInfo2KHR, - ) { - (self.cmd_blit_image2_khr)(command_buffer, p_blit_image_info) - } - #[doc = ""] - pub unsafe fn cmd_resolve_image2_khr( - &self, - command_buffer: CommandBuffer, - p_resolve_image_info: *const ResolveImageInfo2KHR, - ) { - (self.cmd_resolve_image2_khr)(command_buffer, p_resolve_image_info) - } } #[doc = "Generated from 'VK_KHR_copy_commands2'"] impl StructureType { - pub const COPY_BUFFER_INFO_2_KHR: Self = Self(1_000_337_000); - pub const COPY_IMAGE_INFO_2_KHR: Self = Self(1_000_337_001); - pub const COPY_BUFFER_TO_IMAGE_INFO_2_KHR: Self = Self(1_000_337_002); - pub const COPY_IMAGE_TO_BUFFER_INFO_2_KHR: Self = Self(1_000_337_003); - pub const BLIT_IMAGE_INFO_2_KHR: Self = Self(1_000_337_004); - pub const RESOLVE_IMAGE_INFO_2_KHR: Self = Self(1_000_337_005); - pub const BUFFER_COPY_2_KHR: Self = Self(1_000_337_006); - pub const IMAGE_COPY_2_KHR: Self = Self(1_000_337_007); - pub const IMAGE_BLIT_2_KHR: Self = Self(1_000_337_008); - pub const BUFFER_IMAGE_COPY_2_KHR: Self = Self(1_000_337_009); - pub const IMAGE_RESOLVE_2_KHR: Self = Self(1_000_337_010); + pub const COPY_BUFFER_INFO_2_KHR: Self = Self::COPY_BUFFER_INFO_2; + pub const COPY_IMAGE_INFO_2_KHR: Self = Self::COPY_IMAGE_INFO_2; + pub const COPY_BUFFER_TO_IMAGE_INFO_2_KHR: Self = Self::COPY_BUFFER_TO_IMAGE_INFO_2; + pub const COPY_IMAGE_TO_BUFFER_INFO_2_KHR: Self = Self::COPY_IMAGE_TO_BUFFER_INFO_2; + pub const BLIT_IMAGE_INFO_2_KHR: Self = Self::BLIT_IMAGE_INFO_2; + pub const RESOLVE_IMAGE_INFO_2_KHR: Self = Self::RESOLVE_IMAGE_INFO_2; + pub const BUFFER_COPY_2_KHR: Self = Self::BUFFER_COPY_2; + pub const IMAGE_COPY_2_KHR: Self = Self::IMAGE_COPY_2; + pub const IMAGE_BLIT_2_KHR: Self = Self::IMAGE_BLIT_2; + pub const BUFFER_IMAGE_COPY_2_KHR: Self = Self::BUFFER_IMAGE_COPY_2; + pub const IMAGE_RESOLVE_2_KHR: Self = Self::IMAGE_RESOLVE_2; } impl ArmExtension339Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_339\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21162,7 +17701,7 @@ impl ArmExtension339Fn { } } impl ExtExtension340Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_340\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21184,7 +17723,7 @@ impl ImageUsageFlags { pub const RESERVED_19_EXT: Self = Self(0b1000_0000_0000_0000_0000); } impl Ext4444FormatsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_4444_formats\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -21203,15 +17742,15 @@ impl Ext4444FormatsFn { } #[doc = "Generated from 'VK_EXT_4444_formats'"] impl Format { - pub const A4R4G4B4_UNORM_PACK16_EXT: Self = Self(1_000_340_000); - pub const A4B4G4R4_UNORM_PACK16_EXT: Self = Self(1_000_340_001); + pub const A4R4G4B4_UNORM_PACK16_EXT: Self = Self::A4R4G4B4_UNORM_PACK16; + pub const A4B4G4R4_UNORM_PACK16_EXT: Self = Self::A4B4G4R4_UNORM_PACK16; } #[doc = "Generated from 'VK_EXT_4444_formats'"] impl StructureType { pub const PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: Self = Self(1_000_340_000); } impl ExtExtension342Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_342\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21229,7 +17768,7 @@ impl ExtExtension342Fn { } } impl ArmRasterizationOrderAttachmentAccessFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_ARM_rasterization_order_attachment_access\0", @@ -21271,7 +17810,7 @@ impl SubpassDescriptionFlags { pub const RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_ARM: Self = Self(0b100_0000); } impl ArmExtension344Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_344\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21289,7 +17828,7 @@ impl ArmExtension344Fn { } } impl ExtRgba10x6FormatsFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_rgba10x6_formats\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -21311,7 +17850,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: Self = Self(1_000_344_000); } impl NvAcquireWinrtDisplayFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_acquire_winrt_display\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -21376,26 +17915,9 @@ impl NvAcquireWinrtDisplayFn { }, } } - #[doc = ""] - pub unsafe fn acquire_winrt_display_nv( - &self, - physical_device: PhysicalDevice, - display: DisplayKHR, - ) -> Result { - (self.acquire_winrt_display_nv)(physical_device, display) - } - #[doc = ""] - pub unsafe fn get_winrt_display_nv( - &self, - physical_device: PhysicalDevice, - device_relative_id: u32, - p_display: *mut DisplayKHR, - ) -> Result { - (self.get_winrt_display_nv)(physical_device, device_relative_id, p_display) - } } impl ExtDirectfbSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_directfb_surface\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -21473,36 +17995,13 @@ impl ExtDirectfbSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_direct_fb_surface_ext( - &self, - instance: Instance, - p_create_info: *const DirectFBSurfaceCreateInfoEXT, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_direct_fb_surface_ext)(instance, p_create_info, p_allocator, p_surface) - } - #[doc = ""] - pub unsafe fn get_physical_device_direct_fb_presentation_support_ext( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - dfb: *mut IDirectFB, - ) -> Bool32 { - (self.get_physical_device_direct_fb_presentation_support_ext)( - physical_device, - queue_family_index, - dfb, - ) - } } #[doc = "Generated from 'VK_EXT_directfb_surface'"] impl StructureType { pub const DIRECTFB_SURFACE_CREATE_INFO_EXT: Self = Self(1_000_346_000); } impl KhrExtension350Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_350\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21520,7 +18019,7 @@ impl KhrExtension350Fn { } } impl NvExtension351Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_351\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21538,7 +18037,7 @@ impl NvExtension351Fn { } } impl ValveMutableDescriptorTypeFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_VALVE_mutable_descriptor_type\0") } @@ -21575,7 +18074,7 @@ impl StructureType { pub const MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: Self = Self(1_000_351_002); } impl ExtVertexInputDynamicStateFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_vertex_input_dynamic_state\0") } @@ -21626,23 +18125,6 @@ impl ExtVertexInputDynamicStateFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_vertex_input_ext( - &self, - command_buffer: CommandBuffer, - vertex_binding_description_count: u32, - p_vertex_binding_descriptions: *const VertexInputBindingDescription2EXT, - vertex_attribute_description_count: u32, - p_vertex_attribute_descriptions: *const VertexInputAttributeDescription2EXT, - ) { - (self.cmd_set_vertex_input_ext)( - command_buffer, - vertex_binding_description_count, - p_vertex_binding_descriptions, - vertex_attribute_description_count, - p_vertex_attribute_descriptions, - ) - } } #[doc = "Generated from 'VK_EXT_vertex_input_dynamic_state'"] impl DynamicState { @@ -21655,7 +18137,7 @@ impl StructureType { pub const VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT: Self = Self(1_000_352_002); } impl ExtPhysicalDeviceDrmFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_physical_device_drm\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -21677,7 +18159,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: Self = Self(1_000_353_000); } impl ExtExtension355Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_355\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21695,7 +18177,7 @@ impl ExtExtension355Fn { } } impl ExtDepthClipControlFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_depth_clip_control\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -21718,7 +18200,7 @@ impl StructureType { pub const PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT: Self = Self(1_000_355_001); } impl ExtPrimitiveTopologyListRestartFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_EXT_primitive_topology_list_restart\0", @@ -21745,7 +18227,7 @@ impl StructureType { Self(1_000_356_000); } impl KhrExtension358Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_358\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21763,7 +18245,7 @@ impl KhrExtension358Fn { } } impl ExtExtension359Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_359\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21781,7 +18263,7 @@ impl ExtExtension359Fn { } } impl ExtExtension360Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_360\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21799,7 +18281,7 @@ impl ExtExtension360Fn { } } impl KhrFormatFeatureFlags2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_format_feature_flags2\0") } @@ -21820,10 +18302,10 @@ impl KhrFormatFeatureFlags2Fn { } #[doc = "Generated from 'VK_KHR_format_feature_flags2'"] impl StructureType { - pub const FORMAT_PROPERTIES_3_KHR: Self = Self(1_000_360_000); + pub const FORMAT_PROPERTIES_3_KHR: Self = Self::FORMAT_PROPERTIES_3; } impl ExtExtension362Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_362\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21841,7 +18323,7 @@ impl ExtExtension362Fn { } } impl ExtExtension363Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_363\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21859,7 +18341,7 @@ impl ExtExtension363Fn { } } impl FuchsiaExtension364Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FUCHSIA_extension_364\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -21877,7 +18359,7 @@ impl FuchsiaExtension364Fn { } } impl FuchsiaExternalMemoryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FUCHSIA_external_memory\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -21953,30 +18435,6 @@ impl FuchsiaExternalMemoryFn { }, } } - #[doc = ""] - pub unsafe fn get_memory_zircon_handle_fuchsia( - &self, - device: Device, - p_get_zircon_handle_info: *const MemoryGetZirconHandleInfoFUCHSIA, - p_zircon_handle: *mut zx_handle_t, - ) -> Result { - (self.get_memory_zircon_handle_fuchsia)(device, p_get_zircon_handle_info, p_zircon_handle) - } - #[doc = ""] - pub unsafe fn get_memory_zircon_handle_properties_fuchsia( - &self, - device: Device, - handle_type: ExternalMemoryHandleTypeFlags, - zircon_handle: zx_handle_t, - p_memory_zircon_handle_properties: *mut MemoryZirconHandlePropertiesFUCHSIA, - ) -> Result { - (self.get_memory_zircon_handle_properties_fuchsia)( - device, - handle_type, - zircon_handle, - p_memory_zircon_handle_properties, - ) - } } #[doc = "Generated from 'VK_FUCHSIA_external_memory'"] impl ExternalMemoryHandleTypeFlags { @@ -21989,7 +18447,7 @@ impl StructureType { pub const MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA: Self = Self(1_000_364_002); } impl FuchsiaExternalSemaphoreFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FUCHSIA_external_semaphore\0") } @@ -22063,27 +18521,6 @@ impl FuchsiaExternalSemaphoreFn { }, } } - #[doc = ""] - pub unsafe fn import_semaphore_zircon_handle_fuchsia( - &self, - device: Device, - p_import_semaphore_zircon_handle_info: *const ImportSemaphoreZirconHandleInfoFUCHSIA, - ) -> Result { - (self.import_semaphore_zircon_handle_fuchsia)(device, p_import_semaphore_zircon_handle_info) - } - #[doc = ""] - pub unsafe fn get_semaphore_zircon_handle_fuchsia( - &self, - device: Device, - p_get_zircon_handle_info: *const SemaphoreGetZirconHandleInfoFUCHSIA, - p_zircon_handle: *mut zx_handle_t, - ) -> Result { - (self.get_semaphore_zircon_handle_fuchsia)( - device, - p_get_zircon_handle_info, - p_zircon_handle, - ) - } } #[doc = "Generated from 'VK_FUCHSIA_external_semaphore'"] impl ExternalSemaphoreHandleTypeFlags { @@ -22095,7 +18532,7 @@ impl StructureType { pub const SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA: Self = Self(1_000_365_001); } impl FuchsiaBufferCollectionFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FUCHSIA_buffer_collection\0") } @@ -22259,60 +18696,6 @@ impl FuchsiaBufferCollectionFn { }, } } - #[doc = ""] - pub unsafe fn create_buffer_collection_fuchsia( - &self, - device: Device, - p_create_info: *const BufferCollectionCreateInfoFUCHSIA, - p_allocator: *const AllocationCallbacks, - p_collection: *mut BufferCollectionFUCHSIA, - ) -> Result { - (self.create_buffer_collection_fuchsia)(device, p_create_info, p_allocator, p_collection) - } - #[doc = ""] - pub unsafe fn set_buffer_collection_image_constraints_fuchsia( - &self, - device: Device, - collection: BufferCollectionFUCHSIA, - p_image_constraints_info: *const ImageConstraintsInfoFUCHSIA, - ) -> Result { - (self.set_buffer_collection_image_constraints_fuchsia)( - device, - collection, - p_image_constraints_info, - ) - } - #[doc = ""] - pub unsafe fn set_buffer_collection_buffer_constraints_fuchsia( - &self, - device: Device, - collection: BufferCollectionFUCHSIA, - p_buffer_constraints_info: *const BufferConstraintsInfoFUCHSIA, - ) -> Result { - (self.set_buffer_collection_buffer_constraints_fuchsia)( - device, - collection, - p_buffer_constraints_info, - ) - } - #[doc = ""] - pub unsafe fn destroy_buffer_collection_fuchsia( - &self, - device: Device, - collection: BufferCollectionFUCHSIA, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_buffer_collection_fuchsia)(device, collection, p_allocator) - } - #[doc = ""] - pub unsafe fn get_buffer_collection_properties_fuchsia( - &self, - device: Device, - collection: BufferCollectionFUCHSIA, - p_properties: *mut BufferCollectionPropertiesFUCHSIA, - ) -> Result { - (self.get_buffer_collection_properties_fuchsia)(device, collection, p_properties) - } } #[doc = "Generated from 'VK_FUCHSIA_buffer_collection'"] impl DebugReportObjectTypeEXT { @@ -22337,7 +18720,7 @@ impl StructureType { pub const BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA: Self = Self(1_000_366_009); } impl FuchsiaExtension368Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FUCHSIA_extension_368\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -22355,7 +18738,7 @@ impl FuchsiaExtension368Fn { } } impl QcomExtension369Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_369\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -22377,7 +18760,7 @@ impl DescriptorBindingFlags { pub const RESERVED_4_QCOM: Self = Self(0b1_0000); } impl HuaweiSubpassShadingFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_HUAWEI_subpass_shading\0") } } pub const SPEC_VERSION: u32 = 2u32; @@ -22445,30 +18828,13 @@ impl HuaweiSubpassShadingFn { }, } } - #[doc = ""] - pub unsafe fn get_device_subpass_shading_max_workgroup_size_huawei( - &self, - device: Device, - renderpass: RenderPass, - p_max_workgroup_size: *mut Extent2D, - ) -> Result { - (self.get_device_subpass_shading_max_workgroup_size_huawei)( - device, - renderpass, - p_max_workgroup_size, - ) - } - #[doc = ""] - pub unsafe fn cmd_subpass_shading_huawei(&self, command_buffer: CommandBuffer) { - (self.cmd_subpass_shading_huawei)(command_buffer) - } } #[doc = "Generated from 'VK_HUAWEI_subpass_shading'"] impl PipelineBindPoint { pub const SUBPASS_SHADING_HUAWEI: Self = Self(1_000_369_003); } #[doc = "Generated from 'VK_HUAWEI_subpass_shading'"] -impl PipelineStageFlags2KHR { +impl PipelineStageFlags2 { pub const SUBPASS_SHADING_HUAWEI: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000_0000); } @@ -22483,7 +18849,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: Self = Self(1_000_369_002); } impl HuaweiInvocationMaskFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_HUAWEI_invocation_mask\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -22529,18 +18895,9 @@ impl HuaweiInvocationMaskFn { }, } } - #[doc = ""] - pub unsafe fn cmd_bind_invocation_mask_huawei( - &self, - command_buffer: CommandBuffer, - image_view: ImageView, - image_layout: ImageLayout, - ) { - (self.cmd_bind_invocation_mask_huawei)(command_buffer, image_view, image_layout) - } } #[doc = "Generated from 'VK_HUAWEI_invocation_mask'"] -impl AccessFlags2KHR { +impl AccessFlags2 { pub const INVOCATION_MASK_READ_HUAWEI: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000_0000); } @@ -22549,7 +18906,7 @@ impl ImageUsageFlags { pub const INVOCATION_MASK_HUAWEI: Self = Self(0b100_0000_0000_0000_0000); } #[doc = "Generated from 'VK_HUAWEI_invocation_mask'"] -impl PipelineStageFlags2KHR { +impl PipelineStageFlags2 { pub const INVOCATION_MASK_HUAWEI: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000); } @@ -22558,7 +18915,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: Self = Self(1_000_370_000); } impl NvExternalMemoryRdmaFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_external_memory_rdma\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -22604,15 +18961,6 @@ impl NvExternalMemoryRdmaFn { }, } } - #[doc = ""] - pub unsafe fn get_memory_remote_address_nv( - &self, - device: Device, - p_memory_get_remote_address_info: *const MemoryGetRemoteAddressInfoNV, - p_address: *mut RemoteAddressNV, - ) -> Result { - (self.get_memory_remote_address_nv)(device, p_memory_get_remote_address_info, p_address) - } } #[doc = "Generated from 'VK_NV_external_memory_rdma'"] impl ExternalMemoryHandleTypeFlags { @@ -22628,7 +18976,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: Self = Self(1_000_371_001); } impl NvExtension373Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_373\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -22646,7 +18994,7 @@ impl NvExtension373Fn { } } impl NvExtension374Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_374\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -22674,7 +19022,7 @@ impl ExternalSemaphoreHandleTypeFlags { pub const RESERVED_6_NV: Self = Self(0b100_0000); } impl NvExtension375Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_375\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -22696,7 +19044,7 @@ impl ExternalMemoryHandleTypeFlags { pub const RESERVED_13_NV: Self = Self(0b10_0000_0000_0000); } impl ExtExtension376Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_376\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -22714,7 +19062,7 @@ impl ExtExtension376Fn { } } impl ExtExtension377Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_377\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -22731,8 +19079,12 @@ impl ExtExtension377Fn { Self {} } } +#[doc = "Generated from 'VK_EXT_extension_377'"] +impl ImageCreateFlags { + pub const RESERVED_18_EXT: Self = Self(0b100_0000_0000_0000_0000); +} impl ExtExtendedDynamicState2Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extended_dynamic_state2\0") } @@ -22743,24 +19095,24 @@ impl ExtExtendedDynamicState2Fn { pub type PFN_vkCmdSetPatchControlPointsEXT = unsafe extern "system" fn(command_buffer: CommandBuffer, patch_control_points: u32); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetRasterizerDiscardEnableEXT = +pub type PFN_vkCmdSetRasterizerDiscardEnable = unsafe extern "system" fn(command_buffer: CommandBuffer, rasterizer_discard_enable: Bool32); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetDepthBiasEnableEXT = +pub type PFN_vkCmdSetDepthBiasEnable = unsafe extern "system" fn(command_buffer: CommandBuffer, depth_bias_enable: Bool32); #[allow(non_camel_case_types)] pub type PFN_vkCmdSetLogicOpEXT = unsafe extern "system" fn(command_buffer: CommandBuffer, logic_op: LogicOp); #[allow(non_camel_case_types)] -pub type PFN_vkCmdSetPrimitiveRestartEnableEXT = +pub type PFN_vkCmdSetPrimitiveRestartEnable = unsafe extern "system" fn(command_buffer: CommandBuffer, primitive_restart_enable: Bool32); #[derive(Clone)] pub struct ExtExtendedDynamicState2Fn { pub cmd_set_patch_control_points_ext: PFN_vkCmdSetPatchControlPointsEXT, - pub cmd_set_rasterizer_discard_enable_ext: PFN_vkCmdSetRasterizerDiscardEnableEXT, - pub cmd_set_depth_bias_enable_ext: PFN_vkCmdSetDepthBiasEnableEXT, + pub cmd_set_rasterizer_discard_enable_ext: PFN_vkCmdSetRasterizerDiscardEnable, + pub cmd_set_depth_bias_enable_ext: PFN_vkCmdSetDepthBiasEnable, pub cmd_set_logic_op_ext: PFN_vkCmdSetLogicOpEXT, - pub cmd_set_primitive_restart_enable_ext: PFN_vkCmdSetPrimitiveRestartEnableEXT, + pub cmd_set_primitive_restart_enable_ext: PFN_vkCmdSetPrimitiveRestartEnable, } unsafe impl Send for ExtExtendedDynamicState2Fn {} unsafe impl Sync for ExtExtendedDynamicState2Fn {} @@ -22868,57 +19220,24 @@ impl ExtExtendedDynamicState2Fn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_patch_control_points_ext( - &self, - command_buffer: CommandBuffer, - patch_control_points: u32, - ) { - (self.cmd_set_patch_control_points_ext)(command_buffer, patch_control_points) - } - #[doc = ""] - pub unsafe fn cmd_set_rasterizer_discard_enable_ext( - &self, - command_buffer: CommandBuffer, - rasterizer_discard_enable: Bool32, - ) { - (self.cmd_set_rasterizer_discard_enable_ext)(command_buffer, rasterizer_discard_enable) - } - #[doc = ""] - pub unsafe fn cmd_set_depth_bias_enable_ext( - &self, - command_buffer: CommandBuffer, - depth_bias_enable: Bool32, - ) { - (self.cmd_set_depth_bias_enable_ext)(command_buffer, depth_bias_enable) - } - #[doc = ""] - pub unsafe fn cmd_set_logic_op_ext(&self, command_buffer: CommandBuffer, logic_op: LogicOp) { - (self.cmd_set_logic_op_ext)(command_buffer, logic_op) - } - #[doc = ""] - pub unsafe fn cmd_set_primitive_restart_enable_ext( - &self, - command_buffer: CommandBuffer, - primitive_restart_enable: Bool32, - ) { - (self.cmd_set_primitive_restart_enable_ext)(command_buffer, primitive_restart_enable) - } } #[doc = "Generated from 'VK_EXT_extended_dynamic_state2'"] impl DynamicState { + #[doc = "Not promoted to 1.3"] pub const PATCH_CONTROL_POINTS_EXT: Self = Self(1_000_377_000); - pub const RASTERIZER_DISCARD_ENABLE_EXT: Self = Self(1_000_377_001); - pub const DEPTH_BIAS_ENABLE_EXT: Self = Self(1_000_377_002); + pub const RASTERIZER_DISCARD_ENABLE_EXT: Self = Self::RASTERIZER_DISCARD_ENABLE; + pub const DEPTH_BIAS_ENABLE_EXT: Self = Self::DEPTH_BIAS_ENABLE; + #[doc = "Not promoted to 1.3"] pub const LOGIC_OP_EXT: Self = Self(1_000_377_003); - pub const PRIMITIVE_RESTART_ENABLE_EXT: Self = Self(1_000_377_004); + pub const PRIMITIVE_RESTART_ENABLE_EXT: Self = Self::PRIMITIVE_RESTART_ENABLE; } #[doc = "Generated from 'VK_EXT_extended_dynamic_state2'"] impl StructureType { + #[doc = "Not promoted to 1.3"] pub const PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: Self = Self(1_000_377_000); } impl QnxScreenSurfaceFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QNX_screen_surface\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -22994,36 +19313,13 @@ impl QnxScreenSurfaceFn { }, } } - #[doc = ""] - pub unsafe fn create_screen_surface_qnx( - &self, - instance: Instance, - p_create_info: *const ScreenSurfaceCreateInfoQNX, - p_allocator: *const AllocationCallbacks, - p_surface: *mut SurfaceKHR, - ) -> Result { - (self.create_screen_surface_qnx)(instance, p_create_info, p_allocator, p_surface) - } - #[doc = ""] - pub unsafe fn get_physical_device_screen_presentation_support_qnx( - &self, - physical_device: PhysicalDevice, - queue_family_index: u32, - window: *mut _screen_window, - ) -> Bool32 { - (self.get_physical_device_screen_presentation_support_qnx)( - physical_device, - queue_family_index, - window, - ) - } } #[doc = "Generated from 'VK_QNX_screen_surface'"] impl StructureType { pub const SCREEN_SURFACE_CREATE_INFO_QNX: Self = Self(1_000_378_000); } impl KhrExtension380Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_380\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23041,7 +19337,7 @@ impl KhrExtension380Fn { } } impl KhrExtension381Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_381\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23059,7 +19355,7 @@ impl KhrExtension381Fn { } } impl ExtColorWriteEnableFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_color_write_enable\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -23105,19 +19401,6 @@ impl ExtColorWriteEnableFn { }, } } - #[doc = ""] - pub unsafe fn cmd_set_color_write_enable_ext( - &self, - command_buffer: CommandBuffer, - attachment_count: u32, - p_color_write_enables: *const Bool32, - ) { - (self.cmd_set_color_write_enable_ext)( - command_buffer, - attachment_count, - p_color_write_enables, - ) - } } #[doc = "Generated from 'VK_EXT_color_write_enable'"] impl DynamicState { @@ -23129,7 +19412,7 @@ impl StructureType { pub const PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: Self = Self(1_000_381_001); } impl ExtExtension383Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_383\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23147,7 +19430,7 @@ impl ExtExtension383Fn { } } impl ExtExtension384Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_384\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23165,7 +19448,7 @@ impl ExtExtension384Fn { } } impl MesaExtension385Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_MESA_extension_385\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23183,7 +19466,7 @@ impl MesaExtension385Fn { } } impl GoogleExtension386Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_386\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23201,7 +19484,7 @@ impl GoogleExtension386Fn { } } impl KhrExtension387Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_387\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23219,15 +19502,15 @@ impl KhrExtension387Fn { } } #[doc = "Generated from 'VK_KHR_extension_387'"] -impl AccessFlags2KHR { - pub const RESERVED_387: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000); +impl AccessFlags2 { + pub const RESERVED_387_KHR: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000); } #[doc = "Generated from 'VK_KHR_extension_387'"] -impl PipelineStageFlags2KHR { - pub const RESERVED_387: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000); +impl PipelineStageFlags2 { + pub const RESERVED_387_KHR: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000); } impl ExtExtension388Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_388\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23245,7 +19528,7 @@ impl ExtExtension388Fn { } } impl ExtGlobalPriorityQueryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_global_priority_query\0") } @@ -23266,11 +19549,13 @@ impl ExtGlobalPriorityQueryFn { } #[doc = "Generated from 'VK_EXT_global_priority_query'"] impl StructureType { - pub const PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: Self = Self(1_000_388_000); - pub const QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: Self = Self(1_000_388_001); + pub const PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: Self = + Self::PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; + pub const QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: Self = + Self::QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR; } impl ExtExtension390Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_390\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23288,7 +19573,7 @@ impl ExtExtension390Fn { } } impl ExtExtension391Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_391\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23306,7 +19591,7 @@ impl ExtExtension391Fn { } } impl ExtImageViewMinLodFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_image_view_min_lod\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -23329,7 +19614,7 @@ impl StructureType { pub const IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT: Self = Self(1_000_391_001); } impl ExtMultiDrawFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_multi_draw\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -23411,46 +19696,6 @@ impl ExtMultiDrawFn { }, } } - #[doc = ""] - pub unsafe fn cmd_draw_multi_ext( - &self, - command_buffer: CommandBuffer, - draw_count: u32, - p_vertex_info: *const MultiDrawInfoEXT, - instance_count: u32, - first_instance: u32, - stride: u32, - ) { - (self.cmd_draw_multi_ext)( - command_buffer, - draw_count, - p_vertex_info, - instance_count, - first_instance, - stride, - ) - } - #[doc = ""] - pub unsafe fn cmd_draw_multi_indexed_ext( - &self, - command_buffer: CommandBuffer, - draw_count: u32, - p_index_info: *const MultiDrawIndexedInfoEXT, - instance_count: u32, - first_instance: u32, - stride: u32, - p_vertex_offset: *const i32, - ) { - (self.cmd_draw_multi_indexed_ext)( - command_buffer, - draw_count, - p_index_info, - instance_count, - first_instance, - stride, - p_vertex_offset, - ) - } } #[doc = "Generated from 'VK_EXT_multi_draw'"] impl StructureType { @@ -23458,7 +19703,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: Self = Self(1_000_392_001); } impl ExtExtension394Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_394\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23479,17 +19724,19 @@ impl ExtExtension394Fn { impl ImageCreateFlags { pub const RESERVED_394_EXT: Self = Self(0b10_0000_0000_0000_0000); } -impl KhrExtension395Fn { - pub fn name() -> &'static ::std::ffi::CStr { - unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_395\0") } +impl KhrPortabilityEnumerationFn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_portability_enumeration\0") + } } - pub const SPEC_VERSION: u32 = 0u32; + pub const SPEC_VERSION: u32 = 1u32; } #[derive(Clone)] -pub struct KhrExtension395Fn {} -unsafe impl Send for KhrExtension395Fn {} -unsafe impl Sync for KhrExtension395Fn {} -impl KhrExtension395Fn { +pub struct KhrPortabilityEnumerationFn {} +unsafe impl Send for KhrPortabilityEnumerationFn {} +unsafe impl Sync for KhrPortabilityEnumerationFn {} +impl KhrPortabilityEnumerationFn { pub fn load(mut _f: F) -> Self where F: FnMut(&::std::ffi::CStr) -> *const c_void, @@ -23497,8 +19744,12 @@ impl KhrExtension395Fn { Self {} } } +#[doc = "Generated from 'VK_KHR_portability_enumeration'"] +impl InstanceCreateFlags { + pub const ENUMERATE_PORTABILITY_KHR: Self = Self(0b1); +} impl KhrExtension396Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_396\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23516,7 +19767,7 @@ impl KhrExtension396Fn { } } impl NvExtension397Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_397\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23534,7 +19785,7 @@ impl NvExtension397Fn { } } impl NvExtension398Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_398\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23552,7 +19803,7 @@ impl NvExtension398Fn { } } impl JuiceExtension399Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_JUICE_extension_399\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23570,7 +19821,7 @@ impl JuiceExtension399Fn { } } impl JuiceExtension400Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_JUICE_extension_400\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23588,7 +19839,7 @@ impl JuiceExtension400Fn { } } impl ExtLoadStoreOpNoneFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_load_store_op_none\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -23611,10 +19862,10 @@ impl AttachmentLoadOp { } #[doc = "Generated from 'VK_EXT_load_store_op_none'"] impl AttachmentStoreOp { - pub const NONE_EXT: Self = Self::NONE_KHR; + pub const NONE_EXT: Self = Self::NONE; } impl FbExtension402Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FB_extension_402\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23632,7 +19883,7 @@ impl FbExtension402Fn { } } impl FbExtension403Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FB_extension_403\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23650,7 +19901,7 @@ impl FbExtension403Fn { } } impl FbExtension404Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_FB_extension_404\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23668,7 +19919,7 @@ impl FbExtension404Fn { } } impl HuaweiExtension405Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_HUAWEI_extension_405\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23686,7 +19937,7 @@ impl HuaweiExtension405Fn { } } impl HuaweiExtension406Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_HUAWEI_extension_406\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23704,7 +19955,7 @@ impl HuaweiExtension406Fn { } } impl GgpExtension407Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_extension_407\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23722,7 +19973,7 @@ impl GgpExtension407Fn { } } impl GgpExtension408Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_extension_408\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23740,7 +19991,7 @@ impl GgpExtension408Fn { } } impl GgpExtension409Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_extension_409\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23758,7 +20009,7 @@ impl GgpExtension409Fn { } } impl GgpExtension410Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_extension_410\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23776,7 +20027,7 @@ impl GgpExtension410Fn { } } impl GgpExtension411Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GGP_extension_411\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -23794,7 +20045,7 @@ impl GgpExtension411Fn { } } impl ExtBorderColorSwizzleFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_border_color_swizzle\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -23817,7 +20068,7 @@ impl StructureType { pub const SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: Self = Self(1_000_411_001); } impl ExtPageableDeviceLocalMemoryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_EXT_pageable_device_local_memory\0", @@ -23864,51 +20115,42 @@ impl ExtPageableDeviceLocalMemoryFn { }, } } - #[doc = ""] - pub unsafe fn set_device_memory_priority_ext( - &self, - device: Device, - memory: DeviceMemory, - priority: f32, - ) { - (self.set_device_memory_priority_ext)(device, memory, priority) - } } #[doc = "Generated from 'VK_EXT_pageable_device_local_memory'"] impl StructureType { pub const PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: Self = Self(1_000_412_000); } impl KhrMaintenance4Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_maintenance4\0") } } pub const SPEC_VERSION: u32 = 2u32; } #[allow(non_camel_case_types)] -pub type PFN_vkGetDeviceBufferMemoryRequirementsKHR = unsafe extern "system" fn( +pub type PFN_vkGetDeviceBufferMemoryRequirements = unsafe extern "system" fn( device: Device, - p_info: *const DeviceBufferMemoryRequirementsKHR, + p_info: *const DeviceBufferMemoryRequirements, p_memory_requirements: *mut MemoryRequirements2, ); #[allow(non_camel_case_types)] -pub type PFN_vkGetDeviceImageMemoryRequirementsKHR = unsafe extern "system" fn( +pub type PFN_vkGetDeviceImageMemoryRequirements = unsafe extern "system" fn( device: Device, - p_info: *const DeviceImageMemoryRequirementsKHR, + p_info: *const DeviceImageMemoryRequirements, p_memory_requirements: *mut MemoryRequirements2, ); #[allow(non_camel_case_types)] -pub type PFN_vkGetDeviceImageSparseMemoryRequirementsKHR = unsafe extern "system" fn( +pub type PFN_vkGetDeviceImageSparseMemoryRequirements = unsafe extern "system" fn( device: Device, - p_info: *const DeviceImageMemoryRequirementsKHR, + p_info: *const DeviceImageMemoryRequirements, p_sparse_memory_requirement_count: *mut u32, p_sparse_memory_requirements: *mut SparseImageMemoryRequirements2, ); #[derive(Clone)] pub struct KhrMaintenance4Fn { - pub get_device_buffer_memory_requirements_khr: PFN_vkGetDeviceBufferMemoryRequirementsKHR, - pub get_device_image_memory_requirements_khr: PFN_vkGetDeviceImageMemoryRequirementsKHR, + pub get_device_buffer_memory_requirements_khr: PFN_vkGetDeviceBufferMemoryRequirements, + pub get_device_image_memory_requirements_khr: PFN_vkGetDeviceImageMemoryRequirements, pub get_device_image_sparse_memory_requirements_khr: - PFN_vkGetDeviceImageSparseMemoryRequirementsKHR, + PFN_vkGetDeviceImageSparseMemoryRequirements, } unsafe impl Send for KhrMaintenance4Fn {} unsafe impl Sync for KhrMaintenance4Fn {} @@ -23921,7 +20163,7 @@ impl KhrMaintenance4Fn { get_device_buffer_memory_requirements_khr: unsafe { unsafe extern "system" fn get_device_buffer_memory_requirements_khr( _device: Device, - _p_info: *const DeviceBufferMemoryRequirementsKHR, + _p_info: *const DeviceBufferMemoryRequirements, _p_memory_requirements: *mut MemoryRequirements2, ) { panic!(concat!( @@ -23942,7 +20184,7 @@ impl KhrMaintenance4Fn { get_device_image_memory_requirements_khr: unsafe { unsafe extern "system" fn get_device_image_memory_requirements_khr( _device: Device, - _p_info: *const DeviceImageMemoryRequirementsKHR, + _p_info: *const DeviceImageMemoryRequirements, _p_memory_requirements: *mut MemoryRequirements2, ) { panic!(concat!( @@ -23963,7 +20205,7 @@ impl KhrMaintenance4Fn { get_device_image_sparse_memory_requirements_khr: unsafe { unsafe extern "system" fn get_device_image_sparse_memory_requirements_khr( _device: Device, - _p_info: *const DeviceImageMemoryRequirementsKHR, + _p_info: *const DeviceImageMemoryRequirements, _p_sparse_memory_requirement_count: *mut u32, _p_sparse_memory_requirements: *mut SparseImageMemoryRequirements2, ) { @@ -23984,53 +20226,22 @@ impl KhrMaintenance4Fn { }, } } - #[doc = ""] - pub unsafe fn get_device_buffer_memory_requirements_khr( - &self, - device: Device, - p_info: *const DeviceBufferMemoryRequirementsKHR, - p_memory_requirements: *mut MemoryRequirements2, - ) { - (self.get_device_buffer_memory_requirements_khr)(device, p_info, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_device_image_memory_requirements_khr( - &self, - device: Device, - p_info: *const DeviceImageMemoryRequirementsKHR, - p_memory_requirements: *mut MemoryRequirements2, - ) { - (self.get_device_image_memory_requirements_khr)(device, p_info, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_device_image_sparse_memory_requirements_khr( - &self, - device: Device, - p_info: *const DeviceImageMemoryRequirementsKHR, - p_sparse_memory_requirement_count: *mut u32, - p_sparse_memory_requirements: *mut SparseImageMemoryRequirements2, - ) { - (self.get_device_image_sparse_memory_requirements_khr)( - device, - p_info, - p_sparse_memory_requirement_count, - p_sparse_memory_requirements, - ) - } } #[doc = "Generated from 'VK_KHR_maintenance4'"] impl ImageAspectFlags { - pub const NONE_KHR: Self = Self(0); + pub const NONE_KHR: Self = Self::NONE; } #[doc = "Generated from 'VK_KHR_maintenance4'"] impl StructureType { - pub const PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: Self = Self(1_000_413_000); - pub const PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: Self = Self(1_000_413_001); - pub const DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR: Self = Self(1_000_413_002); - pub const DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR: Self = Self(1_000_413_003); + pub const PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: Self = + Self::PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; + pub const PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: Self = + Self::PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES; + pub const DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR: Self = Self::DEVICE_BUFFER_MEMORY_REQUIREMENTS; + pub const DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR: Self = Self::DEVICE_IMAGE_MEMORY_REQUIREMENTS; } impl HuaweiExtension415Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_HUAWEI_extension_415\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24048,7 +20259,7 @@ impl HuaweiExtension415Fn { } } impl ArmExtension416Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_416\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24066,7 +20277,7 @@ impl ArmExtension416Fn { } } impl KhrExtension417Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_417\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24084,7 +20295,7 @@ impl KhrExtension417Fn { } } impl ArmExtension418Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_418\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24102,7 +20313,7 @@ impl ArmExtension418Fn { } } impl ExtExtension419Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_419\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24120,7 +20331,7 @@ impl ExtExtension419Fn { } } impl ExtExtension420Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_420\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24137,26 +20348,96 @@ impl ExtExtension420Fn { Self {} } } -impl KhrExtension421Fn { - pub fn name() -> &'static ::std::ffi::CStr { - unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_421\0") } +impl ValveDescriptorSetHostMappingFn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"VK_VALVE_descriptor_set_host_mapping\0", + ) + } } - pub const SPEC_VERSION: u32 = 0u32; + pub const SPEC_VERSION: u32 = 1u32; } +#[allow(non_camel_case_types)] +pub type PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE = unsafe extern "system" fn( + device: Device, + p_binding_reference: *const DescriptorSetBindingReferenceVALVE, + p_host_mapping: *mut DescriptorSetLayoutHostMappingInfoVALVE, +); +#[allow(non_camel_case_types)] +pub type PFN_vkGetDescriptorSetHostMappingVALVE = unsafe extern "system" fn( + device: Device, + descriptor_set: DescriptorSet, + pp_data: *mut *mut c_void, +); #[derive(Clone)] -pub struct KhrExtension421Fn {} -unsafe impl Send for KhrExtension421Fn {} -unsafe impl Sync for KhrExtension421Fn {} -impl KhrExtension421Fn { +pub struct ValveDescriptorSetHostMappingFn { + pub get_descriptor_set_layout_host_mapping_info_valve: + PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE, + pub get_descriptor_set_host_mapping_valve: PFN_vkGetDescriptorSetHostMappingVALVE, +} +unsafe impl Send for ValveDescriptorSetHostMappingFn {} +unsafe impl Sync for ValveDescriptorSetHostMappingFn {} +impl ValveDescriptorSetHostMappingFn { pub fn load(mut _f: F) -> Self where F: FnMut(&::std::ffi::CStr) -> *const c_void, { - Self {} + Self { + get_descriptor_set_layout_host_mapping_info_valve: unsafe { + unsafe extern "system" fn get_descriptor_set_layout_host_mapping_info_valve( + _device: Device, + _p_binding_reference: *const DescriptorSetBindingReferenceVALVE, + _p_host_mapping: *mut DescriptorSetLayoutHostMappingInfoVALVE, + ) { + panic!(concat!( + "Unable to load ", + stringify!(get_descriptor_set_layout_host_mapping_info_valve) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkGetDescriptorSetLayoutHostMappingInfoVALVE\0", + ); + let val = _f(cname); + if val.is_null() { + get_descriptor_set_layout_host_mapping_info_valve + } else { + ::std::mem::transmute(val) + } + }, + get_descriptor_set_host_mapping_valve: unsafe { + unsafe extern "system" fn get_descriptor_set_host_mapping_valve( + _device: Device, + _descriptor_set: DescriptorSet, + _pp_data: *mut *mut c_void, + ) { + panic!(concat!( + "Unable to load ", + stringify!(get_descriptor_set_host_mapping_valve) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkGetDescriptorSetHostMappingVALVE\0", + ); + let val = _f(cname); + if val.is_null() { + get_descriptor_set_host_mapping_valve + } else { + ::std::mem::transmute(val) + } + }, + } } } +#[doc = "Generated from 'VK_VALVE_descriptor_set_host_mapping'"] +impl StructureType { + pub const PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: Self = + Self(1_000_420_000); + pub const DESCRIPTOR_SET_BINDING_REFERENCE_VALVE: Self = Self(1_000_420_001); + pub const DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE: Self = Self(1_000_420_002); +} impl ExtExtension422Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_422\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24174,7 +20455,7 @@ impl ExtExtension422Fn { } } impl ExtDisableCubeMapWrapFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_disable_cube_map_wrap\0") } @@ -24198,7 +20479,7 @@ impl SamplerCreateFlags { pub const RESERVED_2_EXT: Self = Self(0b100); } impl ArmExtension424Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_424\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24216,7 +20497,7 @@ impl ArmExtension424Fn { } } impl ArmExtension425Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_425\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24234,7 +20515,7 @@ impl ArmExtension425Fn { } } impl QcomFragmentDensityMapOffsetFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked( b"VK_QCOM_fragment_density_map_offset\0", @@ -24267,7 +20548,7 @@ impl StructureType { pub const SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM: Self = Self(1_000_425_002); } impl NvExtension427Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_427\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24285,7 +20566,7 @@ impl NvExtension427Fn { } } impl NvExtension428Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_428\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24303,7 +20584,7 @@ impl NvExtension428Fn { } } impl NvExtension429Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_429\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24321,7 +20602,7 @@ impl NvExtension429Fn { } } impl NvExtension430Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_430\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24339,7 +20620,7 @@ impl NvExtension430Fn { } } impl NvLinearColorAttachmentFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_linear_color_attachment\0") } @@ -24359,7 +20640,7 @@ impl NvLinearColorAttachmentFn { } } #[doc = "Generated from 'VK_NV_linear_color_attachment'"] -impl FormatFeatureFlags2KHR { +impl FormatFeatureFlags2 { #[doc = "Format support linear image as render target, it cannot be mixed with non linear attachment"] pub const LINEAR_COLOR_ATTACHMENT_NV: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000_0000); @@ -24369,7 +20650,7 @@ impl StructureType { pub const PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: Self = Self(1_000_430_000); } impl NvExtension432Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_432\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24387,7 +20668,7 @@ impl NvExtension432Fn { } } impl NvExtension433Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_433\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24405,7 +20686,7 @@ impl NvExtension433Fn { } } impl GoogleSurfacelessQueryFn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_surfaceless_query\0") } } pub const SPEC_VERSION: u32 = 1u32; @@ -24423,7 +20704,7 @@ impl GoogleSurfacelessQueryFn { } } impl KhrExtension435Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_extension_435\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24441,7 +20722,7 @@ impl KhrExtension435Fn { } } impl NvExtension436Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_436\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24459,7 +20740,7 @@ impl NvExtension436Fn { } } impl ExtExtension437Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_437\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24477,7 +20758,7 @@ impl ExtExtension437Fn { } } impl ExtExtension438Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_438\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24495,7 +20776,7 @@ impl ExtExtension438Fn { } } impl SecExtension439Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_SEC_extension_439\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24513,7 +20794,7 @@ impl SecExtension439Fn { } } impl QcomExtension440Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_440\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24539,7 +20820,7 @@ impl QueueFlags { pub const RESERVED_7_QCOM: Self = Self(0b1000_0000); } impl QcomExtension441Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_QCOM_extension_441\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24557,7 +20838,7 @@ impl QcomExtension441Fn { } } #[doc = "Generated from 'VK_QCOM_extension_441'"] -impl FormatFeatureFlags2KHR { +impl FormatFeatureFlags2 { pub const RESERVED_34_QCOM: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000); pub const RESERVED_35_QCOM: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000); pub const RESERVED_36_QCOM: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000); @@ -24573,7 +20854,7 @@ impl SamplerCreateFlags { pub const IMAGE_PROCESSING_QCOM: Self = Self(0b1_0000); } impl CoreaviExtension442Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_COREAVI_extension_442\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24591,7 +20872,7 @@ impl CoreaviExtension442Fn { } } impl CoreaviExtension443Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_COREAVI_extension_443\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24609,7 +20890,7 @@ impl CoreaviExtension443Fn { } } impl CoreaviExtension444Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_COREAVI_extension_444\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24631,7 +20912,7 @@ impl CommandPoolResetFlags { pub const RESERVED_1_COREAVI: Self = Self(0b10); } impl CoreaviExtension445Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_COREAVI_extension_445\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24649,7 +20930,7 @@ impl CoreaviExtension445Fn { } } impl CoreaviExtension446Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_COREAVI_extension_446\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24667,7 +20948,7 @@ impl CoreaviExtension446Fn { } } impl CoreaviExtension447Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_COREAVI_extension_447\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24685,7 +20966,7 @@ impl CoreaviExtension447Fn { } } impl SecExtension448Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_SEC_extension_448\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24703,7 +20984,7 @@ impl SecExtension448Fn { } } impl SecExtension449Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_SEC_extension_449\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24721,7 +21002,7 @@ impl SecExtension449Fn { } } impl SecExtension450Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_SEC_extension_450\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24739,7 +21020,7 @@ impl SecExtension450Fn { } } impl SecExtension451Fn { - pub fn name() -> &'static ::std::ffi::CStr { + pub const fn name() -> &'static ::std::ffi::CStr { unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_SEC_extension_451\0") } } pub const SPEC_VERSION: u32 = 0u32; @@ -24756,3 +21037,223 @@ impl SecExtension451Fn { Self {} } } +impl NvExtension452Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_452\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct NvExtension452Fn {} +unsafe impl Send for NvExtension452Fn {} +unsafe impl Sync for NvExtension452Fn {} +impl NvExtension452Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl ArmExtension453Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_453\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ArmExtension453Fn {} +unsafe impl Send for ArmExtension453Fn {} +unsafe impl Sync for ArmExtension453Fn {} +impl ArmExtension453Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl GoogleExtension454Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_454\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct GoogleExtension454Fn {} +unsafe impl Send for GoogleExtension454Fn {} +unsafe impl Sync for GoogleExtension454Fn {} +impl GoogleExtension454Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl GoogleExtension455Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_GOOGLE_extension_455\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct GoogleExtension455Fn {} +unsafe impl Send for GoogleExtension455Fn {} +unsafe impl Sync for GoogleExtension455Fn {} +impl GoogleExtension455Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl NvExtension456Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_extension_456\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct NvExtension456Fn {} +unsafe impl Send for NvExtension456Fn {} +unsafe impl Sync for NvExtension456Fn {} +impl NvExtension456Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl ExtExtension457Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_457\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ExtExtension457Fn {} +unsafe impl Send for ExtExtension457Fn {} +unsafe impl Sync for ExtExtension457Fn {} +impl ExtExtension457Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl ExtExtension458Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_458\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ExtExtension458Fn {} +unsafe impl Send for ExtExtension458Fn {} +unsafe impl Sync for ExtExtension458Fn {} +impl ExtExtension458Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl ArmExtension459Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_extension_459\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ArmExtension459Fn {} +unsafe impl Send for ArmExtension459Fn {} +unsafe impl Sync for ArmExtension459Fn {} +impl ArmExtension459Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl ExtExtension460Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_460\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ExtExtension460Fn {} +unsafe impl Send for ExtExtension460Fn {} +unsafe impl Sync for ExtExtension460Fn {} +impl ExtExtension460Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl ExtExtension461Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_461\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ExtExtension461Fn {} +unsafe impl Send for ExtExtension461Fn {} +unsafe impl Sync for ExtExtension461Fn {} +impl ExtExtension461Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +#[doc = "Generated from 'VK_EXT_extension_461'"] +impl FormatFeatureFlags2 { + pub const RESERVED_39_EXT: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000_0000); +} +impl ExtExtension462Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_462\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ExtExtension462Fn {} +unsafe impl Send for ExtExtension462Fn {} +unsafe impl Sync for ExtExtension462Fn {} +impl ExtExtension462Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +impl ExtExtension463Fn { + pub const fn name() -> &'static ::std::ffi::CStr { + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_extension_463\0") } + } + pub const SPEC_VERSION: u32 = 0u32; +} +#[derive(Clone)] +pub struct ExtExtension463Fn {} +unsafe impl Send for ExtExtension463Fn {} +unsafe impl Sync for ExtExtension463Fn {} +impl ExtExtension463Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} diff --git a/third_party/rust/ash/src/vk/feature_extensions.rs b/third_party/rust/ash/src/vk/feature_extensions.rs index e96857a7d825e..4b1820c9a726e 100644 --- a/third_party/rust/ash/src/vk/feature_extensions.rs +++ b/third_party/rust/ash/src/vk/feature_extensions.rs @@ -301,3 +301,151 @@ 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); +} diff --git a/third_party/rust/ash/src/vk/features.rs b/third_party/rust/ash/src/vk/features.rs index 0b12aa7b700e7..4a52e377eff7b 100644 --- a/third_party/rust/ash/src/vk/features.rs +++ b/third_party/rust/ash/src/vk/features.rs @@ -38,14 +38,6 @@ impl StaticFn { }, } } - #[doc = ""] - pub unsafe fn get_instance_proc_addr( - &self, - instance: Instance, - p_name: *const c_char, - ) -> PFN_vkVoidFunction { - (self.get_instance_proc_addr)(instance, p_name) - } } #[allow(non_camel_case_types)] pub type PFN_vkCreateInstance = unsafe extern "system" fn( @@ -137,32 +129,6 @@ impl EntryFnV1_0 { }, } } - #[doc = ""] - pub unsafe fn create_instance( - &self, - p_create_info: *const InstanceCreateInfo, - p_allocator: *const AllocationCallbacks, - p_instance: *mut Instance, - ) -> Result { - (self.create_instance)(p_create_info, p_allocator, p_instance) - } - #[doc = ""] - pub unsafe fn enumerate_instance_extension_properties( - &self, - p_layer_name: *const c_char, - p_property_count: *mut u32, - p_properties: *mut ExtensionProperties, - ) -> Result { - (self.enumerate_instance_extension_properties)(p_layer_name, p_property_count, p_properties) - } - #[doc = ""] - pub unsafe fn enumerate_instance_layer_properties( - &self, - p_property_count: *mut u32, - p_properties: *mut LayerProperties, - ) -> Result { - (self.enumerate_instance_layer_properties)(p_property_count, p_properties) - } } #[allow(non_camel_case_types)] pub type PFN_vkDestroyInstance = @@ -536,155 +502,6 @@ impl InstanceFnV1_0 { }, } } - #[doc = ""] - pub unsafe fn destroy_instance( - &self, - instance: Instance, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_instance)(instance, p_allocator) - } - #[doc = ""] - pub unsafe fn enumerate_physical_devices( - &self, - instance: Instance, - p_physical_device_count: *mut u32, - p_physical_devices: *mut PhysicalDevice, - ) -> Result { - (self.enumerate_physical_devices)(instance, p_physical_device_count, p_physical_devices) - } - #[doc = ""] - pub unsafe fn get_physical_device_features( - &self, - physical_device: PhysicalDevice, - p_features: *mut PhysicalDeviceFeatures, - ) { - (self.get_physical_device_features)(physical_device, p_features) - } - #[doc = ""] - pub unsafe fn get_physical_device_format_properties( - &self, - physical_device: PhysicalDevice, - format: Format, - p_format_properties: *mut FormatProperties, - ) { - (self.get_physical_device_format_properties)(physical_device, format, p_format_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_image_format_properties( - &self, - physical_device: PhysicalDevice, - format: Format, - ty: ImageType, - tiling: ImageTiling, - usage: ImageUsageFlags, - flags: ImageCreateFlags, - p_image_format_properties: *mut ImageFormatProperties, - ) -> Result { - (self.get_physical_device_image_format_properties)( - physical_device, - format, - ty, - tiling, - usage, - flags, - p_image_format_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_properties( - &self, - physical_device: PhysicalDevice, - p_properties: *mut PhysicalDeviceProperties, - ) { - (self.get_physical_device_properties)(physical_device, p_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_queue_family_properties( - &self, - physical_device: PhysicalDevice, - p_queue_family_property_count: *mut u32, - p_queue_family_properties: *mut QueueFamilyProperties, - ) { - (self.get_physical_device_queue_family_properties)( - physical_device, - p_queue_family_property_count, - p_queue_family_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_memory_properties( - &self, - physical_device: PhysicalDevice, - p_memory_properties: *mut PhysicalDeviceMemoryProperties, - ) { - (self.get_physical_device_memory_properties)(physical_device, p_memory_properties) - } - #[doc = ""] - pub unsafe fn get_device_proc_addr( - &self, - device: Device, - p_name: *const c_char, - ) -> PFN_vkVoidFunction { - (self.get_device_proc_addr)(device, p_name) - } - #[doc = ""] - pub unsafe fn create_device( - &self, - physical_device: PhysicalDevice, - p_create_info: *const DeviceCreateInfo, - p_allocator: *const AllocationCallbacks, - p_device: *mut Device, - ) -> Result { - (self.create_device)(physical_device, p_create_info, p_allocator, p_device) - } - #[doc = ""] - pub unsafe fn enumerate_device_extension_properties( - &self, - physical_device: PhysicalDevice, - p_layer_name: *const c_char, - p_property_count: *mut u32, - p_properties: *mut ExtensionProperties, - ) -> Result { - (self.enumerate_device_extension_properties)( - physical_device, - p_layer_name, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn enumerate_device_layer_properties( - &self, - physical_device: PhysicalDevice, - p_property_count: *mut u32, - p_properties: *mut LayerProperties, - ) -> Result { - (self.enumerate_device_layer_properties)(physical_device, p_property_count, p_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_sparse_image_format_properties( - &self, - physical_device: PhysicalDevice, - format: Format, - ty: ImageType, - samples: SampleCountFlags, - usage: ImageUsageFlags, - tiling: ImageTiling, - p_property_count: *mut u32, - p_properties: *mut SparseImageFormatProperties, - ) { - (self.get_physical_device_sparse_image_format_properties)( - physical_device, - format, - ty, - samples, - usage, - tiling, - p_property_count, - p_properties, - ) - } } #[allow(non_camel_case_types)] pub type PFN_vkDestroyDevice = @@ -3826,1328 +3643,6 @@ impl DeviceFnV1_0 { }, } } - #[doc = ""] - pub unsafe fn destroy_device(&self, device: Device, p_allocator: *const AllocationCallbacks) { - (self.destroy_device)(device, p_allocator) - } - #[doc = ""] - pub unsafe fn get_device_queue( - &self, - device: Device, - queue_family_index: u32, - queue_index: u32, - p_queue: *mut Queue, - ) { - (self.get_device_queue)(device, queue_family_index, queue_index, p_queue) - } - #[doc = ""] - pub unsafe fn queue_submit( - &self, - queue: Queue, - submit_count: u32, - p_submits: *const SubmitInfo, - fence: Fence, - ) -> Result { - (self.queue_submit)(queue, submit_count, p_submits, fence) - } - #[doc = ""] - pub unsafe fn queue_wait_idle(&self, queue: Queue) -> Result { - (self.queue_wait_idle)(queue) - } - #[doc = ""] - pub unsafe fn device_wait_idle(&self, device: Device) -> Result { - (self.device_wait_idle)(device) - } - #[doc = ""] - pub unsafe fn allocate_memory( - &self, - device: Device, - p_allocate_info: *const MemoryAllocateInfo, - p_allocator: *const AllocationCallbacks, - p_memory: *mut DeviceMemory, - ) -> Result { - (self.allocate_memory)(device, p_allocate_info, p_allocator, p_memory) - } - #[doc = ""] - pub unsafe fn free_memory( - &self, - device: Device, - memory: DeviceMemory, - p_allocator: *const AllocationCallbacks, - ) { - (self.free_memory)(device, memory, p_allocator) - } - #[doc = ""] - pub unsafe fn map_memory( - &self, - device: Device, - memory: DeviceMemory, - offset: DeviceSize, - size: DeviceSize, - flags: MemoryMapFlags, - pp_data: *mut *mut c_void, - ) -> Result { - (self.map_memory)(device, memory, offset, size, flags, pp_data) - } - #[doc = ""] - pub unsafe fn unmap_memory(&self, device: Device, memory: DeviceMemory) { - (self.unmap_memory)(device, memory) - } - #[doc = ""] - pub unsafe fn flush_mapped_memory_ranges( - &self, - device: Device, - memory_range_count: u32, - p_memory_ranges: *const MappedMemoryRange, - ) -> Result { - (self.flush_mapped_memory_ranges)(device, memory_range_count, p_memory_ranges) - } - #[doc = ""] - pub unsafe fn invalidate_mapped_memory_ranges( - &self, - device: Device, - memory_range_count: u32, - p_memory_ranges: *const MappedMemoryRange, - ) -> Result { - (self.invalidate_mapped_memory_ranges)(device, memory_range_count, p_memory_ranges) - } - #[doc = ""] - pub unsafe fn get_device_memory_commitment( - &self, - device: Device, - memory: DeviceMemory, - p_committed_memory_in_bytes: *mut DeviceSize, - ) { - (self.get_device_memory_commitment)(device, memory, p_committed_memory_in_bytes) - } - #[doc = ""] - pub unsafe fn bind_buffer_memory( - &self, - device: Device, - buffer: Buffer, - memory: DeviceMemory, - memory_offset: DeviceSize, - ) -> Result { - (self.bind_buffer_memory)(device, buffer, memory, memory_offset) - } - #[doc = ""] - pub unsafe fn bind_image_memory( - &self, - device: Device, - image: Image, - memory: DeviceMemory, - memory_offset: DeviceSize, - ) -> Result { - (self.bind_image_memory)(device, image, memory, memory_offset) - } - #[doc = ""] - pub unsafe fn get_buffer_memory_requirements( - &self, - device: Device, - buffer: Buffer, - p_memory_requirements: *mut MemoryRequirements, - ) { - (self.get_buffer_memory_requirements)(device, buffer, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_image_memory_requirements( - &self, - device: Device, - image: Image, - p_memory_requirements: *mut MemoryRequirements, - ) { - (self.get_image_memory_requirements)(device, image, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_image_sparse_memory_requirements( - &self, - device: Device, - image: Image, - p_sparse_memory_requirement_count: *mut u32, - p_sparse_memory_requirements: *mut SparseImageMemoryRequirements, - ) { - (self.get_image_sparse_memory_requirements)( - device, - image, - p_sparse_memory_requirement_count, - p_sparse_memory_requirements, - ) - } - #[doc = ""] - pub unsafe fn queue_bind_sparse( - &self, - queue: Queue, - bind_info_count: u32, - p_bind_info: *const BindSparseInfo, - fence: Fence, - ) -> Result { - (self.queue_bind_sparse)(queue, bind_info_count, p_bind_info, fence) - } - #[doc = ""] - pub unsafe fn create_fence( - &self, - device: Device, - p_create_info: *const FenceCreateInfo, - p_allocator: *const AllocationCallbacks, - p_fence: *mut Fence, - ) -> Result { - (self.create_fence)(device, p_create_info, p_allocator, p_fence) - } - #[doc = ""] - pub unsafe fn destroy_fence( - &self, - device: Device, - fence: Fence, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_fence)(device, fence, p_allocator) - } - #[doc = ""] - pub unsafe fn reset_fences( - &self, - device: Device, - fence_count: u32, - p_fences: *const Fence, - ) -> Result { - (self.reset_fences)(device, fence_count, p_fences) - } - #[doc = ""] - pub unsafe fn get_fence_status(&self, device: Device, fence: Fence) -> Result { - (self.get_fence_status)(device, fence) - } - #[doc = ""] - pub unsafe fn wait_for_fences( - &self, - device: Device, - fence_count: u32, - p_fences: *const Fence, - wait_all: Bool32, - timeout: u64, - ) -> Result { - (self.wait_for_fences)(device, fence_count, p_fences, wait_all, timeout) - } - #[doc = ""] - pub unsafe fn create_semaphore( - &self, - device: Device, - p_create_info: *const SemaphoreCreateInfo, - p_allocator: *const AllocationCallbacks, - p_semaphore: *mut Semaphore, - ) -> Result { - (self.create_semaphore)(device, p_create_info, p_allocator, p_semaphore) - } - #[doc = ""] - pub unsafe fn destroy_semaphore( - &self, - device: Device, - semaphore: Semaphore, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_semaphore)(device, semaphore, p_allocator) - } - #[doc = ""] - pub unsafe fn create_event( - &self, - device: Device, - p_create_info: *const EventCreateInfo, - p_allocator: *const AllocationCallbacks, - p_event: *mut Event, - ) -> Result { - (self.create_event)(device, p_create_info, p_allocator, p_event) - } - #[doc = ""] - pub unsafe fn destroy_event( - &self, - device: Device, - event: Event, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_event)(device, event, p_allocator) - } - #[doc = ""] - pub unsafe fn get_event_status(&self, device: Device, event: Event) -> Result { - (self.get_event_status)(device, event) - } - #[doc = ""] - pub unsafe fn set_event(&self, device: Device, event: Event) -> Result { - (self.set_event)(device, event) - } - #[doc = ""] - pub unsafe fn reset_event(&self, device: Device, event: Event) -> Result { - (self.reset_event)(device, event) - } - #[doc = ""] - pub unsafe fn create_query_pool( - &self, - device: Device, - p_create_info: *const QueryPoolCreateInfo, - p_allocator: *const AllocationCallbacks, - p_query_pool: *mut QueryPool, - ) -> Result { - (self.create_query_pool)(device, p_create_info, p_allocator, p_query_pool) - } - #[doc = ""] - pub unsafe fn destroy_query_pool( - &self, - device: Device, - query_pool: QueryPool, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_query_pool)(device, query_pool, p_allocator) - } - #[doc = ""] - pub unsafe fn get_query_pool_results( - &self, - device: Device, - query_pool: QueryPool, - first_query: u32, - query_count: u32, - data_size: usize, - p_data: *mut c_void, - stride: DeviceSize, - flags: QueryResultFlags, - ) -> Result { - (self.get_query_pool_results)( - device, - query_pool, - first_query, - query_count, - data_size, - p_data, - stride, - flags, - ) - } - #[doc = ""] - pub unsafe fn create_buffer( - &self, - device: Device, - p_create_info: *const BufferCreateInfo, - p_allocator: *const AllocationCallbacks, - p_buffer: *mut Buffer, - ) -> Result { - (self.create_buffer)(device, p_create_info, p_allocator, p_buffer) - } - #[doc = ""] - pub unsafe fn destroy_buffer( - &self, - device: Device, - buffer: Buffer, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_buffer)(device, buffer, p_allocator) - } - #[doc = ""] - pub unsafe fn create_buffer_view( - &self, - device: Device, - p_create_info: *const BufferViewCreateInfo, - p_allocator: *const AllocationCallbacks, - p_view: *mut BufferView, - ) -> Result { - (self.create_buffer_view)(device, p_create_info, p_allocator, p_view) - } - #[doc = ""] - pub unsafe fn destroy_buffer_view( - &self, - device: Device, - buffer_view: BufferView, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_buffer_view)(device, buffer_view, p_allocator) - } - #[doc = ""] - pub unsafe fn create_image( - &self, - device: Device, - p_create_info: *const ImageCreateInfo, - p_allocator: *const AllocationCallbacks, - p_image: *mut Image, - ) -> Result { - (self.create_image)(device, p_create_info, p_allocator, p_image) - } - #[doc = ""] - pub unsafe fn destroy_image( - &self, - device: Device, - image: Image, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_image)(device, image, p_allocator) - } - #[doc = ""] - pub unsafe fn get_image_subresource_layout( - &self, - device: Device, - image: Image, - p_subresource: *const ImageSubresource, - p_layout: *mut SubresourceLayout, - ) { - (self.get_image_subresource_layout)(device, image, p_subresource, p_layout) - } - #[doc = ""] - pub unsafe fn create_image_view( - &self, - device: Device, - p_create_info: *const ImageViewCreateInfo, - p_allocator: *const AllocationCallbacks, - p_view: *mut ImageView, - ) -> Result { - (self.create_image_view)(device, p_create_info, p_allocator, p_view) - } - #[doc = ""] - pub unsafe fn destroy_image_view( - &self, - device: Device, - image_view: ImageView, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_image_view)(device, image_view, p_allocator) - } - #[doc = ""] - pub unsafe fn create_shader_module( - &self, - device: Device, - p_create_info: *const ShaderModuleCreateInfo, - p_allocator: *const AllocationCallbacks, - p_shader_module: *mut ShaderModule, - ) -> Result { - (self.create_shader_module)(device, p_create_info, p_allocator, p_shader_module) - } - #[doc = ""] - pub unsafe fn destroy_shader_module( - &self, - device: Device, - shader_module: ShaderModule, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_shader_module)(device, shader_module, p_allocator) - } - #[doc = ""] - pub unsafe fn create_pipeline_cache( - &self, - device: Device, - p_create_info: *const PipelineCacheCreateInfo, - p_allocator: *const AllocationCallbacks, - p_pipeline_cache: *mut PipelineCache, - ) -> Result { - (self.create_pipeline_cache)(device, p_create_info, p_allocator, p_pipeline_cache) - } - #[doc = ""] - pub unsafe fn destroy_pipeline_cache( - &self, - device: Device, - pipeline_cache: PipelineCache, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_pipeline_cache)(device, pipeline_cache, p_allocator) - } - #[doc = ""] - pub unsafe fn get_pipeline_cache_data( - &self, - device: Device, - pipeline_cache: PipelineCache, - p_data_size: *mut usize, - p_data: *mut c_void, - ) -> Result { - (self.get_pipeline_cache_data)(device, pipeline_cache, p_data_size, p_data) - } - #[doc = ""] - pub unsafe fn merge_pipeline_caches( - &self, - device: Device, - dst_cache: PipelineCache, - src_cache_count: u32, - p_src_caches: *const PipelineCache, - ) -> Result { - (self.merge_pipeline_caches)(device, dst_cache, src_cache_count, p_src_caches) - } - #[doc = ""] - pub unsafe fn create_graphics_pipelines( - &self, - device: Device, - pipeline_cache: PipelineCache, - create_info_count: u32, - p_create_infos: *const GraphicsPipelineCreateInfo, - p_allocator: *const AllocationCallbacks, - p_pipelines: *mut Pipeline, - ) -> Result { - (self.create_graphics_pipelines)( - device, - pipeline_cache, - create_info_count, - p_create_infos, - p_allocator, - p_pipelines, - ) - } - #[doc = ""] - pub unsafe fn create_compute_pipelines( - &self, - device: Device, - pipeline_cache: PipelineCache, - create_info_count: u32, - p_create_infos: *const ComputePipelineCreateInfo, - p_allocator: *const AllocationCallbacks, - p_pipelines: *mut Pipeline, - ) -> Result { - (self.create_compute_pipelines)( - device, - pipeline_cache, - create_info_count, - p_create_infos, - p_allocator, - p_pipelines, - ) - } - #[doc = ""] - pub unsafe fn destroy_pipeline( - &self, - device: Device, - pipeline: Pipeline, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_pipeline)(device, pipeline, p_allocator) - } - #[doc = ""] - pub unsafe fn create_pipeline_layout( - &self, - device: Device, - p_create_info: *const PipelineLayoutCreateInfo, - p_allocator: *const AllocationCallbacks, - p_pipeline_layout: *mut PipelineLayout, - ) -> Result { - (self.create_pipeline_layout)(device, p_create_info, p_allocator, p_pipeline_layout) - } - #[doc = ""] - pub unsafe fn destroy_pipeline_layout( - &self, - device: Device, - pipeline_layout: PipelineLayout, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_pipeline_layout)(device, pipeline_layout, p_allocator) - } - #[doc = ""] - pub unsafe fn create_sampler( - &self, - device: Device, - p_create_info: *const SamplerCreateInfo, - p_allocator: *const AllocationCallbacks, - p_sampler: *mut Sampler, - ) -> Result { - (self.create_sampler)(device, p_create_info, p_allocator, p_sampler) - } - #[doc = ""] - pub unsafe fn destroy_sampler( - &self, - device: Device, - sampler: Sampler, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_sampler)(device, sampler, p_allocator) - } - #[doc = ""] - pub unsafe fn create_descriptor_set_layout( - &self, - device: Device, - p_create_info: *const DescriptorSetLayoutCreateInfo, - p_allocator: *const AllocationCallbacks, - p_set_layout: *mut DescriptorSetLayout, - ) -> Result { - (self.create_descriptor_set_layout)(device, p_create_info, p_allocator, p_set_layout) - } - #[doc = ""] - pub unsafe fn destroy_descriptor_set_layout( - &self, - device: Device, - descriptor_set_layout: DescriptorSetLayout, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_descriptor_set_layout)(device, descriptor_set_layout, p_allocator) - } - #[doc = ""] - pub unsafe fn create_descriptor_pool( - &self, - device: Device, - p_create_info: *const DescriptorPoolCreateInfo, - p_allocator: *const AllocationCallbacks, - p_descriptor_pool: *mut DescriptorPool, - ) -> Result { - (self.create_descriptor_pool)(device, p_create_info, p_allocator, p_descriptor_pool) - } - #[doc = ""] - pub unsafe fn destroy_descriptor_pool( - &self, - device: Device, - descriptor_pool: DescriptorPool, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_descriptor_pool)(device, descriptor_pool, p_allocator) - } - #[doc = ""] - pub unsafe fn reset_descriptor_pool( - &self, - device: Device, - descriptor_pool: DescriptorPool, - flags: DescriptorPoolResetFlags, - ) -> Result { - (self.reset_descriptor_pool)(device, descriptor_pool, flags) - } - #[doc = ""] - pub unsafe fn allocate_descriptor_sets( - &self, - device: Device, - p_allocate_info: *const DescriptorSetAllocateInfo, - p_descriptor_sets: *mut DescriptorSet, - ) -> Result { - (self.allocate_descriptor_sets)(device, p_allocate_info, p_descriptor_sets) - } - #[doc = ""] - pub unsafe fn free_descriptor_sets( - &self, - device: Device, - descriptor_pool: DescriptorPool, - descriptor_set_count: u32, - p_descriptor_sets: *const DescriptorSet, - ) -> Result { - (self.free_descriptor_sets)( - device, - descriptor_pool, - descriptor_set_count, - p_descriptor_sets, - ) - } - #[doc = ""] - pub unsafe fn update_descriptor_sets( - &self, - device: Device, - descriptor_write_count: u32, - p_descriptor_writes: *const WriteDescriptorSet, - descriptor_copy_count: u32, - p_descriptor_copies: *const CopyDescriptorSet, - ) { - (self.update_descriptor_sets)( - device, - descriptor_write_count, - p_descriptor_writes, - descriptor_copy_count, - p_descriptor_copies, - ) - } - #[doc = ""] - pub unsafe fn create_framebuffer( - &self, - device: Device, - p_create_info: *const FramebufferCreateInfo, - p_allocator: *const AllocationCallbacks, - p_framebuffer: *mut Framebuffer, - ) -> Result { - (self.create_framebuffer)(device, p_create_info, p_allocator, p_framebuffer) - } - #[doc = ""] - pub unsafe fn destroy_framebuffer( - &self, - device: Device, - framebuffer: Framebuffer, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_framebuffer)(device, framebuffer, p_allocator) - } - #[doc = ""] - pub unsafe fn create_render_pass( - &self, - device: Device, - p_create_info: *const RenderPassCreateInfo, - p_allocator: *const AllocationCallbacks, - p_render_pass: *mut RenderPass, - ) -> Result { - (self.create_render_pass)(device, p_create_info, p_allocator, p_render_pass) - } - #[doc = ""] - pub unsafe fn destroy_render_pass( - &self, - device: Device, - render_pass: RenderPass, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_render_pass)(device, render_pass, p_allocator) - } - #[doc = ""] - pub unsafe fn get_render_area_granularity( - &self, - device: Device, - render_pass: RenderPass, - p_granularity: *mut Extent2D, - ) { - (self.get_render_area_granularity)(device, render_pass, p_granularity) - } - #[doc = ""] - pub unsafe fn create_command_pool( - &self, - device: Device, - p_create_info: *const CommandPoolCreateInfo, - p_allocator: *const AllocationCallbacks, - p_command_pool: *mut CommandPool, - ) -> Result { - (self.create_command_pool)(device, p_create_info, p_allocator, p_command_pool) - } - #[doc = ""] - pub unsafe fn destroy_command_pool( - &self, - device: Device, - command_pool: CommandPool, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_command_pool)(device, command_pool, p_allocator) - } - #[doc = ""] - pub unsafe fn reset_command_pool( - &self, - device: Device, - command_pool: CommandPool, - flags: CommandPoolResetFlags, - ) -> Result { - (self.reset_command_pool)(device, command_pool, flags) - } - #[doc = ""] - pub unsafe fn allocate_command_buffers( - &self, - device: Device, - p_allocate_info: *const CommandBufferAllocateInfo, - p_command_buffers: *mut CommandBuffer, - ) -> Result { - (self.allocate_command_buffers)(device, p_allocate_info, p_command_buffers) - } - #[doc = ""] - pub unsafe fn free_command_buffers( - &self, - device: Device, - command_pool: CommandPool, - command_buffer_count: u32, - p_command_buffers: *const CommandBuffer, - ) { - (self.free_command_buffers)( - device, - command_pool, - command_buffer_count, - p_command_buffers, - ) - } - #[doc = ""] - pub unsafe fn begin_command_buffer( - &self, - command_buffer: CommandBuffer, - p_begin_info: *const CommandBufferBeginInfo, - ) -> Result { - (self.begin_command_buffer)(command_buffer, p_begin_info) - } - #[doc = ""] - pub unsafe fn end_command_buffer(&self, command_buffer: CommandBuffer) -> Result { - (self.end_command_buffer)(command_buffer) - } - #[doc = ""] - pub unsafe fn reset_command_buffer( - &self, - command_buffer: CommandBuffer, - flags: CommandBufferResetFlags, - ) -> Result { - (self.reset_command_buffer)(command_buffer, flags) - } - #[doc = ""] - pub unsafe fn cmd_bind_pipeline( - &self, - command_buffer: CommandBuffer, - pipeline_bind_point: PipelineBindPoint, - pipeline: Pipeline, - ) { - (self.cmd_bind_pipeline)(command_buffer, pipeline_bind_point, pipeline) - } - #[doc = ""] - pub unsafe fn cmd_set_viewport( - &self, - command_buffer: CommandBuffer, - first_viewport: u32, - viewport_count: u32, - p_viewports: *const Viewport, - ) { - (self.cmd_set_viewport)(command_buffer, first_viewport, viewport_count, p_viewports) - } - #[doc = ""] - pub unsafe fn cmd_set_scissor( - &self, - command_buffer: CommandBuffer, - first_scissor: u32, - scissor_count: u32, - p_scissors: *const Rect2D, - ) { - (self.cmd_set_scissor)(command_buffer, first_scissor, scissor_count, p_scissors) - } - #[doc = ""] - pub unsafe fn cmd_set_line_width(&self, command_buffer: CommandBuffer, line_width: f32) { - (self.cmd_set_line_width)(command_buffer, line_width) - } - #[doc = ""] - pub unsafe fn cmd_set_depth_bias( - &self, - command_buffer: CommandBuffer, - depth_bias_constant_factor: f32, - depth_bias_clamp: f32, - depth_bias_slope_factor: f32, - ) { - (self.cmd_set_depth_bias)( - command_buffer, - depth_bias_constant_factor, - depth_bias_clamp, - depth_bias_slope_factor, - ) - } - #[doc = ""] - pub unsafe fn cmd_set_blend_constants( - &self, - command_buffer: CommandBuffer, - blend_constants: *const [f32; 4], - ) { - (self.cmd_set_blend_constants)(command_buffer, blend_constants) - } - #[doc = ""] - pub unsafe fn cmd_set_depth_bounds( - &self, - command_buffer: CommandBuffer, - min_depth_bounds: f32, - max_depth_bounds: f32, - ) { - (self.cmd_set_depth_bounds)(command_buffer, min_depth_bounds, max_depth_bounds) - } - #[doc = ""] - pub unsafe fn cmd_set_stencil_compare_mask( - &self, - command_buffer: CommandBuffer, - face_mask: StencilFaceFlags, - compare_mask: u32, - ) { - (self.cmd_set_stencil_compare_mask)(command_buffer, face_mask, compare_mask) - } - #[doc = ""] - pub unsafe fn cmd_set_stencil_write_mask( - &self, - command_buffer: CommandBuffer, - face_mask: StencilFaceFlags, - write_mask: u32, - ) { - (self.cmd_set_stencil_write_mask)(command_buffer, face_mask, write_mask) - } - #[doc = ""] - pub unsafe fn cmd_set_stencil_reference( - &self, - command_buffer: CommandBuffer, - face_mask: StencilFaceFlags, - reference: u32, - ) { - (self.cmd_set_stencil_reference)(command_buffer, face_mask, reference) - } - #[doc = ""] - pub unsafe fn cmd_bind_descriptor_sets( - &self, - command_buffer: CommandBuffer, - pipeline_bind_point: PipelineBindPoint, - layout: PipelineLayout, - first_set: u32, - descriptor_set_count: u32, - p_descriptor_sets: *const DescriptorSet, - dynamic_offset_count: u32, - p_dynamic_offsets: *const u32, - ) { - (self.cmd_bind_descriptor_sets)( - command_buffer, - pipeline_bind_point, - layout, - first_set, - descriptor_set_count, - p_descriptor_sets, - dynamic_offset_count, - p_dynamic_offsets, - ) - } - #[doc = ""] - pub unsafe fn cmd_bind_index_buffer( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - index_type: IndexType, - ) { - (self.cmd_bind_index_buffer)(command_buffer, buffer, offset, index_type) - } - #[doc = ""] - pub unsafe fn cmd_bind_vertex_buffers( - &self, - command_buffer: CommandBuffer, - first_binding: u32, - binding_count: u32, - p_buffers: *const Buffer, - p_offsets: *const DeviceSize, - ) { - (self.cmd_bind_vertex_buffers)( - command_buffer, - first_binding, - binding_count, - p_buffers, - p_offsets, - ) - } - #[doc = ""] - pub unsafe fn cmd_draw( - &self, - command_buffer: CommandBuffer, - vertex_count: u32, - instance_count: u32, - first_vertex: u32, - first_instance: u32, - ) { - (self.cmd_draw)( - command_buffer, - vertex_count, - instance_count, - first_vertex, - first_instance, - ) - } - #[doc = ""] - pub unsafe fn cmd_draw_indexed( - &self, - command_buffer: CommandBuffer, - index_count: u32, - instance_count: u32, - first_index: u32, - vertex_offset: i32, - first_instance: u32, - ) { - (self.cmd_draw_indexed)( - command_buffer, - index_count, - instance_count, - first_index, - vertex_offset, - first_instance, - ) - } - #[doc = ""] - pub unsafe fn cmd_draw_indirect( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indirect)(command_buffer, buffer, offset, draw_count, stride) - } - #[doc = ""] - pub unsafe fn cmd_draw_indexed_indirect( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indexed_indirect)(command_buffer, buffer, offset, draw_count, stride) - } - #[doc = ""] - pub unsafe fn cmd_dispatch( - &self, - command_buffer: CommandBuffer, - group_count_x: u32, - group_count_y: u32, - group_count_z: u32, - ) { - (self.cmd_dispatch)(command_buffer, group_count_x, group_count_y, group_count_z) - } - #[doc = ""] - pub unsafe fn cmd_dispatch_indirect( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - ) { - (self.cmd_dispatch_indirect)(command_buffer, buffer, offset) - } - #[doc = ""] - pub unsafe fn cmd_copy_buffer( - &self, - command_buffer: CommandBuffer, - src_buffer: Buffer, - dst_buffer: Buffer, - region_count: u32, - p_regions: *const BufferCopy, - ) { - (self.cmd_copy_buffer)( - command_buffer, - src_buffer, - dst_buffer, - region_count, - p_regions, - ) - } - #[doc = ""] - pub unsafe fn cmd_copy_image( - &self, - command_buffer: CommandBuffer, - src_image: Image, - src_image_layout: ImageLayout, - dst_image: Image, - dst_image_layout: ImageLayout, - region_count: u32, - p_regions: *const ImageCopy, - ) { - (self.cmd_copy_image)( - command_buffer, - src_image, - src_image_layout, - dst_image, - dst_image_layout, - region_count, - p_regions, - ) - } - #[doc = ""] - pub unsafe fn cmd_blit_image( - &self, - command_buffer: CommandBuffer, - src_image: Image, - src_image_layout: ImageLayout, - dst_image: Image, - dst_image_layout: ImageLayout, - region_count: u32, - p_regions: *const ImageBlit, - filter: Filter, - ) { - (self.cmd_blit_image)( - command_buffer, - src_image, - src_image_layout, - dst_image, - dst_image_layout, - region_count, - p_regions, - filter, - ) - } - #[doc = ""] - pub unsafe fn cmd_copy_buffer_to_image( - &self, - command_buffer: CommandBuffer, - src_buffer: Buffer, - dst_image: Image, - dst_image_layout: ImageLayout, - region_count: u32, - p_regions: *const BufferImageCopy, - ) { - (self.cmd_copy_buffer_to_image)( - command_buffer, - src_buffer, - dst_image, - dst_image_layout, - region_count, - p_regions, - ) - } - #[doc = ""] - pub unsafe fn cmd_copy_image_to_buffer( - &self, - command_buffer: CommandBuffer, - src_image: Image, - src_image_layout: ImageLayout, - dst_buffer: Buffer, - region_count: u32, - p_regions: *const BufferImageCopy, - ) { - (self.cmd_copy_image_to_buffer)( - command_buffer, - src_image, - src_image_layout, - dst_buffer, - region_count, - p_regions, - ) - } - #[doc = ""] - pub unsafe fn cmd_update_buffer( - &self, - command_buffer: CommandBuffer, - dst_buffer: Buffer, - dst_offset: DeviceSize, - data_size: DeviceSize, - p_data: *const c_void, - ) { - (self.cmd_update_buffer)(command_buffer, dst_buffer, dst_offset, data_size, p_data) - } - #[doc = ""] - pub unsafe fn cmd_fill_buffer( - &self, - command_buffer: CommandBuffer, - dst_buffer: Buffer, - dst_offset: DeviceSize, - size: DeviceSize, - data: u32, - ) { - (self.cmd_fill_buffer)(command_buffer, dst_buffer, dst_offset, size, data) - } - #[doc = ""] - pub unsafe fn cmd_clear_color_image( - &self, - command_buffer: CommandBuffer, - image: Image, - image_layout: ImageLayout, - p_color: *const ClearColorValue, - range_count: u32, - p_ranges: *const ImageSubresourceRange, - ) { - (self.cmd_clear_color_image)( - command_buffer, - image, - image_layout, - p_color, - range_count, - p_ranges, - ) - } - #[doc = ""] - pub unsafe fn cmd_clear_depth_stencil_image( - &self, - command_buffer: CommandBuffer, - image: Image, - image_layout: ImageLayout, - p_depth_stencil: *const ClearDepthStencilValue, - range_count: u32, - p_ranges: *const ImageSubresourceRange, - ) { - (self.cmd_clear_depth_stencil_image)( - command_buffer, - image, - image_layout, - p_depth_stencil, - range_count, - p_ranges, - ) - } - #[doc = ""] - pub unsafe fn cmd_clear_attachments( - &self, - command_buffer: CommandBuffer, - attachment_count: u32, - p_attachments: *const ClearAttachment, - rect_count: u32, - p_rects: *const ClearRect, - ) { - (self.cmd_clear_attachments)( - command_buffer, - attachment_count, - p_attachments, - rect_count, - p_rects, - ) - } - #[doc = ""] - pub unsafe fn cmd_resolve_image( - &self, - command_buffer: CommandBuffer, - src_image: Image, - src_image_layout: ImageLayout, - dst_image: Image, - dst_image_layout: ImageLayout, - region_count: u32, - p_regions: *const ImageResolve, - ) { - (self.cmd_resolve_image)( - command_buffer, - src_image, - src_image_layout, - dst_image, - dst_image_layout, - region_count, - p_regions, - ) - } - #[doc = ""] - pub unsafe fn cmd_set_event( - &self, - command_buffer: CommandBuffer, - event: Event, - stage_mask: PipelineStageFlags, - ) { - (self.cmd_set_event)(command_buffer, event, stage_mask) - } - #[doc = ""] - pub unsafe fn cmd_reset_event( - &self, - command_buffer: CommandBuffer, - event: Event, - stage_mask: PipelineStageFlags, - ) { - (self.cmd_reset_event)(command_buffer, event, stage_mask) - } - #[doc = ""] - pub unsafe fn cmd_wait_events( - &self, - command_buffer: CommandBuffer, - event_count: u32, - p_events: *const Event, - src_stage_mask: PipelineStageFlags, - dst_stage_mask: PipelineStageFlags, - memory_barrier_count: u32, - p_memory_barriers: *const MemoryBarrier, - buffer_memory_barrier_count: u32, - p_buffer_memory_barriers: *const BufferMemoryBarrier, - image_memory_barrier_count: u32, - p_image_memory_barriers: *const ImageMemoryBarrier, - ) { - (self.cmd_wait_events)( - command_buffer, - event_count, - p_events, - src_stage_mask, - dst_stage_mask, - memory_barrier_count, - p_memory_barriers, - buffer_memory_barrier_count, - p_buffer_memory_barriers, - image_memory_barrier_count, - p_image_memory_barriers, - ) - } - #[doc = ""] - pub unsafe fn cmd_pipeline_barrier( - &self, - command_buffer: CommandBuffer, - src_stage_mask: PipelineStageFlags, - dst_stage_mask: PipelineStageFlags, - dependency_flags: DependencyFlags, - memory_barrier_count: u32, - p_memory_barriers: *const MemoryBarrier, - buffer_memory_barrier_count: u32, - p_buffer_memory_barriers: *const BufferMemoryBarrier, - image_memory_barrier_count: u32, - p_image_memory_barriers: *const ImageMemoryBarrier, - ) { - (self.cmd_pipeline_barrier)( - command_buffer, - src_stage_mask, - dst_stage_mask, - dependency_flags, - memory_barrier_count, - p_memory_barriers, - buffer_memory_barrier_count, - p_buffer_memory_barriers, - image_memory_barrier_count, - p_image_memory_barriers, - ) - } - #[doc = ""] - pub unsafe fn cmd_begin_query( - &self, - command_buffer: CommandBuffer, - query_pool: QueryPool, - query: u32, - flags: QueryControlFlags, - ) { - (self.cmd_begin_query)(command_buffer, query_pool, query, flags) - } - #[doc = ""] - pub unsafe fn cmd_end_query( - &self, - command_buffer: CommandBuffer, - query_pool: QueryPool, - query: u32, - ) { - (self.cmd_end_query)(command_buffer, query_pool, query) - } - #[doc = ""] - pub unsafe fn cmd_reset_query_pool( - &self, - command_buffer: CommandBuffer, - query_pool: QueryPool, - first_query: u32, - query_count: u32, - ) { - (self.cmd_reset_query_pool)(command_buffer, query_pool, first_query, query_count) - } - #[doc = ""] - pub unsafe fn cmd_write_timestamp( - &self, - command_buffer: CommandBuffer, - pipeline_stage: PipelineStageFlags, - query_pool: QueryPool, - query: u32, - ) { - (self.cmd_write_timestamp)(command_buffer, pipeline_stage, query_pool, query) - } - #[doc = ""] - pub unsafe fn cmd_copy_query_pool_results( - &self, - command_buffer: CommandBuffer, - query_pool: QueryPool, - first_query: u32, - query_count: u32, - dst_buffer: Buffer, - dst_offset: DeviceSize, - stride: DeviceSize, - flags: QueryResultFlags, - ) { - (self.cmd_copy_query_pool_results)( - command_buffer, - query_pool, - first_query, - query_count, - dst_buffer, - dst_offset, - stride, - flags, - ) - } - #[doc = ""] - pub unsafe fn cmd_push_constants( - &self, - command_buffer: CommandBuffer, - layout: PipelineLayout, - stage_flags: ShaderStageFlags, - offset: u32, - size: u32, - p_values: *const c_void, - ) { - (self.cmd_push_constants)(command_buffer, layout, stage_flags, offset, size, p_values) - } - #[doc = ""] - pub unsafe fn cmd_begin_render_pass( - &self, - command_buffer: CommandBuffer, - p_render_pass_begin: *const RenderPassBeginInfo, - contents: SubpassContents, - ) { - (self.cmd_begin_render_pass)(command_buffer, p_render_pass_begin, contents) - } - #[doc = ""] - pub unsafe fn cmd_next_subpass( - &self, - command_buffer: CommandBuffer, - contents: SubpassContents, - ) { - (self.cmd_next_subpass)(command_buffer, contents) - } - #[doc = ""] - pub unsafe fn cmd_end_render_pass(&self, command_buffer: CommandBuffer) { - (self.cmd_end_render_pass)(command_buffer) - } - #[doc = ""] - pub unsafe fn cmd_execute_commands( - &self, - command_buffer: CommandBuffer, - command_buffer_count: u32, - p_command_buffers: *const CommandBuffer, - ) { - (self.cmd_execute_commands)(command_buffer, command_buffer_count, p_command_buffers) - } } #[allow(non_camel_case_types)] pub type PFN_vkEnumerateInstanceVersion = @@ -5185,10 +3680,6 @@ impl EntryFnV1_1 { }, } } - #[doc = ""] - pub unsafe fn enumerate_instance_version(&self, p_api_version: *mut u32) -> Result { - (self.enumerate_instance_version)(p_api_version) - } } #[derive(Clone)] pub struct InstanceFnV1_1 { @@ -5449,132 +3940,6 @@ impl InstanceFnV1_1 { }, } } - #[doc = ""] - pub unsafe fn enumerate_physical_device_groups( - &self, - instance: Instance, - p_physical_device_group_count: *mut u32, - p_physical_device_group_properties: *mut PhysicalDeviceGroupProperties, - ) -> Result { - (self.enumerate_physical_device_groups)( - instance, - p_physical_device_group_count, - p_physical_device_group_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_features2( - &self, - physical_device: PhysicalDevice, - p_features: *mut PhysicalDeviceFeatures2, - ) { - (self.get_physical_device_features2)(physical_device, p_features) - } - #[doc = ""] - pub unsafe fn get_physical_device_properties2( - &self, - physical_device: PhysicalDevice, - p_properties: *mut PhysicalDeviceProperties2, - ) { - (self.get_physical_device_properties2)(physical_device, p_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_format_properties2( - &self, - physical_device: PhysicalDevice, - format: Format, - p_format_properties: *mut FormatProperties2, - ) { - (self.get_physical_device_format_properties2)(physical_device, format, p_format_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_image_format_properties2( - &self, - physical_device: PhysicalDevice, - p_image_format_info: *const PhysicalDeviceImageFormatInfo2, - p_image_format_properties: *mut ImageFormatProperties2, - ) -> Result { - (self.get_physical_device_image_format_properties2)( - physical_device, - p_image_format_info, - p_image_format_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_queue_family_properties2( - &self, - physical_device: PhysicalDevice, - p_queue_family_property_count: *mut u32, - p_queue_family_properties: *mut QueueFamilyProperties2, - ) { - (self.get_physical_device_queue_family_properties2)( - physical_device, - p_queue_family_property_count, - p_queue_family_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_memory_properties2( - &self, - physical_device: PhysicalDevice, - p_memory_properties: *mut PhysicalDeviceMemoryProperties2, - ) { - (self.get_physical_device_memory_properties2)(physical_device, p_memory_properties) - } - #[doc = ""] - pub unsafe fn get_physical_device_sparse_image_format_properties2( - &self, - physical_device: PhysicalDevice, - p_format_info: *const PhysicalDeviceSparseImageFormatInfo2, - p_property_count: *mut u32, - p_properties: *mut SparseImageFormatProperties2, - ) { - (self.get_physical_device_sparse_image_format_properties2)( - physical_device, - p_format_info, - p_property_count, - p_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_external_buffer_properties( - &self, - physical_device: PhysicalDevice, - p_external_buffer_info: *const PhysicalDeviceExternalBufferInfo, - p_external_buffer_properties: *mut ExternalBufferProperties, - ) { - (self.get_physical_device_external_buffer_properties)( - physical_device, - p_external_buffer_info, - p_external_buffer_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_external_fence_properties( - &self, - physical_device: PhysicalDevice, - p_external_fence_info: *const PhysicalDeviceExternalFenceInfo, - p_external_fence_properties: *mut ExternalFenceProperties, - ) { - (self.get_physical_device_external_fence_properties)( - physical_device, - p_external_fence_info, - p_external_fence_properties, - ) - } - #[doc = ""] - pub unsafe fn get_physical_device_external_semaphore_properties( - &self, - physical_device: PhysicalDevice, - p_external_semaphore_info: *const PhysicalDeviceExternalSemaphoreInfo, - p_external_semaphore_properties: *mut ExternalSemaphoreProperties, - ) { - (self.get_physical_device_external_semaphore_properties)( - physical_device, - p_external_semaphore_info, - p_external_semaphore_properties, - ) - } } #[allow(non_camel_case_types)] pub type PFN_vkGetDeviceQueue2 = unsafe extern "system" fn( @@ -5929,189 +4294,6 @@ impl DeviceFnV1_1 { }, } } - #[doc = ""] - pub unsafe fn bind_buffer_memory2( - &self, - device: Device, - bind_info_count: u32, - p_bind_infos: *const BindBufferMemoryInfo, - ) -> Result { - (self.bind_buffer_memory2)(device, bind_info_count, p_bind_infos) - } - #[doc = ""] - pub unsafe fn bind_image_memory2( - &self, - device: Device, - bind_info_count: u32, - p_bind_infos: *const BindImageMemoryInfo, - ) -> Result { - (self.bind_image_memory2)(device, bind_info_count, p_bind_infos) - } - #[doc = ""] - pub unsafe fn get_device_group_peer_memory_features( - &self, - device: Device, - heap_index: u32, - local_device_index: u32, - remote_device_index: u32, - p_peer_memory_features: *mut PeerMemoryFeatureFlags, - ) { - (self.get_device_group_peer_memory_features)( - device, - heap_index, - local_device_index, - remote_device_index, - p_peer_memory_features, - ) - } - #[doc = ""] - pub unsafe fn cmd_set_device_mask(&self, command_buffer: CommandBuffer, device_mask: u32) { - (self.cmd_set_device_mask)(command_buffer, device_mask) - } - #[doc = ""] - pub unsafe fn cmd_dispatch_base( - &self, - command_buffer: CommandBuffer, - base_group_x: u32, - base_group_y: u32, - base_group_z: u32, - group_count_x: u32, - group_count_y: u32, - group_count_z: u32, - ) { - (self.cmd_dispatch_base)( - command_buffer, - base_group_x, - base_group_y, - base_group_z, - group_count_x, - group_count_y, - group_count_z, - ) - } - #[doc = ""] - pub unsafe fn get_image_memory_requirements2( - &self, - device: Device, - p_info: *const ImageMemoryRequirementsInfo2, - p_memory_requirements: *mut MemoryRequirements2, - ) { - (self.get_image_memory_requirements2)(device, p_info, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_buffer_memory_requirements2( - &self, - device: Device, - p_info: *const BufferMemoryRequirementsInfo2, - p_memory_requirements: *mut MemoryRequirements2, - ) { - (self.get_buffer_memory_requirements2)(device, p_info, p_memory_requirements) - } - #[doc = ""] - pub unsafe fn get_image_sparse_memory_requirements2( - &self, - device: Device, - p_info: *const ImageSparseMemoryRequirementsInfo2, - p_sparse_memory_requirement_count: *mut u32, - p_sparse_memory_requirements: *mut SparseImageMemoryRequirements2, - ) { - (self.get_image_sparse_memory_requirements2)( - device, - p_info, - p_sparse_memory_requirement_count, - p_sparse_memory_requirements, - ) - } - #[doc = ""] - pub unsafe fn trim_command_pool( - &self, - device: Device, - command_pool: CommandPool, - flags: CommandPoolTrimFlags, - ) { - (self.trim_command_pool)(device, command_pool, flags) - } - #[doc = ""] - pub unsafe fn get_device_queue2( - &self, - device: Device, - p_queue_info: *const DeviceQueueInfo2, - p_queue: *mut Queue, - ) { - (self.get_device_queue2)(device, p_queue_info, p_queue) - } - #[doc = ""] - pub unsafe fn create_sampler_ycbcr_conversion( - &self, - device: Device, - p_create_info: *const SamplerYcbcrConversionCreateInfo, - p_allocator: *const AllocationCallbacks, - p_ycbcr_conversion: *mut SamplerYcbcrConversion, - ) -> Result { - (self.create_sampler_ycbcr_conversion)( - device, - p_create_info, - p_allocator, - p_ycbcr_conversion, - ) - } - #[doc = ""] - pub unsafe fn destroy_sampler_ycbcr_conversion( - &self, - device: Device, - ycbcr_conversion: SamplerYcbcrConversion, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_sampler_ycbcr_conversion)(device, ycbcr_conversion, p_allocator) - } - #[doc = ""] - pub unsafe fn create_descriptor_update_template( - &self, - device: Device, - p_create_info: *const DescriptorUpdateTemplateCreateInfo, - p_allocator: *const AllocationCallbacks, - p_descriptor_update_template: *mut DescriptorUpdateTemplate, - ) -> Result { - (self.create_descriptor_update_template)( - device, - p_create_info, - p_allocator, - p_descriptor_update_template, - ) - } - #[doc = ""] - pub unsafe fn destroy_descriptor_update_template( - &self, - device: Device, - descriptor_update_template: DescriptorUpdateTemplate, - p_allocator: *const AllocationCallbacks, - ) { - (self.destroy_descriptor_update_template)(device, descriptor_update_template, p_allocator) - } - #[doc = ""] - pub unsafe fn update_descriptor_set_with_template( - &self, - device: Device, - descriptor_set: DescriptorSet, - descriptor_update_template: DescriptorUpdateTemplate, - p_data: *const c_void, - ) { - (self.update_descriptor_set_with_template)( - device, - descriptor_set, - descriptor_update_template, - p_data, - ) - } - #[doc = ""] - pub unsafe fn get_descriptor_set_layout_support( - &self, - device: Device, - p_create_info: *const DescriptorSetLayoutCreateInfo, - p_support: *mut DescriptorSetLayoutSupport, - ) { - (self.get_descriptor_set_layout_support)(device, p_create_info, p_support) - } } #[derive(Clone)] pub struct EntryFnV1_2 {} @@ -6411,142 +4593,761 @@ impl DeviceFnV1_2 { }, } } - #[doc = ""] - pub unsafe fn cmd_draw_indirect_count( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - count_buffer: Buffer, - count_buffer_offset: DeviceSize, - max_draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indirect_count)( - command_buffer, - buffer, - offset, - count_buffer, - count_buffer_offset, - max_draw_count, - stride, - ) - } - #[doc = ""] - pub unsafe fn cmd_draw_indexed_indirect_count( - &self, - command_buffer: CommandBuffer, - buffer: Buffer, - offset: DeviceSize, - count_buffer: Buffer, - count_buffer_offset: DeviceSize, - max_draw_count: u32, - stride: u32, - ) { - (self.cmd_draw_indexed_indirect_count)( - command_buffer, - buffer, - offset, - count_buffer, - count_buffer_offset, - max_draw_count, - stride, - ) - } - #[doc = ""] - pub unsafe fn create_render_pass2( - &self, - device: Device, - p_create_info: *const RenderPassCreateInfo2, - p_allocator: *const AllocationCallbacks, - p_render_pass: *mut RenderPass, - ) -> Result { - (self.create_render_pass2)(device, p_create_info, p_allocator, p_render_pass) - } - #[doc = ""] - pub unsafe fn cmd_begin_render_pass2( - &self, - command_buffer: CommandBuffer, - p_render_pass_begin: *const RenderPassBeginInfo, - p_subpass_begin_info: *const SubpassBeginInfo, - ) { - (self.cmd_begin_render_pass2)(command_buffer, p_render_pass_begin, p_subpass_begin_info) - } - #[doc = ""] - pub unsafe fn cmd_next_subpass2( - &self, - command_buffer: CommandBuffer, - p_subpass_begin_info: *const SubpassBeginInfo, - p_subpass_end_info: *const SubpassEndInfo, - ) { - (self.cmd_next_subpass2)(command_buffer, p_subpass_begin_info, p_subpass_end_info) - } - #[doc = ""] - pub unsafe fn cmd_end_render_pass2( - &self, - command_buffer: CommandBuffer, - p_subpass_end_info: *const SubpassEndInfo, - ) { - (self.cmd_end_render_pass2)(command_buffer, p_subpass_end_info) - } - #[doc = ""] - pub unsafe fn reset_query_pool( - &self, - device: Device, - query_pool: QueryPool, - first_query: u32, - query_count: u32, - ) { - (self.reset_query_pool)(device, query_pool, first_query, query_count) - } - #[doc = ""] - pub unsafe fn get_semaphore_counter_value( - &self, - device: Device, - semaphore: Semaphore, - p_value: *mut u64, - ) -> Result { - (self.get_semaphore_counter_value)(device, semaphore, p_value) - } - #[doc = ""] - pub unsafe fn wait_semaphores( - &self, - device: Device, - p_wait_info: *const SemaphoreWaitInfo, - timeout: u64, - ) -> Result { - (self.wait_semaphores)(device, p_wait_info, timeout) - } - #[doc = ""] - pub unsafe fn signal_semaphore( - &self, - device: Device, - p_signal_info: *const SemaphoreSignalInfo, - ) -> Result { - (self.signal_semaphore)(device, p_signal_info) - } - #[doc = ""] - pub unsafe fn get_buffer_device_address( - &self, - device: Device, - p_info: *const BufferDeviceAddressInfo, - ) -> DeviceAddress { - (self.get_buffer_device_address)(device, p_info) +} +#[derive(Clone)] +pub struct EntryFnV1_3 {} +unsafe impl Send for EntryFnV1_3 {} +unsafe impl Sync for EntryFnV1_3 {} +impl EntryFnV1_3 { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} } - #[doc = ""] - pub unsafe fn get_buffer_opaque_capture_address( - &self, - device: Device, - p_info: *const BufferDeviceAddressInfo, - ) -> u64 { - (self.get_buffer_opaque_capture_address)(device, p_info) +} +#[derive(Clone)] +pub struct InstanceFnV1_3 { + pub get_physical_device_tool_properties: crate::vk::PFN_vkGetPhysicalDeviceToolProperties, +} +unsafe impl Send for InstanceFnV1_3 {} +unsafe impl Sync for InstanceFnV1_3 {} +impl InstanceFnV1_3 { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self { + get_physical_device_tool_properties: unsafe { + unsafe extern "system" fn get_physical_device_tool_properties( + _physical_device: PhysicalDevice, + _p_tool_count: *mut u32, + _p_tool_properties: *mut PhysicalDeviceToolProperties, + ) -> Result { + panic!(concat!( + "Unable to load ", + stringify!(get_physical_device_tool_properties) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkGetPhysicalDeviceToolProperties\0", + ); + let val = _f(cname); + if val.is_null() { + get_physical_device_tool_properties + } else { + ::std::mem::transmute(val) + } + }, + } } - #[doc = ""] - pub unsafe fn get_device_memory_opaque_capture_address( - &self, - device: Device, - p_info: *const DeviceMemoryOpaqueCaptureAddressInfo, - ) -> u64 { - (self.get_device_memory_opaque_capture_address)(device, p_info) +} +#[derive(Clone)] +pub struct DeviceFnV1_3 { + pub create_private_data_slot: crate::vk::PFN_vkCreatePrivateDataSlot, + pub destroy_private_data_slot: crate::vk::PFN_vkDestroyPrivateDataSlot, + pub set_private_data: crate::vk::PFN_vkSetPrivateData, + pub get_private_data: crate::vk::PFN_vkGetPrivateData, + pub cmd_set_event2: crate::vk::PFN_vkCmdSetEvent2, + pub cmd_reset_event2: crate::vk::PFN_vkCmdResetEvent2, + pub cmd_wait_events2: crate::vk::PFN_vkCmdWaitEvents2, + pub cmd_pipeline_barrier2: crate::vk::PFN_vkCmdPipelineBarrier2, + pub cmd_write_timestamp2: crate::vk::PFN_vkCmdWriteTimestamp2, + pub queue_submit2: crate::vk::PFN_vkQueueSubmit2, + pub cmd_copy_buffer2: crate::vk::PFN_vkCmdCopyBuffer2, + pub cmd_copy_image2: crate::vk::PFN_vkCmdCopyImage2, + pub cmd_copy_buffer_to_image2: crate::vk::PFN_vkCmdCopyBufferToImage2, + pub cmd_copy_image_to_buffer2: crate::vk::PFN_vkCmdCopyImageToBuffer2, + pub cmd_blit_image2: crate::vk::PFN_vkCmdBlitImage2, + pub cmd_resolve_image2: crate::vk::PFN_vkCmdResolveImage2, + pub cmd_begin_rendering: crate::vk::PFN_vkCmdBeginRendering, + pub cmd_end_rendering: crate::vk::PFN_vkCmdEndRendering, + pub cmd_set_cull_mode: crate::vk::PFN_vkCmdSetCullMode, + pub cmd_set_front_face: crate::vk::PFN_vkCmdSetFrontFace, + pub cmd_set_primitive_topology: crate::vk::PFN_vkCmdSetPrimitiveTopology, + pub cmd_set_viewport_with_count: crate::vk::PFN_vkCmdSetViewportWithCount, + pub cmd_set_scissor_with_count: crate::vk::PFN_vkCmdSetScissorWithCount, + pub cmd_bind_vertex_buffers2: crate::vk::PFN_vkCmdBindVertexBuffers2, + pub cmd_set_depth_test_enable: crate::vk::PFN_vkCmdSetDepthTestEnable, + pub cmd_set_depth_write_enable: crate::vk::PFN_vkCmdSetDepthWriteEnable, + pub cmd_set_depth_compare_op: crate::vk::PFN_vkCmdSetDepthCompareOp, + pub cmd_set_depth_bounds_test_enable: crate::vk::PFN_vkCmdSetDepthBoundsTestEnable, + pub cmd_set_stencil_test_enable: crate::vk::PFN_vkCmdSetStencilTestEnable, + pub cmd_set_stencil_op: crate::vk::PFN_vkCmdSetStencilOp, + pub cmd_set_rasterizer_discard_enable: crate::vk::PFN_vkCmdSetRasterizerDiscardEnable, + pub cmd_set_depth_bias_enable: crate::vk::PFN_vkCmdSetDepthBiasEnable, + pub cmd_set_primitive_restart_enable: crate::vk::PFN_vkCmdSetPrimitiveRestartEnable, + pub get_device_buffer_memory_requirements: crate::vk::PFN_vkGetDeviceBufferMemoryRequirements, + pub get_device_image_memory_requirements: crate::vk::PFN_vkGetDeviceImageMemoryRequirements, + pub get_device_image_sparse_memory_requirements: + crate::vk::PFN_vkGetDeviceImageSparseMemoryRequirements, +} +unsafe impl Send for DeviceFnV1_3 {} +unsafe impl Sync for DeviceFnV1_3 {} +impl DeviceFnV1_3 { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self { + create_private_data_slot: unsafe { + unsafe extern "system" fn create_private_data_slot( + _device: Device, + _p_create_info: *const PrivateDataSlotCreateInfo, + _p_allocator: *const AllocationCallbacks, + _p_private_data_slot: *mut PrivateDataSlot, + ) -> Result { + panic!(concat!( + "Unable to load ", + stringify!(create_private_data_slot) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCreatePrivateDataSlot\0"); + let val = _f(cname); + if val.is_null() { + create_private_data_slot + } else { + ::std::mem::transmute(val) + } + }, + destroy_private_data_slot: unsafe { + unsafe extern "system" fn destroy_private_data_slot( + _device: Device, + _private_data_slot: PrivateDataSlot, + _p_allocator: *const AllocationCallbacks, + ) { + panic!(concat!( + "Unable to load ", + stringify!(destroy_private_data_slot) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkDestroyPrivateDataSlot\0"); + let val = _f(cname); + if val.is_null() { + destroy_private_data_slot + } else { + ::std::mem::transmute(val) + } + }, + set_private_data: unsafe { + unsafe extern "system" fn set_private_data( + _device: Device, + _object_type: ObjectType, + _object_handle: u64, + _private_data_slot: PrivateDataSlot, + _data: u64, + ) -> Result { + panic!(concat!("Unable to load ", stringify!(set_private_data))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkSetPrivateData\0"); + let val = _f(cname); + if val.is_null() { + set_private_data + } else { + ::std::mem::transmute(val) + } + }, + get_private_data: unsafe { + unsafe extern "system" fn get_private_data( + _device: Device, + _object_type: ObjectType, + _object_handle: u64, + _private_data_slot: PrivateDataSlot, + _p_data: *mut u64, + ) { + panic!(concat!("Unable to load ", stringify!(get_private_data))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetPrivateData\0"); + let val = _f(cname); + if val.is_null() { + get_private_data + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_event2: unsafe { + unsafe extern "system" fn cmd_set_event2( + _command_buffer: CommandBuffer, + _event: Event, + _p_dependency_info: *const DependencyInfo, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_set_event2))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetEvent2\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_event2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_reset_event2: unsafe { + unsafe extern "system" fn cmd_reset_event2( + _command_buffer: CommandBuffer, + _event: Event, + _stage_mask: PipelineStageFlags2, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_reset_event2))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdResetEvent2\0"); + let val = _f(cname); + if val.is_null() { + cmd_reset_event2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_wait_events2: unsafe { + unsafe extern "system" fn cmd_wait_events2( + _command_buffer: CommandBuffer, + _event_count: u32, + _p_events: *const Event, + _p_dependency_infos: *const DependencyInfo, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_wait_events2))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdWaitEvents2\0"); + let val = _f(cname); + if val.is_null() { + cmd_wait_events2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_pipeline_barrier2: unsafe { + unsafe extern "system" fn cmd_pipeline_barrier2( + _command_buffer: CommandBuffer, + _p_dependency_info: *const DependencyInfo, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_pipeline_barrier2) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdPipelineBarrier2\0"); + let val = _f(cname); + if val.is_null() { + cmd_pipeline_barrier2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_write_timestamp2: unsafe { + unsafe extern "system" fn cmd_write_timestamp2( + _command_buffer: CommandBuffer, + _stage: PipelineStageFlags2, + _query_pool: QueryPool, + _query: u32, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_write_timestamp2))) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdWriteTimestamp2\0"); + let val = _f(cname); + if val.is_null() { + cmd_write_timestamp2 + } else { + ::std::mem::transmute(val) + } + }, + queue_submit2: unsafe { + unsafe extern "system" fn queue_submit2( + _queue: Queue, + _submit_count: u32, + _p_submits: *const SubmitInfo2, + _fence: Fence, + ) -> Result { + panic!(concat!("Unable to load ", stringify!(queue_submit2))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkQueueSubmit2\0"); + let val = _f(cname); + if val.is_null() { + queue_submit2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_copy_buffer2: unsafe { + unsafe extern "system" fn cmd_copy_buffer2( + _command_buffer: CommandBuffer, + _p_copy_buffer_info: *const CopyBufferInfo2, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_copy_buffer2))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdCopyBuffer2\0"); + let val = _f(cname); + if val.is_null() { + cmd_copy_buffer2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_copy_image2: unsafe { + unsafe extern "system" fn cmd_copy_image2( + _command_buffer: CommandBuffer, + _p_copy_image_info: *const CopyImageInfo2, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_copy_image2))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdCopyImage2\0"); + let val = _f(cname); + if val.is_null() { + cmd_copy_image2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_copy_buffer_to_image2: unsafe { + unsafe extern "system" fn cmd_copy_buffer_to_image2( + _command_buffer: CommandBuffer, + _p_copy_buffer_to_image_info: *const CopyBufferToImageInfo2, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_copy_buffer_to_image2) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdCopyBufferToImage2\0"); + let val = _f(cname); + if val.is_null() { + cmd_copy_buffer_to_image2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_copy_image_to_buffer2: unsafe { + unsafe extern "system" fn cmd_copy_image_to_buffer2( + _command_buffer: CommandBuffer, + _p_copy_image_to_buffer_info: *const CopyImageToBufferInfo2, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_copy_image_to_buffer2) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdCopyImageToBuffer2\0"); + let val = _f(cname); + if val.is_null() { + cmd_copy_image_to_buffer2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_blit_image2: unsafe { + unsafe extern "system" fn cmd_blit_image2( + _command_buffer: CommandBuffer, + _p_blit_image_info: *const BlitImageInfo2, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_blit_image2))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBlitImage2\0"); + let val = _f(cname); + if val.is_null() { + cmd_blit_image2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_resolve_image2: unsafe { + unsafe extern "system" fn cmd_resolve_image2( + _command_buffer: CommandBuffer, + _p_resolve_image_info: *const ResolveImageInfo2, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_resolve_image2))) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdResolveImage2\0"); + let val = _f(cname); + if val.is_null() { + cmd_resolve_image2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_begin_rendering: unsafe { + unsafe extern "system" fn cmd_begin_rendering( + _command_buffer: CommandBuffer, + _p_rendering_info: *const RenderingInfo, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_begin_rendering))) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBeginRendering\0"); + let val = _f(cname); + if val.is_null() { + cmd_begin_rendering + } else { + ::std::mem::transmute(val) + } + }, + cmd_end_rendering: unsafe { + unsafe extern "system" fn cmd_end_rendering(_command_buffer: CommandBuffer) { + panic!(concat!("Unable to load ", stringify!(cmd_end_rendering))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdEndRendering\0"); + let val = _f(cname); + if val.is_null() { + cmd_end_rendering + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_cull_mode: unsafe { + unsafe extern "system" fn cmd_set_cull_mode( + _command_buffer: CommandBuffer, + _cull_mode: CullModeFlags, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_set_cull_mode))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetCullMode\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_cull_mode + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_front_face: unsafe { + unsafe extern "system" fn cmd_set_front_face( + _command_buffer: CommandBuffer, + _front_face: FrontFace, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_set_front_face))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetFrontFace\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_front_face + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_primitive_topology: unsafe { + unsafe extern "system" fn cmd_set_primitive_topology( + _command_buffer: CommandBuffer, + _primitive_topology: PrimitiveTopology, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_primitive_topology) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetPrimitiveTopology\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_primitive_topology + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_viewport_with_count: unsafe { + unsafe extern "system" fn cmd_set_viewport_with_count( + _command_buffer: CommandBuffer, + _viewport_count: u32, + _p_viewports: *const Viewport, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_viewport_with_count) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetViewportWithCount\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_viewport_with_count + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_scissor_with_count: unsafe { + unsafe extern "system" fn cmd_set_scissor_with_count( + _command_buffer: CommandBuffer, + _scissor_count: u32, + _p_scissors: *const Rect2D, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_scissor_with_count) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetScissorWithCount\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_scissor_with_count + } else { + ::std::mem::transmute(val) + } + }, + cmd_bind_vertex_buffers2: unsafe { + unsafe extern "system" fn cmd_bind_vertex_buffers2( + _command_buffer: CommandBuffer, + _first_binding: u32, + _binding_count: u32, + _p_buffers: *const Buffer, + _p_offsets: *const DeviceSize, + _p_sizes: *const DeviceSize, + _p_strides: *const DeviceSize, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_bind_vertex_buffers2) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdBindVertexBuffers2\0"); + let val = _f(cname); + if val.is_null() { + cmd_bind_vertex_buffers2 + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_depth_test_enable: unsafe { + unsafe extern "system" fn cmd_set_depth_test_enable( + _command_buffer: CommandBuffer, + _depth_test_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_depth_test_enable) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetDepthTestEnable\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_depth_test_enable + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_depth_write_enable: unsafe { + unsafe extern "system" fn cmd_set_depth_write_enable( + _command_buffer: CommandBuffer, + _depth_write_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_depth_write_enable) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetDepthWriteEnable\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_depth_write_enable + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_depth_compare_op: unsafe { + unsafe extern "system" fn cmd_set_depth_compare_op( + _command_buffer: CommandBuffer, + _depth_compare_op: CompareOp, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_depth_compare_op) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetDepthCompareOp\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_depth_compare_op + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_depth_bounds_test_enable: unsafe { + unsafe extern "system" fn cmd_set_depth_bounds_test_enable( + _command_buffer: CommandBuffer, + _depth_bounds_test_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_depth_bounds_test_enable) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdSetDepthBoundsTestEnable\0", + ); + let val = _f(cname); + if val.is_null() { + cmd_set_depth_bounds_test_enable + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_stencil_test_enable: unsafe { + unsafe extern "system" fn cmd_set_stencil_test_enable( + _command_buffer: CommandBuffer, + _stencil_test_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_stencil_test_enable) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetStencilTestEnable\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_stencil_test_enable + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_stencil_op: unsafe { + unsafe extern "system" fn cmd_set_stencil_op( + _command_buffer: CommandBuffer, + _face_mask: StencilFaceFlags, + _fail_op: StencilOp, + _pass_op: StencilOp, + _depth_fail_op: StencilOp, + _compare_op: CompareOp, + ) { + panic!(concat!("Unable to load ", stringify!(cmd_set_stencil_op))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetStencilOp\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_stencil_op + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_rasterizer_discard_enable: unsafe { + unsafe extern "system" fn cmd_set_rasterizer_discard_enable( + _command_buffer: CommandBuffer, + _rasterizer_discard_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_rasterizer_discard_enable) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdSetRasterizerDiscardEnable\0", + ); + let val = _f(cname); + if val.is_null() { + cmd_set_rasterizer_discard_enable + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_depth_bias_enable: unsafe { + unsafe extern "system" fn cmd_set_depth_bias_enable( + _command_buffer: CommandBuffer, + _depth_bias_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_depth_bias_enable) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdSetDepthBiasEnable\0"); + let val = _f(cname); + if val.is_null() { + cmd_set_depth_bias_enable + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_primitive_restart_enable: unsafe { + unsafe extern "system" fn cmd_set_primitive_restart_enable( + _command_buffer: CommandBuffer, + _primitive_restart_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_primitive_restart_enable) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdSetPrimitiveRestartEnable\0", + ); + let val = _f(cname); + if val.is_null() { + cmd_set_primitive_restart_enable + } else { + ::std::mem::transmute(val) + } + }, + get_device_buffer_memory_requirements: unsafe { + unsafe extern "system" fn get_device_buffer_memory_requirements( + _device: Device, + _p_info: *const DeviceBufferMemoryRequirements, + _p_memory_requirements: *mut MemoryRequirements2, + ) { + panic!(concat!( + "Unable to load ", + stringify!(get_device_buffer_memory_requirements) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkGetDeviceBufferMemoryRequirements\0", + ); + let val = _f(cname); + if val.is_null() { + get_device_buffer_memory_requirements + } else { + ::std::mem::transmute(val) + } + }, + get_device_image_memory_requirements: unsafe { + unsafe extern "system" fn get_device_image_memory_requirements( + _device: Device, + _p_info: *const DeviceImageMemoryRequirements, + _p_memory_requirements: *mut MemoryRequirements2, + ) { + panic!(concat!( + "Unable to load ", + stringify!(get_device_image_memory_requirements) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkGetDeviceImageMemoryRequirements\0", + ); + let val = _f(cname); + if val.is_null() { + get_device_image_memory_requirements + } else { + ::std::mem::transmute(val) + } + }, + get_device_image_sparse_memory_requirements: unsafe { + unsafe extern "system" fn get_device_image_sparse_memory_requirements( + _device: Device, + _p_info: *const DeviceImageMemoryRequirements, + _p_sparse_memory_requirement_count: *mut u32, + _p_sparse_memory_requirements: *mut SparseImageMemoryRequirements2, + ) { + panic!(concat!( + "Unable to load ", + stringify!(get_device_image_sparse_memory_requirements) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkGetDeviceImageSparseMemoryRequirements\0", + ); + let val = _f(cname); + if val.is_null() { + get_device_image_sparse_memory_requirements + } else { + ::std::mem::transmute(val) + } + }, + } } } diff --git a/third_party/rust/ash/src/vk/macros.rs b/third_party/rust/ash/src/vk/macros.rs index b0e9a1aea0ae6..e986be312502f 100644 --- a/third_party/rust/ash/src/vk/macros.rs +++ b/third_party/rust/ash/src/vk/macros.rs @@ -20,17 +20,17 @@ macro_rules! vk_bitflags_wrapped { self.0 } #[inline] - pub fn is_empty(self) -> bool { - self == Self::empty() + pub const fn is_empty(self) -> bool { + self.0 == Self::empty().0 } #[inline] - pub fn intersects(self, other: Self) -> bool { - self & other != Self::empty() + pub const fn intersects(self, other: Self) -> bool { + !Self(self.0 & other.0).is_empty() } #[doc = r" Returns whether `other` is a subset of `self`"] #[inline] - pub fn contains(self, other: Self) -> bool { - self & other == other + pub const fn contains(self, other: Self) -> bool { + self.0 & other.0 == other.0 } } 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 as u64 + self.0 } fn from_raw(x: u64) -> Self { - Self(x as _) + Self(x) } } impl $name { diff --git a/third_party/rust/ash/src/vk/native.rs b/third_party/rust/ash/src/vk/native.rs index cd03182eca414..e5c52f401f7a1 100644 --- a/third_party/rust/ash/src/vk/native.rs +++ b/third_party/rust/ash/src/vk/native.rs @@ -620,6 +620,7 @@ fn bindgen_test_layout_StdVideoH264HrdParameters() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH264SequenceParameterSetVui { + pub flags: StdVideoH264SpsVuiFlags, pub aspect_ratio_idc: StdVideoH264AspectRatioIdc, pub sar_width: u16, pub sar_height: u16, @@ -629,10 +630,9 @@ pub struct StdVideoH264SequenceParameterSetVui { pub matrix_coefficients: u8, pub num_units_in_tick: u32, pub time_scale: u32, - pub pHrdParameters: *mut StdVideoH264HrdParameters, + pub pHrdParameters: *const StdVideoH264HrdParameters, pub max_num_reorder_frames: u8, pub max_dec_frame_buffering: u8, - pub flags: StdVideoH264SpsVuiFlags, } #[test] fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { @@ -649,12 +649,25 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { stringify!(StdVideoH264SequenceParameterSetVui) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH264SequenceParameterSetVui), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).aspect_ratio_idc as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -667,7 +680,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).sar_width as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -680,7 +693,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).sar_height as *const _ as usize }, - 6usize, + 10usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -693,7 +706,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).video_format as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -706,7 +719,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).color_primaries as *const _ as usize }, - 9usize, + 13usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -719,7 +732,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).transfer_characteristics as *const _ as usize }, - 10usize, + 14usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -732,7 +745,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).matrix_coefficients as *const _ as usize }, - 11usize, + 15usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -745,7 +758,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).num_units_in_tick as *const _ as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -758,7 +771,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { &(*(::std::ptr::null::())).time_scale as *const _ as usize }, - 16usize, + 20usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSetVui), @@ -805,19 +818,6 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSetVui() { stringify!(max_dec_frame_buffering) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ - as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH264SequenceParameterSetVui), - "::", - stringify!(flags) - ) - ); } #[repr(C)] #[repr(align(4))] @@ -1186,6 +1186,7 @@ fn bindgen_test_layout_StdVideoH264ScalingLists() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH264SequenceParameterSet { + pub flags: StdVideoH264SpsFlags, pub profile_idc: StdVideoH264ProfileIdc, pub level_idc: StdVideoH264Level, pub seq_parameter_set_id: u8, @@ -1205,10 +1206,9 @@ pub struct StdVideoH264SequenceParameterSet { pub frame_crop_right_offset: u32, pub frame_crop_top_offset: u32, pub frame_crop_bottom_offset: u32, - pub flags: StdVideoH264SpsFlags, - pub pOffsetForRefFrame: *mut i32, - pub pScalingLists: *mut StdVideoH264ScalingLists, - pub pSequenceParameterSetVui: *mut StdVideoH264SequenceParameterSetVui, + pub pOffsetForRefFrame: *const i32, + pub pScalingLists: *const StdVideoH264ScalingLists, + pub pSequenceParameterSetVui: *const StdVideoH264SequenceParameterSetVui, } #[test] fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { @@ -1225,12 +1225,24 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { stringify!(StdVideoH264SequenceParameterSet) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH264SequenceParameterSet), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).profile_idc as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1243,7 +1255,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).level_idc as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1256,7 +1268,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).seq_parameter_set_id as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1269,7 +1281,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).chroma_format_idc as *const _ as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1282,7 +1294,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).bit_depth_luma_minus8 as *const _ as usize }, - 16usize, + 20usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1295,7 +1307,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).bit_depth_chroma_minus8 as *const _ as usize }, - 17usize, + 21usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1308,7 +1320,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).log2_max_frame_num_minus4 as *const _ as usize }, - 18usize, + 22usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1321,7 +1333,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).pic_order_cnt_type as *const _ as usize }, - 20usize, + 24usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1334,7 +1346,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_max_pic_order_cnt_lsb_minus4 as *const _ as usize }, - 24usize, + 28usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1347,7 +1359,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).offset_for_non_ref_pic as *const _ as usize }, - 28usize, + 32usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1360,7 +1372,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())) .offset_for_top_to_bottom_field as *const _ as usize }, - 32usize, + 36usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1373,7 +1385,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())) .num_ref_frames_in_pic_order_cnt_cycle as *const _ as usize }, - 36usize, + 40usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1386,7 +1398,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).max_num_ref_frames as *const _ as usize }, - 37usize, + 41usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1399,7 +1411,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).pic_width_in_mbs_minus1 as *const _ as usize }, - 40usize, + 44usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1412,7 +1424,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())) .pic_height_in_map_units_minus1 as *const _ as usize }, - 44usize, + 48usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1425,7 +1437,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).frame_crop_left_offset as *const _ as usize }, - 48usize, + 52usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1438,7 +1450,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).frame_crop_right_offset as *const _ as usize }, - 52usize, + 56usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1451,7 +1463,7 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).frame_crop_top_offset as *const _ as usize }, - 56usize, + 60usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), @@ -1464,24 +1476,12 @@ fn bindgen_test_layout_StdVideoH264SequenceParameterSet() { &(*(::std::ptr::null::())).frame_crop_bottom_offset as *const _ as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH264SequenceParameterSet), - "::", - stringify!(frame_crop_bottom_offset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize - }, 64usize, concat!( "Offset of field: ", stringify!(StdVideoH264SequenceParameterSet), "::", - stringify!(flags) + stringify!(frame_crop_bottom_offset) ) ); assert_eq!( @@ -1708,6 +1708,7 @@ impl StdVideoH264PpsFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH264PictureParameterSet { + pub flags: StdVideoH264PpsFlags, pub seq_parameter_set_id: u8, pub pic_parameter_set_id: u8, pub num_ref_idx_l0_default_active_minus1: u8, @@ -1717,8 +1718,7 @@ pub struct StdVideoH264PictureParameterSet { pub pic_init_qs_minus26: i8, pub chroma_qp_index_offset: i8, pub second_chroma_qp_index_offset: i8, - pub flags: StdVideoH264PpsFlags, - pub pScalingLists: *mut StdVideoH264ScalingLists, + pub pScalingLists: *const StdVideoH264ScalingLists, } #[test] fn bindgen_test_layout_StdVideoH264PictureParameterSet() { @@ -1732,12 +1732,24 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { 8usize, concat!("Alignment of ", stringify!(StdVideoH264PictureParameterSet)) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH264PictureParameterSet), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).seq_parameter_set_id as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1750,7 +1762,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())).pic_parameter_set_id as *const _ as usize }, - 1usize, + 5usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1763,7 +1775,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())) .num_ref_idx_l0_default_active_minus1 as *const _ as usize }, - 2usize, + 6usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1776,7 +1788,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())) .num_ref_idx_l1_default_active_minus1 as *const _ as usize }, - 3usize, + 7usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1789,7 +1801,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())).weighted_bipred_idc as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1802,7 +1814,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())).pic_init_qp_minus26 as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1815,7 +1827,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())).pic_init_qs_minus26 as *const _ as usize }, - 9usize, + 13usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1828,7 +1840,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())).chroma_qp_index_offset as *const _ as usize }, - 10usize, + 14usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1841,7 +1853,7 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { &(*(::std::ptr::null::())) .second_chroma_qp_index_offset as *const _ as usize }, - 11usize, + 15usize, concat!( "Offset of field: ", stringify!(StdVideoH264PictureParameterSet), @@ -1849,18 +1861,6 @@ fn bindgen_test_layout_StdVideoH264PictureParameterSet() { stringify!(second_chroma_qp_index_offset) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH264PictureParameterSet), - "::", - stringify!(flags) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pScalingLists as *const _ @@ -2007,13 +2007,13 @@ impl StdVideoDecodeH264PictureInfoFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoDecodeH264PictureInfo { + pub flags: StdVideoDecodeH264PictureInfoFlags, pub seq_parameter_set_id: u8, pub pic_parameter_set_id: u8, pub reserved: u16, pub frame_num: u16, pub idr_pic_id: u16, pub PicOrderCnt: [i32; 2usize], - pub flags: StdVideoDecodeH264PictureInfoFlags, } #[test] fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { @@ -2027,12 +2027,24 @@ fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { 4usize, concat!("Alignment of ", stringify!(StdVideoDecodeH264PictureInfo)) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoDecodeH264PictureInfo), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).seq_parameter_set_id as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264PictureInfo), @@ -2045,7 +2057,7 @@ fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { &(*(::std::ptr::null::())).pic_parameter_set_id as *const _ as usize }, - 1usize, + 5usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264PictureInfo), @@ -2057,7 +2069,7 @@ fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 2usize, + 6usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264PictureInfo), @@ -2069,7 +2081,7 @@ fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { unsafe { &(*(::std::ptr::null::())).frame_num as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264PictureInfo), @@ -2082,7 +2094,7 @@ fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { &(*(::std::ptr::null::())).idr_pic_id as *const _ as usize }, - 6usize, + 10usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264PictureInfo), @@ -2095,7 +2107,7 @@ fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { &(*(::std::ptr::null::())).PicOrderCnt as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264PictureInfo), @@ -2103,18 +2115,6 @@ fn bindgen_test_layout_StdVideoDecodeH264PictureInfo() { stringify!(PicOrderCnt) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(StdVideoDecodeH264PictureInfo), - "::", - stringify!(flags) - ) - ); } #[repr(C)] #[repr(align(4))] @@ -2167,11 +2167,11 @@ impl StdVideoDecodeH264ReferenceInfoFlags { } } #[inline] - pub fn is_long_term(&self) -> u32 { + pub fn used_for_long_term_reference(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } } #[inline] - pub fn set_is_long_term(&mut self, val: u32) { + pub fn set_used_for_long_term_reference(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(2usize, 1u8, val as u64) @@ -2192,7 +2192,7 @@ impl StdVideoDecodeH264ReferenceInfoFlags { pub fn new_bitfield_1( top_field_flag: u32, bottom_field_flag: u32, - is_long_term: u32, + used_for_long_term_reference: u32, is_non_existing: u32, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); @@ -2205,8 +2205,9 @@ impl StdVideoDecodeH264ReferenceInfoFlags { bottom_field_flag as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let is_long_term: u32 = unsafe { ::std::mem::transmute(is_long_term) }; - is_long_term as u64 + let used_for_long_term_reference: u32 = + unsafe { ::std::mem::transmute(used_for_long_term_reference) }; + used_for_long_term_reference as u64 }); __bindgen_bitfield_unit.set(3usize, 1u8, { let is_non_existing: u32 = unsafe { ::std::mem::transmute(is_non_existing) }; @@ -2218,10 +2219,10 @@ impl StdVideoDecodeH264ReferenceInfoFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoDecodeH264ReferenceInfo { + pub flags: StdVideoDecodeH264ReferenceInfoFlags, pub FrameNum: u16, pub reserved: u16, pub PicOrderCnt: [i32; 2usize], - pub flags: StdVideoDecodeH264ReferenceInfoFlags, } #[test] fn bindgen_test_layout_StdVideoDecodeH264ReferenceInfo() { @@ -2237,53 +2238,53 @@ fn bindgen_test_layout_StdVideoDecodeH264ReferenceInfo() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).FrameNum as *const _ - as usize + &(*(::std::ptr::null::())).flags as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264ReferenceInfo), "::", - stringify!(FrameNum) + stringify!(flags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).reserved as *const _ + &(*(::std::ptr::null::())).FrameNum as *const _ as usize }, - 2usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264ReferenceInfo), "::", - stringify!(reserved) + stringify!(FrameNum) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).PicOrderCnt as *const _ + &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 4usize, + 6usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264ReferenceInfo), "::", - stringify!(PicOrderCnt) + stringify!(reserved) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize + &(*(::std::ptr::null::())).PicOrderCnt as *const _ + as usize }, - 12usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH264ReferenceInfo), "::", - stringify!(flags) + stringify!(PicOrderCnt) ) ); } @@ -2567,7 +2568,7 @@ fn bindgen_test_layout_StdVideoDecodeH264MvcElement() { pub struct StdVideoDecodeH264Mvc { pub viewId0: u32, pub mvcElementCount: u32, - pub pMvcElements: *mut StdVideoDecodeH264MvcElement, + pub pMvcElements: *const StdVideoDecodeH264MvcElement, } #[test] fn bindgen_test_layout_StdVideoDecodeH264Mvc() { @@ -2953,6 +2954,7 @@ impl StdVideoH265HrdFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH265HrdParameters { + pub flags: StdVideoH265HrdFlags, pub tick_divisor_minus2: u8, pub du_cpb_removal_delay_increment_length_minus1: u8, pub dpb_output_delay_du_length_minus1: u8, @@ -2964,9 +2966,8 @@ pub struct StdVideoH265HrdParameters { pub dpb_output_delay_length_minus1: u8, pub cpb_cnt_minus1: [u8; 7usize], pub elemental_duration_in_tc_minus1: [u16; 7usize], - pub pSubLayerHrdParametersNal: [*mut StdVideoH265SubLayerHrdParameters; 7usize], - pub pSubLayerHrdParametersVcl: [*mut StdVideoH265SubLayerHrdParameters; 7usize], - pub flags: StdVideoH265HrdFlags, + pub pSubLayerHrdParametersNal: [*const StdVideoH265SubLayerHrdParameters; 7usize], + pub pSubLayerHrdParametersVcl: [*const StdVideoH265SubLayerHrdParameters; 7usize], } #[test] fn bindgen_test_layout_StdVideoH265HrdParameters() { @@ -2980,12 +2981,22 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { 8usize, concat!("Alignment of ", stringify!(StdVideoH265HrdParameters)) ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH265HrdParameters), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).tick_divisor_minus2 as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -2998,7 +3009,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())) .du_cpb_removal_delay_increment_length_minus1 as *const _ as usize }, - 1usize, + 5usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3011,7 +3022,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).dpb_output_delay_du_length_minus1 as *const _ as usize }, - 2usize, + 6usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3024,7 +3035,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).bit_rate_scale as *const _ as usize }, - 3usize, + 7usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3037,7 +3048,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).cpb_size_scale as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3050,7 +3061,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).cpb_size_du_scale as *const _ as usize }, - 5usize, + 9usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3063,7 +3074,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())) .initial_cpb_removal_delay_length_minus1 as *const _ as usize }, - 6usize, + 10usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3076,7 +3087,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).au_cpb_removal_delay_length_minus1 as *const _ as usize }, - 7usize, + 11usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3089,7 +3100,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).dpb_output_delay_length_minus1 as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3102,7 +3113,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).cpb_cnt_minus1 as *const _ as usize }, - 9usize, + 13usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3115,7 +3126,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).elemental_duration_in_tc_minus1 as *const _ as usize }, - 16usize, + 20usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3128,7 +3139,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).pSubLayerHrdParametersNal as *const _ as usize }, - 32usize, + 40usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3141,7 +3152,7 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { &(*(::std::ptr::null::())).pSubLayerHrdParametersVcl as *const _ as usize }, - 88usize, + 96usize, concat!( "Offset of field: ", stringify!(StdVideoH265HrdParameters), @@ -3149,16 +3160,6 @@ fn bindgen_test_layout_StdVideoH265HrdParameters() { stringify!(pSubLayerHrdParametersVcl) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH265HrdParameters), - "::", - stringify!(flags) - ) - ); } #[repr(C)] #[repr(align(4))] @@ -3260,14 +3261,14 @@ impl StdVideoH265VpsFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH265VideoParameterSet { + pub flags: StdVideoH265VpsFlags, pub vps_video_parameter_set_id: u8, pub vps_max_sub_layers_minus1: u8, pub vps_num_units_in_tick: u32, pub vps_time_scale: u32, pub vps_num_ticks_poc_diff_one_minus1: u32, - pub pDecPicBufMgr: *mut StdVideoH265DecPicBufMgr, - pub pHrdParameters: *mut StdVideoH265HrdParameters, - pub flags: StdVideoH265VpsFlags, + pub pDecPicBufMgr: *const StdVideoH265DecPicBufMgr, + pub pHrdParameters: *const StdVideoH265HrdParameters, } #[test] fn bindgen_test_layout_StdVideoH265VideoParameterSet() { @@ -3281,12 +3282,24 @@ fn bindgen_test_layout_StdVideoH265VideoParameterSet() { 8usize, concat!("Alignment of ", stringify!(StdVideoH265VideoParameterSet)) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH265VideoParameterSet), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).vps_video_parameter_set_id as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH265VideoParameterSet), @@ -3299,7 +3312,7 @@ fn bindgen_test_layout_StdVideoH265VideoParameterSet() { &(*(::std::ptr::null::())).vps_max_sub_layers_minus1 as *const _ as usize }, - 1usize, + 5usize, concat!( "Offset of field: ", stringify!(StdVideoH265VideoParameterSet), @@ -3312,7 +3325,7 @@ fn bindgen_test_layout_StdVideoH265VideoParameterSet() { &(*(::std::ptr::null::())).vps_num_units_in_tick as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH265VideoParameterSet), @@ -3325,7 +3338,7 @@ fn bindgen_test_layout_StdVideoH265VideoParameterSet() { &(*(::std::ptr::null::())).vps_time_scale as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH265VideoParameterSet), @@ -3338,7 +3351,7 @@ fn bindgen_test_layout_StdVideoH265VideoParameterSet() { &(*(::std::ptr::null::())) .vps_num_ticks_poc_diff_one_minus1 as *const _ as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoH265VideoParameterSet), @@ -3351,7 +3364,7 @@ fn bindgen_test_layout_StdVideoH265VideoParameterSet() { &(*(::std::ptr::null::())).pDecPicBufMgr as *const _ as usize }, - 16usize, + 24usize, concat!( "Offset of field: ", stringify!(StdVideoH265VideoParameterSet), @@ -3364,24 +3377,12 @@ fn bindgen_test_layout_StdVideoH265VideoParameterSet() { &(*(::std::ptr::null::())).pHrdParameters as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH265VideoParameterSet), - "::", - stringify!(pHrdParameters) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize - }, 32usize, concat!( "Offset of field: ", stringify!(StdVideoH265VideoParameterSet), "::", - stringify!(flags) + stringify!(pHrdParameters) ) ); } @@ -3821,6 +3822,7 @@ impl StdVideoH265SpsVuiFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH265SequenceParameterSetVui { + pub flags: StdVideoH265SpsVuiFlags, pub aspect_ratio_idc: u8, pub sar_width: u16, pub sar_height: u16, @@ -3837,13 +3839,12 @@ pub struct StdVideoH265SequenceParameterSetVui { pub vui_num_units_in_tick: u32, pub vui_time_scale: u32, pub vui_num_ticks_poc_diff_one_minus1: u32, - pub pHrdParameters: *mut StdVideoH265HrdParameters, + pub pHrdParameters: *const StdVideoH265HrdParameters, pub min_spatial_segmentation_idc: u16, pub max_bytes_per_pic_denom: u8, pub max_bits_per_min_cu_denom: u8, pub log2_max_mv_length_horizontal: u8, pub log2_max_mv_length_vertical: u8, - pub flags: StdVideoH265SpsVuiFlags, } #[test] fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { @@ -3860,12 +3861,25 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { stringify!(StdVideoH265SequenceParameterSetVui) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH265SequenceParameterSetVui), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).aspect_ratio_idc as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3878,7 +3892,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).sar_width as *const _ as usize }, - 2usize, + 6usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3891,7 +3905,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).sar_height as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3904,7 +3918,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).video_format as *const _ as usize }, - 6usize, + 10usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3917,7 +3931,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).colour_primaries as *const _ as usize }, - 7usize, + 11usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3930,7 +3944,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).transfer_characteristics as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3943,7 +3957,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).matrix_coeffs as *const _ as usize }, - 9usize, + 13usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3956,7 +3970,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .chroma_sample_loc_type_top_field as *const _ as usize }, - 10usize, + 14usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3969,7 +3983,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .chroma_sample_loc_type_bottom_field as *const _ as usize }, - 11usize, + 15usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3982,7 +3996,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).def_disp_win_left_offset as *const _ as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -3995,7 +4009,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .def_disp_win_right_offset as *const _ as usize }, - 14usize, + 18usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4008,7 +4022,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).def_disp_win_top_offset as *const _ as usize }, - 16usize, + 20usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4021,7 +4035,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .def_disp_win_bottom_offset as *const _ as usize }, - 18usize, + 22usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4034,7 +4048,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).vui_num_units_in_tick as *const _ as usize }, - 20usize, + 24usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4047,7 +4061,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).vui_time_scale as *const _ as usize }, - 24usize, + 28usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4060,7 +4074,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .vui_num_ticks_poc_diff_one_minus1 as *const _ as usize }, - 28usize, + 32usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4073,7 +4087,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).pHrdParameters as *const _ as usize }, - 32usize, + 40usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4086,7 +4100,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .min_spatial_segmentation_idc as *const _ as usize }, - 40usize, + 48usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4099,7 +4113,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())).max_bytes_per_pic_denom as *const _ as usize }, - 42usize, + 50usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4112,7 +4126,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .max_bits_per_min_cu_denom as *const _ as usize }, - 43usize, + 51usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4125,7 +4139,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .log2_max_mv_length_horizontal as *const _ as usize }, - 44usize, + 52usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4138,7 +4152,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { &(*(::std::ptr::null::())) .log2_max_mv_length_vertical as *const _ as usize }, - 45usize, + 53usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSetVui), @@ -4146,19 +4160,6 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSetVui() { stringify!(log2_max_mv_length_vertical) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ - as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH265SequenceParameterSetVui), - "::", - stringify!(flags) - ) - ); } #[repr(C)] #[derive(Copy, Clone)] @@ -4469,50 +4470,61 @@ impl StdVideoH265SpsFlags { } } #[inline] - pub fn sps_curr_pic_ref_enabled_flag(&self) -> u32 { + pub fn sps_scc_extension_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) } } #[inline] - pub fn set_sps_curr_pic_ref_enabled_flag(&mut self, val: u32) { + pub fn set_sps_scc_extension_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(23usize, 1u8, val as u64) } } #[inline] - pub fn palette_mode_enabled_flag(&self) -> u32 { + pub fn sps_curr_pic_ref_enabled_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) } } #[inline] - pub fn set_palette_mode_enabled_flag(&mut self, val: u32) { + pub fn set_sps_curr_pic_ref_enabled_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(24usize, 1u8, val as u64) } } #[inline] - pub fn sps_palette_predictor_initializer_present_flag(&self) -> u32 { + pub fn palette_mode_enabled_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) } } #[inline] - pub fn set_sps_palette_predictor_initializer_present_flag(&mut self, val: u32) { + pub fn set_palette_mode_enabled_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(25usize, 1u8, val as u64) } } #[inline] - pub fn intra_boundary_filtering_disabled_flag(&self) -> u32 { + pub fn sps_palette_predictor_initializer_present_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) } } #[inline] - pub fn set_intra_boundary_filtering_disabled_flag(&mut self, val: u32) { + pub fn set_sps_palette_predictor_initializer_present_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(26usize, 1u8, val as u64) } } #[inline] + pub fn intra_boundary_filtering_disabled_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) } + } + #[inline] + pub fn set_intra_boundary_filtering_disabled_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(27usize, 1u8, val as u64) + } + } + #[inline] pub fn new_bitfield_1( sps_temporal_id_nesting_flag: u32, separate_colour_plane_flag: u32, @@ -4537,6 +4549,7 @@ impl StdVideoH265SpsFlags { high_precision_offsets_enabled_flag: u32, persistent_rice_adaptation_enabled_flag: u32, cabac_bypass_alignment_enabled_flag: u32, + sps_scc_extension_flag: u32, sps_curr_pic_ref_enabled_flag: u32, palette_mode_enabled_flag: u32, sps_palette_predictor_initializer_present_flag: u32, @@ -4657,21 +4670,26 @@ impl StdVideoH265SpsFlags { cabac_bypass_alignment_enabled_flag as u64 }); __bindgen_bitfield_unit.set(23usize, 1u8, { + let sps_scc_extension_flag: u32 = + unsafe { ::std::mem::transmute(sps_scc_extension_flag) }; + sps_scc_extension_flag as u64 + }); + __bindgen_bitfield_unit.set(24usize, 1u8, { let sps_curr_pic_ref_enabled_flag: u32 = unsafe { ::std::mem::transmute(sps_curr_pic_ref_enabled_flag) }; sps_curr_pic_ref_enabled_flag as u64 }); - __bindgen_bitfield_unit.set(24usize, 1u8, { + __bindgen_bitfield_unit.set(25usize, 1u8, { let palette_mode_enabled_flag: u32 = unsafe { ::std::mem::transmute(palette_mode_enabled_flag) }; palette_mode_enabled_flag as u64 }); - __bindgen_bitfield_unit.set(25usize, 1u8, { + __bindgen_bitfield_unit.set(26usize, 1u8, { let sps_palette_predictor_initializer_present_flag: u32 = unsafe { ::std::mem::transmute(sps_palette_predictor_initializer_present_flag) }; sps_palette_predictor_initializer_present_flag as u64 }); - __bindgen_bitfield_unit.set(26usize, 1u8, { + __bindgen_bitfield_unit.set(27usize, 1u8, { let intra_boundary_filtering_disabled_flag: u32 = unsafe { ::std::mem::transmute(intra_boundary_filtering_disabled_flag) }; intra_boundary_filtering_disabled_flag as u64 @@ -4682,6 +4700,7 @@ impl StdVideoH265SpsFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH265SequenceParameterSet { + pub flags: StdVideoH265SpsFlags, pub profile_idc: StdVideoH265ProfileIdc, pub level_idc: StdVideoH265Level, pub pic_width_in_luma_samples: u32, @@ -4693,7 +4712,7 @@ pub struct StdVideoH265SequenceParameterSet { pub bit_depth_luma_minus8: u8, pub bit_depth_chroma_minus8: u8, pub log2_max_pic_order_cnt_lsb_minus4: u8, - pub sps_max_dec_pic_buffering_minus1: u8, + pub sps_max_dec_pic_buffering_minus1: [u8; 8usize], pub log2_min_luma_coding_block_size_minus3: u8, pub log2_diff_max_min_luma_coding_block_size: u8, pub log2_min_luma_transform_block_size_minus2: u8, @@ -4710,15 +4729,14 @@ pub struct StdVideoH265SequenceParameterSet { pub conf_win_right_offset: u32, pub conf_win_top_offset: u32, pub conf_win_bottom_offset: u32, - pub pDecPicBufMgr: *mut StdVideoH265DecPicBufMgr, - pub flags: StdVideoH265SpsFlags, - pub pScalingLists: *mut StdVideoH265ScalingLists, - pub pSequenceParameterSetVui: *mut StdVideoH265SequenceParameterSetVui, + pub pDecPicBufMgr: *const StdVideoH265DecPicBufMgr, + pub pScalingLists: *const StdVideoH265ScalingLists, + pub pSequenceParameterSetVui: *const StdVideoH265SequenceParameterSetVui, pub palette_max_size: u8, pub delta_palette_max_predictor_size: u8, pub motion_vector_resolution_control_idc: u8, pub sps_num_palette_predictor_initializer_minus1: u8, - pub pPredictorPaletteEntries: *mut StdVideoH265PredictorPaletteEntries, + pub pPredictorPaletteEntries: *const StdVideoH265PredictorPaletteEntries, } #[test] fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { @@ -4735,12 +4753,24 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { stringify!(StdVideoH265SequenceParameterSet) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH265SequenceParameterSet), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).profile_idc as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4753,7 +4783,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).level_idc as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4766,7 +4796,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).pic_width_in_luma_samples as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4779,7 +4809,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).pic_height_in_luma_samples as *const _ as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4792,7 +4822,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).sps_video_parameter_set_id as *const _ as usize }, - 16usize, + 20usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4805,7 +4835,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).sps_max_sub_layers_minus1 as *const _ as usize }, - 17usize, + 21usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4818,7 +4848,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).sps_seq_parameter_set_id as *const _ as usize }, - 18usize, + 22usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4831,7 +4861,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).chroma_format_idc as *const _ as usize }, - 19usize, + 23usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4844,7 +4874,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).bit_depth_luma_minus8 as *const _ as usize }, - 20usize, + 24usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4857,7 +4887,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).bit_depth_chroma_minus8 as *const _ as usize }, - 21usize, + 25usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4870,7 +4900,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_max_pic_order_cnt_lsb_minus4 as *const _ as usize }, - 22usize, + 26usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4883,7 +4913,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .sps_max_dec_pic_buffering_minus1 as *const _ as usize }, - 23usize, + 27usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4896,7 +4926,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_min_luma_coding_block_size_minus3 as *const _ as usize }, - 24usize, + 35usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4909,7 +4939,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_diff_max_min_luma_coding_block_size as *const _ as usize }, - 25usize, + 36usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4922,7 +4952,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_min_luma_transform_block_size_minus2 as *const _ as usize }, - 26usize, + 37usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4935,7 +4965,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_diff_max_min_luma_transform_block_size as *const _ as usize }, - 27usize, + 38usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4948,7 +4978,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .max_transform_hierarchy_depth_inter as *const _ as usize }, - 28usize, + 39usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4961,7 +4991,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .max_transform_hierarchy_depth_intra as *const _ as usize }, - 29usize, + 40usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4974,7 +5004,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).num_short_term_ref_pic_sets as *const _ as usize }, - 30usize, + 41usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -4987,7 +5017,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).num_long_term_ref_pics_sps as *const _ as usize }, - 31usize, + 42usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5000,7 +5030,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .pcm_sample_bit_depth_luma_minus1 as *const _ as usize }, - 32usize, + 43usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5013,7 +5043,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .pcm_sample_bit_depth_chroma_minus1 as *const _ as usize }, - 33usize, + 44usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5026,7 +5056,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_min_pcm_luma_coding_block_size_minus3 as *const _ as usize }, - 34usize, + 45usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5039,7 +5069,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())) .log2_diff_max_min_pcm_luma_coding_block_size as *const _ as usize }, - 35usize, + 46usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5052,7 +5082,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).conf_win_left_offset as *const _ as usize }, - 36usize, + 48usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5065,7 +5095,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).conf_win_right_offset as *const _ as usize }, - 40usize, + 52usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5078,7 +5108,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).conf_win_top_offset as *const _ as usize }, - 44usize, + 56usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5091,7 +5121,7 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).conf_win_bottom_offset as *const _ as usize }, - 48usize, + 60usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), @@ -5104,24 +5134,12 @@ fn bindgen_test_layout_StdVideoH265SequenceParameterSet() { &(*(::std::ptr::null::())).pDecPicBufMgr as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH265SequenceParameterSet), - "::", - stringify!(pDecPicBufMgr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize - }, 64usize, concat!( "Offset of field: ", stringify!(StdVideoH265SequenceParameterSet), "::", - stringify!(flags) + stringify!(pDecPicBufMgr) ) ); assert_eq!( @@ -5770,6 +5788,7 @@ impl StdVideoH265PpsFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoH265PictureParameterSet { + pub flags: StdVideoH265PpsFlags, pub pps_pic_parameter_set_id: u8, pub pps_seq_parameter_set_id: u8, pub num_extra_slice_header_bits: u8, @@ -5786,8 +5805,7 @@ pub struct StdVideoH265PictureParameterSet { pub pps_beta_offset_div2: i8, pub pps_tc_offset_div2: i8, pub log2_parallel_merge_level_minus2: u8, - pub flags: StdVideoH265PpsFlags, - pub pScalingLists: *mut StdVideoH265ScalingLists, + pub pScalingLists: *const StdVideoH265ScalingLists, pub log2_max_transform_skip_block_size_minus2: u8, pub diff_cu_chroma_qp_offset_depth: u8, pub chroma_qp_offset_list_len_minus1: u8, @@ -5801,7 +5819,7 @@ pub struct StdVideoH265PictureParameterSet { pub pps_num_palette_predictor_initializer: u8, pub luma_bit_depth_entry_minus8: u8, pub chroma_bit_depth_entry_minus8: u8, - pub pPredictorPaletteEntries: *mut StdVideoH265PredictorPaletteEntries, + pub pPredictorPaletteEntries: *const StdVideoH265PredictorPaletteEntries, } #[test] fn bindgen_test_layout_StdVideoH265PictureParameterSet() { @@ -5815,12 +5833,24 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { 8usize, concat!("Alignment of ", stringify!(StdVideoH265PictureParameterSet)) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoH265PictureParameterSet), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pps_pic_parameter_set_id as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5833,7 +5863,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).pps_seq_parameter_set_id as *const _ as usize }, - 1usize, + 5usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5846,7 +5876,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).num_extra_slice_header_bits as *const _ as usize }, - 2usize, + 6usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5859,7 +5889,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())) .num_ref_idx_l0_default_active_minus1 as *const _ as usize }, - 3usize, + 7usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5872,7 +5902,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())) .num_ref_idx_l1_default_active_minus1 as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5885,7 +5915,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).init_qp_minus26 as *const _ as usize }, - 5usize, + 9usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5898,7 +5928,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).diff_cu_qp_delta_depth as *const _ as usize }, - 6usize, + 10usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5911,7 +5941,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).pps_cb_qp_offset as *const _ as usize }, - 7usize, + 11usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5924,7 +5954,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).pps_cr_qp_offset as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5937,7 +5967,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).num_tile_columns_minus1 as *const _ as usize }, - 9usize, + 13usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5950,7 +5980,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).num_tile_rows_minus1 as *const _ as usize }, - 10usize, + 14usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5963,7 +5993,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).column_width_minus1 as *const _ as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5976,7 +6006,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).row_height_minus1 as *const _ as usize }, - 50usize, + 54usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -5989,7 +6019,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).pps_beta_offset_div2 as *const _ as usize }, - 92usize, + 96usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -6002,7 +6032,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())).pps_tc_offset_div2 as *const _ as usize }, - 93usize, + 97usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -6015,7 +6045,7 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { &(*(::std::ptr::null::())) .log2_parallel_merge_level_minus2 as *const _ as usize }, - 94usize, + 98usize, concat!( "Offset of field: ", stringify!(StdVideoH265PictureParameterSet), @@ -6023,18 +6053,6 @@ fn bindgen_test_layout_StdVideoH265PictureParameterSet() { stringify!(log2_parallel_merge_level_minus2) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(StdVideoH265PictureParameterSet), - "::", - stringify!(flags) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pScalingLists as *const _ @@ -6331,8 +6349,9 @@ impl StdVideoDecodeH265PictureInfoFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoDecodeH265PictureInfo { - pub vps_video_parameter_set_id: u8, - pub sps_seq_parameter_set_id: u8, + pub flags: StdVideoDecodeH265PictureInfoFlags, + pub sps_video_parameter_set_id: u8, + pub pps_seq_parameter_set_id: u8, pub pps_pic_parameter_set_id: u8, pub num_short_term_ref_pic_sets: u8, pub PicOrderCntVal: i32, @@ -6341,7 +6360,6 @@ pub struct StdVideoDecodeH265PictureInfo { pub RefPicSetStCurrBefore: [u8; 8usize], pub RefPicSetStCurrAfter: [u8; 8usize], pub RefPicSetLtCurr: [u8; 8usize], - pub flags: StdVideoDecodeH265PictureInfoFlags, } #[test] fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { @@ -6357,28 +6375,40 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).vps_video_parameter_set_id - as *const _ as usize + &(*(::std::ptr::null::())).flags as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), "::", - stringify!(vps_video_parameter_set_id) + stringify!(flags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).sps_seq_parameter_set_id + &(*(::std::ptr::null::())).sps_video_parameter_set_id as *const _ as usize }, - 1usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), "::", - stringify!(sps_seq_parameter_set_id) + stringify!(sps_video_parameter_set_id) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).pps_seq_parameter_set_id + as *const _ as usize + }, + 5usize, + concat!( + "Offset of field: ", + stringify!(StdVideoDecodeH265PictureInfo), + "::", + stringify!(pps_seq_parameter_set_id) ) ); assert_eq!( @@ -6386,7 +6416,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).pps_pic_parameter_set_id as *const _ as usize }, - 2usize, + 6usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6399,7 +6429,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).num_short_term_ref_pic_sets as *const _ as usize }, - 3usize, + 7usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6412,7 +6442,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).PicOrderCntVal as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6425,7 +6455,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).NumBitsForSTRefPicSetInSlice as *const _ as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6438,7 +6468,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).NumDeltaPocsOfRefRpsIdx as *const _ as usize }, - 10usize, + 14usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6451,7 +6481,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).RefPicSetStCurrBefore as *const _ as usize }, - 11usize, + 15usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6464,7 +6494,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).RefPicSetStCurrAfter as *const _ as usize }, - 19usize, + 23usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6477,7 +6507,7 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { &(*(::std::ptr::null::())).RefPicSetLtCurr as *const _ as usize }, - 27usize, + 31usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265PictureInfo), @@ -6485,18 +6515,6 @@ fn bindgen_test_layout_StdVideoDecodeH265PictureInfo() { stringify!(RefPicSetLtCurr) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(StdVideoDecodeH265PictureInfo), - "::", - stringify!(flags) - ) - ); } #[repr(C)] #[repr(align(4))] @@ -6527,38 +6545,55 @@ fn bindgen_test_layout_StdVideoDecodeH265ReferenceInfoFlags() { } impl StdVideoDecodeH265ReferenceInfoFlags { #[inline] - pub fn is_long_term(&self) -> u32 { + pub fn used_for_long_term_reference(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] - pub fn set_is_long_term(&mut self, val: u32) { + pub fn set_used_for_long_term_reference(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn is_non_existing(&self) -> u32 { + pub fn unused_for_reference(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } } #[inline] - pub fn set_is_non_existing(&mut self, val: u32) { + pub fn set_unused_for_reference(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(1usize, 1u8, val as u64) } } #[inline] + pub fn is_non_existing(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_is_non_existing(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] pub fn new_bitfield_1( - is_long_term: u32, + used_for_long_term_reference: u32, + unused_for_reference: u32, is_non_existing: u32, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let is_long_term: u32 = unsafe { ::std::mem::transmute(is_long_term) }; - is_long_term as u64 + let used_for_long_term_reference: u32 = + unsafe { ::std::mem::transmute(used_for_long_term_reference) }; + used_for_long_term_reference as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { + let unused_for_reference: u32 = unsafe { ::std::mem::transmute(unused_for_reference) }; + unused_for_reference as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { let is_non_existing: u32 = unsafe { ::std::mem::transmute(is_non_existing) }; is_non_existing as u64 }); @@ -6568,8 +6603,8 @@ impl StdVideoDecodeH265ReferenceInfoFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoDecodeH265ReferenceInfo { - pub PicOrderCntVal: i32, pub flags: StdVideoDecodeH265ReferenceInfoFlags, + pub PicOrderCntVal: i32, } #[test] fn bindgen_test_layout_StdVideoDecodeH265ReferenceInfo() { @@ -6585,172 +6620,386 @@ fn bindgen_test_layout_StdVideoDecodeH265ReferenceInfo() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).PicOrderCntVal as *const _ - as usize + &(*(::std::ptr::null::())).flags as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265ReferenceInfo), "::", - stringify!(PicOrderCntVal) + stringify!(flags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize + &(*(::std::ptr::null::())).PicOrderCntVal as *const _ + as usize }, 4usize, concat!( "Offset of field: ", stringify!(StdVideoDecodeH265ReferenceInfo), "::", - stringify!(flags) + stringify!(PicOrderCntVal) ) ); } #[repr(C)] -#[repr(align(4))] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH264SliceHeaderFlags { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - pub __bindgen_padding_0: [u8; 3usize], +pub struct StdVideoEncodeH264WeightTableFlags { + pub luma_weight_l0_flag: u32, + pub chroma_weight_l0_flag: u32, + pub luma_weight_l1_flag: u32, + pub chroma_weight_l1_flag: u32, } #[test] -fn bindgen_test_layout_StdVideoEncodeH264SliceHeaderFlags() { +fn bindgen_test_layout_StdVideoEncodeH264WeightTableFlags() { assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(StdVideoEncodeH264SliceHeaderFlags)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(StdVideoEncodeH264WeightTableFlags)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, concat!( "Alignment of ", - stringify!(StdVideoEncodeH264SliceHeaderFlags) + stringify!(StdVideoEncodeH264WeightTableFlags) ) ); -} -impl StdVideoEncodeH264SliceHeaderFlags { - #[inline] - pub fn idr_flag(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_idr_flag(&mut self, val: u32) { + assert_eq!( unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn is_reference_flag(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_is_reference_flag(&mut self, val: u32) { + &(*(::std::ptr::null::())).luma_weight_l0_flag + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTableFlags), + "::", + stringify!(luma_weight_l0_flag) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn num_ref_idx_active_override_flag(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_num_ref_idx_active_override_flag(&mut self, val: u32) { + &(*(::std::ptr::null::())).chroma_weight_l0_flag + as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTableFlags), + "::", + stringify!(chroma_weight_l0_flag) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn no_output_of_prior_pics_flag(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } - } - #[inline] - pub fn set_no_output_of_prior_pics_flag(&mut self, val: u32) { + &(*(::std::ptr::null::())).luma_weight_l1_flag + as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTableFlags), + "::", + stringify!(luma_weight_l1_flag) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn long_term_reference_flag(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } - } - #[inline] - pub fn set_long_term_reference_flag(&mut self, val: u32) { + &(*(::std::ptr::null::())).chroma_weight_l1_flag + as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTableFlags), + "::", + stringify!(chroma_weight_l1_flag) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct StdVideoEncodeH264WeightTable { + pub flags: StdVideoEncodeH264WeightTableFlags, + pub luma_log2_weight_denom: u8, + pub chroma_log2_weight_denom: u8, + pub luma_weight_l0: [i8; 32usize], + pub luma_offset_l0: [i8; 32usize], + pub chroma_weight_l0: [[i8; 2usize]; 32usize], + pub chroma_offset_l0: [[i8; 2usize]; 32usize], + pub luma_weight_l1: [i8; 32usize], + pub luma_offset_l1: [i8; 32usize], + pub chroma_weight_l1: [[i8; 2usize]; 32usize], + pub chroma_offset_l1: [[i8; 2usize]; 32usize], +} +#[test] +fn bindgen_test_layout_StdVideoEncodeH264WeightTable() { + assert_eq!( + ::std::mem::size_of::(), + 404usize, + concat!("Size of: ", stringify!(StdVideoEncodeH264WeightTable)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(StdVideoEncodeH264WeightTable)) + ); + assert_eq!( unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn adaptive_ref_pic_marking_mode_flag(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } - } - #[inline] - pub fn set_adaptive_ref_pic_marking_mode_flag(&mut self, val: u32) { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(flags) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn no_prior_references_available_flag(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } - } - #[inline] - pub fn set_no_prior_references_available_flag(&mut self, val: u32) { + &(*(::std::ptr::null::())).luma_log2_weight_denom + as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(luma_log2_weight_denom) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) + &(*(::std::ptr::null::())).chroma_log2_weight_denom + as *const _ as usize + }, + 17usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(chroma_log2_weight_denom) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).luma_weight_l0 as *const _ + as usize + }, + 18usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(luma_weight_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).luma_offset_l0 as *const _ + as usize + }, + 50usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(luma_offset_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).chroma_weight_l0 as *const _ + as usize + }, + 82usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(chroma_weight_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).chroma_offset_l0 as *const _ + as usize + }, + 146usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(chroma_offset_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).luma_weight_l1 as *const _ + as usize + }, + 210usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(luma_weight_l1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).luma_offset_l1 as *const _ + as usize + }, + 242usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(luma_offset_l1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).chroma_weight_l1 as *const _ + as usize + }, + 274usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(chroma_weight_l1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).chroma_offset_l1 as *const _ + as usize + }, + 338usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264WeightTable), + "::", + stringify!(chroma_offset_l1) + ) + ); +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct StdVideoEncodeH264SliceHeaderFlags { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 3usize], +} +#[test] +fn bindgen_test_layout_StdVideoEncodeH264SliceHeaderFlags() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(StdVideoEncodeH264SliceHeaderFlags)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(StdVideoEncodeH264SliceHeaderFlags) + ) + ); +} +impl StdVideoEncodeH264SliceHeaderFlags { + #[inline] + pub fn direct_spatial_mv_pred_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_direct_spatial_mv_pred_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn num_ref_idx_active_override_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_num_ref_idx_active_override_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn no_output_of_prior_pics_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_no_output_of_prior_pics_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn adaptive_ref_pic_marking_mode_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_adaptive_ref_pic_marking_mode_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn no_prior_references_available_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_no_prior_references_available_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) } } #[inline] pub fn new_bitfield_1( - idr_flag: u32, - is_reference_flag: u32, + direct_spatial_mv_pred_flag: u32, num_ref_idx_active_override_flag: u32, no_output_of_prior_pics_flag: u32, - long_term_reference_flag: u32, adaptive_ref_pic_marking_mode_flag: u32, no_prior_references_available_flag: u32, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let idr_flag: u32 = unsafe { ::std::mem::transmute(idr_flag) }; - idr_flag as u64 + let direct_spatial_mv_pred_flag: u32 = + unsafe { ::std::mem::transmute(direct_spatial_mv_pred_flag) }; + direct_spatial_mv_pred_flag as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { - let is_reference_flag: u32 = unsafe { ::std::mem::transmute(is_reference_flag) }; - is_reference_flag as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { let num_ref_idx_active_override_flag: u32 = unsafe { ::std::mem::transmute(num_ref_idx_active_override_flag) }; num_ref_idx_active_override_flag as u64 }); - __bindgen_bitfield_unit.set(3usize, 1u8, { + __bindgen_bitfield_unit.set(2usize, 1u8, { let no_output_of_prior_pics_flag: u32 = unsafe { ::std::mem::transmute(no_output_of_prior_pics_flag) }; no_output_of_prior_pics_flag as u64 }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let long_term_reference_flag: u32 = - unsafe { ::std::mem::transmute(long_term_reference_flag) }; - long_term_reference_flag as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { + __bindgen_bitfield_unit.set(3usize, 1u8, { let adaptive_ref_pic_marking_mode_flag: u32 = unsafe { ::std::mem::transmute(adaptive_ref_pic_marking_mode_flag) }; adaptive_ref_pic_marking_mode_flag as u64 }); - __bindgen_bitfield_unit.set(6usize, 1u8, { + __bindgen_bitfield_unit.set(4usize, 1u8, { let no_prior_references_available_flag: u32 = unsafe { ::std::mem::transmute(no_prior_references_available_flag) }; no_prior_references_available_flag as u64 @@ -6806,11 +7055,11 @@ impl StdVideoEncodeH264PictureInfoFlags { } } #[inline] - pub fn long_term_reference_flag(&self) -> u32 { + pub fn used_for_long_term_reference(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } } #[inline] - pub fn set_long_term_reference_flag(&mut self, val: u32) { + pub fn set_used_for_long_term_reference(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(2usize, 1u8, val as u64) @@ -6820,7 +7069,7 @@ impl StdVideoEncodeH264PictureInfoFlags { pub fn new_bitfield_1( idr_flag: u32, is_reference_flag: u32, - long_term_reference_flag: u32, + used_for_long_term_reference: u32, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { @@ -6832,9 +7081,61 @@ impl StdVideoEncodeH264PictureInfoFlags { is_reference_flag as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let long_term_reference_flag: u32 = - unsafe { ::std::mem::transmute(long_term_reference_flag) }; - long_term_reference_flag as u64 + let used_for_long_term_reference: u32 = + unsafe { ::std::mem::transmute(used_for_long_term_reference) }; + used_for_long_term_reference as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct StdVideoEncodeH264ReferenceInfoFlags { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 3usize], +} +#[test] +fn bindgen_test_layout_StdVideoEncodeH264ReferenceInfoFlags() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(StdVideoEncodeH264ReferenceInfoFlags) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(StdVideoEncodeH264ReferenceInfoFlags) + ) + ); +} +impl StdVideoEncodeH264ReferenceInfoFlags { + #[inline] + pub fn used_for_long_term_reference(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_used_for_long_term_reference(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + used_for_long_term_reference: u32, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let used_for_long_term_reference: u32 = + unsafe { ::std::mem::transmute(used_for_long_term_reference) }; + used_for_long_term_reference as u64 }); __bindgen_bitfield_unit } @@ -7062,11 +7363,11 @@ fn bindgen_test_layout_StdVideoEncodeH264RefPicMarkingEntry() { pub struct StdVideoEncodeH264RefMemMgmtCtrlOperations { pub flags: StdVideoEncodeH264RefMgmtFlags, pub refList0ModOpCount: u8, - pub pRefList0ModOperations: *mut StdVideoEncodeH264RefListModEntry, + pub pRefList0ModOperations: *const StdVideoEncodeH264RefListModEntry, pub refList1ModOpCount: u8, - pub pRefList1ModOperations: *mut StdVideoEncodeH264RefListModEntry, + pub pRefList1ModOperations: *const StdVideoEncodeH264RefListModEntry, pub refPicMarkingOpCount: u8, - pub pRefPicMarkingOperations: *mut StdVideoEncodeH264RefPicMarkingEntry, + pub pRefPicMarkingOperations: *const StdVideoEncodeH264RefPicMarkingEntry, } #[test] fn bindgen_test_layout_StdVideoEncodeH264RefMemMgmtCtrlOperations() { @@ -7182,11 +7483,11 @@ fn bindgen_test_layout_StdVideoEncodeH264RefMemMgmtCtrlOperations() { #[derive(Debug, Copy, Clone)] pub struct StdVideoEncodeH264PictureInfo { pub flags: StdVideoEncodeH264PictureInfoFlags, + pub seq_parameter_set_id: u8, + pub pic_parameter_set_id: u8, pub pictureType: StdVideoH264PictureType, - pub frameNum: u32, - pub pictureOrderCount: u32, - pub long_term_pic_num: u16, - pub long_term_frame_idx: u16, + pub frame_num: u32, + pub PicOrderCnt: i32, } #[test] fn bindgen_test_layout_StdVideoEncodeH264PictureInfo() { @@ -7214,146 +7515,218 @@ fn bindgen_test_layout_StdVideoEncodeH264PictureInfo() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).pictureType as *const _ - as usize + &(*(::std::ptr::null::())).seq_parameter_set_id + as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264PictureInfo), "::", - stringify!(pictureType) + stringify!(seq_parameter_set_id) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).frameNum as *const _ as usize + &(*(::std::ptr::null::())).pic_parameter_set_id + as *const _ as usize }, - 8usize, + 5usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264PictureInfo), "::", - stringify!(frameNum) + stringify!(pic_parameter_set_id) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).pictureOrderCount as *const _ + &(*(::std::ptr::null::())).pictureType as *const _ as usize }, - 12usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264PictureInfo), "::", - stringify!(pictureOrderCount) + stringify!(pictureType) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).long_term_pic_num as *const _ - as usize + &(*(::std::ptr::null::())).frame_num as *const _ as usize }, - 16usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264PictureInfo), "::", - stringify!(long_term_pic_num) + stringify!(frame_num) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).long_term_frame_idx - as *const _ as usize + &(*(::std::ptr::null::())).PicOrderCnt as *const _ + as usize }, - 18usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264PictureInfo), "::", - stringify!(long_term_frame_idx) + stringify!(PicOrderCnt) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH264SliceHeader { - pub flags: StdVideoEncodeH264SliceHeaderFlags, - pub slice_type: StdVideoH264SliceType, - pub seq_parameter_set_id: u8, - pub pic_parameter_set_id: u8, - pub idr_pic_id: u16, - pub num_ref_idx_l0_active_minus1: u8, - pub num_ref_idx_l1_active_minus1: u8, - pub cabac_init_idc: StdVideoH264CabacInitIdc, - pub disable_deblocking_filter_idc: StdVideoH264DisableDeblockingFilterIdc, - pub slice_alpha_c0_offset_div2: i8, - pub slice_beta_offset_div2: i8, - pub pMemMgmtCtrlOperations: *mut StdVideoEncodeH264RefMemMgmtCtrlOperations, +pub struct StdVideoEncodeH264ReferenceInfo { + pub flags: StdVideoEncodeH264ReferenceInfoFlags, + pub FrameNum: u32, + pub PicOrderCnt: i32, + pub long_term_pic_num: u16, + pub long_term_frame_idx: u16, } #[test] -fn bindgen_test_layout_StdVideoEncodeH264SliceHeader() { +fn bindgen_test_layout_StdVideoEncodeH264ReferenceInfo() { assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(StdVideoEncodeH264SliceHeader)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(StdVideoEncodeH264ReferenceInfo)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(StdVideoEncodeH264SliceHeader)) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(StdVideoEncodeH264ReferenceInfo)) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize + &(*(::std::ptr::null::())).flags as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH264SliceHeader), + stringify!(StdVideoEncodeH264ReferenceInfo), "::", stringify!(flags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_type as *const _ + &(*(::std::ptr::null::())).FrameNum as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH264SliceHeader), + stringify!(StdVideoEncodeH264ReferenceInfo), "::", - stringify!(slice_type) + stringify!(FrameNum) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).PicOrderCnt as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceInfo), + "::", + stringify!(PicOrderCnt) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).long_term_pic_num + as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceInfo), + "::", + stringify!(long_term_pic_num) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).seq_parameter_set_id + &(*(::std::ptr::null::())).long_term_frame_idx as *const _ as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceInfo), + "::", + stringify!(long_term_frame_idx) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct StdVideoEncodeH264SliceHeader { + pub flags: StdVideoEncodeH264SliceHeaderFlags, + pub first_mb_in_slice: u32, + pub slice_type: StdVideoH264SliceType, + pub idr_pic_id: u16, + pub num_ref_idx_l0_active_minus1: u8, + pub num_ref_idx_l1_active_minus1: u8, + pub cabac_init_idc: StdVideoH264CabacInitIdc, + pub disable_deblocking_filter_idc: StdVideoH264DisableDeblockingFilterIdc, + pub slice_alpha_c0_offset_div2: i8, + pub slice_beta_offset_div2: i8, + pub pWeightTable: *const StdVideoEncodeH264WeightTable, +} +#[test] +fn bindgen_test_layout_StdVideoEncodeH264SliceHeader() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(StdVideoEncodeH264SliceHeader)) + ); + assert_eq!( + ::std::mem::align_of::(), 8usize, + concat!("Alignment of ", stringify!(StdVideoEncodeH264SliceHeader)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264SliceHeader), "::", - stringify!(seq_parameter_set_id) + stringify!(flags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).pic_parameter_set_id - as *const _ as usize + &(*(::std::ptr::null::())).first_mb_in_slice as *const _ + as usize }, - 9usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264SliceHeader), "::", - stringify!(pic_parameter_set_id) + stringify!(first_mb_in_slice) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).slice_type as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264SliceHeader), + "::", + stringify!(slice_type) ) ); assert_eq!( @@ -7361,7 +7734,7 @@ fn bindgen_test_layout_StdVideoEncodeH264SliceHeader() { &(*(::std::ptr::null::())).idr_pic_id as *const _ as usize }, - 10usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264SliceHeader), @@ -7374,7 +7747,7 @@ fn bindgen_test_layout_StdVideoEncodeH264SliceHeader() { &(*(::std::ptr::null::())).num_ref_idx_l0_active_minus1 as *const _ as usize }, - 12usize, + 14usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264SliceHeader), @@ -7387,7 +7760,7 @@ fn bindgen_test_layout_StdVideoEncodeH264SliceHeader() { &(*(::std::ptr::null::())).num_ref_idx_l1_active_minus1 as *const _ as usize }, - 13usize, + 15usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264SliceHeader), @@ -7449,98 +7822,292 @@ fn bindgen_test_layout_StdVideoEncodeH264SliceHeader() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).pMemMgmtCtrlOperations - as *const _ as usize + &(*(::std::ptr::null::())).pWeightTable as *const _ + as usize }, 32usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264SliceHeader), "::", - stringify!(pMemMgmtCtrlOperations) + stringify!(pWeightTable) ) ); } #[repr(C)] -#[repr(align(4))] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH265SliceHeaderFlags { - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +pub struct StdVideoEncodeH265WeightTableFlags { pub luma_weight_l0_flag: u16, pub chroma_weight_l0_flag: u16, pub luma_weight_l1_flag: u16, pub chroma_weight_l1_flag: u16, } #[test] -fn bindgen_test_layout_StdVideoEncodeH265SliceHeaderFlags() { +fn bindgen_test_layout_StdVideoEncodeH265WeightTableFlags() { assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(StdVideoEncodeH265SliceHeaderFlags)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(StdVideoEncodeH265WeightTableFlags)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, + ::std::mem::align_of::(), + 2usize, concat!( "Alignment of ", - stringify!(StdVideoEncodeH265SliceHeaderFlags) + stringify!(StdVideoEncodeH265WeightTableFlags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).luma_weight_l0_flag + &(*(::std::ptr::null::())).luma_weight_l0_flag as *const _ as usize }, - 4usize, + 0usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeaderFlags), + stringify!(StdVideoEncodeH265WeightTableFlags), "::", stringify!(luma_weight_l0_flag) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).chroma_weight_l0_flag + &(*(::std::ptr::null::())).chroma_weight_l0_flag as *const _ as usize }, - 6usize, + 2usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeaderFlags), + stringify!(StdVideoEncodeH265WeightTableFlags), "::", stringify!(chroma_weight_l0_flag) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).luma_weight_l1_flag + &(*(::std::ptr::null::())).luma_weight_l1_flag as *const _ as usize }, - 8usize, + 4usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeaderFlags), + stringify!(StdVideoEncodeH265WeightTableFlags), "::", stringify!(luma_weight_l1_flag) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).chroma_weight_l1_flag + &(*(::std::ptr::null::())).chroma_weight_l1_flag as *const _ as usize }, - 10usize, + 6usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeaderFlags), + stringify!(StdVideoEncodeH265WeightTableFlags), "::", stringify!(chroma_weight_l1_flag) ) ); } -impl StdVideoEncodeH265SliceHeaderFlags { +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct StdVideoEncodeH265WeightTable { + pub flags: StdVideoEncodeH265WeightTableFlags, + pub luma_log2_weight_denom: u8, + pub delta_chroma_log2_weight_denom: i8, + pub delta_luma_weight_l0: [i8; 15usize], + pub luma_offset_l0: [i8; 15usize], + pub delta_chroma_weight_l0: [[i8; 2usize]; 15usize], + pub delta_chroma_offset_l0: [[i8; 2usize]; 15usize], + pub delta_luma_weight_l1: [i8; 15usize], + pub luma_offset_l1: [i8; 15usize], + pub delta_chroma_weight_l1: [[i8; 2usize]; 15usize], + pub delta_chroma_offset_l1: [[i8; 2usize]; 15usize], +} +#[test] +fn bindgen_test_layout_StdVideoEncodeH265WeightTable() { + assert_eq!( + ::std::mem::size_of::(), + 190usize, + concat!("Size of: ", stringify!(StdVideoEncodeH265WeightTable)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(StdVideoEncodeH265WeightTable)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).luma_log2_weight_denom + as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(luma_log2_weight_denom) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).delta_chroma_log2_weight_denom + as *const _ as usize + }, + 9usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(delta_chroma_log2_weight_denom) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).delta_luma_weight_l0 + as *const _ as usize + }, + 10usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(delta_luma_weight_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).luma_offset_l0 as *const _ + as usize + }, + 25usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(luma_offset_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).delta_chroma_weight_l0 + as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(delta_chroma_weight_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).delta_chroma_offset_l0 + as *const _ as usize + }, + 70usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(delta_chroma_offset_l0) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).delta_luma_weight_l1 + as *const _ as usize + }, + 100usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(delta_luma_weight_l1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).luma_offset_l1 as *const _ + as usize + }, + 115usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(luma_offset_l1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).delta_chroma_weight_l1 + as *const _ as usize + }, + 130usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(delta_chroma_weight_l1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).delta_chroma_offset_l1 + as *const _ as usize + }, + 160usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265WeightTable), + "::", + stringify!(delta_chroma_offset_l1) + ) + ); +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct StdVideoEncodeH265SliceSegmentHeaderFlags { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, + pub __bindgen_padding_0: u16, +} +#[test] +fn bindgen_test_layout_StdVideoEncodeH265SliceSegmentHeaderFlags() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(StdVideoEncodeH265SliceSegmentHeaderFlags) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(StdVideoEncodeH265SliceSegmentHeaderFlags) + ) + ); +} +impl StdVideoEncodeH265SliceSegmentHeaderFlags { #[inline] pub fn first_slice_segment_in_pic_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } @@ -7575,142 +8142,132 @@ impl StdVideoEncodeH265SliceHeaderFlags { } } #[inline] - pub fn short_term_ref_pic_set_sps_flag(&self) -> u32 { + pub fn pic_output_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } } #[inline] - pub fn set_short_term_ref_pic_set_sps_flag(&mut self, val: u32) { + pub fn set_pic_output_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(3usize, 1u8, val as u64) } } #[inline] - pub fn slice_temporal_mvp_enable_flag(&self) -> u32 { + pub fn short_term_ref_pic_set_sps_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } } #[inline] - pub fn set_slice_temporal_mvp_enable_flag(&mut self, val: u32) { + pub fn set_short_term_ref_pic_set_sps_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(4usize, 1u8, val as u64) } } #[inline] - pub fn slice_sao_luma_flag(&self) -> u32 { + pub fn slice_temporal_mvp_enable_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } } #[inline] - pub fn set_slice_sao_luma_flag(&mut self, val: u32) { + pub fn set_slice_temporal_mvp_enable_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(5usize, 1u8, val as u64) } } #[inline] - pub fn slice_sao_chroma_flag(&self) -> u32 { + pub fn slice_sao_luma_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } } #[inline] - pub fn set_slice_sao_chroma_flag(&mut self, val: u32) { + pub fn set_slice_sao_luma_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(6usize, 1u8, val as u64) } } #[inline] - pub fn num_ref_idx_active_override_flag(&self) -> u32 { + pub fn slice_sao_chroma_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } } #[inline] - pub fn set_num_ref_idx_active_override_flag(&mut self, val: u32) { + pub fn set_slice_sao_chroma_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(7usize, 1u8, val as u64) } } #[inline] - pub fn mvd_l1_zero_flag(&self) -> u32 { + pub fn num_ref_idx_active_override_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } } #[inline] - pub fn set_mvd_l1_zero_flag(&mut self, val: u32) { + pub fn set_num_ref_idx_active_override_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(8usize, 1u8, val as u64) } } #[inline] - pub fn cabac_init_flag(&self) -> u32 { + pub fn mvd_l1_zero_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } } #[inline] - pub fn set_cabac_init_flag(&mut self, val: u32) { + pub fn set_mvd_l1_zero_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(9usize, 1u8, val as u64) } } #[inline] - pub fn slice_deblocking_filter_disable_flag(&self) -> u32 { + pub fn cabac_init_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) } } #[inline] - pub fn set_slice_deblocking_filter_disable_flag(&mut self, val: u32) { + pub fn set_cabac_init_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(10usize, 1u8, val as u64) } } #[inline] - pub fn collocated_from_l0_flag(&self) -> u32 { + pub fn slice_deblocking_filter_disable_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) } } #[inline] - pub fn set_collocated_from_l0_flag(&mut self, val: u32) { + pub fn set_slice_deblocking_filter_disable_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(11usize, 1u8, val as u64) } } #[inline] - pub fn slice_loop_filter_across_slices_enabled_flag(&self) -> u32 { + pub fn collocated_from_l0_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) } } #[inline] - pub fn set_slice_loop_filter_across_slices_enabled_flag(&mut self, val: u32) { + pub fn set_collocated_from_l0_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(12usize, 1u8, val as u64) } } #[inline] - pub fn bLastSliceInPic(&self) -> u32 { + pub fn slice_loop_filter_across_slices_enabled_flag(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) } } #[inline] - pub fn set_bLastSliceInPic(&mut self, val: u32) { + pub fn set_slice_loop_filter_across_slices_enabled_flag(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(13usize, 1u8, val as u64) } } #[inline] - pub fn reservedBits(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 18u8) as u32) } - } - #[inline] - pub fn set_reservedBits(&mut self, val: u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(14usize, 18u8, val as u64) - } - } - #[inline] pub fn new_bitfield_1( first_slice_segment_in_pic_flag: u32, no_output_of_prior_pics_flag: u32, dependent_slice_segment_flag: u32, + pic_output_flag: u32, short_term_ref_pic_set_sps_flag: u32, slice_temporal_mvp_enable_flag: u32, slice_sao_luma_flag: u32, @@ -7721,10 +8278,8 @@ impl StdVideoEncodeH265SliceHeaderFlags { slice_deblocking_filter_disable_flag: u32, collocated_from_l0_flag: u32, slice_loop_filter_across_slices_enabled_flag: u32, - bLastSliceInPic: u32, - reservedBits: u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + ) -> __BindgenBitfieldUnit<[u8; 2usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let first_slice_segment_in_pic_flag: u32 = unsafe { ::std::mem::transmute(first_slice_segment_in_pic_flag) }; @@ -7741,68 +8296,64 @@ impl StdVideoEncodeH265SliceHeaderFlags { dependent_slice_segment_flag as u64 }); __bindgen_bitfield_unit.set(3usize, 1u8, { + let pic_output_flag: u32 = unsafe { ::std::mem::transmute(pic_output_flag) }; + pic_output_flag as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { let short_term_ref_pic_set_sps_flag: u32 = unsafe { ::std::mem::transmute(short_term_ref_pic_set_sps_flag) }; short_term_ref_pic_set_sps_flag as u64 }); - __bindgen_bitfield_unit.set(4usize, 1u8, { + __bindgen_bitfield_unit.set(5usize, 1u8, { let slice_temporal_mvp_enable_flag: u32 = unsafe { ::std::mem::transmute(slice_temporal_mvp_enable_flag) }; slice_temporal_mvp_enable_flag as u64 }); - __bindgen_bitfield_unit.set(5usize, 1u8, { + __bindgen_bitfield_unit.set(6usize, 1u8, { let slice_sao_luma_flag: u32 = unsafe { ::std::mem::transmute(slice_sao_luma_flag) }; slice_sao_luma_flag as u64 }); - __bindgen_bitfield_unit.set(6usize, 1u8, { + __bindgen_bitfield_unit.set(7usize, 1u8, { let slice_sao_chroma_flag: u32 = unsafe { ::std::mem::transmute(slice_sao_chroma_flag) }; slice_sao_chroma_flag as u64 }); - __bindgen_bitfield_unit.set(7usize, 1u8, { + __bindgen_bitfield_unit.set(8usize, 1u8, { let num_ref_idx_active_override_flag: u32 = unsafe { ::std::mem::transmute(num_ref_idx_active_override_flag) }; num_ref_idx_active_override_flag as u64 }); - __bindgen_bitfield_unit.set(8usize, 1u8, { + __bindgen_bitfield_unit.set(9usize, 1u8, { let mvd_l1_zero_flag: u32 = unsafe { ::std::mem::transmute(mvd_l1_zero_flag) }; mvd_l1_zero_flag as u64 }); - __bindgen_bitfield_unit.set(9usize, 1u8, { + __bindgen_bitfield_unit.set(10usize, 1u8, { let cabac_init_flag: u32 = unsafe { ::std::mem::transmute(cabac_init_flag) }; cabac_init_flag as u64 }); - __bindgen_bitfield_unit.set(10usize, 1u8, { + __bindgen_bitfield_unit.set(11usize, 1u8, { let slice_deblocking_filter_disable_flag: u32 = unsafe { ::std::mem::transmute(slice_deblocking_filter_disable_flag) }; slice_deblocking_filter_disable_flag as u64 }); - __bindgen_bitfield_unit.set(11usize, 1u8, { + __bindgen_bitfield_unit.set(12usize, 1u8, { let collocated_from_l0_flag: u32 = unsafe { ::std::mem::transmute(collocated_from_l0_flag) }; collocated_from_l0_flag as u64 }); - __bindgen_bitfield_unit.set(12usize, 1u8, { + __bindgen_bitfield_unit.set(13usize, 1u8, { let slice_loop_filter_across_slices_enabled_flag: u32 = unsafe { ::std::mem::transmute(slice_loop_filter_across_slices_enabled_flag) }; slice_loop_filter_across_slices_enabled_flag as u64 }); - __bindgen_bitfield_unit.set(13usize, 1u8, { - let bLastSliceInPic: u32 = unsafe { ::std::mem::transmute(bLastSliceInPic) }; - bLastSliceInPic as u64 - }); - __bindgen_bitfield_unit.set(14usize, 18u8, { - let reservedBits: u32 = unsafe { ::std::mem::transmute(reservedBits) }; - reservedBits as u64 - }); __bindgen_bitfield_unit } } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH265SliceHeader { +pub struct StdVideoEncodeH265SliceSegmentHeader { + pub flags: StdVideoEncodeH265SliceSegmentHeaderFlags, pub slice_type: StdVideoH265SliceType, - pub slice_pic_parameter_set_id: u8, pub num_short_term_ref_pic_sets: u8, pub slice_segment_address: u32, pub short_term_ref_pic_set_idx: u8, @@ -7811,18 +8362,7 @@ pub struct StdVideoEncodeH265SliceHeader { pub collocated_ref_idx: u8, pub num_ref_idx_l0_active_minus1: u8, pub num_ref_idx_l1_active_minus1: u8, - pub luma_log2_weight_denom: u8, - pub delta_chroma_log2_weight_denom: i8, - pub delta_luma_weight_l0: [i8; 15usize], - pub luma_offset_l0: [i8; 15usize], - pub delta_chroma_weight_l0: [[i8; 2usize]; 15usize], - pub delta_chroma_offset_l0: [[i8; 2usize]; 15usize], - pub delta_luma_weight_l1: [i8; 15usize], - pub luma_offset_l1: [i8; 15usize], - pub delta_chroma_weight_l1: [[i8; 2usize]; 15usize], - pub delta_chroma_offset_l1: [[i8; 2usize]; 15usize], pub MaxNumMergeCand: u8, - pub slice_qp_delta: i8, pub slice_cb_qp_offset: i8, pub slice_cr_qp_offset: i8, pub slice_beta_offset_div2: i8, @@ -7830,407 +8370,271 @@ pub struct StdVideoEncodeH265SliceHeader { pub slice_act_y_qp_offset: i8, pub slice_act_cb_qp_offset: i8, pub slice_act_cr_qp_offset: i8, - pub flags: StdVideoEncodeH265SliceHeaderFlags, + pub pWeightTable: *const StdVideoEncodeH265WeightTable, } #[test] -fn bindgen_test_layout_StdVideoEncodeH265SliceHeader() { - assert_eq!( - ::std::mem::size_of::(), - 224usize, - concat!("Size of: ", stringify!(StdVideoEncodeH265SliceHeader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(StdVideoEncodeH265SliceHeader)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).slice_type as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(slice_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).slice_pic_parameter_set_id - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(slice_pic_parameter_set_id) - ) - ); +fn bindgen_test_layout_StdVideoEncodeH265SliceSegmentHeader() { assert_eq!( - unsafe { - &(*(::std::ptr::null::())).num_short_term_ref_pic_sets - as *const _ as usize - }, - 5usize, + ::std::mem::size_of::(), + 40usize, concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(num_short_term_ref_pic_sets) + "Size of: ", + stringify!(StdVideoEncodeH265SliceSegmentHeader) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).slice_segment_address - as *const _ as usize - }, + ::std::mem::align_of::(), 8usize, concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(slice_segment_address) + "Alignment of ", + stringify!(StdVideoEncodeH265SliceSegmentHeader) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).short_term_ref_pic_set_idx - as *const _ as usize + &(*(::std::ptr::null::())).flags as *const _ + as usize }, - 12usize, + 0usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(short_term_ref_pic_set_idx) + stringify!(flags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).num_long_term_sps as *const _ + &(*(::std::ptr::null::())).slice_type as *const _ as usize }, - 13usize, + 4usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(num_long_term_sps) + stringify!(slice_type) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).num_long_term_pics as *const _ - as usize + &(*(::std::ptr::null::())) + .num_short_term_ref_pic_sets as *const _ as usize }, - 14usize, + 8usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(num_long_term_pics) + stringify!(num_short_term_ref_pic_sets) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).collocated_ref_idx as *const _ - as usize + &(*(::std::ptr::null::())).slice_segment_address + as *const _ as usize }, - 15usize, + 12usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(collocated_ref_idx) + stringify!(slice_segment_address) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).num_ref_idx_l0_active_minus1 - as *const _ as usize + &(*(::std::ptr::null::())) + .short_term_ref_pic_set_idx as *const _ as usize }, 16usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(num_ref_idx_l0_active_minus1) + stringify!(short_term_ref_pic_set_idx) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).num_ref_idx_l1_active_minus1 + &(*(::std::ptr::null::())).num_long_term_sps as *const _ as usize }, 17usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(num_ref_idx_l1_active_minus1) + stringify!(num_long_term_sps) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).luma_log2_weight_denom + &(*(::std::ptr::null::())).num_long_term_pics as *const _ as usize }, 18usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(luma_log2_weight_denom) + stringify!(num_long_term_pics) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).delta_chroma_log2_weight_denom + &(*(::std::ptr::null::())).collocated_ref_idx as *const _ as usize }, 19usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(delta_chroma_log2_weight_denom) + stringify!(collocated_ref_idx) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).delta_luma_weight_l0 - as *const _ as usize + &(*(::std::ptr::null::())) + .num_ref_idx_l0_active_minus1 as *const _ as usize }, 20usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(delta_luma_weight_l0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).luma_offset_l0 as *const _ - as usize - }, - 35usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(luma_offset_l0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).delta_chroma_weight_l0 - as *const _ as usize - }, - 50usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(delta_chroma_weight_l0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).delta_chroma_offset_l0 - as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(delta_chroma_offset_l0) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).delta_luma_weight_l1 - as *const _ as usize - }, - 110usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(delta_luma_weight_l1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).luma_offset_l1 as *const _ - as usize - }, - 125usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(luma_offset_l1) + stringify!(num_ref_idx_l0_active_minus1) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).delta_chroma_weight_l1 - as *const _ as usize + &(*(::std::ptr::null::())) + .num_ref_idx_l1_active_minus1 as *const _ as usize }, - 140usize, + 21usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(delta_chroma_weight_l1) + stringify!(num_ref_idx_l1_active_minus1) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).delta_chroma_offset_l1 + &(*(::std::ptr::null::())).MaxNumMergeCand as *const _ as usize }, - 170usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(delta_chroma_offset_l1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).MaxNumMergeCand as *const _ - as usize - }, - 200usize, + 22usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(MaxNumMergeCand) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_qp_delta as *const _ - as usize - }, - 201usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), - "::", - stringify!(slice_qp_delta) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).slice_cb_qp_offset as *const _ - as usize + &(*(::std::ptr::null::())).slice_cb_qp_offset + as *const _ as usize }, - 202usize, + 23usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(slice_cb_qp_offset) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_cr_qp_offset as *const _ - as usize + &(*(::std::ptr::null::())).slice_cr_qp_offset + as *const _ as usize }, - 203usize, + 24usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(slice_cr_qp_offset) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_beta_offset_div2 + &(*(::std::ptr::null::())).slice_beta_offset_div2 as *const _ as usize }, - 204usize, + 25usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(slice_beta_offset_div2) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_tc_offset_div2 + &(*(::std::ptr::null::())).slice_tc_offset_div2 as *const _ as usize }, - 205usize, + 26usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(slice_tc_offset_div2) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_act_y_qp_offset + &(*(::std::ptr::null::())).slice_act_y_qp_offset as *const _ as usize }, - 206usize, + 27usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(slice_act_y_qp_offset) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_act_cb_qp_offset + &(*(::std::ptr::null::())).slice_act_cb_qp_offset as *const _ as usize }, - 207usize, + 28usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(slice_act_cb_qp_offset) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).slice_act_cr_qp_offset + &(*(::std::ptr::null::())).slice_act_cr_qp_offset as *const _ as usize }, - 208usize, + 29usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", stringify!(slice_act_cr_qp_offset) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize + &(*(::std::ptr::null::())).pWeightTable + as *const _ as usize }, - 212usize, + 32usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265SliceHeader), + stringify!(StdVideoEncodeH265SliceSegmentHeader), "::", - stringify!(flags) + stringify!(pWeightTable) ) ); } @@ -8308,9 +8712,9 @@ impl StdVideoEncodeH265ReferenceModificationFlags { pub struct StdVideoEncodeH265ReferenceModifications { pub flags: StdVideoEncodeH265ReferenceModificationFlags, pub referenceList0ModificationsCount: u8, - pub pReferenceList0Modifications: *mut u8, + pub pReferenceList0Modifications: *const u8, pub referenceList1ModificationsCount: u8, - pub pReferenceList1Modifications: *mut u8, + pub pReferenceList1Modifications: *const u8, } #[test] fn bindgen_test_layout_StdVideoEncodeH265ReferenceModifications() { @@ -8455,10 +8859,34 @@ impl StdVideoEncodeH265PictureInfoFlags { } } #[inline] + pub fn discardable_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_discardable_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn cross_layer_bla_flag(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_cross_layer_bla_flag(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] pub fn new_bitfield_1( is_reference_flag: u32, IrapPicFlag: u32, long_term_flag: u32, + discardable_flag: u32, + cross_layer_bla_flag: u32, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { @@ -8473,18 +8901,27 @@ impl StdVideoEncodeH265PictureInfoFlags { let long_term_flag: u32 = unsafe { ::std::mem::transmute(long_term_flag) }; long_term_flag as u64 }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let discardable_flag: u32 = unsafe { ::std::mem::transmute(discardable_flag) }; + discardable_flag as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let cross_layer_bla_flag: u32 = unsafe { ::std::mem::transmute(cross_layer_bla_flag) }; + cross_layer_bla_flag as u64 + }); __bindgen_bitfield_unit } } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoEncodeH265PictureInfo { + pub flags: StdVideoEncodeH265PictureInfoFlags, pub PictureType: StdVideoH265PictureType, pub sps_video_parameter_set_id: u8, pub pps_seq_parameter_set_id: u8, + pub pps_pic_parameter_set_id: u8, pub PicOrderCntVal: i32, pub TemporalId: u8, - pub flags: StdVideoEncodeH265PictureInfoFlags, } #[test] fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { @@ -8498,12 +8935,24 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { 4usize, concat!("Alignment of ", stringify!(StdVideoEncodeH265PictureInfo)) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265PictureInfo), + "::", + stringify!(flags) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).PictureType as *const _ as usize }, - 0usize, + 4usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265PictureInfo), @@ -8516,7 +8965,7 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { &(*(::std::ptr::null::())).sps_video_parameter_set_id as *const _ as usize }, - 4usize, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265PictureInfo), @@ -8529,7 +8978,7 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { &(*(::std::ptr::null::())).pps_seq_parameter_set_id as *const _ as usize }, - 5usize, + 9usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265PictureInfo), @@ -8539,20 +8988,20 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).PicOrderCntVal as *const _ - as usize + &(*(::std::ptr::null::())).pps_pic_parameter_set_id + as *const _ as usize }, - 8usize, + 10usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265PictureInfo), "::", - stringify!(PicOrderCntVal) + stringify!(pps_pic_parameter_set_id) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).TemporalId as *const _ + &(*(::std::ptr::null::())).PicOrderCntVal as *const _ as usize }, 12usize, @@ -8560,19 +9009,20 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { "Offset of field: ", stringify!(StdVideoEncodeH265PictureInfo), "::", - stringify!(TemporalId) + stringify!(PicOrderCntVal) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize + &(*(::std::ptr::null::())).TemporalId as *const _ + as usize }, 16usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265PictureInfo), "::", - stringify!(flags) + stringify!(TemporalId) ) ); } @@ -8605,22 +9055,22 @@ fn bindgen_test_layout_StdVideoEncodeH265ReferenceInfoFlags() { } impl StdVideoEncodeH265ReferenceInfoFlags { #[inline] - pub fn is_long_term(&self) -> u32 { + pub fn used_for_long_term_reference(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] - pub fn set_is_long_term(&mut self, val: u32) { + pub fn set_used_for_long_term_reference(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn isUsedFlag(&self) -> u32 { + pub fn unused_for_reference(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } } #[inline] - pub fn set_isUsedFlag(&mut self, val: u32) { + pub fn set_unused_for_reference(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(1usize, 1u8, val as u64) @@ -8628,17 +9078,18 @@ impl StdVideoEncodeH265ReferenceInfoFlags { } #[inline] pub fn new_bitfield_1( - is_long_term: u32, - isUsedFlag: u32, + used_for_long_term_reference: u32, + unused_for_reference: u32, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let is_long_term: u32 = unsafe { ::std::mem::transmute(is_long_term) }; - is_long_term as u64 + let used_for_long_term_reference: u32 = + unsafe { ::std::mem::transmute(used_for_long_term_reference) }; + used_for_long_term_reference as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { - let isUsedFlag: u32 = unsafe { ::std::mem::transmute(isUsedFlag) }; - isUsedFlag as u64 + let unused_for_reference: u32 = unsafe { ::std::mem::transmute(unused_for_reference) }; + unused_for_reference as u64 }); __bindgen_bitfield_unit } @@ -8646,9 +9097,9 @@ impl StdVideoEncodeH265ReferenceInfoFlags { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StdVideoEncodeH265ReferenceInfo { + pub flags: StdVideoEncodeH265ReferenceInfoFlags, pub PicOrderCntVal: i32, pub TemporalId: u8, - pub flags: StdVideoEncodeH265ReferenceInfoFlags, } #[test] fn bindgen_test_layout_StdVideoEncodeH265ReferenceInfo() { @@ -8664,20 +9115,19 @@ fn bindgen_test_layout_StdVideoEncodeH265ReferenceInfo() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).PicOrderCntVal as *const _ - as usize + &(*(::std::ptr::null::())).flags as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265ReferenceInfo), "::", - stringify!(PicOrderCntVal) + stringify!(flags) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).TemporalId as *const _ + &(*(::std::ptr::null::())).PicOrderCntVal as *const _ as usize }, 4usize, @@ -8685,19 +9135,20 @@ fn bindgen_test_layout_StdVideoEncodeH265ReferenceInfo() { "Offset of field: ", stringify!(StdVideoEncodeH265ReferenceInfo), "::", - stringify!(TemporalId) + stringify!(PicOrderCntVal) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).flags as *const _ as usize + &(*(::std::ptr::null::())).TemporalId as *const _ + as usize }, 8usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265ReferenceInfo), "::", - stringify!(flags) + stringify!(TemporalId) ) ); } diff --git a/third_party/rust/ash/src/vk/prelude.rs b/third_party/rust/ash/src/vk/prelude.rs index f873937c08e4d..10918809d5428 100644 --- a/third_party/rust/ash/src/vk/prelude.rs +++ b/third_party/rust/ash/src/vk/prelude.rs @@ -1,12 +1,14 @@ +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`][super::AccelerationStructureInstanceKHR], -/// [`vk::AccelerationStructureSRTMotionInstanceNV`][super::AccelerationStructureSRTMotionInstanceNV] and -/// [`vk::AccelerationStructureMatrixMotionInstanceNV`][super::AccelerationStructureMatrixMotionInstanceNV]. +/// [`vk::AccelerationStructureInstanceKHR`], +/// [`vk::AccelerationStructureSRTMotionInstanceNV`] and +/// [`vk::AccelerationStructureMatrixMotionInstanceNV`]. /// -/// [acceleration structure instances]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureInstanceKHR.html#_description +/// [acceleration structure instances]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkAccelerationStructureInstanceKHR.html#_description #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)] #[repr(transparent)] pub struct Packed24_8(u32); @@ -26,3 +28,31 @@ 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 for vk::Extent3D { + fn from(value: vk::Extent2D) -> Self { + Self { + width: value.width, + height: value.height, + depth: 1, + } + } +} + +impl From for vk::Rect2D { + fn from(extent: vk::Extent2D) -> Self { + Self { + offset: Default::default(), + extent, + } + } +} diff --git a/third_party/rust/d3d12/.cargo-checksum.json b/third_party/rust/d3d12/.cargo-checksum.json index 066a4eb857d69..324f2f0f39c7a 100644 --- a/third_party/rust/d3d12/.cargo-checksum.json +++ b/third_party/rust/d3d12/.cargo-checksum.json @@ -1 +1 @@ -{"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"} \ No newline at end of file +{"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} \ No newline at end of file diff --git a/third_party/rust/d3d12/Cargo.toml b/third_party/rust/d3d12/Cargo.toml index b6c92ef83f656..0a41a3d753245 100644 --- a/third_party/rust/d3d12/Cargo.toml +++ b/third_party/rust/d3d12/Cargo.toml @@ -1,38 +1,28 @@ -# 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 ", "Dzmitry Malyshau "] +authors = [ + "msiglreith ", + "Dzmitry Malyshau ", +] description = "Low level D3D12 API wrapper" -documentation = "https://docs.rs/d3d12" +repository = "https://github.com/gfx-rs/d3d12-rs" keywords = ["windows", "graphics"] -categories = ["api-bindings", "graphics", "memory-management", "os::windows-apis"] 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" +documentation = "https://docs.rs/d3d12" +categories = ["api-bindings", "graphics", "memory-management", "os::windows-apis"] +edition = "2018" + +[features] +implicit-link = [] -[dependencies.libloading] -version = "0.7" -optional = true +[dependencies] +bitflags = "1" +libloading = { version = "0.7", optional = true } [dependencies.winapi] version = "0.3" -features = ["dxgi1_2", "dxgi1_3", "dxgi1_4", "dxgidebug", "d3d12", "d3d12sdklayers", "d3dcommon", "d3dcompiler", "dxgiformat", "synchapi", "winerror"] +features = ["dxgi1_2","dxgi1_3","dxgi1_4","dxgi1_5","dxgi1_6","dxgidebug","d3d12","d3d12sdklayers","d3dcommon","d3dcompiler","dxgiformat","synchapi","winerror"] -[features] -implicit-link = [] +[package.metadata.docs.rs] +default-target = "x86_64-pc-windows-msvc" diff --git a/third_party/rust/d3d12/src/com.rs b/third_party/rust/d3d12/src/com.rs index 7007060a13e99..f3a85789ce991 100644 --- a/third_party/rust/d3d12/src/com.rs +++ b/third_party/rust/d3d12/src/com.rs @@ -31,9 +31,13 @@ impl WeakPtr { self.0 } - pub unsafe fn mut_void(&mut self) -> *mut *mut c_void { + pub 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 WeakPtr { @@ -100,3 +104,160 @@ impl Hash for WeakPtr { 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 -> Self`) +/// - the as function (`&self -> Option>`) +/// - the unwrap function (`&self -> WeakPtr` 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 and se cast to &WeakPtr + 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 and se cast to &WeakPtr + unsafe { std::mem::transmute(v) } + } + )* + } + } + }; +} diff --git a/third_party/rust/d3d12/src/descriptor.rs b/third_party/rust/d3d12/src/descriptor.rs index bfa0204127371..02ca2e83c5bc1 100644 --- a/third_party/rust/d3d12/src/descriptor.rs +++ b/third_party/rust/d3d12/src/descriptor.rs @@ -156,6 +156,7 @@ 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 }, diff --git a/third_party/rust/d3d12/src/dxgi.rs b/third_party/rust/d3d12/src/dxgi.rs index 67c7489b398c6..0a66dcd02772d 100644 --- a/third_party/rust/d3d12/src/dxgi.rs +++ b/third_party/rust/d3d12/src/dxgi.rs @@ -1,8 +1,11 @@ -use crate::{com::WeakPtr, CommandQueue, D3DResult, Resource, SampleDesc, HRESULT}; +use crate::{com::WeakPtr, D3DResult, Resource, SampleDesc, HRESULT}; use std::ptr; use winapi::{ - shared::{dxgi, dxgi1_2, dxgi1_3, dxgi1_4, dxgiformat, dxgitype, windef::HWND}, - um::{d3d12, dxgidebug}, + shared::{ + dxgi, dxgi1_2, dxgi1_3, dxgi1_4, dxgi1_5, dxgi1_6, dxgiformat, dxgitype, minwindef::TRUE, + windef::HWND, + }, + um::{d3d12, dxgidebug, unknwnbase::IUnknown}, Interface, }; @@ -39,13 +42,53 @@ pub enum AlphaMode { ForceDword = dxgi1_2::DXGI_ALPHA_MODE_FORCE_DWORD, } +pub type InfoQueue = WeakPtr; + pub type Adapter1 = WeakPtr; +pub type Adapter2 = WeakPtr; +pub type Adapter3 = WeakPtr; +pub type Adapter4 = WeakPtr; +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; pub type Factory2 = WeakPtr; +pub type Factory3 = WeakPtr; pub type Factory4 = WeakPtr; -pub type InfoQueue = WeakPtr; +pub type Factory5 = WeakPtr; +pub type Factory6 = WeakPtr; +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 SwapChain = WeakPtr; pub type SwapChain1 = WeakPtr; +pub type SwapChain2 = WeakPtr; pub type SwapChain3 = WeakPtr; +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)] @@ -82,6 +125,21 @@ impl DxgiLib { Ok((factory, hr)) } + pub fn create_factory1(&self) -> Result, 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 = self.lib.get(b"CreateDXGIFactory1")?; + func(&dxgi::IDXGIFactory1::uuidof(), factory.mut_void()) + }; + + Ok((factory, hr)) + } + pub fn get_debug_interface1(&self) -> Result, libloading::Error> { type Fun = extern "system" fn( winapi::shared::minwindef::UINT, @@ -112,38 +170,80 @@ 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 Factory2 { - // TODO: interface not complete - pub fn create_swapchain_for_hwnd( +impl Factory1 { + pub fn create_swapchain( &self, - queue: CommandQueue, + queue: *mut IUnknown, hwnd: HWND, desc: &SwapchainDesc, - ) -> D3DResult { - 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, + ) -> D3DResult { + 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, }, - Scaling: desc.scaling as _, - Stereo: desc.stereo as _, + 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, + hwnd: HWND, + desc: &SwapchainDesc, + ) -> D3DResult { let mut swap_chain = SwapChain1::null(); let hr = unsafe { self.CreateSwapChainForHwnd( - queue.as_mut_ptr() as *mut _, + queue, hwnd, - &desc, + &desc.to_desc1(), ptr::null(), ptr::null_mut(), swap_chain.mut_void() as *mut *mut _, @@ -152,6 +252,24 @@ impl Factory2 { (swap_chain, hr) } + + pub fn create_swapchain_for_composition( + &self, + queue: *mut IUnknown, + desc: &SwapchainDesc, + ) -> D3DResult { + 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 { @@ -169,10 +287,6 @@ 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 { let mut adapter = Adapter1::null(); let hr = unsafe { self.EnumAdapters1(id, adapter.mut_void() as *mut *mut _) }; @@ -214,17 +328,7 @@ 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() } } diff --git a/third_party/rust/d3d12/src/lib.rs b/third_party/rust/d3d12/src/lib.rs index 49efc7ebcf768..e52f9d9d46dca 100644 --- a/third_party/rust/d3d12/src/lib.rs +++ b/third_party/rust/d3d12/src/lib.rs @@ -1,7 +1,7 @@ #[macro_use] extern crate bitflags; -use std::ffi::CStr; +use std::{convert::TryFrom, ffi::CStr}; use winapi::{ shared::dxgiformat, um::{d3d12, d3dcommon}, @@ -64,6 +64,7 @@ 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, @@ -76,6 +77,25 @@ pub enum FeatureLevel { L12_1 = d3dcommon::D3D_FEATURE_LEVEL_12_1, } +impl TryFrom for FeatureLevel { + type Error = (); + + fn try_from(value: u32) -> Result { + 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; pub type Error = WeakPtr; diff --git a/third_party/rust/metal/.cargo-checksum.json b/third_party/rust/metal/.cargo-checksum.json index d3d2edf4c206b..2e5bb4bec9968 100644 --- a/third_party/rust/metal/.cargo-checksum.json +++ b/third_party/rust/metal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".github/workflows/ci.yml":"08d24906a6e23f870040b1dff654a89ca915b28973c1d7f10503fd3c1d326ce6","Cargo.toml":"fe3ef7610f777a6e11c4b057560f1daf5fd612c1fb5595ee0c49e3478a37cbea","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","Makefile":"6fddc61a94f5b31a65b11c1bef8b19c92bff738716998076c5d49c2834223c75","README.md":"6817e12da257b43352f71f595dcc713adf117c734ebf656e6af2d7d04be27cd6","bors.toml":"c2733ec512a08bf76b6a1ed77270810a0edeb888ba24c2a75679e1eb1bd563a5","examples/argument-buffer/main.rs":"4c1d1d9949bc56628980f84077dafdfa68a853141d6d4dc3e6202f6c61ba11f7","examples/bind/main.rs":"a0c85aad05f08666f9b380a7146a8473a6a6fe0db5d523760373093a0af20e5f","examples/caps/main.rs":"b7be00c1cc9042140d34ea05051152a7035f316f0bdcd31ac5a660a97e0c4f70","examples/circle/README.md":"e1c97cf5252f0d1f2934ace78b5d839c5f45911f3007dbd2925eeceefb8f0af6","examples/circle/main.rs":"91d80c85a358400ceeddf1ab108a7e1052dd208c4ec72cde925d02284d3cf9d4","examples/circle/screenshot.png":"97bf07c85bf02367447b9c8a81707c124e4a3b420fa386b95ba08b21938f4f2a","examples/circle/shaders.metal":"5e4f40efca5bb386204a09e1b983cc6c634fdf1ca9dd4974227313adbf50e8b5","examples/circle/shaders.metallib":"666a9491d795ef9c0b9c122c7ada571cc2c0e8774d2d89e5b4b996f3dc47962b","examples/compute/compute-argument-buffer.metal":"6530bbd6a0101d9db2893805436f5dc877959e81ea97a27014c0fc52fc9fa77b","examples/compute/compute-argument-buffer.rs":"e3de61fd7cc2f14d9d52300e4878601dbc072bc26d9dafc66115df58f94e0470","examples/compute/embedded-lib.rs":"55f701810fa5270c27ca771e713f9f8cf09e124a997b0b03790b38435593a7ea","examples/compute/main.rs":"f16cbf57cd27dc948ff651251ce26e6bd616cb5d989b8dadb4256c73a9bfba4b","examples/compute/shaders.metal":"f2b15551bb5247b88a3029c3d8ef37c6fa04a4a6cca9f90f069894ed6822b4bf","examples/compute/shaders.metallib":"fef91643e60c0ec99ad2bd2f3916299bcc3e6a80038ea27bed59681badfea7d1","examples/events/main.rs":"9cb35381b0a3918bd7d530171de8f7cceafe3d4851c0f430b4aff1f5c2aae749","examples/fence/main.rs":"47741327e62db1d8bd344b6a9ec26ef13ffb0b56b0dd7077c5d926d43faaeff7","examples/headless-render/.gitignore":"99520a5b5abaf30fc75759f1fd9f4338b6fbd1fc49f2dcbb466b22e6f9db4f62","examples/headless-render/README.md":"b1c97b52701cfb41fc0b9e269ba7a7a454d9161746198e2f5789f2636f60842d","examples/headless-render/main.rs":"cf0180839e8d09d4bf403ae947365ac18fa17782172986311bfa04b84f88169e","examples/headless-render/screenshot.png":"01d6ea5791b63b0f01190198756446cf313fc25dc64d0138c1b4f62c9f862dd1","examples/library/main.rs":"a1420ec28a471f28a789b75b3ecf5abb699ed352b337747169914812fb98045a","examples/mps/main.rs":"51f34582bf118f171bbb81d22c11407c7a35f381dbbff2d75c6f8e90d22a2aa1","examples/mps/shaders.metal":"155922d6a4184078ae7ee29504a268e1218f07d908f921eef60e5bfa8a793bda","examples/mps/shaders.metallib":"b62451223549b1e7eb90ec3d3534c0ed4cdfdc581c7df3ffcdc4786a5fcacde4","examples/reflection/main.rs":"01b0cd95558b8c3e547b239a1b2ae7e882ab0f52346f96bcefd2e9616693a98c","examples/shader-dylib/main.rs":"d29ab2105131b8c56a6af6453f1d973e2bda5564f84b652c01e4a4e44b7a70f2","examples/shader-dylib/test_dylib.metal":"3469de785c2c0da784e84758fc0da5a81e474ca15588485d9e04398690641cc8","examples/shader-dylib/test_shader.metal":"1a04ff8ab3288b09d14cd35440b2557e92ddedbff9d07c4144a22e9062e6e1e4","examples/window/README.md":"69655cff298e07887fe70e8a13e27d8a87efcd0cc0da4e15485134e064e1aceb","examples/window/main.rs":"09c508013223de859f33fb69410bde30e8d7f04952850504d8b1f8faf7049b1b","examples/window/screenshot.png":"da7369d7cc297c7f7f6bd773c93e7d708d72442c9c5ff5a20c2f2ee6852552dc","examples/window/shaders.metal":"90dee6c752add5c617dfdca93064b2824b44ff8c01ef63986826f6a1531e95d6","examples/window/shaders.metallib":"16fa82beb70bf16c3501970cae0d5028a747a08164337161dc9c2e8965d4c366","src/argument.rs":"578ca587dfb034a7e8e4551fd93164a86595a4637e5656fc6cc429ae2de6cda2","src/buffer.rs":"80c55c8703340bf0d4d1b5eface518fdf82355ccb897883639cbf7e4933a4344","src/capturedescriptor.rs":"7d90b1e7b87fa9da1e38bba9637cd8d7a18a81f8c3f408149058ed4ea20a6894","src/capturemanager.rs":"bdee9e170da371778452513a9ac363a738ea8bfd3f0870d86c6013459c5af010","src/commandbuffer.rs":"0123224dcc0552748f1c2c87385f1f6be2863887f8862fbfd8b3a1562d9f69ba","src/commandqueue.rs":"5b87621ae4495ae04a5de5ce980d0cde31b4bb0d1e31e932d34c49252240c9d9","src/constants.rs":"7be4d901da863f126d158d1042f5482a122fbcf760f7c225b0b1693a55f6bb4b","src/depthstencil.rs":"5bfa4f49940fdc9d12b2af08f7fe710c41f0b7e26bdb6f8709fe17b9a9d7d5eb","src/device.rs":"5c5f7613e0c94ff8291c7edfba16d9981875e6ec4ea9310a1d56d46b07c13ae8","src/drawable.rs":"aea0759dc9de002c660e938319dfdfd3e4e82add30ed626ea31e3270698f4b85","src/encoder.rs":"3fd70d1f0a6f151076b6bb2ed3e3e65a90665bb76b1dec03153ea7c77bb5a749","src/heap.rs":"fcbb7dfaafb1008fadd75fb2b394776c9843fe98a266e237d7a7b4d80e046b06","src/indirect_encoder.rs":"eaf7755de9438022e3908e8426a139c33d4929d7be4b5e056d959eeecd560136","src/lib.rs":"b1fc90132440c270264e575e452f1d2a47420215ca3d08f8212e91f84009e603","src/library.rs":"61d0b8313e51c48ed3f5ee88dfe42b010e4c72ca160c29f94f8e73db7a006c3e","src/mps.rs":"b415be3221754d836fd535f4b5b45ed484d4cc926bd26145e82a9e61d337da4c","src/pipeline/compute.rs":"e4bed01671a466ed460fbc9059ac72dab7cb123a964de63058f0e5aafdc5e2a0","src/pipeline/mod.rs":"5ec3cb524cc03202a3394dad5a7d0b733474f664935353253e76a49aed5513ad","src/pipeline/render.rs":"6738931629f1944d69815622a9f3281e55df0e56dc87d3cdb885cc8c7e2c8820","src/renderpass.rs":"666ca2a35d2bb96564f105a87f03cfbf87d3fd10e6915e473e8ff4c0db49fdef","src/resource.rs":"617dc7c9b08388b406c7b178f5ff25ee46a54299213a57ab09f5039b2b1e5927","src/sampler.rs":"adabef3520a18c829bfd9b705897873d9adc37ebe88cfa6864154483dd858b9d","src/sync.rs":"4b9f6a9f9425751411c8104fe0ebbe8e1d89db2005d929ada5334962a3301b8d","src/texture.rs":"2df3003396aa8f0552b853dac33ba970a918bc73d183fe0d3dad4bc21ee37e10","src/types.rs":"5a754c8036ff4ab1ec41d01af5fba64f3085f2a9dd1d15d00e907e40b85cf163","src/vertexdescriptor.rs":"5874f54bcc5613adff613ed3e2bb08870b1115ef6d369b21612ce848796b005e"},"package":null} \ No newline at end of file +{"files":{".github/workflows/ci.yml":"08d24906a6e23f870040b1dff654a89ca915b28973c1d7f10503fd3c1d326ce6","Cargo.toml":"bfc970fac37789f9893633c2551d0d2dd917e7aef3a790d7fc330319d0ef29f7","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","Makefile":"6fddc61a94f5b31a65b11c1bef8b19c92bff738716998076c5d49c2834223c75","README.md":"6817e12da257b43352f71f595dcc713adf117c734ebf656e6af2d7d04be27cd6","bors.toml":"c2733ec512a08bf76b6a1ed77270810a0edeb888ba24c2a75679e1eb1bd563a5","examples/argument-buffer/main.rs":"a087db6648a4b092520de29616521c704d892e0d3ace935d16f3f339415c4361","examples/bind/main.rs":"a0c85aad05f08666f9b380a7146a8473a6a6fe0db5d523760373093a0af20e5f","examples/bindless/main.rs":"0aaad9e42634c1ea204342a76c1bfe80c8fcf9d3ebe8247846cf63ecb08fb0d5","examples/caps/main.rs":"b7be00c1cc9042140d34ea05051152a7035f316f0bdcd31ac5a660a97e0c4f70","examples/circle/README.md":"e1c97cf5252f0d1f2934ace78b5d839c5f45911f3007dbd2925eeceefb8f0af6","examples/circle/main.rs":"91d80c85a358400ceeddf1ab108a7e1052dd208c4ec72cde925d02284d3cf9d4","examples/circle/screenshot.png":"97bf07c85bf02367447b9c8a81707c124e4a3b420fa386b95ba08b21938f4f2a","examples/circle/shaders.metal":"5e4f40efca5bb386204a09e1b983cc6c634fdf1ca9dd4974227313adbf50e8b5","examples/circle/shaders.metallib":"666a9491d795ef9c0b9c122c7ada571cc2c0e8774d2d89e5b4b996f3dc47962b","examples/compute/compute-argument-buffer.metal":"6530bbd6a0101d9db2893805436f5dc877959e81ea97a27014c0fc52fc9fa77b","examples/compute/compute-argument-buffer.rs":"e3de61fd7cc2f14d9d52300e4878601dbc072bc26d9dafc66115df58f94e0470","examples/compute/embedded-lib.rs":"55f701810fa5270c27ca771e713f9f8cf09e124a997b0b03790b38435593a7ea","examples/compute/main.rs":"f16cbf57cd27dc948ff651251ce26e6bd616cb5d989b8dadb4256c73a9bfba4b","examples/compute/shaders.metal":"f2b15551bb5247b88a3029c3d8ef37c6fa04a4a6cca9f90f069894ed6822b4bf","examples/compute/shaders.metallib":"fef91643e60c0ec99ad2bd2f3916299bcc3e6a80038ea27bed59681badfea7d1","examples/events/main.rs":"9cb35381b0a3918bd7d530171de8f7cceafe3d4851c0f430b4aff1f5c2aae749","examples/fence/main.rs":"47741327e62db1d8bd344b6a9ec26ef13ffb0b56b0dd7077c5d926d43faaeff7","examples/headless-render/.gitignore":"99520a5b5abaf30fc75759f1fd9f4338b6fbd1fc49f2dcbb466b22e6f9db4f62","examples/headless-render/README.md":"b1c97b52701cfb41fc0b9e269ba7a7a454d9161746198e2f5789f2636f60842d","examples/headless-render/main.rs":"cf0180839e8d09d4bf403ae947365ac18fa17782172986311bfa04b84f88169e","examples/headless-render/screenshot.png":"01d6ea5791b63b0f01190198756446cf313fc25dc64d0138c1b4f62c9f862dd1","examples/library/main.rs":"a1420ec28a471f28a789b75b3ecf5abb699ed352b337747169914812fb98045a","examples/mps/main.rs":"51f34582bf118f171bbb81d22c11407c7a35f381dbbff2d75c6f8e90d22a2aa1","examples/mps/shaders.metal":"155922d6a4184078ae7ee29504a268e1218f07d908f921eef60e5bfa8a793bda","examples/mps/shaders.metallib":"b62451223549b1e7eb90ec3d3534c0ed4cdfdc581c7df3ffcdc4786a5fcacde4","examples/reflection/main.rs":"01b0cd95558b8c3e547b239a1b2ae7e882ab0f52346f96bcefd2e9616693a98c","examples/shader-dylib/main.rs":"d29ab2105131b8c56a6af6453f1d973e2bda5564f84b652c01e4a4e44b7a70f2","examples/shader-dylib/test_dylib.metal":"3469de785c2c0da784e84758fc0da5a81e474ca15588485d9e04398690641cc8","examples/shader-dylib/test_shader.metal":"1a04ff8ab3288b09d14cd35440b2557e92ddedbff9d07c4144a22e9062e6e1e4","examples/window/README.md":"69655cff298e07887fe70e8a13e27d8a87efcd0cc0da4e15485134e064e1aceb","examples/window/main.rs":"09c508013223de859f33fb69410bde30e8d7f04952850504d8b1f8faf7049b1b","examples/window/screenshot.png":"da7369d7cc297c7f7f6bd773c93e7d708d72442c9c5ff5a20c2f2ee6852552dc","examples/window/shaders.metal":"90dee6c752add5c617dfdca93064b2824b44ff8c01ef63986826f6a1531e95d6","examples/window/shaders.metallib":"16fa82beb70bf16c3501970cae0d5028a747a08164337161dc9c2e8965d4c366","src/argument.rs":"578ca587dfb034a7e8e4551fd93164a86595a4637e5656fc6cc429ae2de6cda2","src/buffer.rs":"80c55c8703340bf0d4d1b5eface518fdf82355ccb897883639cbf7e4933a4344","src/capturedescriptor.rs":"7d90b1e7b87fa9da1e38bba9637cd8d7a18a81f8c3f408149058ed4ea20a6894","src/capturemanager.rs":"bdee9e170da371778452513a9ac363a738ea8bfd3f0870d86c6013459c5af010","src/commandbuffer.rs":"8636043739fb9ea44f443ef315fadfa13675d04827e5fac42abcde0b2c612a0c","src/commandqueue.rs":"5b87621ae4495ae04a5de5ce980d0cde31b4bb0d1e31e932d34c49252240c9d9","src/constants.rs":"d9bea9cb01892f40fb635cef5ca247023c1998b47b33cc5ce39696fac634383b","src/depthstencil.rs":"5bfa4f49940fdc9d12b2af08f7fe710c41f0b7e26bdb6f8709fe17b9a9d7d5eb","src/device.rs":"1af6bc1c60981c60d102338bb9618c3a6bb215994501a64c31997dd1e7976377","src/drawable.rs":"aea0759dc9de002c660e938319dfdfd3e4e82add30ed626ea31e3270698f4b85","src/encoder.rs":"ca942ea6d0ea7a01edb6e049fb90080d611d1fb7b2161320d2d89b0e6a37c749","src/heap.rs":"fcbb7dfaafb1008fadd75fb2b394776c9843fe98a266e237d7a7b4d80e046b06","src/indirect_encoder.rs":"eaf7755de9438022e3908e8426a139c33d4929d7be4b5e056d959eeecd560136","src/lib.rs":"739a1c4bbe611c609a6aed2ebac5dc20a4742c0d9ba19369fdd0a11905d668d4","src/library.rs":"985bb5833b55f054b932df425932574d6c65ee2ed11b5e1ccd5a2e279c52d54c","src/mps.rs":"b415be3221754d836fd535f4b5b45ed484d4cc926bd26145e82a9e61d337da4c","src/pipeline/compute.rs":"e4bed01671a466ed460fbc9059ac72dab7cb123a964de63058f0e5aafdc5e2a0","src/pipeline/mod.rs":"5ec3cb524cc03202a3394dad5a7d0b733474f664935353253e76a49aed5513ad","src/pipeline/render.rs":"6738931629f1944d69815622a9f3281e55df0e56dc87d3cdb885cc8c7e2c8820","src/renderpass.rs":"666ca2a35d2bb96564f105a87f03cfbf87d3fd10e6915e473e8ff4c0db49fdef","src/resource.rs":"9753cc15c5d0064e954717c61feb902c218141b1b0e77bce4f9d0653b6d4589b","src/sampler.rs":"adabef3520a18c829bfd9b705897873d9adc37ebe88cfa6864154483dd858b9d","src/sync.rs":"a2c081984630634134b17007a6ff7a016e2aa9070bc46754d3e82500fc25eb53","src/texture.rs":"2df3003396aa8f0552b853dac33ba970a918bc73d183fe0d3dad4bc21ee37e10","src/types.rs":"5a754c8036ff4ab1ec41d01af5fba64f3085f2a9dd1d15d00e907e40b85cf163","src/vertexdescriptor.rs":"5874f54bcc5613adff613ed3e2bb08870b1115ef6d369b21612ce848796b005e"},"package":null} \ No newline at end of file diff --git a/third_party/rust/metal/Cargo.toml b/third_party/rust/metal/Cargo.toml index c4558cc651dc7..de188de5c58dc 100644 --- a/third_party/rust/metal/Cargo.toml +++ b/third_party/rust/metal/Cargo.toml @@ -57,6 +57,9 @@ name = "caps" [[example]] name = "argument-buffer" +[[example]] +name = "bindless" + [[example]] name = "circle" path = "examples/circle/main.rs" diff --git a/third_party/rust/metal/examples/argument-buffer/main.rs b/third_party/rust/metal/examples/argument-buffer/main.rs index 96c177d21a46c..23e88990d93e4 100644 --- a/third_party/rust/metal/examples/argument-buffer/main.rs +++ b/third_party/rust/metal/examples/argument-buffer/main.rs @@ -12,24 +12,77 @@ fn main() { autoreleasepool(|| { let device = Device::system_default().expect("no device found"); + /* + + // Build encoder for the following MSL argument buffer: + struct ArgumentBuffer { + texture2d texture [[id(0)]]; + sampler sampler [[id(1)]]; + array 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_data_type(MTLDataType::Sampler); desc2.set_index(1); + desc2.set_data_type(MTLDataType::Sampler); + + 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 buffer = device.new_buffer(encoder.encoded_length(), MTLResourceOptions::empty()); - encoder.set_argument_buffer(&buffer, 0); + let argument_buffer = + device.new_buffer(encoder.encoded_length(), MTLResourceOptions::empty()); + encoder.set_argument_buffer(&argument_buffer, 0); let sampler = { let descriptor = SamplerDescriptor::new(); descriptor.set_support_argument_buffers(true); device.new_sampler(&descriptor) }; - encoder.set_sampler_state(1, &sampler); 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(); }); } diff --git a/third_party/rust/metal/examples/bindless/main.rs b/third_party/rust/metal/examples/bindless/main.rs new file mode 100644 index 0000000000000..09c3a59ab9ae9 --- /dev/null +++ b/third_party/rust/metal/examples/bindless/main.rs @@ -0,0 +1,149 @@ +// Copyright 2017 GFX developers +// +// Licensed under the Apache License, Version 2.0, or the MIT license , 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 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::>(); + + // 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(); + }); +} diff --git a/third_party/rust/metal/src/commandbuffer.rs b/third_party/rust/metal/src/commandbuffer.rs index ba8ccfee68440..32a1d8fb94747 100644 --- a/third_party/rust/metal/src/commandbuffer.rs +++ b/third_party/rust/metal/src/commandbuffer.rs @@ -144,4 +144,15 @@ 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] } + } } diff --git a/third_party/rust/metal/src/constants.rs b/third_party/rust/metal/src/constants.rs index b6765a04cd5b1..0afbdd7e29205 100644 --- a/third_party/rust/metal/src/constants.rs +++ b/third_party/rust/metal/src/constants.rs @@ -121,6 +121,20 @@ 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, diff --git a/third_party/rust/metal/src/device.rs b/third_party/rust/metal/src/device.rs index a81fd165846ae..1cb0a40783dc3 100644 --- a/third_party/rust/metal/src/device.rs +++ b/third_party/rust/metal/src/device.rs @@ -13,6 +13,7 @@ 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)] @@ -44,12 +45,14 @@ pub enum MTLFeatureSet { macOS_GPUFamily1_v1 = 10000, macOS_GPUFamily1_v2 = 10001, - //macOS_ReadWriteTextureTier2 = 10002, TODO: Uncomment when feature tables updated + // Available on macOS 10.12+ + macOS_ReadWriteTextureTier2 = 10002, 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] @@ -133,7 +136,7 @@ impl MTLFeatureSet { tvOS_GPUFamily1_v3 | tvOS_GPUFamily2_v1 => 11, tvOS_GPUFamily1_v4 | tvOS_GPUFamily2_v2 => 12, macOS_GPUFamily1_v1 => 11, - macOS_GPUFamily1_v2 => 12, + macOS_GPUFamily1_v2 | macOS_ReadWriteTextureTier2 => 12, macOS_GPUFamily1_v3 => 13, macOS_GPUFamily1_v4 | macOS_GPUFamily2_v1 => 14, } @@ -142,10 +145,20 @@ 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_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_ReadWriteTextureTier2 + | 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 @@ -159,9 +172,16 @@ 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 - | 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 + | macOS_ReadWriteTextureTier2 + | 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 diff --git a/third_party/rust/metal/src/encoder.rs b/third_party/rust/metal/src/encoder.rs index 57645f1bda189..364a27e5fad5f 100644 --- a/third_party/rust/metal/src/encoder.rs +++ b/third_party/rust/metal/src/encoder.rs @@ -674,17 +674,124 @@ 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 + #[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 + 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 + #[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, @@ -1035,19 +1142,69 @@ 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 + /// + /// # 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 + /// + /// # 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] } } diff --git a/third_party/rust/metal/src/lib.rs b/third_party/rust/metal/src/lib.rs index 1eca90bd47944..437674a5f492b 100644 --- a/third_party/rust/metal/src/lib.rs +++ b/third_party/rust/metal/src/lib.rs @@ -391,6 +391,10 @@ 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] } } diff --git a/third_party/rust/metal/src/library.rs b/third_party/rust/metal/src/library.rs index 894b8ceb14953..9a5a36b62e747 100644 --- a/third_party/rust/metal/src/library.rs +++ b/third_party/rust/metal/src/library.rs @@ -387,8 +387,10 @@ pub enum MTLLanguageVersion { V2_0 = 0x20000, V2_1 = 0x20001, V2_2 = 0x20002, - /// Only available on (macos(11.0), ios(14.0)) + /// 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 {} diff --git a/third_party/rust/metal/src/resource.rs b/third_party/rust/metal/src/resource.rs index 7c742bc185fec..8986a9c83894f 100644 --- a/third_party/rust/metal/src/resource.rs +++ b/third_party/rust/metal/src/resource.rs @@ -71,9 +71,18 @@ bitflags! { } bitflags! { + /// Options that describe how a graphics or compute function uses an argument buffer’s 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; } } diff --git a/third_party/rust/metal/src/sync.rs b/third_party/rust/metal/src/sync.rs index b2b765d5b0963..e4b3d8aa671a4 100644 --- a/third_party/rust/metal/src/sync.rs +++ b/third_party/rust/metal/src/sync.rs @@ -136,11 +136,21 @@ impl FenceRef { } } -#[repr(u64)] -#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] -pub enum MTLRenderStages { - Vertex = 0, - Fragment = 1, +bitflags! { + /// The render stages at which a synchronization command is triggered. + /// + /// Render stages provide finer control for specifying when synchronization must occur, + /// allowing for vertex and fragment processing to overlap in execution. + /// + /// See + pub struct MTLRenderStages: NSUInteger { + /// The vertex rendering stage. + const Vertex = 1 << 0; + /// The fragment rendering stage. + const Fragment = 1 << 1; + /// The tile rendering stage. + const Tile = 1 << 2; + } } const BLOCK_HAS_COPY_DISPOSE: i32 = 0x02000000; diff --git a/third_party/rust/naga/.cargo-checksum.json b/third_party/rust/naga/.cargo-checksum.json index 1840b602a88da..723961cabd2a6 100644 --- a/third_party/rust/naga/.cargo-checksum.json +++ b/third_party/rust/naga/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".github/workflows/lazy.yml":"efffd9aafa5e1fbe8c1746035e31523c5819348116a6b982ab6ab39a8c887c78",".github/workflows/pipeline.yml":"a8b6a5a9f67d8afd085af6e0fb9a52f9994c33f07845c22000fb496a78d44711",".github/workflows/validation-linux.yml":"797389222960f54d3da8d58b017c44be1b5f45033d8f635c17172bd79a975dbd",".github/workflows/validation-macos.yml":"ace910e819b4b7f4c3bcef0f6b8109bdf9fa817806b125605bd5f860c375d77e",".github/workflows/validation-windows.yml":"3717d69c8c21b379a40a6ff5a19dff18f06c56b767b3884565ecda0ddbe54493","CHANGELOG.md":"72d2dd5ce3a831f5eac9c1459efdfca0af2a42794221f56191c3e4fb2a6d25d8","Cargo.toml":"44d4f635972b61fbc954747ff9eedb0d6024a78d0e25a2e7e7e7cbbf5ad27843","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"ca3be8518f5ef097669cea882643fc532025f29972def4fda49df885565a0480","Makefile":"2d4f0ec26e216fbdf07adbadc6d22673113df1d9fd88c39bb08cf2b7e33e596b","README.md":"5ca0312b21dfe64d7a56a3cd5e1b8cf1e02401c4ab7a2f35ee517bcb9f3d2b59","src/arena.rs":"61d7fc5765b4f3b8937d094ba735dcdca821c784c82d0011479e4d6f2d124119","src/back/dot/mod.rs":"cf441bcd461f5a4cb387f8c0723976718e209f4df3cc28553a2857ee0164365e","src/back/glsl/features.rs":"4a3dffb37479fd4c3e7181a09d7feec7b0832ebdcd9994e97ad23878e1ccf5fd","src/back/glsl/keywords.rs":"3f23b1e63e99a7056c3b223524d5d37000ef7316ae9df25532a726a1157d1dcd","src/back/glsl/mod.rs":"2e9abd51acac4b13a9dfe0d008fbbf1a3ef0bbe123b5f0d59eb43b7eb5d4ed28","src/back/hlsl/conv.rs":"d953ca0e87be17be98cdf38ff817cf2cefcfb5bebb60749aecc11aaa5b1ff7c9","src/back/hlsl/help.rs":"cbd6c492764f5a2d5d2fae70d2b791833827f7a693130e921e84f557069d9563","src/back/hlsl/keywords.rs":"d0fdd74bc166da61200d595689d2fbfbaa863d18eda706bb44aee1c2e66f9552","src/back/hlsl/mod.rs":"f39bda69a86bf02e4bb978f4498ccd8738f00883dfd55c39011da9fa2bd006fd","src/back/hlsl/storage.rs":"ad01f03fae29f332b03d74d451e5dae49b861715a7df0b8475e7ff502780216c","src/back/hlsl/writer.rs":"0e8c151db0eb4dd59bcf2a1528fbf2718151f0705558d35848b098146359081a","src/back/mod.rs":"9b5b99830a5e1e90d6d915b9c54b35917002500f96e3cc826ddf959a6f9b2b42","src/back/msl/keywords.rs":"295e9df5cca319a9a506305bb3461057225b8468dfb920d4927608d42382e170","src/back/msl/mod.rs":"321056bca15c6afd0285376fc29109f8113d5494152b4d2037216dab38a0bacb","src/back/msl/sampler.rs":"19a905f5eb11d9dad769b60694d1ed7a16ad36ce92b57f9bf70f0a60cd0df1ee","src/back/msl/writer.rs":"bf750f61b053d523a25dc1f0ea15211eae6593bc31ba763379e2050df5b49b82","src/back/spv/block.rs":"c02ecac1dbca29fb0472aaa1eb09022f89c1c6f12a2c0183bf939211d8b32cb2","src/back/spv/helpers.rs":"be99802e93ba16d37d2c4fb22df1344ef68972c8392a6288bbbc98b9f10bad29","src/back/spv/image.rs":"06d2cdaad927f084e6655c628bde9686180881a0485d1d27bdf97d165e7652f1","src/back/spv/index.rs":"86495ac33b47de1a942cfdd30547971c7a24b26b047244366011e911ce50927a","src/back/spv/instructions.rs":"75392cb3312e247d2cda846b4560b4abf713d15723ef5bc368a45de0ce466830","src/back/spv/layout.rs":"41b5b8b5c1ca85be27246c0d2393542e971514362a445dd2a984fad7ee49cedb","src/back/spv/mod.rs":"33e955772e8fa760d6833e921ab8c8f979bd73bfec3dbe1d500ed55946794fee","src/back/spv/recyclable.rs":"e8afff29750035ef7e20d86eb9976b83d26aa8431c93233f5749dfc1933790f5","src/back/spv/selection.rs":"11b54603b909619ac5c1ed35501a583a4594a35e6b06f8110f641bfa49bfcff9","src/back/spv/writer.rs":"9a4678b1848a0dbc5f9f43f2a10421fcdfdd9b5624ac22855cd6150107ed242d","src/back/wgsl/mod.rs":"5b8320b020228a80cdf5f156655e81fcea1c5f4cdfee586ecb5732b5658f193a","src/back/wgsl/writer.rs":"524ce7773a6998c476935fc67b845b10b4282764671ca8f3039f4869fa6efc3d","src/block.rs":"70df4dc2db3eddd2e79ece7f1b47bac29aeb0f8508cebc45ca8a53afa85e2d8e","src/front/glsl/ast.rs":"9a2e2629e56529ee96461e6abd50bd5ecaa380224664a003682b89669d42bfd0","src/front/glsl/builtins.rs":"4b5e8b85f904c3fb8651736f7546fb7266eab16eeaf4f0b3dd4c78d290bfda94","src/front/glsl/constants.rs":"77577f577e300978c06546912419eea710d2ca2eec1ecde5a0b3f2bf2273f757","src/front/glsl/context.rs":"e564148af72e0d8a933649bfa5c67e0ec11636cbafaac162b16a21bf6b730102","src/front/glsl/error.rs":"8d922a9272966d2b217d182b772b51ddf3285a5259d5d7e93e7f6c26602e9572","src/front/glsl/functions.rs":"70dacb5d4f446421b6e888b7f2637c2903e825d91c3ddf83d9114505d87aff7b","src/front/glsl/lex.rs":"32f3c20c2e1c96ac17e5ad12b329b887ac6118bc64b50cee6b30522f7108e765","src/front/glsl/mod.rs":"8274819551f8d87d5a2ec5fd1ebb7ace99d4f388256651b9eece5e510d88fc2b","src/front/glsl/offset.rs":"176cbb38f0495637f40e71e2c9abc40692b996d006293a844fde65cf8d1329dd","src/front/glsl/parser.rs":"ec107dd25159328a89d87ae7fc3d785a90e997fe95ee06e40c6c29ce69790d7d","src/front/glsl/parser/declarations.rs":"051f73470cc07e049cbfccfcbdb1fd712182b2d6359b6000b4678a8fbff56e9d","src/front/glsl/parser/expressions.rs":"9d83c8913d6b29dfafeb8dcef8acc20037f12fad10706106de3997f82f5cba05","src/front/glsl/parser/functions.rs":"26e6fc498608d1ae3f683a472c37950d5bf2ed9bf5a53a6452b508ba78f04416","src/front/glsl/parser/types.rs":"347a2df154f3af63b92a732b54c50f69443f54719c33cc6ad3206bc85e9cb364","src/front/glsl/parser_tests.rs":"4256fdce5e5de7234a173ecd0dc77eef20052932b0d298c1227b40bd6a7f6a28","src/front/glsl/token.rs":"fb1e7a49962810b437626a673d3d4f6ae7944203ee7dc957c08faf4571509d0e","src/front/glsl/types.rs":"8519cb2b82c3d97e5d57118ac656b02ca124f4d9c685cd43ed94614a1e32bb20","src/front/glsl/variables.rs":"aeae6d4c77ecce36d42a8f7ae0d3e28ec3160eb4569d597305d90bd0c8ca67bd","src/front/interpolator.rs":"6e332ab7bede15b20db9e287e99b9d9f4308745a3a48ee15e734ac99a68a1672","src/front/mod.rs":"cfbf9b7df3532901a1d18e3d65623d7016e40d143fcce8deb9883bc85fd4640a","src/front/spv/convert.rs":"537886868d9872aaab0e40bd12546bf7355971c9eae8a2825d58530860626a9a","src/front/spv/error.rs":"62265bbd2f06f0251002d3af7848945848472a95028fd699b15f6e78a68c4849","src/front/spv/function.rs":"b8af2f68d2525a70c638d4cbe0d2609bae9c9bd30f18feb9eccbb4ee58554795","src/front/spv/image.rs":"ad2640c88ae3d9cafb668c12438059d523862c73709b4042709bc7fd23af4cac","src/front/spv/mod.rs":"dc30ddeb1c686e0d1d4711d9f2fd7dd30f29b244a3293f608107b81bf8ced6ec","src/front/spv/null.rs":"f61427f28330d07954269743cc5a39278d3f4774602735eb2995e43ce799a471","src/front/wgsl/conv.rs":"711adef37ac9eb0b10a31f0a72b9fbd448bf0cf986d5257d3f41ced631db2524","src/front/wgsl/lexer.rs":"2eed41d137abee6f7bde70ddf77ae8ac79c6389f79769e2673bb048537835680","src/front/wgsl/mod.rs":"25f6b8fbd25ef76342c89f457259a21e138571ed03a59259ff378703b5018256","src/front/wgsl/number_literals.rs":"2ff0d67d4266d8b49515bb4ecf555f13b24708c325c5d4c1d4fff01db746fc6f","src/front/wgsl/tests.rs":"3c540534229aa01a894cd7576f0932753bf2bbb652154790871baa058e30ebb9","src/keywords/mod.rs":"b991d0ac2004fd801ee2aea92363fdcdcdf2d32495870f4db0a31043af3d8af0","src/keywords/wgsl.rs":"42fe3f63d850c0c424234333efd9349303422f273a4047f4b5edb4ab6efcd54f","src/lib.rs":"39f4083190154bef41ff0dfa5363b5d7af43123bb103d54070216fe2310e391b","src/proc/index.rs":"6de2c35272bf780fbe7bdb2b998c8442a178459cedabe9bc2ba7575bfe70931c","src/proc/layouter.rs":"01003caa3d9e34636a249b6da9862d2595c6d12a161e8e1c1f2a9579fd8e7be0","src/proc/mod.rs":"d907b2fc40603b971de60fa9fab594c1791c97968831e12e6ae291d2667cd8f7","src/proc/namer.rs":"2cab7428296a243a23234a516ceb569104f86ad4d68ffdf022a060a9fc0c4e83","src/proc/terminator.rs":"f00409a63d5258494080ee55d25cc91c40dc1d4b211a99a0e3cb43e78d4843cd","src/proc/typifier.rs":"fa7bab65f51400e5d1444220836a59bad276116343ce7cf7544a257a416502d2","src/span.rs":"094d13d19bb5017cbf6a942ec9c9055fdea554fe8e06e7b88406532eba8b54fa","src/valid/analyzer.rs":"fd59ea9523c45eaf3fd4392a6c0ed9115e5b19e97b48453cb657e3a88db096c8","src/valid/compose.rs":"17f4a35a47a839efc15dd73a53d6f7df69435d42fe4fdb6cef2619115bd748a7","src/valid/expression.rs":"bad7186b41484fff7a8cfec264e8668c4ac536bb334177065c08e24b637f5cce","src/valid/function.rs":"1b0ca4b9ce803cafff163a6f8de215ac258e377dc64ef914a22467d3725d5f8b","src/valid/interface.rs":"0c64a9bc82ac44ab5d8b4713f734b1c950271625c2a3ae88aa64357361167d99","src/valid/mod.rs":"0d2ac4202780d12040788b3b78c1d7ed5af1c680acd6aab55f1672a6ac6080e8","src/valid/type.rs":"9688297672eb89c8fded7823004432a441bbb14a04b096b47ab65e2f977ed071"},"package":null} \ No newline at end of file +{"files":{".github/workflows/lazy.yml":"efffd9aafa5e1fbe8c1746035e31523c5819348116a6b982ab6ab39a8c887c78",".github/workflows/pipeline.yml":"5b5495aa4a9b5a262aaf4443e3c50268a139f3cc47575169b29408653a832977",".github/workflows/validation-linux.yml":"797389222960f54d3da8d58b017c44be1b5f45033d8f635c17172bd79a975dbd",".github/workflows/validation-macos.yml":"ace910e819b4b7f4c3bcef0f6b8109bdf9fa817806b125605bd5f860c375d77e",".github/workflows/validation-windows.yml":"3717d69c8c21b379a40a6ff5a19dff18f06c56b767b3884565ecda0ddbe54493","CHANGELOG.md":"b60fd344cbb487d43bcf38e3827054ce71d8c4ce34370d125c02bb0ecf8b40ed","Cargo.toml":"0b7ca07a6abaae67f96f41e5459fd41359ce3a83f137c29c9aa7d388c54370e2","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"ca3be8518f5ef097669cea882643fc532025f29972def4fda49df885565a0480","Makefile":"f4fce2a22f5d285e2682b95c863a26e64915eee856c221a1274462d1fe0774e7","README.md":"5ca0312b21dfe64d7a56a3cd5e1b8cf1e02401c4ab7a2f35ee517bcb9f3d2b59","benches/criterion.rs":"470d09d115eabb7f4761f73365aec9cf417f3445193aba124cec3704dda45730","src/arena.rs":"5fabf0106f2a9cdba9ced3dedb1575832ed1707a48f0cc890a394ff6b2f476fd","src/back/dot/mod.rs":"59a44df6776e48e6695065da517a1b5bfdd50b4b031ca3c4a0a9b25860122198","src/back/glsl/features.rs":"eff30fd295b132cdcc31e3198e63ff8c5b357f2c7e15ecbaddedc7fc3321bf14","src/back/glsl/keywords.rs":"3f23b1e63e99a7056c3b223524d5d37000ef7316ae9df25532a726a1157d1dcd","src/back/glsl/mod.rs":"d97ad75dddf9857ece3585a5c5aa18fa1c052531f4ba5be87e57072d2b6a2909","src/back/hlsl/conv.rs":"d953ca0e87be17be98cdf38ff817cf2cefcfb5bebb60749aecc11aaa5b1ff7c9","src/back/hlsl/help.rs":"680eb5960b48a79a4f5d2e639a311ef5a7a15bc2bc5fb84e04efa3f23a65a469","src/back/hlsl/keywords.rs":"a158c52bf9a05514b5a6e29658c2872c1cf2a6f295e8094a6ac4a37f76a761ad","src/back/hlsl/mod.rs":"e542f6373c1878957af77e127f87dc9c1759e7f172254a5dcfa4b1daa8225b96","src/back/hlsl/storage.rs":"5cbbd0c62f210f5c168af40fda3033b737c78f1270e8b20088f29631226be8ff","src/back/hlsl/writer.rs":"6ff16726a036e1b1aa332ebaad0892a68ffa452e3cf155b28de287c01a7416e5","src/back/mod.rs":"4786ecd5287d9305bfbd84e31a87f23f472b9d2eafd089ea36b9501891a40972","src/back/msl/keywords.rs":"e1c2bf804b1a3a56639bedb9c1b3b78fbf920724ef65f91fe2e9fe476ee3fbbf","src/back/msl/mod.rs":"0a9c36b126789921834a0c9e58d8ffec007ca95604a0c26cd4bf325d9dcc143e","src/back/msl/sampler.rs":"19a905f5eb11d9dad769b60694d1ed7a16ad36ce92b57f9bf70f0a60cd0df1ee","src/back/msl/writer.rs":"5c729c23f7603f23071b707a22c2c886359ad860e24599e16bf5990332ff61de","src/back/spv/block.rs":"03bfc2f7fc8335294adb9f2fc9f5f3b822fcf73724d59dd683261983bffd8222","src/back/spv/helpers.rs":"93428ff26d1d58c5252e379f45cba5ea341e1e2228450fcb7759939577a17444","src/back/spv/image.rs":"d5d48f1294e096265d7077131f8486c936d817472e6f131b3834b6acc1bc93d2","src/back/spv/index.rs":"7a9815bdb1f323a780d41092371582f6d4210f305bec5c74e882dbb6d2d49bc3","src/back/spv/instructions.rs":"75392cb3312e247d2cda846b4560b4abf713d15723ef5bc368a45de0ce466830","src/back/spv/layout.rs":"41b5b8b5c1ca85be27246c0d2393542e971514362a445dd2a984fad7ee49cedb","src/back/spv/mod.rs":"8260beef708a2f1d85f850413a1de76432adceaaeb9587a0e239a7ea91f6744c","src/back/spv/recyclable.rs":"1deb340e077f820dd90826456410a7b9d5c66cd0c708ff7844a449a4bfca1450","src/back/spv/selection.rs":"81e404abfa0a977f7c1f76ccb37a78d13ccadbda229048dad53cc67687cc39db","src/back/spv/writer.rs":"ac7c2ad4cb8e13764c9f16674d4296f2467d48de4d4b23a019d3f863d0973370","src/back/wgsl/mod.rs":"a42db9cc9a200e596d9fa5c68329081829d784b80500b711e8d744e0f03146e0","src/back/wgsl/writer.rs":"ac805ea6d1f45110ea42f799cff78781f8a8e7dfc3a9cbfba4ff4955963dcb69","src/block.rs":"752eca1a6ae19465794131677907b6d0adb332122c8c1b62c7d6530c36e321fb","src/front/glsl/ast.rs":"e3c8206c4c10ed205923a8c9a965e755238fc10b30ae689998eb1ebf17ef248d","src/front/glsl/builtins.rs":"55a37bf0cbcb5316b35bc5d44c5c281861b10039f92f238394e6cee08bf2c852","src/front/glsl/constants.rs":"77577f577e300978c06546912419eea710d2ca2eec1ecde5a0b3f2bf2273f757","src/front/glsl/context.rs":"56bdd119daa05e158d9d495e10ea942ea6d7aba1c57a9787f56ec1bb87e286b5","src/front/glsl/error.rs":"1da0ee90f34fb9106430fa4474c3833646da50a27488af3d1410a8563f58bb20","src/front/glsl/functions.rs":"e5ccfd6cf032b1497b1b360854cad9016e944ecff1c8adc5223c2731275582ee","src/front/glsl/lex.rs":"32f3c20c2e1c96ac17e5ad12b329b887ac6118bc64b50cee6b30522f7108e765","src/front/glsl/mod.rs":"dd5c18c529789fddb061feb84195fd8a01a50ca90cb71ab5e20a99ea6085eac7","src/front/glsl/offset.rs":"9ccd83bb1a3ebf887099c26cf6d665886ce3aed29cf990667df300f1109de398","src/front/glsl/parser.rs":"8542bdfcd57810b11287a5c37195963069d21fc0cc875aa59f384f045bc17c00","src/front/glsl/parser/declarations.rs":"2c7321e22e819182bddec30a13778c5b7c65771b7a2a62c5465b82dd7b39783a","src/front/glsl/parser/expressions.rs":"9d83c8913d6b29dfafeb8dcef8acc20037f12fad10706106de3997f82f5cba05","src/front/glsl/parser/functions.rs":"fa95912a50770e51174b15edab3c904ec7a7adc30a7499ab62fa517269a71480","src/front/glsl/parser/types.rs":"281219573296788c2732893a76a9bc88b2f3e8923ca443a28949b81e27318367","src/front/glsl/parser_tests.rs":"4256fdce5e5de7234a173ecd0dc77eef20052932b0d298c1227b40bd6a7f6a28","src/front/glsl/token.rs":"44f00bd92ce95f3962308f872b3fd93ab18f3363664f7ba31ba8e2aad98a4536","src/front/glsl/types.rs":"8f781ea6a97e4c1691572e0e1c33ce9f860f1f4a96768efa600ac17183cb9c76","src/front/glsl/variables.rs":"ad01ca9fdab9e6d048c6fa1c5009f430c35e4915df1273ddedc753fb11cf4e6b","src/front/interpolator.rs":"45a9289066ddd43490d85b20c912beee11fe81432764f77fc53c7008746e51b8","src/front/mod.rs":"b71c4d655de3ea3d6b742501d28e8843e5422b7bd42ca29af4e0b36e272a8f4c","src/front/spv/convert.rs":"76adf50e3985da1ac5cbbd31fd245e5645321bb98563910ad051eb84c8f9330b","src/front/spv/error.rs":"62265bbd2f06f0251002d3af7848945848472a95028fd699b15f6e78a68c4849","src/front/spv/function.rs":"bde98ca6ccc57ba37ec4f1d5db1de4e6ac646b4d610ec9bc2c2a9bfa8eb2939e","src/front/spv/image.rs":"88a041f0cb1e26a5ca90f7419ebf712149689560fd5806f313dfeda580466203","src/front/spv/mod.rs":"838a4a1c2c9cb1bdf81704b8f375230aaadfd95ef86a0733cd7ce97837a99d34","src/front/spv/null.rs":"f61427f28330d07954269743cc5a39278d3f4774602735eb2995e43ce799a471","src/front/wgsl/conv.rs":"4d3439d1a6bc6676a76cbb1c8206718785555dcf4bf5fd2c9709389cdbb5a16f","src/front/wgsl/lexer.rs":"18cab127250f4ce01c057c5871a91c1c8cd9d2a7961c6c193ff6cb850bbec005","src/front/wgsl/mod.rs":"a12660347ea13c3ef9428224dea440457bc72477a43ecb8a07e2fbce63111d46","src/front/wgsl/number_literals.rs":"7d0790ae9704c679230c4a1961a3bb101a7270aab0c54ddc5b17c5c4ed77f395","src/front/wgsl/tests.rs":"0ad185673ead49efdd7e6bd6b2b5e23c7c4f339eb2add619bd8bbe5348c2b77d","src/keywords/mod.rs":"0138f3931f8af0b0a05174549d0fd2152945b027dc3febefc1bbd676581d2e45","src/keywords/wgsl.rs":"9914852895849d30a06e7b4aa1201aa9723abfd73360d5b25ee3ee8753302084","src/lib.rs":"ad2d81125834ae90de9993120b0c3f27415a0c9529c44004018c9a7150890826","src/proc/index.rs":"1c4fc8244802b01870f95e11599abfb3a4027692eff5ee2fa6dbbb1c2701be60","src/proc/layouter.rs":"d0daac499e8b31bee5f5e545852e8b140af537ac56c24eb1e69a480ddd125543","src/proc/mod.rs":"bc0957606a420cffc1474858365eaff1b00854fc5186fc40ada888e5ee01b378","src/proc/namer.rs":"2cab7428296a243a23234a516ceb569104f86ad4d68ffdf022a060a9fc0c4e83","src/proc/terminator.rs":"f00409a63d5258494080ee55d25cc91c40dc1d4b211a99a0e3cb43e78d4843cd","src/proc/typifier.rs":"6f43eae760d402ff8fe5d55bc4c5c614d96191e6bb6f3d9f4bc9060a57daa8b6","src/span.rs":"b99370746f9122cdabffffbf405b0be49ad2620575858084387f62febad7c804","src/valid/analyzer.rs":"3aa4dca29df0b2e5f44702851cc4a8059449193f60e2f5754ee2076cefbbf8f4","src/valid/compose.rs":"e4c029db8d07ca5e11d4e7e59d8885634856872b595a166e266a3ce0342ccdcd","src/valid/expression.rs":"ad5826dec66d4593e211217f8582afd8d6b6ae5b186647fb133aaabd500e9576","src/valid/function.rs":"c78e387af5a96e2614bacc4b4673446d20e6a08b468e9eb76474ac4e15dd3cea","src/valid/interface.rs":"ecc782c359ed64d3d3195f790631a66df9fe705791e1caeb2cf205087f03f06c","src/valid/mod.rs":"20a169af629c21ec7947fc7a114a490a515d9807c429cfe5c31d5c4c3969266c","src/valid/type.rs":"f0991c45bf1fd979fbd6a429ac113aacaaf7ccef3ad9ee2dcc44ae892116545a"},"package":null} \ No newline at end of file diff --git a/third_party/rust/naga/.github/workflows/pipeline.yml b/third_party/rust/naga/.github/workflows/pipeline.yml index d7e652155f3d5..b19fd9a8b74cb 100644 --- a/third_party/rust/naga/.github/workflows/pipeline.yml +++ b/third_party/rust/naga/.github/workflows/pipeline.yml @@ -3,25 +3,47 @@ name: pipeline on: [push, pull_request] jobs: - test: - name: Test + test-msrv: + name: Test MSRV runs-on: ubuntu-latest - strategy: - matrix: - rust: ["1.43.0", nightly] steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: ${{ matrix.rust }} + toolchain: "1.43.0" override: true - uses: actions-rs/cargo@v1 name: Downgrade bitflags to MSRV - if: ${{ matrix.rust }} == "1.43.0" with: command: update args: -p bitflags --precise 1.2.1 + - uses: actions-rs/cargo@v1 + name: Downgrade indexmap to MSRV + with: + command: update + args: -p indexmap --precise 1.6.2 + - uses: actions-rs/cargo@v1 + name: Test all features + with: + # we could use `test` but `criterion` is a dev dependency, + # and it doesn't build with our MSRV + command: check + # `cli` already enables most features, + # except for `arbitrary`, which requires Rust-1.51 + args: --workspace + - name: Check snapshots + run: git diff --exit-code -- tests/out + test: + name: Test Nightly + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true - uses: actions-rs/cargo@v1 name: Default test with: diff --git a/third_party/rust/naga/CHANGELOG.md b/third_party/rust/naga/CHANGELOG.md index 93ab09e9efa50..3406481f31fd7 100644 --- a/third_party/rust/naga/CHANGELOG.md +++ b/third_party/rust/naga/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## v0.9 (TBD) + - WGSL: + - commas are used to separate struct members intead of semicolons + - attributes are declared with `@attrib` instead of `[[attrib]]` + - `stride` attribute is removed + - block comments are supported + - renames: + - `findLsb` -> `firstTrailingBit` + - `findMsb` -> `firstLeadingBit` + ## v0.8 (2021-12-18) - development release for wgpu-0.12 - lots of fixes in all parts diff --git a/third_party/rust/naga/Cargo.toml b/third_party/rust/naga/Cargo.toml index 5b06a4275c4b6..13a385d5d66ff 100644 --- a/third_party/rust/naga/Cargo.toml +++ b/third_party/rust/naga/Cargo.toml @@ -14,22 +14,6 @@ resolver = "2" [package.metadata.docs.rs] all-features = true -[dependencies] -# MSRV warning: bitflags 1.3 requires Rust-1.46 -bitflags = "1" -bit-set = "0.5" -codespan-reporting = { version = "0.11.0", optional = true } -rustc-hash = "1.1.0" -indexmap = "~1.6" # 1.7 has MSRV 1.49 -log = "0.4" -num-traits = "0.2" -spirv = { version = "0.2", optional = true } -thiserror = "1.0.21" -serde = { version = "1.0", features = ["derive"], optional = true } -petgraph = { version ="0.6", optional = true } -pp-rs = { version = "0.2.1", optional = true } -hexf-parse = { version = "0.2.1", optional = true } - [profile.release] panic = "abort" @@ -53,7 +37,34 @@ hlsl-out = [] span = ["codespan-reporting"] validate = [] +[[bench]] +name = "criterion" +harness = false + +# MSRV warnings: +# - arbitrary 1.0.3 requires Rust-1.51 +# - bitflags 1.3 requires Rust-1.46 +# - indexmap 1.7 requires Rust-1.49 + +[dependencies] +arbitrary = { version = "1", features = ["derive"], optional = true } +bitflags = "1" +bit-set = "0.5" +codespan-reporting = { version = "0.11.0", optional = true } +rustc-hash = "1.1.0" +indexmap = "1.6" +log = "0.4" +num-traits = "0.2" +spirv = { version = "0.2", optional = true } +thiserror = "1.0.21" +serde = { version = "1.0", features = ["derive"], optional = true } +petgraph = { version ="0.6", optional = true } +pp-rs = { version = "0.2.1", optional = true } +hexf-parse = { version = "0.2.1", optional = true } + [dev-dependencies] +bincode = "1" +criterion = { version = "0.3", features = [] } diff = "0.1" ron = "0.7" serde = { version = "1.0", features = ["derive"] } diff --git a/third_party/rust/naga/Makefile b/third_party/rust/naga/Makefile index 841f077a82255..4622fdbb5df2d 100644 --- a/third_party/rust/naga/Makefile +++ b/third_party/rust/naga/Makefile @@ -11,6 +11,10 @@ all: clean: rm *.metal *.air *.metallib *.vert *.frag *.comp *.spv +bench: + #rm -Rf target/criterion + cargo bench + %.metal: $(SNAPSHOTS_BASE_IN)/%.wgsl $(wildcard src/*.rs src/**/*.rs examples/*.rs) cargo run --features wgsl-in,msl-out -- $< $@ diff --git a/third_party/rust/naga/benches/criterion.rs b/third_party/rust/naga/benches/criterion.rs new file mode 100644 index 0000000000000..f239948e88fd8 --- /dev/null +++ b/third_party/rust/naga/benches/criterion.rs @@ -0,0 +1,274 @@ +use criterion::*; +use std::{fs, path::PathBuf, slice}; + +fn gather_inputs(folder: &str, extension: &str) -> Vec> { + let mut list = Vec::new(); + let read_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join(folder) + .read_dir() + .unwrap(); + for file_entry in read_dir { + match file_entry { + Ok(entry) => match entry.path().extension() { + Some(ostr) if &*ostr == extension => { + let input = fs::read(entry.path()).unwrap_or_default(); + list.push(input.into_boxed_slice()); + } + _ => continue, + }, + Err(e) => { + log::warn!("Skipping file: {:?}", e); + continue; + } + } + } + list +} + +fn parse_glsl(stage: naga::ShaderStage, inputs: &[Box<[u8]>]) { + let mut parser = naga::front::glsl::Parser::default(); + let options = naga::front::glsl::Options { + stage, + defines: Default::default(), + }; + for input in inputs.iter() { + let string = std::str::from_utf8(input).unwrap(); + parser.parse(&options, string).unwrap(); + } +} + +fn frontends(c: &mut Criterion) { + let mut group = c.benchmark_group("front"); + #[cfg(all(feature = "wgsl-in", feature = "serialize", feature = "deserialize"))] + group.bench_function("bin", |b| { + let inputs_wgsl = gather_inputs("tests/in", "wgsl"); + let mut parser = naga::front::wgsl::Parser::new(); + let inputs_bin = inputs_wgsl + .iter() + .map(|input| { + let string = std::str::from_utf8(input).unwrap(); + let module = parser.parse(string).unwrap(); + bincode::serialize(&module).unwrap() + }) + .collect::>(); + b.iter(move || { + for input in inputs_bin.iter() { + bincode::deserialize::(input).unwrap(); + } + }); + }); + #[cfg(feature = "wgsl-in")] + group.bench_function("wgsl", |b| { + let inputs_wgsl = gather_inputs("tests/in", "wgsl"); + let inputs = inputs_wgsl + .iter() + .map(|input| std::str::from_utf8(input).unwrap()) + .collect::>(); + let mut parser = naga::front::wgsl::Parser::new(); + b.iter(move || { + for &input in inputs.iter() { + parser.parse(input).unwrap(); + } + }); + }); + #[cfg(feature = "spv-in")] + group.bench_function("spv", |b| { + let inputs = gather_inputs("tests/in/spv", "spv"); + b.iter(move || { + let options = naga::front::spv::Options::default(); + for input in inputs.iter() { + let spv = + unsafe { slice::from_raw_parts(input.as_ptr() as *const u32, input.len() / 4) }; + let parser = naga::front::spv::Parser::new(spv.iter().cloned(), &options); + parser.parse().unwrap(); + } + }); + }); + #[cfg(feature = "glsl-in")] + group.bench_function("glsl", |b| { + let vert = gather_inputs("tests/in/glsl", "vert"); + b.iter(move || parse_glsl(naga::ShaderStage::Vertex, &vert)); + let frag = gather_inputs("tests/in/glsl", "frag"); + b.iter(move || parse_glsl(naga::ShaderStage::Vertex, &frag)); + //TODO: hangs for some reason! + //let comp = gather_inputs("tests/in/glsl", "comp"); + //b.iter(move || parse_glsl(naga::ShaderStage::Compute, &comp)); + }); +} + +#[cfg(feature = "wgsl-in")] +fn gather_modules() -> Vec { + let inputs = gather_inputs("tests/in", "wgsl"); + let mut parser = naga::front::wgsl::Parser::new(); + inputs + .iter() + .map(|input| { + let string = std::str::from_utf8(input).unwrap(); + parser.parse(string).unwrap() + }) + .collect() +} +#[cfg(not(feature = "wgsl-in"))] +fn gather_modules() -> Vec { + Vec::new() +} + +fn validation(c: &mut Criterion) { + let inputs = gather_modules(); + let mut group = c.benchmark_group("valid"); + #[cfg(feature = "validate")] + group.bench_function("safe", |b| { + let mut validator = naga::valid::Validator::new( + naga::valid::ValidationFlags::all(), + naga::valid::Capabilities::all(), + ); + b.iter(|| { + for input in inputs.iter() { + validator.validate(input).unwrap(); + } + }); + }); + #[cfg(feature = "validate")] + group.bench_function("unsafe", |b| { + let mut validator = naga::valid::Validator::new( + naga::valid::ValidationFlags::empty(), + naga::valid::Capabilities::all(), + ); + b.iter(|| { + for input in inputs.iter() { + validator.validate(input).unwrap(); + } + }); + }); +} + +fn backends(c: &mut Criterion) { + #[cfg(feature = "validate")] + let inputs = { + let mut validator = naga::valid::Validator::new( + naga::valid::ValidationFlags::empty(), + naga::valid::Capabilities::empty(), + ); + let input_modules = gather_modules(); + input_modules + .into_iter() + .flat_map(|module| validator.validate(&module).ok().map(|info| (module, info))) + .collect::>() + }; + #[cfg(not(feature = "validate"))] + let inputs = Vec::<(naga::Module, naga::valid::ModuleInfo)>::new(); + + let mut group = c.benchmark_group("back"); + #[cfg(feature = "wgsl-out")] + group.bench_function("wgsl", |b| { + b.iter(|| { + let mut string = String::new(); + let flags = naga::back::wgsl::WriterFlags::empty(); + for &(ref module, ref info) in inputs.iter() { + let mut writer = naga::back::wgsl::Writer::new(&mut string, flags); + writer.write(module, info).unwrap(); + string.clear(); + } + }); + }); + + #[cfg(feature = "spv-out")] + group.bench_function("spv", |b| { + b.iter(|| { + let mut data = Vec::new(); + let options = naga::back::spv::Options::default(); + for &(ref module, ref info) in inputs.iter() { + let mut writer = naga::back::spv::Writer::new(&options).unwrap(); + writer.write(module, info, None, &mut data).unwrap(); + data.clear(); + } + }); + }); + #[cfg(feature = "spv-out")] + group.bench_function("spv-separate", |b| { + b.iter(|| { + let mut data = Vec::new(); + let options = naga::back::spv::Options::default(); + for &(ref module, ref info) in inputs.iter() { + let mut writer = naga::back::spv::Writer::new(&options).unwrap(); + for ep in module.entry_points.iter() { + let pipeline_options = naga::back::spv::PipelineOptions { + shader_stage: ep.stage, + entry_point: ep.name.clone(), + }; + writer + .write(module, info, Some(&pipeline_options), &mut data) + .unwrap(); + data.clear(); + } + } + }); + }); + + #[cfg(feature = "msl-out")] + group.bench_function("msl", |b| { + b.iter(|| { + let mut string = String::new(); + let options = naga::back::msl::Options::default(); + for &(ref module, ref info) in inputs.iter() { + let pipeline_options = naga::back::msl::PipelineOptions::default(); + let mut writer = naga::back::msl::Writer::new(&mut string); + writer + .write(module, info, &options, &pipeline_options) + .unwrap(); + string.clear(); + } + }); + }); + + #[cfg(feature = "hlsl-out")] + group.bench_function("hlsl", |b| { + b.iter(|| { + let options = naga::back::hlsl::Options::default(); + let mut string = String::new(); + for &(ref module, ref info) in inputs.iter() { + let mut writer = naga::back::hlsl::Writer::new(&mut string, &options); + let _ = writer.write(module, info); // may fail on unimplemented things + string.clear(); + } + }); + }); + + #[cfg(feature = "glsl-out")] + group.bench_function("glsl-separate", |b| { + b.iter(|| { + let mut string = String::new(); + let options = naga::back::glsl::Options { + version: naga::back::glsl::Version::Embedded(320), + writer_flags: naga::back::glsl::WriterFlags::empty(), + binding_map: Default::default(), + }; + for &(ref module, ref info) in inputs.iter() { + for ep in module.entry_points.iter() { + let pipeline_options = naga::back::glsl::PipelineOptions { + shader_stage: ep.stage, + entry_point: ep.name.clone(), + }; + match naga::back::glsl::Writer::new( + &mut string, + module, + info, + &options, + &pipeline_options, + ) { + Ok(mut writer) => { + let _ = writer.write(); // can error if unsupported + } + Err(_) => { + // missing features + } + }; + string.clear(); + } + } + }); + }); +} + +criterion_group!(criterion, frontends, validation, backends,); +criterion_main!(criterion); diff --git a/third_party/rust/naga/src/arena.rs b/third_party/rust/naga/src/arena.rs index 4884010d3c79c..583e99eec2002 100644 --- a/third_party/rust/naga/src/arena.rs +++ b/third_party/rust/naga/src/arena.rs @@ -8,6 +8,13 @@ type Index = NonZeroU32; use crate::Span; use indexmap::set::IndexSet; +#[derive(Clone, Copy, Debug, thiserror::Error, PartialEq)] +#[error("Handle {index} of {kind} is either not present, or inaccessible yet")] +pub struct BadHandle { + pub kind: &'static str, + pub index: usize, +} + /// A strongly typed reference to an arena item. /// /// A `Handle` value can be used as an index into an [`Arena`] or [`UniqueArena`]. @@ -17,6 +24,7 @@ use indexmap::set::IndexSet; any(feature = "serialize", feature = "deserialize"), serde(transparent) )] +#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Handle { index: Index, #[cfg_attr(any(feature = "serialize", feature = "deserialize"), serde(skip))] @@ -110,6 +118,7 @@ impl Handle { any(feature = "serialize", feature = "deserialize"), serde(transparent) )] +#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Range { inner: ops::Range, #[cfg_attr(any(feature = "serialize", feature = "deserialize"), serde(skip))] @@ -154,6 +163,7 @@ impl Iterator for Range { /// a reference to the stored item. #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "serialize", serde(transparent))] +#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(test, derive(PartialEq))] pub struct Arena { /// Values of this arena. @@ -262,8 +272,11 @@ impl Arena { self.fetch_if_or_append(value, span, T::eq) } - pub fn try_get(&self, handle: Handle) -> Option<&T> { - self.data.get(handle.index()) + pub fn try_get(&self, handle: Handle) -> Result<&T, BadHandle> { + self.data.get(handle.index()).ok_or_else(|| BadHandle { + kind: std::any::type_name::(), + index: handle.index(), + }) } /// Get a mutable reference to an element in the arena. @@ -516,8 +529,11 @@ impl UniqueArena { } /// Return this arena's value at `handle`, if that is a valid handle. - pub fn get_handle(&self, handle: Handle) -> Option<&T> { - self.set.get_index(handle.index()) + pub fn get_handle(&self, handle: Handle) -> Result<&T, BadHandle> { + self.set.get_index(handle.index()).ok_or_else(|| BadHandle { + kind: std::any::type_name::(), + index: handle.index(), + }) } } @@ -543,8 +559,7 @@ impl ops::Index> for UniqueArena { #[cfg(feature = "serialize")] impl serde::Serialize for UniqueArena where - T: Eq + hash::Hash, - T: serde::Serialize, + T: Eq + hash::Hash + serde::Serialize, { fn serialize(&self, serializer: S) -> Result where @@ -557,8 +572,7 @@ where #[cfg(feature = "deserialize")] impl<'de, T> serde::Deserialize<'de> for UniqueArena where - T: Eq + hash::Hash, - T: serde::Deserialize<'de>, + T: Eq + hash::Hash + serde::Deserialize<'de>, { fn deserialize(deserializer: D) -> Result where @@ -575,3 +589,36 @@ where }) } } + +//Note: largely borrowed from `HashSet` implementation +#[cfg(feature = "arbitrary")] +impl<'a, T> arbitrary::Arbitrary<'a> for UniqueArena +where + T: Eq + hash::Hash + arbitrary::Arbitrary<'a>, +{ + fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result { + let mut arena = Self::default(); + for elem in u.arbitrary_iter()? { + arena.set.insert(elem?); + #[cfg(feature = "span")] + arena.span_info.push(Span::UNDEFINED); + } + Ok(arena) + } + + fn arbitrary_take_rest(u: arbitrary::Unstructured<'a>) -> arbitrary::Result { + let mut arena = Self::default(); + for elem in u.arbitrary_take_rest_iter()? { + arena.set.insert(elem?); + #[cfg(feature = "span")] + arena.span_info.push(Span::UNDEFINED); + } + Ok(arena) + } + + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + let depth_hint = ::size_hint(depth); + arbitrary::size_hint::and(depth_hint, (0, None)) + } +} diff --git a/third_party/rust/naga/src/back/dot/mod.rs b/third_party/rust/naga/src/back/dot/mod.rs index bee46704cea7f..523e48ce5fcae 100644 --- a/third_party/rust/naga/src/back/dot/mod.rs +++ b/third_party/rust/naga/src/back/dot/mod.rs @@ -1,8 +1,11 @@ -/*! GraphViz (DOT) backend - * - * This backend writes a graph in the DOT format, for the ease - * of IR inspection and debugging. -!*/ +/*! +Backend for [DOT][dot] (Graphviz). + +This backend writes a graph in the DOT language, for the ease +of IR inspection and debugging. + +[dot]: https://graphviz.org/doc/info/lang.html +*/ use crate::{ arena::Handle, @@ -271,15 +274,19 @@ fn write_fun( image, coordinate, array_index, - index, + sample, + level, } => { edges.insert("image", image); edges.insert("coordinate", coordinate); if let Some(expr) = array_index { edges.insert("array_index", expr); } - if let Some(expr) = index { - edges.insert("index", expr); + if let Some(sample) = sample { + edges.insert("sample", sample); + } + if let Some(level) = level { + edges.insert("level", level); } ("ImageLoad".into(), 5) } @@ -470,6 +477,7 @@ fn write_fun( Ok(()) } +/// Write shader module to a [`String`]. pub fn write(module: &crate::Module, mod_info: Option<&ModuleInfo>) -> Result { use std::fmt::Write as _; @@ -484,7 +492,7 @@ pub fn write(module: &crate::Module, mod_info: Option<&ModuleInfo>) -> Result Self { Self(Features::empty()) } - /// Adds to the list of required [`Features`](Features) + /// Adds to the list of required [`Features`] pub fn request(&mut self, features: Features) { self.0 |= features } - /// Checks that all required [`Features`](Features) are available for the specified + /// Checks that all required [`Features`] are available for the specified /// [`Version`](super::Version) otherwise returns an /// [`Error::MissingFeatures`](super::Error::MissingFeatures) pub fn check_availability(&self, version: Version) -> BackendResult { @@ -214,10 +215,10 @@ impl FeaturesManager { } impl<'a, W> Writer<'a, W> { - /// Helper method that searches the module for all the needed [`Features`](Features) + /// Helper method that searches the module for all the needed [`Features`] /// /// # Errors - /// If the version doesn't support any of the needed [`Features`](Features) a + /// If the version doesn't support any of the needed [`Features`] a /// [`Error::MissingFeatures`](super::Error::MissingFeatures) will be returned pub(super) fn collect_required_features(&mut self) -> BackendResult { let ep_info = self.info.get_entry_point(self.entry_point_idx as usize); @@ -343,14 +344,21 @@ impl<'a, W> Writer<'a, W> { } } + let mut push_constant_used = false; + for (handle, global) in self.module.global_variables.iter() { if ep_info[handle].is_empty() { continue; } - match global.class { - StorageClass::WorkGroup => self.features.request(Features::COMPUTE_SHADER), - StorageClass::Storage { .. } => self.features.request(Features::BUFFER_STORAGE), - StorageClass::PushConstant => return Err(Error::PushConstantNotSupported), + match global.space { + AddressSpace::WorkGroup => self.features.request(Features::COMPUTE_SHADER), + AddressSpace::Storage { .. } => self.features.request(Features::BUFFER_STORAGE), + AddressSpace::PushConstant => { + if push_constant_used { + return Err(Error::MultiplePushConstants); + } + push_constant_used = true; + } _ => {} } } @@ -379,7 +387,7 @@ impl<'a, W> Writer<'a, W> { self.features.check_availability(self.options.version) } - /// Helper method that checks the [`Features`](Features) needed by a scalar + /// Helper method that checks the [`Features`] needed by a scalar fn scalar_required_features(&mut self, kind: ScalarKind, width: Bytes) { if kind == ScalarKind::Float && width == 8 { self.features.request(Features::DOUBLE_TYPE); diff --git a/third_party/rust/naga/src/back/glsl/mod.rs b/third_party/rust/naga/src/back/glsl/mod.rs index 239cb0a159cbe..c8dabbe58d6d4 100644 --- a/third_party/rust/naga/src/back/glsl/mod.rs +++ b/third_party/rust/naga/src/back/glsl/mod.rs @@ -1,22 +1,25 @@ -//! OpenGL shading language backend -//! -//! The main structure is [`Writer`](Writer), it maintains internal state that is used -//! to output a [`Module`](crate::Module) into glsl -//! -//! # Supported versions -//! ### Core -//! - 330 -//! - 400 -//! - 410 -//! - 420 -//! - 430 -//! - 450 -//! - 460 -//! -//! ### ES -//! - 300 -//! - 310 -//! +/*! +Backend for [GLSL][glsl] (OpenGL Shading Language). + +The main structure is [`Writer`], it maintains internal state that is used +to output a [`Module`](crate::Module) into glsl + +# Supported versions +### Core +- 330 +- 400 +- 410 +- 420 +- 430 +- 450 +- 460 + +### ES +- 300 +- 310 + +[glsl]: https://www.khronos.org/registry/OpenGL/index_gl.php +*/ // GLSL is mostly a superset of C but it also removes some parts of it this is a list of relevant // aspects for this backend. @@ -33,7 +36,7 @@ // `#extension name: behaviour` // Extensions provide increased features in a plugin fashion but they aren't required to be // supported hence why they are called extensions, that's why `behaviour` is used it specifies -// wether the extension is strictly required or if it should only be enabled if needed. In our case +// whether the extension is strictly required or if it should only be enabled if needed. In our case // when we use extensions we set behaviour to `require` always. // // The only thing that glsl removes that makes a difference are pointers. @@ -61,11 +64,12 @@ mod features; /// Contains a constant with a slice of all the reserved keywords RESERVED_KEYWORDS mod keywords; -/// List of supported core glsl versions +/// List of supported `core` GLSL versions. pub const SUPPORTED_CORE_VERSIONS: &[u16] = &[330, 400, 410, 420, 430, 440, 450]; -/// List of supported es glsl versions +/// List of supported `es` GLSL versions. pub const SUPPORTED_ES_VERSIONS: &[u16] = &[300, 310, 320]; +/// Mapping between resources and bindings. pub type BindingMap = std::collections::BTreeMap; impl crate::AtomicFunction { @@ -83,20 +87,21 @@ impl crate::AtomicFunction { } } -impl crate::StorageClass { +impl crate::AddressSpace { fn is_buffer(&self) -> bool { match *self { - crate::StorageClass::Uniform | crate::StorageClass::Storage { .. } => true, + crate::AddressSpace::Uniform | crate::AddressSpace::Storage { .. } => true, _ => false, } } - /// Whether a variable with this storage class can be initialized + /// Whether a variable with this address space can be initialized fn initializable(&self) -> bool { match *self { - crate::StorageClass::WorkGroup - | crate::StorageClass::Uniform - | crate::StorageClass::Storage { .. } => false, + crate::AddressSpace::WorkGroup + | crate::AddressSpace::Uniform + | crate::AddressSpace::PushConstant + | crate::AddressSpace::Storage { .. } => false, _ => true, } } @@ -124,19 +129,31 @@ impl<'a> GlobalTypeKind<'a> { } => Self::Unsized(members), _ => Self::WrappedStruct, }, + // Naga IR permits globals to be dynamically sized arrays. Render + // these in GLSL as buffers. + crate::TypeInner::Array { + size: crate::ArraySize::Dynamic, + .. + } => Self::WrappedStruct, + // Naga IR permits globals to be constant sized arrays. Render + // these in GLSL as uniforms. + crate::TypeInner::Array { + size: crate::ArraySize::Constant(..), + .. + } => Self::WrappedStruct, _ => Self::Other, } } } -/// glsl version +/// A GLSL version. #[derive(Debug, Copy, Clone, PartialEq)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub enum Version { - /// `core` glsl + /// `core` GLSL. Desktop(u16), - /// `es` glsl + /// `es` GLSL. Embedded(u16), } @@ -205,10 +222,11 @@ impl fmt::Display for Version { } bitflags::bitflags! { + /// Configuration flags for the [`Writer`]. #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub struct WriterFlags: u32 { - /// Flip output Y and extend Z from (0,1) to (-1,1). + /// Flip output Y and extend Z from (0, 1) to (-1, 1). const ADJUST_COORDINATE_SPACE = 0x1; /// Supports GL_EXT_texture_shadow_lod on the host, which provides /// additional functions on shadows and arrays of shadows. @@ -216,14 +234,14 @@ bitflags::bitflags! { } } -/// Structure that contains the configuration used in the [`Writer`](Writer) +/// Configuration used in the [`Writer`]. #[derive(Debug, Clone)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub struct Options { - /// The glsl version to be used + /// The GLSL version to be used. pub version: Version, - /// Configuration flags for the writer. + /// Configuration flags for the [`Writer`]. pub writer_flags: WriterFlags, /// Map of resources association to binding locations. pub binding_map: BindingMap, @@ -239,40 +257,41 @@ impl Default for Options { } } -// A subset of options that are meant to be changed per pipeline. +/// A subset of options meant to be changed per pipeline. #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub struct PipelineOptions { - /// The stage of the entry point + /// The stage of the entry point. pub shader_stage: ShaderStage, - /// The name of the entry point + /// The name of the entry point. /// - /// If no entry point that matches is found a error will be thrown while creating a new instance - /// of [`Writer`](struct.Writer.html) + /// If no entry point that matches is found while creating a [`Writer`], a error will be thrown. pub entry_point: String, } -/// Structure that contains a reflection info +/// Reflection info for texture mappings and uniforms. pub struct ReflectionInfo { + /// Mapping between texture names and variables/samplers. pub texture_mapping: crate::FastHashMap, + /// Mapping between uniform variables and names. pub uniforms: crate::FastHashMap, String>, } -/// Structure that connects a texture to a sampler or not +/// Mapping between a texture and its sampler, if it exists. /// -/// glsl pre vulkan has no concept of separate textures and samplers instead everything is a -/// `gsamplerN` where `g` is the scalar type and `N` is the dimension, but naga uses separate textures -/// and samplers in the IR so the backend produces a [`HashMap`](crate::FastHashMap) with the texture name -/// as a key and a [`TextureMapping`](TextureMapping) as a value this way the user knows where to bind. +/// GLSL pre-Vulkan has no concept of separate textures and samplers. Instead, everything is a +/// `gsamplerN` where `g` is the scalar type and `N` is the dimension. But naga uses separate textures +/// and samplers in the IR, so the backend produces a [`FastHashMap`](crate::FastHashMap) with the texture name +/// as a key and a [`TextureMapping`] as a value. This way, the user knows where to bind. /// -/// [`Storage`](crate::ImageClass::Storage) images produce `gimageN` and don't have an associated sampler -/// so the [`sampler`](Self::sampler) field will be [`None`](std::option::Option::None) +/// [`Storage`](crate::ImageClass::Storage) images produce `gimageN` and don't have an associated sampler, +/// so the [`sampler`](Self::sampler) field will be [`None`]. #[derive(Debug, Clone)] pub struct TextureMapping { - /// Handle to the image global variable + /// Handle to the image global variable. pub texture: Handle, - /// Handle to the associated sampler global variable if it exists + /// Handle to the associated sampler global variable, if it exists. pub sampler: Option>, } @@ -337,88 +356,90 @@ impl ShaderStage { /// Shorthand result used internally by the backend type BackendResult = Result; -/// A glsl compilation error. +/// A GLSL compilation error. #[derive(Debug, Error)] pub enum Error { - /// A error occurred while writing to the output + /// A error occurred while writing to the output. #[error("Format error")] FmtError(#[from] FmtError), - /// The specified [`Version`](Version) doesn't have all required [`Features`](super) + /// The specified [`Version`] doesn't have all required [`Features`]. /// - /// Contains the missing [`Features`](Features) + /// Contains the missing [`Features`]. #[error("The selected version doesn't support {0:?}")] MissingFeatures(Features), - /// [`StorageClass::PushConstant`](crate::StorageClass::PushConstant) was used and isn't - /// supported in the glsl backend - #[error("Push constants aren't supported")] - PushConstantNotSupported, - /// The specified [`Version`](Version) isn't supported + /// [`AddressSpace::PushConstant`](crate::AddressSpace::PushConstant) was used more than + /// once in the entry point, which isn't supported. + #[error("Multiple push constants aren't supported")] + MultiplePushConstants, + /// The specified [`Version`] isn't supported. #[error("The specified version isn't supported")] VersionNotSupported, - /// The entry point couldn't be found + /// The entry point couldn't be found. #[error("The requested entry point couldn't be found")] EntryPointNotFound, - /// A call was made to an unsupported external + /// A call was made to an unsupported external. #[error("A call was made to an unsupported external: {0}")] UnsupportedExternal(String), - /// A scalar with an unsupported width was requested + /// A scalar with an unsupported width was requested. #[error("A scalar with an unsupported width was requested: {0:?} {1:?}")] UnsupportedScalar(crate::ScalarKind, crate::Bytes), - /// A image was used with multiple samplers, this isn't supported + /// A image was used with multiple samplers, which isn't supported. #[error("A image was used with multiple samplers")] ImageMultipleSamplers, #[error("{0}")] Custom(String), } -/// Binary operation with a different logic on the GLSL side +/// Binary operation with a different logic on the GLSL side. enum BinaryOperation { /// Vector comparison should use the function like `greaterThan()`, etc. VectorCompare, - /// GLSL `%` is SPIR-V `OpUMod/OpSMod` and `mod()` is `OpFMod`, but [`BinaryOperator::Modulo`](crate::BinaryOperator::Modulo) is `OpFRem` + /// GLSL `%` is SPIR-V `OpUMod/OpSMod` and `mod()` is `OpFMod`, but [`BinaryOperator::Modulo`](crate::BinaryOperator::Modulo) is `OpFRem`. Modulo, - /// Any plain operation. No additional logic required + /// Any plain operation. No additional logic required. Other, } -/// Main structure of the glsl backend responsible for all code generation +/// Writer responsible for all code generation. pub struct Writer<'a, W> { // Inputs - /// The module being written + /// The module being written. module: &'a crate::Module, /// The module analysis. info: &'a valid::ModuleInfo, - /// The output writer + /// The output writer. out: W, - /// User defined configuration to be used + /// User defined configuration to be used. options: &'a Options, // Internal State - /// Features manager used to store all the needed features and write them + /// Features manager used to store all the needed features and write them. features: FeaturesManager, namer: proc::Namer, /// A map with all the names needed for writing the module - /// (generated by a [`Namer`](crate::proc::Namer)) + /// (generated by a [`Namer`](crate::proc::Namer)). names: crate::FastHashMap, - /// A map with the names of global variables needed for reflections + /// A map with the names of global variables needed for reflections. reflection_names_globals: crate::FastHashMap, String>, - /// The selected entry point + /// The selected entry point. entry_point: &'a crate::EntryPoint, - /// The index of the selected entry point + /// The index of the selected entry point. entry_point_idx: proc::EntryPointIndex, - /// Used to generate a unique number for blocks + /// A generator for unique block numbers. block_id: IdGenerator, - /// Set of expressions that have associated temporary variables + /// Set of expressions that have associated temporary variables. named_expressions: crate::NamedExpressions, + /// Set of expressions that need to be baked to avoid unnecessary repetition in output + need_bake_expressions: back::NeedBakeExpressions, } impl<'a, W: Write> Writer<'a, W> { - /// Creates a new [`Writer`](Writer) instance + /// Creates a new [`Writer`] instance. /// /// # Errors - /// - If the version specified isn't supported (or invalid) - /// - If the entry point couldn't be found on the module - /// - If the version specified doesn't support some used features + /// - If the version specified is invalid or supported. + /// - If the entry point couldn't be found in the module. + /// - If the version specified doesn't support some used features. pub fn new( out: W, module: &'a crate::Module, @@ -460,7 +481,8 @@ impl<'a, W: Write> Writer<'a, W> { entry_point_idx: ep_idx as u16, block_id: IdGenerator::default(), - named_expressions: crate::NamedExpressions::default(), + named_expressions: Default::default(), + need_bake_expressions: Default::default(), }; // Find all features required to print this module @@ -562,7 +584,7 @@ impl<'a, W: Write> Writer<'a, W> { GlobalTypeKind::Other => { let used_by_global = self.module.global_variables.iter().any(|(vh, var)| { - !ep_info[vh].is_empty() && var.class.is_buffer() && var.ty == handle + !ep_info[vh].is_empty() && var.space.is_buffer() && var.ty == handle }); // If not used by a global, it's safe to just spew it here !used_by_global @@ -751,7 +773,7 @@ impl<'a, W: Write> Writer<'a, W> { size: None, kind, width, - class: _, + space: _, } => write!(self.out, "{}", glsl_scalar(kind, width)?.full)?, // Vectors are just `gvecN` where `g` is the scalar prefix and `N` is the vector size TypeInner::Vector { size, kind, width } @@ -759,7 +781,7 @@ impl<'a, W: Write> Writer<'a, W> { size: Some(size), kind, width, - class: _, + space: _, } => write!( self.out, "{}vec{}", @@ -890,22 +912,22 @@ impl<'a, W: Write> Writer<'a, W> { if let Some(ref br) = global.binding { match self.options.binding_map.get(br) { Some(binding) => { - let layout = match global.class { - crate::StorageClass::Storage { .. } => { + let layout = match global.space { + crate::AddressSpace::Storage { .. } => { if self.options.version.supports_std430_layout() { "std430, " } else { "std140, " } } - crate::StorageClass::Uniform => "std140, ", + crate::AddressSpace::Uniform => "std140, ", _ => "", }; write!(self.out, "layout({}binding = {}) ", layout, binding)? } None => { log::debug!("unassigned binding for {:?}", global.name); - if let crate::StorageClass::Storage { .. } = global.class { + if let crate::AddressSpace::Storage { .. } = global.space { if self.options.version.supports_std430_layout() { write!(self.out, "layout(std430) ")? } @@ -915,13 +937,13 @@ impl<'a, W: Write> Writer<'a, W> { } } - if let crate::StorageClass::Storage { access } = global.class { + if let crate::AddressSpace::Storage { access } = global.space { self.write_storage_access(access)?; } // Write the storage class // Trailing space is important - if let Some(storage_class) = glsl_storage_class(global.class) { + if let Some(storage_class) = glsl_storage_class(global.space) { write!(self.out, "{} ", storage_class)?; } @@ -930,7 +952,7 @@ impl<'a, W: Write> Writer<'a, W> { // generated number so it's unique and `members` are the same as in a struct // Write the block name, it's just the struct name appended with `_block_ID` - let needs_wrapper = if global.class.is_buffer() { + let needs_wrapper = if global.space.is_buffer() { let ty_name = &self.names[&NameKey::Type(global.ty)]; let block_name = format!( "{}_block_{}{:?}", @@ -962,6 +984,11 @@ impl<'a, W: Write> Writer<'a, W> { false }; + if let crate::AddressSpace::PushConstant = global.space { + let global_name = self.get_global_name(handle, global); + self.reflection_names_globals.insert(handle, global_name); + } + // Finally write the global name and end the global with a `;` and a newline // Leading space is important write!(self.out, " ")?; @@ -971,7 +998,7 @@ impl<'a, W: Write> Writer<'a, W> { self.write_array_size(size)?; } - if global.class.initializable() && is_value_init_supported(self.module, global.ty) { + if global.space.initializable() && is_value_init_supported(self.module, global.ty) { write!(self.out, " = ")?; if let Some(init) = global.init { self.write_constant(init)?; @@ -988,6 +1015,45 @@ impl<'a, W: Write> Writer<'a, W> { Ok(()) } + /// Helper method used to find which expressions of a given function require baking + /// + /// # Notes + /// Clears `need_bake_expressions` set before adding to it + fn update_expressions_to_bake(&mut self, func: &crate::Function, info: &valid::FunctionInfo) { + use crate::Expression; + self.need_bake_expressions.clear(); + for expr in func.expressions.iter() { + let expr_info = &info[expr.0]; + let min_ref_count = func.expressions[expr.0].bake_ref_count(); + if min_ref_count <= expr_info.ref_count { + self.need_bake_expressions.insert(expr.0); + } + // if the expression is a Dot product with integer arguments, + // then the args needs baking as well + if let ( + fun_handle, + &Expression::Math { + fun: crate::MathFunction::Dot, + arg, + arg1, + .. + }, + ) = expr + { + let inner = info[fun_handle].ty.inner_with(&self.module.types); + if let TypeInner::Scalar { kind, .. } = *inner { + match kind { + crate::ScalarKind::Sint | crate::ScalarKind::Uint => { + self.need_bake_expressions.insert(arg); + self.need_bake_expressions.insert(arg1.unwrap()); + } + _ => {} + } + } + } + } + } + /// Helper method used to get a name for a global /// /// Globals have different naming schemes depending on their binding: @@ -1139,6 +1205,7 @@ impl<'a, W: Write> Writer<'a, W> { }; self.named_expressions.clear(); + self.update_expressions_to_bake(func, info); // Write the function header // @@ -1178,12 +1245,13 @@ impl<'a, W: Write> Writer<'a, W> { }; let arguments: Vec<_> = arguments .iter() - .filter(|arg| match self.module.types[arg.ty].inner { + .enumerate() + .filter(|&(_, arg)| match self.module.types[arg.ty].inner { TypeInner::Sampler { .. } => false, _ => true, }) .collect(); - self.write_slice(&arguments, |this, i, arg| { + self.write_slice(&arguments, |this, _, &(i, arg)| { // Write the argument type match this.module.types[arg.ty].inner { // We treat images separately because they might require @@ -1221,7 +1289,7 @@ impl<'a, W: Write> Writer<'a, W> { // Write the argument name // The leading space is important - write!(this.out, " {}", &this.names[&ctx.argument_key(i)])?; + write!(this.out, " {}", &this.names[&ctx.argument_key(i as u32)])?; Ok(()) })?; @@ -1388,6 +1456,33 @@ impl<'a, W: Write> Writer<'a, W> { Ok(()) } + /// Helper method used to output a dot product as an arithmetic expression + /// + fn write_dot_product( + &mut self, + arg: Handle, + arg1: Handle, + size: usize, + ) -> BackendResult { + write!(self.out, "(")?; + + let arg0_name = &self.named_expressions[&arg]; + let arg1_name = &self.named_expressions[&arg1]; + + // This will print an extra '+' at the beginning but that is fine in glsl + for index in 0..size { + let component = back::COMPONENTS[index]; + write!( + self.out, + " + {}.{} * {}.{}", + arg0_name, component, arg1_name, component + )?; + } + + write!(self.out, ")")?; + Ok(()) + } + /// Helper method used to write structs /// /// # Notes @@ -1465,7 +1560,7 @@ impl<'a, W: Write> Writer<'a, W> { Statement::Emit(ref range) => { for handle in range.clone() { let info = &ctx.info[handle]; - let ptr_class = info.ty.inner_with(&self.module.types).pointer_class(); + let ptr_class = info.ty.inner_with(&self.module.types).pointer_space(); let expr_name = if ptr_class.is_some() { // GLSL can't save a pointer-valued expression in a variable, // but we shouldn't ever need to: they should never be named expressions, @@ -1477,13 +1572,10 @@ impl<'a, W: Write> Writer<'a, W> { // Otherwise, we could accidentally write variable name instead of full expression. // Also, we use sanitized names! It defense backend from generating variable with name from reserved keywords. Some(self.namer.call(name)) + } else if self.need_bake_expressions.contains(&handle) { + Some(format!("{}{}", back::BAKE_PREFIX, handle.index())) } else { - let min_ref_count = ctx.expressions[handle].bake_ref_count(); - if min_ref_count <= info.ref_count { - Some(format!("{}{}", super::BAKE_PREFIX, handle.index())) - } else { - None - } + None }; if let Some(name) = expr_name { @@ -1755,13 +1847,18 @@ impl<'a, W: Write> Writer<'a, W> { // keyword which ceases all further processing in a fragment shader, it's called OpKill // in spir-v that's why it's called `Statement::Kill` Statement::Kill => writeln!(self.out, "{}discard;", level)?, - // Issue an execution or a memory barrier. + // Issue a memory barrier. Please note that to ensure visibility, + // OpenGL always requires a call to the `barrier()` function after a `memoryBarrier*()` Statement::Barrier(flags) => { - if flags.is_empty() { - writeln!(self.out, "{}barrier();", level)?; - } else { - writeln!(self.out, "{}groupMemoryBarrier();", level)?; + if flags.contains(crate::Barrier::STORAGE) { + writeln!(self.out, "{}memoryBarrierBuffer();", level)?; + } + + if flags.contains(crate::Barrier::WORK_GROUP) { + writeln!(self.out, "{}memoryBarrierShared();", level)?; } + + writeln!(self.out, "{}barrier();", level)?; } // Stores in glsl are just variable assignments written as `pointer = value;` Statement::Store { pointer, value } => { @@ -1801,7 +1898,7 @@ impl<'a, W: Write> Writer<'a, W> { } => { write!(self.out, "{}", level)?; if let Some(expr) = result { - let name = format!("{}{}", super::BAKE_PREFIX, expr.index()); + let name = format!("{}{}", back::BAKE_PREFIX, expr.index()); let result = self.module.functions[function].result.as_ref().unwrap(); self.write_type(result.ty)?; write!(self.out, " {} = ", name)?; @@ -1829,7 +1926,7 @@ impl<'a, W: Write> Writer<'a, W> { result, } => { write!(self.out, "{}", level)?; - let res_name = format!("{}{}", super::BAKE_PREFIX, result.index()); + let res_name = format!("{}{}", back::BAKE_PREFIX, result.index()); let res_ty = ctx.info[result].ty.inner_with(&self.module.types); self.write_value_type(res_ty)?; write!(self.out, " {} = ", res_name)?; @@ -1893,7 +1990,7 @@ impl<'a, W: Write> Writer<'a, W> { let base_ty_res = &ctx.info[base].ty; let mut resolved = base_ty_res.inner_with(&self.module.types); let base_ty_handle = match *resolved { - TypeInner::Pointer { base, class: _ } => { + TypeInner::Pointer { base, space: _ } => { resolved = &self.module.types[base].inner; Some(base) } @@ -1976,7 +2073,7 @@ impl<'a, W: Write> Writer<'a, W> { Expression::Load { pointer } => self.write_expr(pointer, ctx)?, // `ImageSample` is a bit complicated compared to the rest of the IR. // - // First there are three variations depending wether the sample level is explicitly set, + // First there are three variations depending whether the sample level is explicitly set, // if it's automatic or it it's bias: // `texture(image, coordinate)` - Automatic sample level // `texture(image, coordinate, bias)` - Bias sample level @@ -2101,7 +2198,11 @@ impl<'a, W: Write> Writer<'a, W> { // Zero needs level set to 0 crate::SampleLevel::Zero => { if workaround_lod_array_shadow_as_grad { - write!(self.out, ", vec2(0,0), vec2(0,0)")?; + let vec_dim = match dim { + crate::ImageDimension::Cube => 3, + _ => 2, + }; + write!(self.out, ", vec{}(0.0), vec{}(0.0)", vec_dim, vec_dim)?; } else if gather.is_none() { write!(self.out, ", 0.0")?; } @@ -2116,15 +2217,25 @@ impl<'a, W: Write> Writer<'a, W> { self.write_expr(expr, ctx)?; } } - crate::SampleLevel::Bias(expr) => { - write!(self.out, ", ")?; - self.write_expr(expr, ctx)?; + crate::SampleLevel::Bias(_) => { + // This needs to be done after the offset writing } crate::SampleLevel::Gradient { x, y } => { - write!(self.out, ", ")?; - self.write_expr(x, ctx)?; - write!(self.out, ", ")?; - self.write_expr(y, ctx)?; + // If we are using sampler2D to replace sampler1D, we also + // need to make sure to use vec2 gradients + if tex_1d_hack { + write!(self.out, ", vec2(")?; + self.write_expr(x, ctx)?; + write!(self.out, ", 0.0)")?; + write!(self.out, ", vec2(")?; + self.write_expr(y, ctx)?; + write!(self.out, ", 0.0)")?; + } else { + write!(self.out, ", ")?; + self.write_expr(x, ctx)?; + write!(self.out, ", ")?; + self.write_expr(y, ctx)?; + } } } @@ -2139,6 +2250,12 @@ impl<'a, W: Write> Writer<'a, W> { } } + // Bias is always the last argument + if let crate::SampleLevel::Bias(expr) = level { + write!(self.out, ", ")?; + self.write_expr(expr, ctx)?; + } + if let (Some(component), None) = (gather, depth_ref) { write!(self.out, ", {}", component as usize)?; } @@ -2158,7 +2275,8 @@ impl<'a, W: Write> Writer<'a, W> { image, coordinate, array_index, - index, + sample, + level, } => { // This will only panic if the module is invalid let (dim, class) = match *ctx.info[image].ty.inner_with(&self.module.types) { @@ -2184,9 +2302,9 @@ impl<'a, W: Write> Writer<'a, W> { write!(self.out, ", ")?; self.write_texture_coordinates(coordinate, array_index, dim, ctx)?; - if let Some(index_expr) = index { + if let Some(sample_or_level) = sample.or(level) { write!(self.out, ", ")?; - self.write_expr(index_expr, ctx)?; + self.write_expr(sample_or_level, ctx)?; } write!(self.out, ")")?; } @@ -2215,14 +2333,16 @@ impl<'a, W: Write> Writer<'a, W> { match query { crate::ImageQuery::Size { level } => { match class { - ImageClass::Sampled { .. } | ImageClass::Depth { .. } => { + ImageClass::Sampled { multi, .. } | ImageClass::Depth { multi } => { write!(self.out, "textureSize(")?; self.write_expr(image, ctx)?; - write!(self.out, ", ")?; if let Some(expr) = level { + write!(self.out, ", ")?; self.write_expr(expr, ctx)?; - } else { - write!(self.out, "0")?; + } else if !multi { + // All textureSize calls requires an lod argument + // except for multisampled samplers + write!(self.out, ", 0")?; } } ImageClass::Storage { .. } => { @@ -2247,8 +2367,14 @@ impl<'a, W: Write> Writer<'a, W> { }; write!(self.out, "{}(", fun_name)?; self.write_expr(image, ctx)?; + // All textureSize calls requires an lod argument + // except for multisampled samplers + if class.is_multisampled() { + write!(self.out, ", 0")?; + } + write!(self.out, ")")?; if components != 1 || self.options.version.is_es() { - write!(self.out, ", 0).{}", back::COMPONENTS[components])?; + write!(self.out, ".{}", back::COMPONENTS[components])?; } } crate::ImageQuery::NumSamples => { @@ -2393,7 +2519,7 @@ impl<'a, W: Write> Writer<'a, W> { write!(self.out, "(")?; self.write_expr(left, ctx)?; - write!(self.out, " {} ", super::binary_operation_str(op))?; + write!(self.out, " {} ", back::binary_operation_str(op))?; self.write_expr(right, ctx)?; write!(self.out, ")")?; @@ -2520,7 +2646,18 @@ impl<'a, W: Write> Writer<'a, W> { Mf::Log2 => "log2", Mf::Pow => "pow", // geometry - Mf::Dot => "dot", + Mf::Dot => match *ctx.info[arg].ty.inner_with(&self.module.types) { + crate::TypeInner::Vector { + kind: crate::ScalarKind::Float, + .. + } => "dot", + crate::TypeInner::Vector { size, .. } => { + return self.write_dot_product(arg, arg1.unwrap(), size as usize) + } + _ => unreachable!( + "Correct TypeInner for dot product should be already validated" + ), + }, Mf::Outer => "outerProduct", Mf::Cross => "cross", Mf::Distance => "distance", @@ -2651,7 +2788,7 @@ impl<'a, W: Write> Writer<'a, W> { let source_kind = inner.scalar_kind().unwrap(); let conv_op = match (source_kind, target_kind) { (Sk::Float, Sk::Sint) => "floatBitsToInt", - (Sk::Float, Sk::Uint) => "floatBitsToUInt", + (Sk::Float, Sk::Uint) => "floatBitsToUint", (Sk::Sint, Sk::Float) => "intBitsToFloat", (Sk::Uint, Sk::Float) => "uintBitsToFloat", // There is no way to bitcast between Uint/Sint in glsl. Use constructor conversion @@ -2705,22 +2842,27 @@ impl<'a, W: Write> Writer<'a, W> { ) -> Result<(), Error> { use crate::ImageDimension as IDim; + let tex_1d_hack = dim == IDim::D1 && self.options.version.is_es(); match array_index { Some(layer_expr) => { - let tex_coord_type = match dim { - IDim::D1 => "ivec2", - IDim::D2 => "ivec3", - IDim::D3 => "ivec4", - IDim::Cube => "ivec4", + let tex_coord_size = match dim { + IDim::D1 => 2, + IDim::D2 => 3, + IDim::D3 => 4, + IDim::Cube => 4, }; - write!(self.out, "{}(", tex_coord_type)?; + write!(self.out, "ivec{}(", tex_coord_size + tex_1d_hack as u8)?; self.write_expr(coordinate, ctx)?; write!(self.out, ", ")?; + // If we are replacing sampler1D with sampler2D we also need + // to add another zero to the coordinates vector for the y component + if tex_1d_hack { + write!(self.out, "0, ")?; + } self.write_expr(layer_expr, ctx)?; write!(self.out, ")")?; } None => { - let tex_1d_hack = dim == IDim::D1 && self.options.version.is_es(); if tex_1d_hack { write!(self.out, "ivec2(")?; } @@ -2852,10 +2994,6 @@ impl<'a, W: Write> Writer<'a, W> { } /// Helper method used to produce the reflection info that's returned to the user - /// - /// It takes an iterator of [`Function`](crate::Function) references instead of - /// [`Handle`](crate::arena::Handle) because [`EntryPoint`](crate::EntryPoint) isn't in any - /// [`Arena`](crate::arena::Arena) and we need to traverse it fn collect_reflection_info(&self) -> Result { use std::collections::hash_map::Entry; let info = self.info.get_entry_point(self.entry_point_idx as usize); @@ -2886,8 +3024,8 @@ impl<'a, W: Write> Writer<'a, W> { continue; } match self.module.types[var.ty].inner { - crate::TypeInner::Struct { .. } => match var.class { - crate::StorageClass::Uniform | crate::StorageClass::Storage { .. } => { + crate::TypeInner::Struct { .. } => match var.space { + crate::AddressSpace::Uniform | crate::AddressSpace::Storage { .. } => { let name = self.reflection_names_globals[&handle].clone(); uniforms.insert(handle, name); } @@ -3010,18 +3148,18 @@ fn glsl_built_in(built_in: crate::BuiltIn, output: bool) -> &'static str { } } -/// Helper function that returns the string corresponding to the storage class -fn glsl_storage_class(class: crate::StorageClass) -> Option<&'static str> { - use crate::StorageClass as Sc; - - match class { - Sc::Function => None, - Sc::Private => None, - Sc::Storage { .. } => Some("buffer"), - Sc::Uniform => Some("uniform"), - Sc::Handle => Some("uniform"), - Sc::WorkGroup => Some("shared"), - Sc::PushConstant => None, +/// Helper function that returns the string corresponding to the address space +fn glsl_storage_class(space: crate::AddressSpace) -> Option<&'static str> { + use crate::AddressSpace as As; + + match space { + As::Function => None, + As::Private => None, + As::Storage { .. } => Some("buffer"), + As::Uniform => Some("uniform"), + As::Handle => Some("uniform"), + As::WorkGroup => Some("shared"), + As::PushConstant => Some("uniform"), } } diff --git a/third_party/rust/naga/src/back/hlsl/help.rs b/third_party/rust/naga/src/back/hlsl/help.rs index 4d9265d727558..91553a508bd04 100644 --- a/third_party/rust/naga/src/back/hlsl/help.rs +++ b/third_party/rust/naga/src/back/hlsl/help.rs @@ -1,28 +1,30 @@ -//! Helpers for the hlsl backend -//! -//! Important note about `Expression::ImageQuery`/`Expression::ArrayLength` and hlsl backend: -//! -//! Due to implementation of `GetDimensions` function in hlsl () -//! backend can't work with it as an expression. -//! Instead, it generates a unique wrapped function per `Expression::ImageQuery`, based on texure info and query function. -//! See `WrappedImageQuery` struct that represents a unique function and will be generated before writing all statements and expressions. -//! This allowed to works with `Expression::ImageQuery` as expression and write wrapped function. -//! -//! For example: -//! ```wgsl -//! let dim_1d = textureDimensions(image_1d); -//! ``` -//! -//! ```hlsl -//! int NagaDimensions1D(Texture1D) -//! { -//! uint4 ret; -//! image_1d.GetDimensions(ret.x); -//! return ret.x; -//! } -//! -//! int dim_1d = NagaDimensions1D(image_1d); -//! ``` +/*! +Helpers for the hlsl backend + +Important note about `Expression::ImageQuery`/`Expression::ArrayLength` and hlsl backend: + +Due to implementation of `GetDimensions` function in hlsl () +backend can't work with it as an expression. +Instead, it generates a unique wrapped function per `Expression::ImageQuery`, based on texure info and query function. +See `WrappedImageQuery` struct that represents a unique function and will be generated before writing all statements and expressions. +This allowed to works with `Expression::ImageQuery` as expression and write wrapped function. + +For example: +```wgsl +let dim_1d = textureDimensions(image_1d); +``` + +```hlsl +int NagaDimensions1D(Texture1D) +{ + uint4 ret; + image_1d.GetDimensions(ret.x); + return ret.x; +} + +int dim_1d = NagaDimensions1D(image_1d); +``` +*/ use super::{super::FunctionCtx, BackendResult, Error}; use crate::{arena::Handle, proc::NameKey}; @@ -99,13 +101,6 @@ impl From for ImageQuery { } } -#[derive(Clone, Copy, PartialEq)] -pub(super) enum MipLevelCoordinate { - NotApplicable, - Zero, - Expression(Handle), -} - impl<'a, W: Write> super::Writer<'a, W> { pub(super) fn write_image_type( &mut self, @@ -430,6 +425,7 @@ impl<'a, W: Write> super::Writer<'a, W> { match func_ctx.expressions[handle] { crate::Expression::ArrayLength(expr) => { let global_expr = match func_ctx.expressions[expr] { + crate::Expression::GlobalVariable(_) => expr, crate::Expression::AccessIndex { base, index: _ } => base, ref other => unreachable!("Array length of {:?}", other), }; @@ -439,8 +435,8 @@ impl<'a, W: Write> super::Writer<'a, W> { } ref other => unreachable!("Array length of base {:?}", other), }; - let storage_access = match global_var.class { - crate::StorageClass::Storage { access } => access, + let storage_access = match global_var.space { + crate::AddressSpace::Storage { access } => access, _ => crate::StorageAccess::default(), }; let wal = WrappedArrayLength { @@ -494,13 +490,12 @@ impl<'a, W: Write> super::Writer<'a, W> { kind: &str, coordinate: Handle, array_index: Option>, - mip_level: MipLevelCoordinate, + mip_level: Option>, module: &crate::Module, func_ctx: &FunctionCtx, ) -> BackendResult { // HLSL expects the array index to be merged with the coordinate - let extra = array_index.is_some() as usize - + (mip_level != MipLevelCoordinate::NotApplicable) as usize; + let extra = array_index.is_some() as usize + (mip_level.is_some()) as usize; if extra == 0 { self.write_expr(module, coordinate, func_ctx)?; } else { @@ -515,15 +510,9 @@ impl<'a, W: Write> super::Writer<'a, W> { write!(self.out, ", ")?; self.write_expr(module, expr, func_ctx)?; } - match mip_level { - MipLevelCoordinate::NotApplicable => {} - MipLevelCoordinate::Zero => { - write!(self.out, ", 0")?; - } - MipLevelCoordinate::Expression(expr) => { - write!(self.out, ", ")?; - self.write_expr(module, expr, func_ctx)?; - } + if let Some(expr) = mip_level { + write!(self.out, ", ")?; + self.write_expr(module, expr, func_ctx)?; } write!(self.out, ")")?; } diff --git a/third_party/rust/naga/src/back/hlsl/keywords.rs b/third_party/rust/naga/src/back/hlsl/keywords.rs index e322c98af103e..7519b767a10ef 100644 --- a/third_party/rust/naga/src/back/hlsl/keywords.rs +++ b/third_party/rust/naga/src/back/hlsl/keywords.rs @@ -1,6 +1,9 @@ -//! HLSL Reserved Words -//! - -//! - +/*! +HLSL Reserved Words +- +- +*/ + pub const RESERVED: &[&str] = &[ "AppendStructuredBuffer", "asm", diff --git a/third_party/rust/naga/src/back/hlsl/mod.rs b/third_party/rust/naga/src/back/hlsl/mod.rs index 693b001827bbc..6f6339d4300a5 100644 --- a/third_party/rust/naga/src/back/hlsl/mod.rs +++ b/third_party/rust/naga/src/back/hlsl/mod.rs @@ -1,21 +1,25 @@ -//! HLSL shading language backend -//! -//! # Supported shader model versions: -//! - 5.0 -//! - 5.1 -//! - 6.0 -//! -//! All matrix construction/deconstruction is row based in HLSL. This means that when -//! we construct a matrix from column vectors, our matrix will be implicitly transposed. -//! The inverse transposition happens when we call `[0]` to get the zeroth column vector. -//! -//! Because all of our matrices are implicitly transposed, we flip arguments to `mul`. `mat * vec` -//! becomes `vec * mat`, etc. This acts as the inverse transpose making the results identical. -//! -//! The only time we don't get this implicit transposition is when reading matrices from Uniforms/Push Constants. -//! To deal with this, we add `row_major` to all declarations of matrices in Uniforms/Push Constants. -//! -//! Finally because all of our matrices are transposed, if you use `mat3x4`, it'll become `float4x3` in HLSL. +/*! +Backend for [HLSL][hlsl] (High-Level Shading Language). + +# Supported shader model versions: +- 5.0 +- 5.1 +- 6.0 + +All matrix construction/deconstruction is row based in HLSL. This means that when +we construct a matrix from column vectors, our matrix will be implicitly transposed. +The inverse transposition happens when we call `[0]` to get the zeroth column vector. + +Because all of our matrices are implicitly transposed, we flip arguments to `mul`. `mat * vec` +becomes `vec * mat`, etc. This acts as the inverse transpose making the results identical. + +The only time we don't get this implicit transposition is when reading matrices from Uniforms/Push Constants. +To deal with this, we add `row_major` to all declarations of matrices in Uniforms/Push Constants. + +Finally because all of our matrices are transposed, if you use `mat3x4`, it'll become `float4x3` in HLSL. + +[hlsl]: https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl +*/ mod conv; mod help; @@ -92,7 +96,7 @@ pub enum EntryPointError { MissingBinding(crate::ResourceBinding), } -/// Structure that contains the configuration used in the [`Writer`](Writer) +/// Configuration used in the [`Writer`]. #[derive(Clone, Debug, Hash, PartialEq, Eq)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] @@ -135,14 +139,15 @@ impl Options { } } -/// Structure that contains a reflection info +/// Reflection info for entry point names. #[derive(Default)] pub struct ReflectionInfo { - /// Mapping of the entry point names. Each item in the array - /// corresponds to an entry point index. The real entry point name may be different if one of the + /// Mapping of the entry point names. + /// + /// Each item in the array corresponds to an entry point index. The real entry point name may be different if one of the /// reserved words are used. /// - ///Note: Some entry points may fail translation because of missing bindings. + /// Note: Some entry points may fail translation because of missing bindings. pub entry_point_names: Vec>, } diff --git a/third_party/rust/naga/src/back/hlsl/storage.rs b/third_party/rust/naga/src/back/hlsl/storage.rs index b235a061fb1bb..4abe663509d36 100644 --- a/third_party/rust/naga/src/back/hlsl/storage.rs +++ b/third_party/rust/naga/src/back/hlsl/storage.rs @@ -1,6 +1,8 @@ -//! Logic related to `ByteAddressBuffer` operations. -//! -//! HLSL backend uses byte address buffers for all storage buffers in IR. +/*! +Logic related to `ByteAddressBuffer` operations. + +HLSL backend uses byte address buffers for all storage buffers in IR. +*/ use super::{super::FunctionCtx, BackendResult, Error}; use crate::{ @@ -148,7 +150,7 @@ impl super::Writer<'_, W> { } => { write!(self.out, "{{")?; let count = module.constants[const_handle].to_array_length().unwrap(); - let stride = module.types[base].inner.span(&module.constants); + let stride = module.types[base].inner.size(&module.constants); let iter = (0..count).map(|i| (TypeResolution::Handle(base), stride * i)); self.write_storage_load_sequence(module, var_handle, iter, func_ctx)?; write!(self.out, "}}")?; @@ -311,7 +313,7 @@ impl super::Writer<'_, W> { writeln!(self.out, ";")?; // then iterate the stores let count = module.constants[const_handle].to_array_length().unwrap(); - let stride = module.types[base].inner.span(&module.constants); + let stride = module.types[base].inner.size(&module.constants); for i in 0..count { self.temp_access_chain.push(SubAccess::Offset(i * stride)); let sv = StoreValue::TempIndex { diff --git a/third_party/rust/naga/src/back/hlsl/writer.rs b/third_party/rust/naga/src/back/hlsl/writer.rs index 412e36d15b822..fce74ee91fa7e 100644 --- a/third_party/rust/naga/src/back/hlsl/writer.rs +++ b/third_party/rust/naga/src/back/hlsl/writer.rs @@ -1,5 +1,5 @@ use super::{ - help::{MipLevelCoordinate, WrappedArrayLength, WrappedConstructor, WrappedImageQuery}, + help::{WrappedArrayLength, WrappedConstructor, WrappedImageQuery}, storage::StoreValue, BackendResult, Error, Options, }; @@ -540,25 +540,25 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { } // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-variable-register - let register_ty = match global.class { - crate::StorageClass::Function => unreachable!("Function storage class"), - crate::StorageClass::Private => { + let register_ty = match global.space { + crate::AddressSpace::Function => unreachable!("Function address space"), + crate::AddressSpace::Private => { write!(self.out, "static ")?; self.write_type(module, global.ty)?; "" } - crate::StorageClass::WorkGroup => { + crate::AddressSpace::WorkGroup => { write!(self.out, "groupshared ")?; self.write_type(module, global.ty)?; "" } - crate::StorageClass::Uniform => { + crate::AddressSpace::Uniform => { // constant buffer declarations are expected to be inlined, e.g. // `cbuffer foo: register(b0) { field1: type1; }` write!(self.out, "cbuffer")?; "b" } - crate::StorageClass::Storage { access } => { + crate::AddressSpace::Storage { access } => { let (prefix, register) = if access.contains(crate::StorageAccess::STORE) { ("RW", "u") } else { @@ -567,7 +567,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { write!(self.out, "{}ByteAddressBuffer", prefix)?; register } - crate::StorageClass::Handle => { + crate::AddressSpace::Handle => { let register = match *inner { TypeInner::Sampler { .. } => "s", // all storage textures are UAV, unconditionally @@ -580,14 +580,11 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { self.write_type(module, global.ty)?; register } - crate::StorageClass::PushConstant => unimplemented!("Push constants"), + crate::AddressSpace::PushConstant => unimplemented!("Push constants"), }; let name = &self.names[&NameKey::GlobalVariable(handle)]; write!(self.out, " {}", name)?; - if let TypeInner::Array { size, .. } = module.types[global.ty].inner { - self.write_array_size(module, size)?; - } if let Some(ref binding) = global.binding { // this was already resolved earlier when we started evaluating an entry point. @@ -597,20 +594,31 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { write!(self.out, ", space{}", bt.space)?; } write!(self.out, ")")?; - } else if global.class == crate::StorageClass::Private { - write!(self.out, " = ")?; - if let Some(init) = global.init { - self.write_constant(module, init)?; - } else { - self.write_default_init(module, global.ty)?; + } else { + // need to write the array size if the type was emitted with `write_type` + if let TypeInner::Array { size, .. } = module.types[global.ty].inner { + self.write_array_size(module, size)?; + } + if global.space == crate::AddressSpace::Private { + write!(self.out, " = ")?; + if let Some(init) = global.init { + self.write_constant(module, init)?; + } else { + self.write_default_init(module, global.ty)?; + } } } - if global.class == crate::StorageClass::Uniform { + if global.space == crate::AddressSpace::Uniform { write!(self.out, " {{ ")?; self.write_type(module, global.ty)?; - let name = &self.names[&NameKey::GlobalVariable(handle)]; - writeln!(self.out, " {}; }}", name)?; + let sub_name = &self.names[&NameKey::GlobalVariable(handle)]; + write!(self.out, " {}", sub_name)?; + // need to write the array size if the type was emitted with `write_type` + if let TypeInner::Array { size, .. } = module.types[global.ty].inner { + self.write_array_size(module, size)?; + } + writeln!(self.out, "; }}")?; } else { writeln!(self.out, ";")?; } @@ -1028,7 +1036,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { Statement::Emit(ref range) => { for handle in range.clone() { let info = &func_ctx.info[handle]; - let ptr_class = info.ty.inner_with(&module.types).pointer_class(); + let ptr_class = info.ty.inner_with(&module.types).pointer_space(); let expr_name = if ptr_class.is_some() { // HLSL can't save a pointer-valued expression in a variable, // but we shouldn't ever need to: they should never be named expressions, @@ -1103,7 +1111,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { Statement::Return { value: Some(expr) } => { let base_ty_res = &func_ctx.info[expr].ty; let mut resolved = base_ty_res.inner_with(&module.types); - if let TypeInner::Pointer { base, class: _ } = *resolved { + if let TypeInner::Pointer { base, space: _ } = *resolved { resolved = &module.types[base].inner; } @@ -1167,7 +1175,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { _ => None, }; - if let Some(crate::StorageClass::Storage { .. }) = ty_inner.pointer_class() { + if let Some(crate::AddressSpace::Storage { .. }) = ty_inner.pointer_space() { let var_handle = self.fill_access_chain(module, pointer, func_ctx)?; self.write_storage_store( module, @@ -1512,10 +1520,10 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { write!(self.out, ")")?; } Expression::Access { base, index } => { - if let Some(crate::StorageClass::Storage { .. }) = func_ctx.info[expr] + if let Some(crate::AddressSpace::Storage { .. }) = func_ctx.info[expr] .ty .inner_with(&module.types) - .pointer_class() + .pointer_space() { // do nothing, the chain is written on `Load`/`Store` } else { @@ -1526,10 +1534,10 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { } } Expression::AccessIndex { base, index } => { - if let Some(crate::StorageClass::Storage { .. }) = func_ctx.info[expr] + if let Some(crate::AddressSpace::Storage { .. }) = func_ctx.info[expr] .ty .inner_with(&module.types) - .pointer_class() + .pointer_space() { // do nothing, the chain is written on `Load`/`Store` } else { @@ -1538,7 +1546,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { let base_ty_res = &func_ctx.info[base].ty; let mut resolved = base_ty_res.inner_with(&module.types); let base_ty_handle = match *resolved { - TypeInner::Pointer { base, class: _ } => { + TypeInner::Pointer { base, space: _ } => { resolved = &module.types[base].inner; Some(base) } @@ -1621,7 +1629,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { "float", coordinate, array_index, - MipLevelCoordinate::NotApplicable, + None, module, func_ctx, )?; @@ -1686,42 +1694,25 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { image, coordinate, array_index, - index, + sample, + level, } => { // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-load - let (ms, storage) = match *func_ctx.info[image].ty.inner_with(&module.types) { - TypeInner::Image { class, .. } => match class { - crate::ImageClass::Sampled { multi, .. } - | crate::ImageClass::Depth { multi } => (multi, false), - crate::ImageClass::Storage { .. } => (false, true), - }, - _ => (false, false), - }; - self.write_expr(module, image, func_ctx)?; write!(self.out, ".Load(")?; - let mip_level = if ms || storage { - MipLevelCoordinate::NotApplicable - } else { - match index { - Some(expr) => MipLevelCoordinate::Expression(expr), - None => MipLevelCoordinate::Zero, - } - }; - self.write_texture_coordinates( "int", coordinate, array_index, - mip_level, + level, module, func_ctx, )?; - if ms { + if let Some(sample) = sample { write!(self.out, ", ")?; - self.write_expr(module, index.unwrap(), func_ctx)?; + self.write_expr(module, sample, func_ctx)?; } // close bracket for Load function @@ -1733,8 +1724,8 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { write!(self.out, ".x")?; } } - Expression::GlobalVariable(handle) => match module.global_variables[handle].class { - crate::StorageClass::Storage { .. } => {} + Expression::GlobalVariable(handle) => match module.global_variables[handle].space { + crate::AddressSpace::Storage { .. } => {} _ => { let name = &self.names[&NameKey::GlobalVariable(handle)]; write!(self.out, "{}", name)?; @@ -1747,9 +1738,9 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { match func_ctx.info[pointer] .ty .inner_with(&module.types) - .pointer_class() + .pointer_space() { - Some(crate::StorageClass::Storage { .. }) => { + Some(crate::AddressSpace::Storage { .. }) => { let var_handle = self.fill_access_chain(module, pointer, func_ctx)?; let result_ty = func_ctx.info[expr].ty.clone(); self.write_storage_load(module, var_handle, result_ty, func_ctx)?; @@ -1760,10 +1751,21 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { } } Expression::Unary { op, expr } => { + use crate::{ScalarKind as Sk, UnaryOperator as Uo}; // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#unary-operators let op_str = match op { - crate::UnaryOperator::Negate => "-", - crate::UnaryOperator::Not => "!", + Uo::Negate => "-", + Uo::Not => match *func_ctx.info[expr].ty.inner_with(&module.types) { + TypeInner::Scalar { kind: Sk::Sint, .. } => "~", + TypeInner::Scalar { kind: Sk::Uint, .. } => "~", + TypeInner::Scalar { kind: Sk::Bool, .. } => "!", + ref other => { + return Err(Error::Custom(format!( + "Cannot apply not to type {:?}", + other + ))) + } + }, }; write!(self.out, "{}", op_str)?; self.write_expr(module, expr, func_ctx)?; @@ -1946,8 +1948,8 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { _ => unreachable!(), }; - let storage_access = match var.class { - crate::StorageClass::Storage { access } => access, + let storage_access = match var.space { + crate::AddressSpace::Storage { access } => access, _ => crate::StorageAccess::default(), }; let wrapped_array_length = WrappedArrayLength { diff --git a/third_party/rust/naga/src/back/mod.rs b/third_party/rust/naga/src/back/mod.rs index 571289a79b67b..9802e5acfe366 100644 --- a/third_party/rust/naga/src/back/mod.rs +++ b/third_party/rust/naga/src/back/mod.rs @@ -1,4 +1,7 @@ -//! Functions which export shader modules into binary and text formats. +/*! +Backend functions that export shader [`Module`](super::Module)s into binary and text formats. +*/ +#![allow(dead_code)] // can be dead if none of the enabled backends need it #[cfg(feature = "dot-out")] pub mod dot; @@ -13,25 +16,21 @@ pub mod spv; #[cfg(feature = "wgsl-out")] pub mod wgsl; -#[allow(dead_code)] const COMPONENTS: &[char] = &['x', 'y', 'z', 'w']; -#[allow(dead_code)] const INDENT: &str = " "; -#[allow(dead_code)] const BAKE_PREFIX: &str = "_e"; +type NeedBakeExpressions = crate::FastHashSet>; + #[derive(Clone, Copy)] -#[allow(dead_code)] struct Level(usize); -#[allow(dead_code)] impl Level { fn next(&self) -> Self { Level(self.0 + 1) } } -#[allow(dead_code)] impl std::fmt::Display for Level { fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { (0..self.0).try_for_each(|_| formatter.write_str(INDENT)) @@ -41,7 +40,6 @@ impl std::fmt::Display for Level { /// Stores the current function type (either a regular function or an entry point) /// /// Also stores data needed to identify it (handle for a regular function or index for an entry point) -#[allow(dead_code)] enum FunctionType { /// A regular function and it's handle Function(crate::Handle), @@ -50,7 +48,6 @@ enum FunctionType { } /// Helper structure that stores data needed when writing the function -#[allow(dead_code)] struct FunctionCtx<'a> { /// The current function being written ty: FunctionType, @@ -62,7 +59,6 @@ struct FunctionCtx<'a> { named_expressions: &'a crate::NamedExpressions, } -#[allow(dead_code)] impl<'a> FunctionCtx<'_> { /// Helper method that generates a [`NameKey`](crate::proc::NameKey) for a local in the current function fn name_key(&self, local: crate::Handle) -> crate::proc::NameKey { @@ -132,7 +128,6 @@ impl crate::Expression { /// See the [module-level documentation][emit] for details. /// /// [emit]: index.html#expression-evaluation-time - #[allow(dead_code)] fn bake_ref_count(&self) -> usize { match *self { // accesses are never cached, only loads are @@ -154,7 +149,6 @@ impl crate::Expression { /// Helper function that returns the string corresponding to the [`BinaryOperator`](crate::BinaryOperator) /// # Notes /// Used by `glsl-out`, `msl-out`, `wgsl-out`, `hlsl-out`. -#[allow(dead_code)] fn binary_operation_str(op: crate::BinaryOperator) -> &'static str { use crate::BinaryOperator as Bo; match op { @@ -182,7 +176,6 @@ fn binary_operation_str(op: crate::BinaryOperator) -> &'static str { /// Helper function that returns the string corresponding to the [`VectorSize`](crate::VectorSize) /// # Notes /// Used by `msl-out`, `wgsl-out`, `hlsl-out`. -#[allow(dead_code)] fn vector_size_str(size: crate::VectorSize) -> &'static str { match size { crate::VectorSize::Bi => "2", @@ -192,7 +185,6 @@ fn vector_size_str(size: crate::VectorSize) -> &'static str { } impl crate::TypeInner { - #[allow(unused)] fn is_handle(&self) -> bool { match *self { crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } => true, @@ -202,9 +194,9 @@ impl crate::TypeInner { } impl crate::Statement { - /// Returns true if the statement directly terminates the current block + /// Returns true if the statement directly terminates the current block. /// - /// Used to decided wether case blocks require a explicit `break` + /// Used to decide whether case blocks require a explicit `break`. pub fn is_terminator(&self) -> bool { match *self { crate::Statement::Break diff --git a/third_party/rust/naga/src/back/msl/keywords.rs b/third_party/rust/naga/src/back/msl/keywords.rs index a62113c097ad8..a3a9c52dcc65e 100644 --- a/third_party/rust/naga/src/back/msl/keywords.rs +++ b/third_party/rust/naga/src/back/msl/keywords.rs @@ -18,6 +18,7 @@ pub const RESERVED: &[&str] = &[ "bool", "char", "int", + "uint", "long", "float", "double", @@ -212,4 +213,5 @@ pub const RESERVED: &[&str] = &[ "M_SQRT1_2", // Naga utilities "DefaultConstructible", + "clamped_lod_e", ]; diff --git a/third_party/rust/naga/src/back/msl/mod.rs b/third_party/rust/naga/src/back/msl/mod.rs index 4295ae0e951c7..0a95e8cf91d84 100644 --- a/third_party/rust/naga/src/back/msl/mod.rs +++ b/third_party/rust/naga/src/back/msl/mod.rs @@ -1,4 +1,5 @@ -/*! Metal Shading Language (MSL) backend +/*! +Backend for [MSL][msl] (Metal Shading Language). ## Binding model @@ -21,7 +22,9 @@ pretend that MSL doesn't have all the restrictions it has. For the result type, if it's a structure, we re-compose it with a temporary value holding the result. -!*/ + +[msl]: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf +*/ use crate::{arena::Handle, proc::index, valid::ModuleInfo}; use std::{ @@ -141,6 +144,8 @@ pub enum Error { UnsupportedBuiltIn(crate::BuiltIn), #[error("capability {0:?} is not supported")] CapabilityNotSupported(crate::valid::Capabilities), + #[error("address space {0:?} is not supported for target MSL version")] + UnsupportedAddressSpace(crate::AddressSpace), } #[derive(Clone, Debug, PartialEq, thiserror::Error)] @@ -185,7 +190,7 @@ pub struct Options { impl Default for Options { fn default() -> Self { Options { - lang_version: (1, 1), + lang_version: (2, 0), per_stage_map: PerStageMap::default(), inline_samplers: Vec::new(), spirv_cross_compatibility: false, @@ -195,24 +200,17 @@ impl Default for Options { } } -// A subset of options that are meant to be changed per pipeline. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +/// A subset of options that are meant to be changed per pipeline. +#[derive(Debug, Default, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub struct PipelineOptions { /// Allow `BuiltIn::PointSize` in the vertex shader. + /// /// Metal doesn't like this for non-point primitive topologies. pub allow_point_size: bool, } -impl Default for PipelineOptions { - fn default() -> Self { - PipelineOptions { - allow_point_size: true, - } - } -} - impl Options { fn resolve_local_binding( &self, @@ -389,11 +387,10 @@ impl ResolvedBinding { Ok(()) } - fn try_fmt_decorated(&self, out: &mut W, terminator: &str) -> Result<(), Error> { + fn try_fmt_decorated(&self, out: &mut W) -> Result<(), Error> { write!(out, " [[")?; self.try_fmt(out)?; write!(out, "]]")?; - write!(out, "{}", terminator)?; Ok(()) } } diff --git a/third_party/rust/naga/src/back/msl/writer.rs b/third_party/rust/naga/src/back/msl/writer.rs index dd4e93b2229bd..3fd0355a3c4b8 100644 --- a/third_party/rust/naga/src/back/msl/writer.rs +++ b/third_party/rust/naga/src/back/msl/writer.rs @@ -25,6 +25,49 @@ const WRAPPED_ARRAY_FIELD: &str = "inner"; // Some more general handling of pointers is needed to be implemented here. const ATOMIC_REFERENCE: &str = "&"; +/// Write the Metal name for a Naga numeric type: scalar, vector, or matrix. +/// +/// The `sizes` slice determines whether this function writes a +/// scalar, vector, or matrix type: +/// +/// - An empty slice produces a scalar type. +/// - A one-element slice produces a vector type. +/// - A two element slice `[ROWS COLUMNS]` produces a matrix of the given size. +fn put_numeric_type( + out: &mut impl Write, + kind: crate::ScalarKind, + sizes: &[crate::VectorSize], +) -> Result<(), FmtError> { + match (kind, sizes) { + (kind, &[]) => { + write!(out, "{}", kind.to_msl_name()) + } + (kind, &[rows]) => { + write!( + out, + "{}::{}{}", + NAMESPACE, + kind.to_msl_name(), + back::vector_size_str(rows) + ) + } + (kind, &[rows, columns]) => { + write!( + out, + "{}::{}{}x{}", + NAMESPACE, + kind.to_msl_name(), + back::vector_size_str(columns), + back::vector_size_str(rows) + ) + } + (_, _) => Ok(()), // not meaningful + } +} + +/// Prefix for cached clamped level-of-detail values for `ImageLoad` expressions. +const CLAMPED_LOD_LOAD_PREFIX: &str = "clamped_lod_e"; + struct TypeContext<'a> { handle: Handle, arena: &'a crate::UniqueArena, @@ -42,80 +85,42 @@ impl<'a> Display for TypeContext<'a> { } match ty.inner { - crate::TypeInner::Scalar { kind, .. } => { - match kind { - // work around Metal toolchain bug with `uint` typedef - crate::ScalarKind::Uint => write!(out, "{}::uint", NAMESPACE), - _ => { - let kind_str = kind.to_msl_name(); - write!(out, "{}", kind_str) - } - } - } + crate::TypeInner::Scalar { kind, .. } => put_numeric_type(out, kind, &[]), crate::TypeInner::Atomic { kind, .. } => { write!(out, "{}::atomic_{}", NAMESPACE, kind.to_msl_name()) } - crate::TypeInner::Vector { size, kind, .. } => { - write!( - out, - "{}::{}{}", - NAMESPACE, - kind.to_msl_name(), - back::vector_size_str(size), - ) - } + crate::TypeInner::Vector { size, kind, .. } => put_numeric_type(out, kind, &[size]), crate::TypeInner::Matrix { columns, rows, .. } => { - write!( - out, - "{}::{}{}x{}", - NAMESPACE, - crate::ScalarKind::Float.to_msl_name(), - back::vector_size_str(columns), - back::vector_size_str(rows), - ) + put_numeric_type(out, crate::ScalarKind::Float, &[rows, columns]) } - crate::TypeInner::Pointer { base, class } => { + crate::TypeInner::Pointer { base, space } => { let sub = Self { handle: base, first_time: false, ..*self }; - let class_name = match class.to_msl_name() { + let space_name = match space.to_msl_name() { Some(name) => name, None => return Ok(()), }; - write!(out, "{} {}&", class_name, sub) + write!(out, "{} {}&", space_name, sub) } crate::TypeInner::ValuePointer { - size: None, + size, kind, width: _, - class, + space, } => { - let class_name = match class.to_msl_name() { - Some(name) => name, + match space.to_msl_name() { + Some(name) => write!(out, "{} ", name)?, None => return Ok(()), }; - write!(out, "{} {}&", class_name, kind.to_msl_name(),) - } - crate::TypeInner::ValuePointer { - size: Some(size), - kind, - width: _, - class, - } => { - let class_name = match class.to_msl_name() { - Some(name) => name, - None => return Ok(()), + match size { + Some(rows) => put_numeric_type(out, kind, &[rows])?, + None => put_numeric_type(out, kind, &[])?, }; - write!( - out, - "{} {}::{}{}&", - class_name, - NAMESPACE, - kind.to_msl_name(), - back::vector_size_str(size), - ) + + write!(out, "&") } crate::TypeInner::Array { base, .. } => { let sub = Self { @@ -213,8 +218,8 @@ impl<'a> TypedGlobalVariable<'a> { let var = &self.module.global_variables[self.handle]; let name = &self.names[&NameKey::GlobalVariable(self.handle)]; - let storage_access = match var.class { - crate::StorageClass::Storage { access } => access, + let storage_access = match var.space { + crate::AddressSpace::Storage { access } => access, _ => match self.module.types[var.ty].inner { crate::TypeInner::Image { class: crate::ImageClass::Storage { access, .. }, @@ -231,15 +236,14 @@ impl<'a> TypedGlobalVariable<'a> { first_time: false, }; - let (space, access, reference) = match var.class.to_msl_name() { + let (space, access, reference) = match var.space.to_msl_name() { Some(space) if self.reference => { - let access = match var.class { - crate::StorageClass::Private | crate::StorageClass::WorkGroup - if !self.usage.contains(valid::GlobalUse::WRITE) => - { - "const" - } - _ => "", + let access = if var.space.needs_access_qualifier() + && !self.usage.contains(valid::GlobalUse::WRITE) + { + "const" + } else { + "" }; (space, access, "&") } @@ -308,6 +312,8 @@ pub struct Writer { out: W, names: FastHashMap, named_expressions: crate::NamedExpressions, + /// Set of expressions that need to be baked to avoid unnecessary repetition in output + need_bake_expressions: back::NeedBakeExpressions, namer: proc::Namer, #[cfg(test)] put_expression_stack_pointers: FastHashSet<*const ()>, @@ -349,7 +355,7 @@ fn should_pack_struct_member( } let ty_inner = &module.types[member.ty].inner; - let last_offset = member.offset + ty_inner.span(&module.constants); + let last_offset = member.offset + ty_inner.size(&module.constants); let next_offset = match members.get(index + 1) { Some(next) => next.offset, None => span, @@ -367,34 +373,55 @@ fn should_pack_struct_member( } fn needs_array_length(ty: Handle, arena: &crate::UniqueArena) -> bool { - if let crate::TypeInner::Struct { ref members, .. } = arena[ty].inner { - if let Some(member) = members.last() { - if let crate::TypeInner::Array { - size: crate::ArraySize::Dynamic, - .. - } = arena[member.ty].inner - { - return true; + match arena[ty].inner { + crate::TypeInner::Struct { ref members, .. } => { + if let Some(member) = members.last() { + if let crate::TypeInner::Array { + size: crate::ArraySize::Dynamic, + .. + } = arena[member.ty].inner + { + return true; + } } + false } + crate::TypeInner::Array { + size: crate::ArraySize::Dynamic, + .. + } => true, + _ => false, } - false } -impl crate::StorageClass { - /// Returns true for storage classes, for which the global - /// variables are passed in function arguments. - /// These arguments need to be passed through any functions - /// called from the entry point. +impl crate::AddressSpace { + /// Returns true if global variables in this address space are + /// passed in function arguments. These arguments need to be + /// passed through any functions called from the entry point. fn needs_pass_through(&self) -> bool { match *self { - crate::StorageClass::Uniform - | crate::StorageClass::Storage { .. } - | crate::StorageClass::Private - | crate::StorageClass::WorkGroup - | crate::StorageClass::PushConstant - | crate::StorageClass::Handle => true, - crate::StorageClass::Function => false, + Self::Uniform + | Self::Storage { .. } + | Self::Private + | Self::WorkGroup + | Self::PushConstant + | Self::Handle => true, + Self::Function => false, + } + } + + /// Returns true if the address space may need a "const" qualifier. + fn needs_access_qualifier(&self) -> bool { + match *self { + //Note: we are ignoring the storage access here, and instead + // rely on the actual use of a global by functions. This means we + // may end up with "const" even if the binding is read-write, + // and that should be OK. + Self::Storage { .. } | Self::Private | Self::WorkGroup => true, + // These translate to `constant` address space, no need for qualifiers. + Self::Uniform | Self::PushConstant => false, + // Not applicable. + Self::Handle | Self::Function => false, } } @@ -402,10 +429,7 @@ impl crate::StorageClass { match self { Self::Handle => None, Self::Uniform | Self::PushConstant => Some("constant"), - Self::Storage { access } if access.contains(crate::StorageAccess::STORE) => { - Some("device") - } - Self::Storage { .. } => Some("constant"), + Self::Storage { .. } => Some("device"), Self::Private | Self::Function => Some("thread"), Self::WorkGroup => Some("threadgroup"), } @@ -448,6 +472,37 @@ enum FunctionOrigin { EntryPoint(proc::EntryPointIndex), } +/// A level of detail argument. +/// +/// When [`BoundsCheckPolicy::Restrict`] applies to an [`ImageLoad`] access, we +/// save the clamped level of detail in a temporary variable whose name is based +/// on the handle of the `ImageLoad` expression. But for other policies, we just +/// use the expression directly. +/// +/// [`BoundsCheckPolicy::Restrict`]: index::BoundsCheckPolicy::Restrict +/// [`ImageLoad`]: crate::Expression::ImageLoad +#[derive(Clone, Copy)] +enum LevelOfDetail { + Direct(Handle), + Restricted(Handle), +} + +/// Values needed to select a particular texel for [`ImageLoad`] and [`ImageStore`]. +/// +/// When this is used in code paths unconcerned with the `Restrict` bounds check +/// policy, the `LevelOfDetail` enum introduces an unneeded match, since `level` +/// will always be either `None` or `Some(Direct(_))`. But this turns out not to +/// be too awkward. If that changes, we can revisit. +/// +/// [`ImageLoad`]: crate::Expression::ImageLoad +/// [`ImageStore`]: crate::Statement::ImageStore +struct TexelAddress { + coordinate: Handle, + array_index: Option>, + sample: Option>, + level: Option, +} + struct ExpressionContext<'a> { function: &'a crate::Function, origin: FunctionOrigin, @@ -468,6 +523,21 @@ impl<'a> ExpressionContext<'a> { self.info[handle].ty.inner_with(&self.module.types) } + /// Return true if calls to `image`'s `read` and `write` methods should supply a level of detail. + /// + /// Only mipmapped images need to specify a level of detail. Since 1D + /// textures cannot have mipmaps, MSL requires that the level argument to + /// texture1d queries and accesses must be a constexpr 0. It's easiest + /// just to omit the level entirely for 1D textures. + fn image_needs_lod(&self, image: Handle) -> bool { + let image_ty = self.resolve_type(image); + if let crate::TypeInner::Image { dim, class, .. } = *image_ty { + class.is_mipmapped() && dim != crate::ImageDimension::D1 + } else { + false + } + } + fn choose_bounds_check_policy( &self, pointer: Handle, @@ -520,7 +590,8 @@ impl Writer { Writer { out, names: FastHashMap::default(), - named_expressions: crate::NamedExpressions::default(), + named_expressions: Default::default(), + need_bake_expressions: Default::default(), namer: proc::Namer::default(), #[cfg(test)] put_expression_stack_pointers: Default::default(), @@ -551,17 +622,31 @@ impl Writer { Ok(()) } + fn put_level_of_detail( + &mut self, + level: LevelOfDetail, + context: &ExpressionContext, + ) -> BackendResult { + match level { + LevelOfDetail::Direct(expr) => self.put_expression(expr, context, true)?, + LevelOfDetail::Restricted(load) => { + write!(self.out, "{}{}", CLAMPED_LOD_LOAD_PREFIX, load.index())? + } + } + Ok(()) + } + fn put_image_query( &mut self, image: Handle, query: &str, - level: Option>, + level: Option, context: &ExpressionContext, ) -> BackendResult { self.put_expression(image, context, false)?; write!(self.out, ".get_{}(", query)?; - if let Some(expr) = level { - self.put_expression(expr, context, true)?; + if let Some(level) = level { + self.put_level_of_detail(level, context)?; } write!(self.out, ")")?; Ok(()) @@ -570,7 +655,8 @@ impl Writer { fn put_image_size_query( &mut self, image: Handle, - level: Option>, + level: Option, + kind: crate::ScalarKind, context: &ExpressionContext, ) -> BackendResult { //Note: MSL only has separate width/height/depth queries, @@ -579,24 +665,31 @@ impl Writer { crate::TypeInner::Image { dim, .. } => dim, ref other => unreachable!("Unexpected type {:?}", other), }; + let coordinate_type = kind.to_msl_name(); match dim { crate::ImageDimension::D1 => { - write!(self.out, "int(")?; // Since 1D textures never have mipmaps, MSL requires that the // `level` argument be a constexpr 0. It's simplest for us just - // to omit the level entirely. - self.put_image_query(image, "width", None, context)?; - write!(self.out, ")")?; + // to pass `None` and omit the level entirely. + if kind == crate::ScalarKind::Uint { + // No need to construct a vector. No cast needed. + self.put_image_query(image, "width", None, context)?; + } else { + // There's no definition for `int` in the `metal` namespace. + write!(self.out, "int(")?; + self.put_image_query(image, "width", None, context)?; + write!(self.out, ")")?; + } } crate::ImageDimension::D2 => { - write!(self.out, "int2(")?; + write!(self.out, "{}::{}2(", NAMESPACE, coordinate_type)?; self.put_image_query(image, "width", level, context)?; write!(self.out, ", ")?; self.put_image_query(image, "height", level, context)?; write!(self.out, ")")?; } crate::ImageDimension::D3 => { - write!(self.out, "int3(")?; + write!(self.out, "{}::{}3(", NAMESPACE, coordinate_type)?; self.put_image_query(image, "width", level, context)?; write!(self.out, ", ")?; self.put_image_query(image, "height", level, context)?; @@ -605,7 +698,7 @@ impl Writer { write!(self.out, ")")?; } crate::ImageDimension::Cube => { - write!(self.out, "int2(")?; + write!(self.out, "{}::{}2(", NAMESPACE, coordinate_type)?; self.put_image_query(image, "width", level, context)?; write!(self.out, ")")?; } @@ -613,18 +706,23 @@ impl Writer { Ok(()) } - fn put_storage_image_coordinate( + fn put_cast_to_uint_scalar_or_vector( &mut self, expr: Handle, context: &ExpressionContext, ) -> BackendResult { // coordinates in IR are int, but Metal expects uint - let size_str = match *context.resolve_type(expr) { - crate::TypeInner::Scalar { .. } => "", - crate::TypeInner::Vector { size, .. } => back::vector_size_str(size), + match *context.resolve_type(expr) { + crate::TypeInner::Scalar { .. } => { + put_numeric_type(&mut self.out, crate::ScalarKind::Uint, &[])? + } + crate::TypeInner::Vector { size, .. } => { + put_numeric_type(&mut self.out, crate::ScalarKind::Uint, &[size])? + } _ => return Err(Error::Validation), }; - write!(self.out, "{}::uint{}(", NAMESPACE, size_str)?; + + write!(self.out, "(")?; self.put_expression(expr, context, true)?; write!(self.out, ")")?; Ok(()) @@ -636,13 +734,7 @@ impl Writer { level: crate::SampleLevel, context: &ExpressionContext, ) -> BackendResult { - let has_levels = match *context.resolve_type(image) { - crate::TypeInner::Image { - dim: crate::ImageDimension::D1, - .. - } => false, - _ => true, - }; + let has_levels = context.image_needs_lod(image); match level { crate::SampleLevel::Auto => {} crate::SampleLevel::Zero => { @@ -672,6 +764,275 @@ impl Writer { Ok(()) } + fn put_image_coordinate_limits( + &mut self, + image: Handle, + level: Option, + context: &ExpressionContext, + ) -> BackendResult { + self.put_image_size_query(image, level, crate::ScalarKind::Uint, context)?; + write!(self.out, " - 1")?; + Ok(()) + } + + /// General function for writing restricted image indexes. + /// + /// This is used to produce restricted mip levels, array indices, and sample + /// indices for [`ImageLoad`] and [`ImageStore`] accesses under the + /// [`Restrict`] bounds check policy. + /// + /// This function writes an expression of the form: + /// + /// ```ignore + /// + /// metal::min(uint(INDEX), IMAGE.LIMIT_METHOD() - 1) + /// + /// ``` + /// + /// [`ImageLoad`]: crate::Expression::ImageLoad + /// [`ImageStore`]: crate::Statement::ImageStore + /// [`Restrict`]: index::BoundsCheckPolicy::Restrict + fn put_restricted_scalar_image_index( + &mut self, + image: Handle, + index: Handle, + limit_method: &str, + context: &ExpressionContext, + ) -> BackendResult { + write!(self.out, "{}::min(uint(", NAMESPACE)?; + self.put_expression(index, context, true)?; + write!(self.out, "), ")?; + self.put_expression(image, context, false)?; + write!(self.out, ".{}() - 1)", limit_method)?; + Ok(()) + } + + fn put_restricted_texel_address( + &mut self, + image: Handle, + address: &TexelAddress, + context: &ExpressionContext, + ) -> BackendResult { + // Write the coordinate. + write!(self.out, "{}::min(", NAMESPACE)?; + self.put_cast_to_uint_scalar_or_vector(address.coordinate, context)?; + write!(self.out, ", ")?; + self.put_image_coordinate_limits(image, address.level, context)?; + write!(self.out, ")")?; + + // Write the array index, if present. + if let Some(array_index) = address.array_index { + write!(self.out, ", ")?; + self.put_restricted_scalar_image_index(image, array_index, "get_array_size", context)?; + } + + // Write the sample index, if present. + if let Some(sample) = address.sample { + write!(self.out, ", ")?; + self.put_restricted_scalar_image_index(image, sample, "get_num_samples", context)?; + } + + // The level of detail should be clamped and cached by + // `put_cache_restricted_level`, so we don't need to clamp it here. + if let Some(level) = address.level { + write!(self.out, ", ")?; + self.put_level_of_detail(level, context)?; + } + + Ok(()) + } + + /// Write an expression that is true if the given image access is in bounds. + fn put_image_access_bounds_check( + &mut self, + image: Handle, + address: &TexelAddress, + context: &ExpressionContext, + ) -> BackendResult { + let mut conjunction = ""; + + // First, check the level of detail. Only if that is in bounds can we + // use it to find the appropriate bounds for the coordinates. + let level = if let Some(level) = address.level { + write!(self.out, "uint(")?; + self.put_level_of_detail(level, context)?; + write!(self.out, ") < ")?; + self.put_expression(image, context, true)?; + write!(self.out, ".get_num_mip_levels()")?; + conjunction = " && "; + Some(level) + } else { + None + }; + + // Check sample index, if present. + if let Some(sample) = address.sample { + write!(self.out, "uint(")?; + self.put_expression(sample, context, true)?; + write!(self.out, ") < ")?; + self.put_expression(image, context, true)?; + write!(self.out, ".get_num_samples()")?; + conjunction = " && "; + } + + // Check array index, if present. + if let Some(array_index) = address.array_index { + write!(self.out, "{}uint(", conjunction)?; + self.put_expression(array_index, context, true)?; + write!(self.out, ") < ")?; + self.put_expression(image, context, true)?; + write!(self.out, ".get_array_size()")?; + conjunction = " && "; + } + + // Finally, check if the coordinates are within bounds. + let coord_is_vector = match *context.resolve_type(address.coordinate) { + crate::TypeInner::Vector { .. } => true, + _ => false, + }; + write!(self.out, "{}", conjunction)?; + if coord_is_vector { + write!(self.out, "{}::all(", NAMESPACE)?; + } + self.put_cast_to_uint_scalar_or_vector(address.coordinate, context)?; + write!(self.out, " < ")?; + self.put_image_size_query(image, level, crate::ScalarKind::Uint, context)?; + if coord_is_vector { + write!(self.out, ")")?; + } + + Ok(()) + } + + fn put_image_load( + &mut self, + load: Handle, + image: Handle, + mut address: TexelAddress, + context: &ExpressionContext, + ) -> BackendResult { + match context.policies.image { + proc::BoundsCheckPolicy::Restrict => { + // Use the cached restricted level of detail, if any. Omit the + // level altogether for 1D textures. + if address.level.is_some() { + address.level = if context.image_needs_lod(image) { + Some(LevelOfDetail::Restricted(load)) + } else { + None + } + } + + self.put_expression(image, context, false)?; + write!(self.out, ".read(")?; + self.put_restricted_texel_address(image, &address, context)?; + write!(self.out, ")")?; + } + proc::BoundsCheckPolicy::ReadZeroSkipWrite => { + write!(self.out, "(")?; + self.put_image_access_bounds_check(image, &address, context)?; + write!(self.out, " ? ")?; + self.put_unchecked_image_load(image, &address, context)?; + write!(self.out, ": DefaultConstructible())")?; + } + proc::BoundsCheckPolicy::Unchecked => { + self.put_unchecked_image_load(image, &address, context)?; + } + } + + Ok(()) + } + + fn put_unchecked_image_load( + &mut self, + image: Handle, + address: &TexelAddress, + context: &ExpressionContext, + ) -> BackendResult { + self.put_expression(image, context, false)?; + write!(self.out, ".read(")?; + // coordinates in IR are int, but Metal expects uint + self.put_cast_to_uint_scalar_or_vector(address.coordinate, context)?; + if let Some(expr) = address.array_index { + write!(self.out, ", ")?; + self.put_expression(expr, context, true)?; + } + if let Some(sample) = address.sample { + write!(self.out, ", ")?; + self.put_expression(sample, context, true)?; + } + if let Some(level) = address.level { + if context.image_needs_lod(image) { + write!(self.out, ", ")?; + self.put_level_of_detail(level, context)?; + } + } + write!(self.out, ")")?; + + Ok(()) + } + + fn put_image_store( + &mut self, + level: back::Level, + image: Handle, + address: &TexelAddress, + value: Handle, + context: &StatementContext, + ) -> BackendResult { + match context.expression.policies.image { + proc::BoundsCheckPolicy::Restrict => { + // We don't have a restricted level value, because we don't + // support writes to mipmapped textures. + debug_assert!(address.level.is_none()); + + write!(self.out, "{}", level)?; + self.put_expression(image, &context.expression, false)?; + write!(self.out, ".write(")?; + self.put_expression(value, &context.expression, true)?; + write!(self.out, ", ")?; + self.put_restricted_texel_address(image, address, &context.expression)?; + writeln!(self.out, ");")?; + } + proc::BoundsCheckPolicy::ReadZeroSkipWrite => { + write!(self.out, "{}if (", level)?; + self.put_image_access_bounds_check(image, address, &context.expression)?; + writeln!(self.out, ") {{")?; + self.put_unchecked_image_store(level.next(), image, address, value, context)?; + writeln!(self.out, "{}}}", level)?; + } + proc::BoundsCheckPolicy::Unchecked => { + self.put_unchecked_image_store(level, image, address, value, context)?; + } + } + + Ok(()) + } + + fn put_unchecked_image_store( + &mut self, + level: back::Level, + image: Handle, + address: &TexelAddress, + value: Handle, + context: &StatementContext, + ) -> BackendResult { + write!(self.out, "{}", level)?; + self.put_expression(image, &context.expression, false)?; + write!(self.out, ".write(")?; + self.put_expression(value, &context.expression, true)?; + write!(self.out, ", ")?; + // coordinates in IR are int, but Metal expects uint + self.put_cast_to_uint_scalar_or_vector(address.coordinate, &context.expression)?; + if let Some(expr) = address.array_index { + write!(self.out, ", ")?; + self.put_expression(expr, &context.expression, true)?; + } + writeln!(self.out, ");")?; + + Ok(()) + } + fn put_compose( &mut self, ty: Handle, @@ -684,25 +1045,11 @@ impl Writer { self.put_call_parameters(components.iter().cloned(), context)?; } crate::TypeInner::Vector { size, kind, .. } => { - write!( - self.out, - "{}::{}{}", - NAMESPACE, - kind.to_msl_name(), - back::vector_size_str(size) - )?; + put_numeric_type(&mut self.out, kind, &[size])?; self.put_call_parameters(components.iter().cloned(), context)?; } crate::TypeInner::Matrix { columns, rows, .. } => { - let kind = crate::ScalarKind::Float; - write!( - self.out, - "{}::{}{}x{}", - NAMESPACE, - kind.to_msl_name(), - back::vector_size_str(columns), - back::vector_size_str(rows) - )?; + put_numeric_type(&mut self.out, crate::ScalarKind::Float, &[rows, columns])?; self.put_call_parameters(components.iter().cloned(), context)?; } crate::TypeInner::Array { .. } | crate::TypeInner::Struct { .. } => { @@ -740,32 +1087,34 @@ impl Writer { context: &ExpressionContext, ) -> BackendResult { let global = &context.module.global_variables[handle]; - let members = match context.module.types[global.ty].inner { - crate::TypeInner::Struct { ref members, .. } => members, + let (offset, array_ty) = match context.module.types[global.ty].inner { + crate::TypeInner::Struct { ref members, .. } => match members.last() { + Some(&crate::StructMember { offset, ty, .. }) => (offset, ty), + None => return Err(Error::Validation), + }, + crate::TypeInner::Array { + size: crate::ArraySize::Dynamic, + .. + } => (0, global.ty), _ => return Err(Error::Validation), }; - let (offset, array_ty) = match members.last() { - Some(&crate::StructMember { offset, ty, .. }) => (offset, ty), - None => return Err(Error::Validation), - }; - - let (span, stride) = match context.module.types[array_ty].inner { + let (size, stride) = match context.module.types[array_ty].inner { crate::TypeInner::Array { base, stride, .. } => ( context.module.types[base] .inner - .span(&context.module.constants), + .size(&context.module.constants), stride, ), _ => return Err(Error::Validation), }; - // When the stride length is larger than the span, the final element's stride of + // When the stride length is larger than the size, the final element's stride of // bytes would have padding following the value. But the buffer size in // `buffer_sizes.sizeN` may not include this padding - it only needs to be large // enough to hold the actual values' bytes. // - // So subtract off the span to get a byte size that falls at the start or within + // So subtract off the size to get a byte size that falls at the start or within // the final element. Then divide by the stride size, to get one less than the // length, and then add one. This works even if the buffer size does include the // stride padding, since division rounds towards zero (MSL 2.4 §6.1). It will fail @@ -774,10 +1123,10 @@ impl Writer { // prevent that. write!( self.out, - "(_buffer_sizes.size{idx} - {offset} - {span}) / {stride}", + "(_buffer_sizes.size{idx} - {offset} - {size}) / {stride}", idx = handle.index(), offset = offset, - span = span, + size = size, stride = stride, )?; Ok(()) @@ -790,15 +1139,60 @@ impl Writer { value: Handle, context: &ExpressionContext, ) -> BackendResult { + // If the pointer we're passing to the atomic operation needs to be conditional + // for `ReadZeroSkipWrite`, the condition needs to *surround* the atomic op, and + // the pointer operand should be unchecked. + let policy = context.choose_bounds_check_policy(pointer); + let checked = policy == index::BoundsCheckPolicy::ReadZeroSkipWrite + && self.put_bounds_checks(pointer, context, back::Level(0), "")?; + + // If requested and successfully put bounds checks, continue the ternary expression. + if checked { + write!(self.out, " ? ")?; + } + write!( self.out, "{}::atomic_fetch_{}_explicit({}", NAMESPACE, key, ATOMIC_REFERENCE )?; - self.put_expression(pointer, context, true)?; + self.put_access_chain(pointer, policy, context)?; write!(self.out, ", ")?; self.put_expression(value, context, true)?; write!(self.out, ", {}::memory_order_relaxed)", NAMESPACE)?; + + // Finish the ternary expression. + if checked { + write!(self.out, " : DefaultConstructible()")?; + } + + Ok(()) + } + + /// Emit code for the arithmetic expression of the dot product. + /// + fn put_dot_product( + &mut self, + arg: Handle, + arg1: Handle, + size: usize, + ) -> BackendResult { + write!(self.out, "(")?; + + let arg0_name = &self.named_expressions[&arg]; + let arg1_name = &self.named_expressions[&arg1]; + + // This will print an extra '+' at the beginning but that is fine in msl + for index in 0..size { + let component = back::COMPONENTS[index]; + write!( + self.out, + " + {}.{} * {}.{}", + arg0_name, component, arg1_name, component + )?; + } + + write!(self.out, ")")?; Ok(()) } @@ -873,10 +1267,8 @@ impl Writer { crate::TypeInner::Scalar { kind, .. } => kind, _ => return Err(Error::Validation), }; - let scalar = scalar_kind.to_msl_name(); - let size = back::vector_size_str(size); - - write!(self.out, "{}::{}{}(", NAMESPACE, scalar, size)?; + put_numeric_type(&mut self.out, scalar_kind, &[size])?; + write!(self.out, "(")?; self.put_expression(value, context, true)?; write!(self.out, ")")?; } @@ -989,36 +1381,27 @@ impl Writer { image, coordinate, array_index, - index, + sample, + level, } => { - self.put_expression(image, context, false)?; - write!(self.out, ".read(")?; - self.put_storage_image_coordinate(coordinate, context)?; - if let Some(expr) = array_index { - write!(self.out, ", ")?; - self.put_expression(expr, context, true)?; - } - if let Some(index) = index { - // Metal requires that the `level` argument to - // `texture1d::read` be a constexpr equal to zero. - if let crate::TypeInner::Image { - dim: crate::ImageDimension::D1, - .. - } = *context.resolve_type(image) - { - // The argument defaults to zero. - } else { - write!(self.out, ", ")?; - self.put_expression(index, context, true)? - } - } - write!(self.out, ")")?; + let address = TexelAddress { + coordinate, + array_index, + sample, + level: level.map(LevelOfDetail::Direct), + }; + self.put_image_load(expr_handle, image, address, context)?; } //Note: for all the queries, the signed integers are expected, // so a conversion is needed. crate::Expression::ImageQuery { image, query } => match query { crate::ImageQuery::Size { level } => { - self.put_image_size_query(image, level, context)?; + self.put_image_size_query( + image, + level.map(LevelOfDetail::Direct), + crate::ScalarKind::Sint, + context, + )?; } crate::ImageQuery::NumLevels => { write!(self.out, "int(")?; @@ -1037,9 +1420,15 @@ impl Writer { } }, crate::Expression::Unary { op, expr } => { + use crate::{ScalarKind as Sk, UnaryOperator as Uo}; let op_str = match op { - crate::UnaryOperator::Negate => "-", - crate::UnaryOperator::Not => "!", + Uo::Negate => "-", + Uo::Not => match *context.resolve_type(expr) { + crate::TypeInner::Scalar { kind: Sk::Sint, .. } => "~", + crate::TypeInner::Scalar { kind: Sk::Uint, .. } => "~", + crate::TypeInner::Scalar { kind: Sk::Bool, .. } => "!", + _ => return Err(Error::Validation), + }, }; write!(self.out, "{}", op_str)?; self.put_expression(expr, context, false)?; @@ -1191,7 +1580,18 @@ impl Writer { Mf::Log2 => "log2", Mf::Pow => "pow", // geometry - Mf::Dot => "dot", + Mf::Dot => match *context.resolve_type(arg) { + crate::TypeInner::Vector { + kind: crate::ScalarKind::Float, + .. + } => "dot", + crate::TypeInner::Vector { size, .. } => { + return self.put_dot_product(arg, arg1.unwrap(), size as usize) + } + _ => unreachable!( + "Correct TypeInner for dot product should be already validated" + ), + }, Mf::Outer => return Err(Error::UnsupportedCall(format!("{:?}", fun))), Mf::Cross => "cross", Mf::Distance => "distance", @@ -1284,7 +1684,6 @@ impl Writer { kind, convert, } => { - let scalar = kind.to_msl_name(); let (src_kind, src_width) = match *context.resolve_type(expr) { crate::TypeInner::Scalar { kind, width } | crate::TypeInner::Vector { kind, width, .. } => (kind, width), @@ -1303,18 +1702,10 @@ impl Writer { write!(self.out, "{}<", op)?; match *context.resolve_type(expr) { crate::TypeInner::Vector { size, .. } => { - write!( - self.out, - "{}::{}{}", - NAMESPACE, - scalar, - back::vector_size_str(size) - )?; + put_numeric_type(&mut self.out, kind, &[size])? } - _ => { - write!(self.out, "{}", scalar)?; - } - } + _ => put_numeric_type(&mut self.out, kind, &[])?, + }; write!(self.out, ">(")?; self.put_expression(expr, context, true)?; write!(self.out, ")")?; @@ -1332,6 +1723,7 @@ impl Writer { _ => return Err(Error::Validation), } } + crate::Expression::GlobalVariable(handle) => handle, _ => return Err(Error::Validation), }; @@ -1378,7 +1770,7 @@ impl Writer { /// The text written is of the form: /// /// ```ignore - /// {level}{prefix}metal::uint(i) < 4 && metal::uint(j) < 10 + /// {level}{prefix}uint(i) < 4 && uint(j) < 10 /// ``` /// /// where `{level}` and `{prefix}` are the arguments to this function. For [`Store`] @@ -1438,7 +1830,7 @@ impl Writer { // Check that the index falls within bounds. Do this with a single // comparison, by casting the index to `uint` first, so that negative // indices become large positive values. - write!(self.out, "{}::uint(", NAMESPACE)?; + write!(self.out, "uint(")?; self.put_index(index, context, true)?; self.out.write_str(") < ")?; match length { @@ -1491,7 +1883,7 @@ impl Writer { let mut base_ty = context.resolve_type(base); // Look through any pointers to see what we're really indexing. - if let crate::TypeInner::Pointer { base, class: _ } = *base_ty { + if let crate::TypeInner::Pointer { base, space: _ } = *base_ty { base_ty = &context.module.types[base].inner; } @@ -1509,7 +1901,7 @@ impl Writer { let mut base_ty_handle = base_resolution.handle(); // Look through any pointers to see what we're really indexing. - if let crate::TypeInner::Pointer { base, class: _ } = *base_ty { + if let crate::TypeInner::Pointer { base, space: _ } = *base_ty { base_ty = &context.module.types[base].inner; base_ty_handle = Some(base); } @@ -1629,8 +2021,8 @@ impl Writer { context: &ExpressionContext, is_scoped: bool, ) -> BackendResult { - // Since access chains never cross storage classes, we can just check the index - // bounds check policy once at the top. + // Since access chains never cross between address spaces, we can just + // check the index bounds check policy once at the top. let policy = context.choose_bounds_check_policy(pointer); if policy == index::BoundsCheckPolicy::ReadZeroSkipWrite && self.put_bounds_checks( @@ -1700,6 +2092,7 @@ impl Writer { ) -> BackendResult { match result_struct { Some(struct_name) => { + let mut has_point_size = false; let result_ty = context.function.result.as_ref().unwrap().ty; match context.module.types[result_ty].inner { crate::TypeInner::Struct { ref members, .. } => { @@ -1708,20 +2101,24 @@ impl Writer { self.put_expression(expr_handle, context, true)?; writeln!(self.out, ";")?; write!(self.out, "{}return {} {{", level, struct_name)?; + let mut is_first = true; + for (index, member) in members.iter().enumerate() { - if !context.pipeline_options.allow_point_size - && member.binding - == Some(crate::Binding::BuiltIn(crate::BuiltIn::PointSize)) - { - continue; - } - if member.binding - == Some(crate::Binding::BuiltIn(crate::BuiltIn::CullDistance)) - { - log::warn!("Ignoring CullDistance BuiltIn"); - continue; + match member.binding { + Some(crate::Binding::BuiltIn(crate::BuiltIn::PointSize)) => { + has_point_size = true; + if !context.pipeline_options.allow_point_size { + continue; + } + } + Some(crate::Binding::BuiltIn(crate::BuiltIn::CullDistance)) => { + log::warn!("Ignoring CullDistance built-in"); + continue; + } + _ => {} } + let comma = if is_first { "" } else { "," }; is_first = false; let name = &self.names[&NameKey::StructMember(result_ty, index as u32)]; @@ -1758,6 +2155,17 @@ impl Writer { self.put_expression(expr_handle, context, true)?; } } + + if let FunctionOrigin::EntryPoint(ep_index) = context.origin { + let stage = context.module.entry_points[ep_index as usize].stage; + if context.pipeline_options.allow_point_size + && stage == crate::ShaderStage::Vertex + && !has_point_size + { + // point size was injected and comes last + write!(self.out, ", 1.0")?; + } + } write!(self.out, " }}")?; } None => { @@ -1769,6 +2177,59 @@ impl Writer { Ok(()) } + /// Helper method used to find which expressions of a given function require baking + /// + /// # Notes + /// This function overwrites the contents of `self.need_bake_expressions` + fn update_expressions_to_bake( + &mut self, + func: &crate::Function, + info: &valid::FunctionInfo, + context: &ExpressionContext, + ) { + use crate::Expression; + self.need_bake_expressions.clear(); + for expr in func.expressions.iter() { + // Expressions whose reference count is above the + // threshold should always be stored in temporaries. + let expr_info = &info[expr.0]; + let min_ref_count = func.expressions[expr.0].bake_ref_count(); + if min_ref_count <= expr_info.ref_count { + self.need_bake_expressions.insert(expr.0); + } + + // WGSL's `dot` function works on any `vecN` type, but Metal's only + // works on floating-point vectors, so we emit inline code for + // integer vector `dot` calls. But that code uses each argument `N` + // times, once for each component (see `put_dot_product`), so to + // avoid duplicated evaluation, we must bake integer operands. + if let ( + fun_handle, + &Expression::Math { + fun: crate::MathFunction::Dot, + arg, + arg1, + .. + }, + ) = expr + { + use crate::TypeInner; + // check what kind of product this is depending + // on the resolve type of the Dot function itself + let inner = context.resolve_type(fun_handle); + if let TypeInner::Scalar { kind, .. } = *inner { + match kind { + crate::ScalarKind::Sint | crate::ScalarKind::Uint => { + self.need_bake_expressions.insert(arg); + self.need_bake_expressions.insert(arg1.unwrap()); + } + _ => {} + } + } + } + } + } + fn start_baking_expression( &mut self, handle: Handle, @@ -1786,34 +2247,14 @@ impl Writer { }; write!(self.out, "{}", ty_name)?; } - TypeResolution::Value(crate::TypeInner::Scalar { - kind: crate::ScalarKind::Uint, - .. - }) => { - // work around Metal toolchain bug with `uint` typedef - write!(self.out, "{}::uint", NAMESPACE)?; - } TypeResolution::Value(crate::TypeInner::Scalar { kind, .. }) => { - write!(self.out, "{}", kind.to_msl_name())?; + put_numeric_type(&mut self.out, kind, &[])?; } TypeResolution::Value(crate::TypeInner::Vector { size, kind, .. }) => { - write!( - self.out, - "{}::{}{}", - NAMESPACE, - kind.to_msl_name(), - back::vector_size_str(size) - )?; + put_numeric_type(&mut self.out, kind, &[size])?; } TypeResolution::Value(crate::TypeInner::Matrix { columns, rows, .. }) => { - write!( - self.out, - "{}::{}{}x{}", - NAMESPACE, - crate::ScalarKind::Float.to_msl_name(), - back::vector_size_str(columns), - back::vector_size_str(rows), - )?; + put_numeric_type(&mut self.out, crate::ScalarKind::Float, &[rows, columns])?; } TypeResolution::Value(ref other) => { log::warn!("Type {:?} isn't a known local", other); //TEMP! @@ -1827,6 +2268,57 @@ impl Writer { Ok(()) } + /// Cache a clamped level of detail value, if necessary. + /// + /// [`ImageLoad`] accesses covered by [`BoundsCheckPolicy::Restrict`] use a + /// properly clamped level of detail value both in the access itself, and + /// for fetching the size of the requested MIP level, needed to clamp the + /// coordinates. To avoid recomputing this clamped level of detail, we cache + /// it in a temporary variable, as part of the [`Emit`] statement covering + /// the [`ImageLoad`] expression. + /// + /// [`ImageLoad`]: crate::Expression::ImageLoad + /// [`BoundsCheckPolicy::Restrict`]: index::BoundsCheckPolicy::Restrict + /// [`Emit`]: crate::Statement::Emit + fn put_cache_restricted_level( + &mut self, + load: Handle, + image: Handle, + mip_level: Option>, + indent: back::Level, + context: &StatementContext, + ) -> BackendResult { + // Does this image access actually require (or even permit) a + // level-of-detail, and does the policy require us to restrict it? + let level_of_detail = match mip_level { + Some(level) => level, + None => return Ok(()), + }; + + if context.expression.policies.image != index::BoundsCheckPolicy::Restrict + || !context.expression.image_needs_lod(image) + { + return Ok(()); + } + + write!( + self.out, + "{}uint {}{} = ", + indent, + CLAMPED_LOD_LOAD_PREFIX, + load.index(), + )?; + self.put_restricted_scalar_image_index( + image, + level_of_detail, + "get_num_mip_levels", + &context.expression, + )?; + writeln!(self.out, ";")?; + + Ok(()) + } + fn put_block( &mut self, level: back::Level, @@ -1844,11 +2336,24 @@ impl Writer { match *statement { crate::Statement::Emit(ref range) => { for handle in range.clone() { + // `ImageLoad` expressions covered by the `Restrict` bounds check policy + // may need to cache a clamped version of their level-of-detail argument. + if let crate::Expression::ImageLoad { + image, + level: mip_level, + .. + } = context.expression.function.expressions[handle] + { + self.put_cache_restricted_level( + handle, image, mip_level, level, context, + )?; + } + let info = &context.expression.info[handle]; let ptr_class = info .ty .inner_with(&context.expression.module.types) - .pointer_class(); + .pointer_space(); let expr_name = if ptr_class.is_some() { None // don't bake pointer expressions (just yet) } else if let Some(name) = @@ -1872,12 +2377,7 @@ impl Writer { if context.expression.guarded_indices.contains(handle.index()) { true } else { - // Expressions whose reference count is above the - // threshold should always be stored in temporaries. - let min_ref_count = context.expression.function.expressions - [handle] - .bake_ref_count(); - min_ref_count <= info.ref_count + self.need_bake_expressions.contains(&handle) }; if bake { @@ -2027,17 +2527,13 @@ impl Writer { array_index, value, } => { - write!(self.out, "{}", level)?; - self.put_expression(image, &context.expression, false)?; - write!(self.out, ".write(")?; - self.put_expression(value, &context.expression, true)?; - write!(self.out, ", ")?; - self.put_storage_image_coordinate(coordinate, &context.expression)?; - if let Some(expr) = array_index { - write!(self.out, ", ")?; - self.put_expression(expr, &context.expression, true)?; - } - writeln!(self.out, ");")?; + let address = TexelAddress { + coordinate, + array_index, + sample: None, + level: None, + }; + self.put_image_store(level, image, &address, value, context)? } crate::Statement::Call { function, @@ -2067,7 +2563,7 @@ impl Writer { if fun_info[handle].is_empty() { continue; } - if var.class.needs_pass_through() { + if var.space.needs_pass_through() { let name = &self.names[&NameKey::GlobalVariable(handle)]; if separate { write!(self.out, ", ")?; @@ -2251,6 +2747,9 @@ impl Writer { writeln!(self.out, "#include ")?; writeln!(self.out, "#include ")?; writeln!(self.out)?; + // Work around Metal bug where `uint` is not available by default + writeln!(self.out, "using {}::uint;", NAMESPACE)?; + writeln!(self.out)?; if options .bounds_check_policies @@ -2272,7 +2771,7 @@ impl Writer { writeln!(self.out, "struct _mslBufferSizes {{")?; for idx in indices { - writeln!(self.out, "{}{}::uint size{};", back::INDENT, NAMESPACE, idx)?; + writeln!(self.out, "{}uint size{};", back::INDENT, idx)?; } writeln!(self.out, "}};")?; @@ -2379,7 +2878,7 @@ impl Writer { writeln!(self.out, "{}char _pad{}[{}];", back::INDENT, index, pad)?; } let ty_inner = &module.types[member.ty].inner; - last_offset = member.offset + ty_inner.span(&module.constants); + last_offset = member.offset + ty_inner.size(&module.constants); let member_name = &self.names[&NameKey::StructMember(handle, index as u32)]; @@ -2609,7 +3108,7 @@ impl Writer { let mut supports_array_length = false; for (handle, var) in module.global_variables.iter() { if !fun_info[handle].is_empty() { - if var.class.needs_pass_through() { + if var.space.needs_pass_through() { pass_through_globals.push(handle); } supports_array_length |= needs_array_length(var.ty, &module.types); @@ -2722,6 +3221,7 @@ impl Writer { result_struct: None, }; self.named_expressions.clear(); + self.update_expressions_to_bake(fun, fun_info, &context.expression); self.put_block(back::Level(1), &fun.body, &context)?; writeln!(self.out, "}}")?; } @@ -2733,7 +3233,6 @@ impl Writer { let fun = &ep.function; let fun_info = mod_info.get_entry_point(ep_index); let mut ep_error = None; - let mut supports_array_length = false; log::trace!( "entry point {:?}, index {:?}", @@ -2741,6 +3240,13 @@ impl Writer { ep_index ); + // Is any global variable used by this entry point dynamically sized? + let supports_array_length = module + .global_variables + .iter() + .filter(|&(handle, _)| !fun_info[handle].is_empty()) + .any(|(_, var)| needs_array_length(var.ty, &module.types)); + // skip this entry point if any global bindings are missing, // or their types are incompatible. if !options.fake_missing_bindings { @@ -2751,10 +3257,9 @@ impl Writer { if let Some(ref br) = var.binding { let good = match options.per_stage_map[ep.stage].resources.get(br) { Some(target) => match module.types[var.ty].inner { - crate::TypeInner::Struct { .. } => target.buffer.is_some(), crate::TypeInner::Image { .. } => target.texture.is_some(), crate::TypeInner::Sampler { .. } => target.sampler.is_some(), - _ => false, + _ => target.buffer.is_some(), }, None => false, }; @@ -2763,13 +3268,12 @@ impl Writer { break; } } - if var.class == crate::StorageClass::PushConstant { + if var.space == crate::AddressSpace::PushConstant { if let Err(e) = options.resolve_push_constants(ep.stage) { ep_error = Some(e); break; } } - supports_array_length |= needs_array_length(var.ty, &module.types); } if supports_array_length { if let Err(err) = options.resolve_sizes_buffer(ep.stage) { @@ -2787,9 +3291,6 @@ impl Writer { writeln!(self.out)?; - let stage_out_name = format!("{}Output", fun_name); - let stage_in_name = format!("{}Input", fun_name); - let (em_str, in_mode, out_mode) = match ep.stage { crate::ShaderStage::Vertex => ( "vertex", @@ -2806,35 +3307,44 @@ impl Writer { } }; - let mut argument_members = Vec::new(); + // List all the Naga `EntryPoint`'s `Function`'s arguments, + // flattening structs into their members. In Metal, we will pass + // each of these values to the entry point as a separate argument— + // except for the varyings, handled next. + let mut flattened_arguments = Vec::new(); for (arg_index, arg) in fun.arguments.iter().enumerate() { match module.types[arg.ty].inner { crate::TypeInner::Struct { ref members, .. } => { for (member_index, member) in members.iter().enumerate() { - argument_members.push(( - NameKey::StructMember(arg.ty, member_index as u32), + let member_index = member_index as u32; + flattened_arguments.push(( + NameKey::StructMember(arg.ty, member_index), member.ty, member.binding.as_ref(), - )) + )); } } - _ => argument_members.push(( + _ => flattened_arguments.push(( NameKey::EntryPointArgument(ep_index as _, arg_index as u32), arg.ty, arg.binding.as_ref(), )), } } + + // Identify the varyings among the argument values, and emit a + // struct type named `Input` to hold them. + let stage_in_name = format!("{}Input", fun_name); let varyings_member_name = self.namer.call("varyings"); - let mut varying_count = 0; - if !argument_members.is_empty() { + let mut has_varyings = false; + if !flattened_arguments.is_empty() { writeln!(self.out, "struct {} {{", stage_in_name)?; - for &(ref name_key, ty, binding) in argument_members.iter() { + for &(ref name_key, ty, binding) in flattened_arguments.iter() { let binding = match binding { Some(ref binding @ &crate::Binding::Location { .. }) => binding, _ => continue, }; - varying_count += 1; + has_varyings = true; let name = &self.names[name_key]; let ty_name = TypeContext { handle: ty, @@ -2845,12 +3355,15 @@ impl Writer { }; let resolved = options.resolve_local_binding(binding, in_mode)?; write!(self.out, "{}{} {}", back::INDENT, ty_name, name)?; - resolved.try_fmt_decorated(&mut self.out, "")?; + resolved.try_fmt_decorated(&mut self.out)?; writeln!(self.out, ";")?; } writeln!(self.out, "}};")?; } + // Define a struct type named for the return value, if any, named + // `Output`. + let stage_out_name = format!("{}Output", fun_name); let result_member_name = self.namer.call("member"); let result_type_name = match fun.result { Some(ref result) => { @@ -2874,6 +3387,7 @@ impl Writer { } writeln!(self.out, "struct {} {{", stage_out_name)?; + let mut has_point_size = false; for (name, ty, binding) in result_members { let ty_name = TypeContext { handle: ty, @@ -2883,19 +3397,27 @@ impl Writer { first_time: true, }; let binding = binding.ok_or(Error::Validation)?; - // Cull Distance is not supported in Metal. - // But we can't return UnsupportedBuiltIn error to user. - // Because otherwise we can't generate msl shader from any glslang SPIR-V shaders. - // glslang generates gl_PerVertex struct with gl_CullDistance builtin inside by default. - if *binding == crate::Binding::BuiltIn(crate::BuiltIn::CullDistance) { - log::warn!("Ignoring CullDistance BuiltIn"); - continue; - } - if !pipeline_options.allow_point_size - && *binding == crate::Binding::BuiltIn(crate::BuiltIn::PointSize) - { - continue; + + match *binding { + // Point size is only supported in VS of pipelines with + // point primitive topology. + crate::Binding::BuiltIn(crate::BuiltIn::PointSize) => { + has_point_size = true; + if !pipeline_options.allow_point_size { + continue; + } + } + // Cull Distance is not supported in Metal. + // But we can't return UnsupportedBuiltIn error to user. + // Because otherwise we can't generate msl shader from any glslang SPIR-V shaders. + // glslang generates gl_PerVertex struct with gl_CullDistance builtin inside by default. + crate::Binding::BuiltIn(crate::BuiltIn::CullDistance) => { + log::warn!("Ignoring CullDistance BuiltIn"); + continue; + } + _ => {} } + let array_len = match module.types[ty].inner { crate::TypeInner::Array { size: crate::ArraySize::Constant(handle), @@ -2905,21 +3427,43 @@ impl Writer { }; let resolved = options.resolve_local_binding(binding, out_mode)?; write!(self.out, "{}{} {}", back::INDENT, ty_name, name)?; - resolved.try_fmt_decorated(&mut self.out, "")?; if let Some(array_len) = array_len { write!(self.out, " [{}]", array_len)?; } - writeln!(self.out, ";")?; + write!(self.out, " [[")?; + resolved.try_fmt(&mut self.out)?; + if options.lang_version >= (2, 1) + && *binding == crate::Binding::BuiltIn(crate::BuiltIn::Position) + { + write!(self.out, ", invariant")?; + } + writeln!(self.out, "]];")?; + } + + if pipeline_options.allow_point_size + && ep.stage == crate::ShaderStage::Vertex + && !has_point_size + { + // inject the point size output last + writeln!( + self.out, + "{}float _point_size [[point_size]];", + back::INDENT + )?; } writeln!(self.out, "}};")?; &stage_out_name } None => "void", }; - writeln!(self.out, "{} {} {}(", em_str, result_type_name, fun_name)?; + // Write the entry point function's name, and begin its argument list. + writeln!(self.out, "{} {} {}(", em_str, result_type_name, fun_name)?; let mut is_first_argument = true; - if varying_count != 0 { + + // If we have produced a struct holding the `EntryPoint`'s + // `Function`'s arguments' varyings, pass that struct first. + if has_varyings { writeln!( self.out, " {} {} [[stage_in]]", @@ -2927,12 +3471,31 @@ impl Writer { )?; is_first_argument = false; } - for &(ref name_key, ty, binding) in argument_members.iter() { + + // Then pass the remaining arguments not included in the varyings + // struct. + // + // Since `Namer.reset` wasn't expecting struct members to be + // suddenly injected into the normal namespace like this, + // `self.names` doesn't keep them distinct from other variables. + // Generate fresh names for these arguments, and remember the + // mapping. + let mut flattened_member_names = FastHashMap::default(); + for &(ref name_key, ty, binding) in flattened_arguments.iter() { let binding = match binding { Some(ref binding @ &crate::Binding::BuiltIn(..)) => binding, _ => continue, }; - let name = &self.names[name_key]; + let name = if let NameKey::StructMember(ty, index) = *name_key { + // We should always insert a fresh entry here, but use + // `or_insert` to get a reference to the `String` we just + // inserted. + flattened_member_names + .entry(NameKey::StructMember(ty, index)) + .or_insert_with(|| self.namer.call(&self.names[name_key])) + } else { + &self.names[name_key] + }; let ty_name = TypeContext { handle: ty, arena: &module.types, @@ -2948,19 +3511,28 @@ impl Writer { ',' }; write!(self.out, "{} {} {}", separator, ty_name, name)?; - resolved.try_fmt_decorated(&mut self.out, "\n")?; + resolved.try_fmt_decorated(&mut self.out)?; + writeln!(self.out)?; } + + // Those global variables used by this entry point and its callees + // get passed as arguments. `Private` globals are an exception, they + // don't outlive this invocation, so we declare them below as locals + // within the entry point. for (handle, var) in module.global_variables.iter() { let usage = fun_info[handle]; - if usage.is_empty() || var.class == crate::StorageClass::Private { + if usage.is_empty() || var.space == crate::AddressSpace::Private { continue; } // the resolves have already been checked for `!fake_missing_bindings` case - let resolved = match var.class { - crate::StorageClass::PushConstant => { + let resolved = match var.space { + crate::AddressSpace::PushConstant => { options.resolve_push_constants(ep.stage).ok() } - crate::StorageClass::WorkGroup => None, + crate::AddressSpace::WorkGroup => None, + crate::AddressSpace::Storage { .. } if options.lang_version < (2, 0) => { + return Err(Error::UnsupportedAddressSpace(var.space)) + } _ => options .resolve_resource_binding(ep.stage, var.binding.as_ref().unwrap()) .ok(), @@ -2988,7 +3560,7 @@ impl Writer { write!(self.out, "{} ", separator)?; tyvar.try_fmt(&mut self.out)?; if let Some(resolved) = resolved { - resolved.try_fmt_decorated(&mut self.out, "")?; + resolved.try_fmt_decorated(&mut self.out)?; } if let Some(value) = var.init { let coco = ConstantContext { @@ -3002,6 +3574,8 @@ impl Writer { writeln!(self.out)?; } + // If this entry uses any variable-length arrays, their sizes are + // passed as a final struct-typed argument. if supports_array_length { // this is checked earlier let resolved = options.resolve_sizes_buffer(ep.stage).unwrap(); @@ -3015,7 +3589,8 @@ impl Writer { "{} constant _mslBufferSizes& _buffer_sizes", separator, )?; - resolved.try_fmt_decorated(&mut self.out, "\n")?; + resolved.try_fmt_decorated(&mut self.out)?; + writeln!(self.out)?; } // end of the entry point argument list @@ -3028,7 +3603,7 @@ impl Writer { if usage.is_empty() { continue; } - if var.class == crate::StorageClass::Private { + if var.space == crate::AddressSpace::Private { let tyvar = TypedGlobalVariable { module, names: &self.names, @@ -3070,7 +3645,16 @@ impl Writer { } } - // Now refactor the inputs in a way that the rest of the code expects + // Now take the arguments that we gathered into structs, and the + // structs that we flattened into arguments, and emit local + // variables with initializers that put everything back the way the + // body code expects. + // + // If we had to generate fresh names for struct members passed as + // arguments, be sure to use those names when rebuilding the struct. + // + // "Each day, I change some zeros to ones, and some ones to zeros. + // The rest, I leave alone." for (arg_index, arg) in fun.arguments.iter().enumerate() { let arg_name = &self.names[&NameKey::EntryPointArgument(ep_index as _, arg_index as u32)]; @@ -3085,8 +3669,14 @@ impl Writer { arg_name )?; for (member_index, member) in members.iter().enumerate() { - let name = - &self.names[&NameKey::StructMember(arg.ty, member_index as u32)]; + let key = NameKey::StructMember(arg.ty, member_index as u32); + // If it's not in the varying struct, then we should + // have passed it as its own argument and assigned + // it a new name. + let name = match member.binding { + Some(crate::Binding::BuiltIn(_)) => &flattened_member_names[&key], + _ => &self.names[&key], + }; if member_index != 0 { write!(self.out, ", ")?; } @@ -3153,6 +3743,7 @@ impl Writer { result_struct: Some(&stage_out_name), }; self.named_expressions.clear(); + self.update_expressions_to_bake(fun, fun_info, &context.expression); self.put_block(back::Level(1), &fun.body, &context)?; writeln!(self.out, "}}")?; if ep_index + 1 != module.entry_points.len() { diff --git a/third_party/rust/naga/src/back/spv/block.rs b/third_party/rust/naga/src/back/spv/block.rs index 02f441885c01b..0ab9c4a71f7e5 100644 --- a/third_party/rust/naga/src/back/spv/block.rs +++ b/third_party/rust/naga/src/back/spv/block.rs @@ -1,4 +1,6 @@ -//! Implementations for `BlockContext` methods. +/*! +Implementations for `BlockContext` methods. +*/ use super::{ index::BoundsCheckResult, make_local, selection::Selection, Block, BlockContext, Dimension, @@ -49,7 +51,7 @@ impl Writer { vector_size: None, kind: crate::ScalarKind::Float, width: 4, - pointer_class: Some(spirv::StorageClass::Output), + pointer_space: Some(spirv::StorageClass::Output), })); let index_y_id = self.get_index_constant(1); let access_id = self.id_gen.next(); @@ -64,7 +66,7 @@ impl Writer { vector_size: None, kind: crate::ScalarKind::Float, width: 4, - pointer_class: None, + pointer_space: None, })); let load_id = self.id_gen.next(); body.push(Instruction::load(float_type_id, load_id, access_id, None)); @@ -91,7 +93,7 @@ impl Writer { vector_size: None, kind: crate::ScalarKind::Float, width: 4, - pointer_class: None, + pointer_space: None, })); let value0_id = self.get_constant_scalar(crate::ScalarValue::Float(0.0), 4); let value1_id = self.get_constant_scalar(crate::ScalarValue::Float(1.0), 4); @@ -174,7 +176,7 @@ impl<'w> BlockContext<'w> { crate::Expression::GlobalVariable(_) | crate::Expression::LocalVariable(_) => true, crate::Expression::FunctionArgument(index) => { let arg = &self.ir_function.arguments[index as usize]; - self.ir_module.types[arg.ty].inner.pointer_class().is_some() + self.ir_module.types[arg.ty].inner.pointer_space().is_some() } // The chain rule: if this `Access...`'s `base` operand was @@ -552,13 +554,34 @@ impl<'w> BlockContext<'w> { Mf::Frexp => MathOp::Ext(spirv::GLOp::Frexp), Mf::Ldexp => MathOp::Ext(spirv::GLOp::Ldexp), // geometry - Mf::Dot => MathOp::Custom(Instruction::binary( - spirv::Op::Dot, - result_type_id, - id, - arg0_id, - arg1_id, - )), + Mf::Dot => match *self.fun_info[arg].ty.inner_with(&self.ir_module.types) { + crate::TypeInner::Vector { + kind: crate::ScalarKind::Float, + .. + } => MathOp::Custom(Instruction::binary( + spirv::Op::Dot, + result_type_id, + id, + arg0_id, + arg1_id, + )), + // TODO: consider using integer dot product if VK_KHR_shader_integer_dot_product is available + crate::TypeInner::Vector { size, .. } => { + self.write_dot_product( + id, + result_type_id, + arg0_id, + arg1_id, + size as u32, + block, + ); + self.cached[expr_handle] = id; + return Ok(()); + } + _ => unreachable!( + "Correct TypeInner for dot product should be already validated" + ), + }, Mf::Outer => MathOp::Custom(Instruction::binary( spirv::Op::OuterProduct, result_type_id, @@ -601,7 +624,7 @@ impl<'w> BlockContext<'w> { vector_size: Some(size), kind, width, - pointer_class: None, + pointer_space: None, })); self.temp_list.clear(); self.temp_list.resize(size as usize, arg2_id); @@ -699,18 +722,18 @@ impl<'w> BlockContext<'w> { match self.write_expression_pointer(pointer, block)? { ExpressionPointer::Ready { pointer_id } => { let id = self.gen_id(); - let atomic_class = + let atomic_space = match *self.fun_info[pointer].ty.inner_with(&self.ir_module.types) { - crate::TypeInner::Pointer { base, class } => { + crate::TypeInner::Pointer { base, space } => { match self.ir_module.types[base].inner { - crate::TypeInner::Atomic { .. } => Some(class), + crate::TypeInner::Atomic { .. } => Some(space), _ => None, } } _ => None, }; - let instruction = if let Some(class) = atomic_class { - let (semantics, scope) = class.to_spirv_semantics_and_scope(); + let instruction = if let Some(space) = atomic_space { + let (semantics, scope) = space.to_spirv_semantics_and_scope(); let scope_constant_id = self.get_scope_constant(scope as u32); let semantics_id = self.get_index_constant(semantics.bits()); Instruction::atomic_load( @@ -797,7 +820,7 @@ impl<'w> BlockContext<'w> { vector_size: Some(size), kind: src_kind, width: src_width, - pointer_class: None, + pointer_space: None, })); let components = [zero_scalar_id; 4]; @@ -834,7 +857,7 @@ impl<'w> BlockContext<'w> { vector_size: Some(size), kind, width: dst_width, - pointer_class: None, + pointer_space: None, })); let components0 = [scalar0_id; 4]; let components1 = [scalar1_id; 4]; @@ -892,10 +915,17 @@ impl<'w> BlockContext<'w> { image, coordinate, array_index, - index, - } => { - self.write_image_load(result_type_id, image, coordinate, array_index, index, block)? - } + sample, + level, + } => self.write_image_load( + result_type_id, + image, + coordinate, + array_index, + level, + sample, + block, + )?, crate::Expression::ImageSample { image, sampler, @@ -948,7 +978,7 @@ impl<'w> BlockContext<'w> { vector_size: Some(size), kind: crate::ScalarKind::Bool, width, - pointer_class: None, + pointer_space: None, })); let id = self.gen_id(); @@ -1120,6 +1150,68 @@ impl<'w> BlockContext<'w> { Ok(pointer) } + /// Build the instructions for the arithmetic expression of a dot product + fn write_dot_product( + &mut self, + result_id: Word, + result_type_id: Word, + arg0_id: Word, + arg1_id: Word, + size: u32, + block: &mut Block, + ) { + let const_null = self.gen_id(); + block + .body + .push(Instruction::constant_null(result_type_id, const_null)); + + let mut partial_sum = const_null; + let last_component = size - 1; + for index in 0..=last_component { + // compute the product of the current components + let a_id = self.gen_id(); + block.body.push(Instruction::composite_extract( + result_type_id, + a_id, + arg0_id, + &[index], + )); + let b_id = self.gen_id(); + block.body.push(Instruction::composite_extract( + result_type_id, + b_id, + arg1_id, + &[index], + )); + let prod_id = self.gen_id(); + block.body.push(Instruction::binary( + spirv::Op::IMul, + result_type_id, + prod_id, + a_id, + b_id, + )); + + // choose the id for the next sum, depending on current index + let id = if index == last_component { + result_id + } else { + self.gen_id() + }; + + // sum the computed product with the partial sum + block.body.push(Instruction::binary( + spirv::Op::IAdd, + result_type_id, + id, + partial_sum, + prod_id, + )); + // set the id of the result as the previous partial sum + partial_sum = id; + } + } + pub(super) fn write_block( &mut self, label_id: Word, @@ -1368,20 +1460,20 @@ impl<'w> BlockContext<'w> { let value_id = self.cached[value]; match self.write_expression_pointer(pointer, &mut block)? { ExpressionPointer::Ready { pointer_id } => { - let atomic_class = match *self.fun_info[pointer] + let atomic_space = match *self.fun_info[pointer] .ty .inner_with(&self.ir_module.types) { - crate::TypeInner::Pointer { base, class } => { + crate::TypeInner::Pointer { base, space } => { match self.ir_module.types[base].inner { - crate::TypeInner::Atomic { .. } => Some(class), + crate::TypeInner::Atomic { .. } => Some(space), _ => None, } } _ => None, }; - let instruction = if let Some(class) = atomic_class { - let (semantics, scope) = class.to_spirv_semantics_and_scope(); + let instruction = if let Some(space) = atomic_space { + let (semantics, scope) = space.to_spirv_semantics_and_scope(); let scope_constant_id = self.get_scope_constant(scope as u32); let semantics_id = self.get_index_constant(semantics.bits()); Instruction::atomic_store( @@ -1465,11 +1557,12 @@ impl<'w> BlockContext<'w> { } }; - let class = match *self.fun_info[pointer].ty.inner_with(&self.ir_module.types) { - crate::TypeInner::Pointer { base: _, class } => class, - _ => unimplemented!(), - }; - let (semantics, scope) = class.to_spirv_semantics_and_scope(); + let space = self.fun_info[pointer] + .ty + .inner_with(&self.ir_module.types) + .pointer_space() + .unwrap(); + let (semantics, scope) = space.to_spirv_semantics_and_scope(); let scope_constant_id = self.get_scope_constant(scope as u32); let semantics_id = self.get_index_constant(semantics.bits()); let value_id = self.cached[value]; diff --git a/third_party/rust/naga/src/back/spv/helpers.rs b/third_party/rust/naga/src/back/spv/helpers.rs index b5c7730465f1c..acde9504d9496 100644 --- a/third_party/rust/naga/src/back/spv/helpers.rs +++ b/third_party/rust/naga/src/back/spv/helpers.rs @@ -20,15 +20,15 @@ pub(super) fn string_to_words(input: &str) -> Vec { words } -pub(super) fn map_storage_class(class: crate::StorageClass) -> spirv::StorageClass { - match class { - crate::StorageClass::Handle => spirv::StorageClass::UniformConstant, - crate::StorageClass::Function => spirv::StorageClass::Function, - crate::StorageClass::Private => spirv::StorageClass::Private, - crate::StorageClass::Storage { .. } => spirv::StorageClass::StorageBuffer, - crate::StorageClass::Uniform => spirv::StorageClass::Uniform, - crate::StorageClass::WorkGroup => spirv::StorageClass::Workgroup, - crate::StorageClass::PushConstant => spirv::StorageClass::PushConstant, +pub(super) fn map_storage_class(space: crate::AddressSpace) -> spirv::StorageClass { + match space { + crate::AddressSpace::Handle => spirv::StorageClass::UniformConstant, + crate::AddressSpace::Function => spirv::StorageClass::Function, + crate::AddressSpace::Private => spirv::StorageClass::Private, + crate::AddressSpace::Storage { .. } => spirv::StorageClass::StorageBuffer, + crate::AddressSpace::Uniform => spirv::StorageClass::Uniform, + crate::AddressSpace::WorkGroup => spirv::StorageClass::Workgroup, + crate::AddressSpace::PushConstant => spirv::StorageClass::PushConstant, } } @@ -49,7 +49,7 @@ pub(super) fn contains_builtin( } } -impl crate::StorageClass { +impl crate::AddressSpace { pub(super) fn to_spirv_semantics_and_scope(self) -> (spirv::MemorySemantics, spirv::Scope) { match self { Self::Storage { .. } => (spirv::MemorySemantics::UNIFORM_MEMORY, spirv::Scope::Device), @@ -65,10 +65,10 @@ impl crate::StorageClass { /// Return true if the global requires a type decorated with "Block". // See `back::spv::GlobalVariable::access_id` for details. pub fn global_needs_wrapper(ir_module: &crate::Module, var: &crate::GlobalVariable) -> bool { - match var.class { - crate::StorageClass::Uniform - | crate::StorageClass::Storage { .. } - | crate::StorageClass::PushConstant => {} + match var.space { + crate::AddressSpace::Uniform + | crate::AddressSpace::Storage { .. } + | crate::AddressSpace::PushConstant => {} _ => return false, }; match ir_module.types[var.ty].inner { @@ -86,6 +86,7 @@ pub fn global_needs_wrapper(ir_module: &crate::Module, var: &crate::GlobalVariab }, None => false, }, - _ => false, + // if it's not a structure, let's wrap it to be able to put "Block" + _ => true, } } diff --git a/third_party/rust/naga/src/back/spv/image.rs b/third_party/rust/naga/src/back/spv/image.rs index 443ef8c57e719..06eb21cb9c78a 100644 --- a/third_party/rust/naga/src/back/spv/image.rs +++ b/third_party/rust/naga/src/back/spv/image.rs @@ -1,4 +1,6 @@ -//! Generating SPIR-V for image operations. +/*! +Generating SPIR-V for image operations. +*/ use super::{ selection::{MergeTuple, Selection}, @@ -33,16 +35,18 @@ struct ImageCoordinates { /// A trait for image access (load or store) code generators. /// -/// When generating code for `ImageLoad` and `ImageStore` expressions, the image -/// bounds checks policy can affect some operands of the image access -/// instruction (the coordinates, level of detail, and sample index), but other -/// aspects are unaffected: the image id, result type (if any), and the specific -/// SPIR-V instruction used. +/// Types implementing this trait hold information about an `ImageStore` or +/// `ImageLoad` operation that is not affected by the bounds check policy. The +/// `generate` method emits code for the access, given the results of bounds +/// checking. /// -/// This struct holds the latter category of information, saving us from passing -/// a half-dozen parameters along the various code paths. The parts that are -/// affected by bounds checks, are passed as parameters to the `generate` -/// method. +/// The [`image`] bounds checks policy affects access coordinates, level of +/// detail, and sample index, but never the image id, result type (if any), or +/// the specific SPIR-V instruction used. Types that implement this trait gather +/// together the latter category, so we don't have to plumb them through the +/// bounds-checking code. +/// +/// [`image`]: crate::proc::BoundsCheckPolicies::index trait Access { /// The Rust type that represents SPIR-V values and types for this access. /// @@ -126,7 +130,7 @@ impl Load { vector_size: Some(crate::VectorSize::Quad), kind: crate::ScalarKind::Float, width: 4, - pointer_class: None, + pointer_space: None, })) } _ => result_type_id, @@ -318,7 +322,7 @@ impl<'w> BlockContext<'w> { vector_size: None, kind: component_kind, width: 4, - pointer_class: None, + pointer_space: None, })); let reconciled_id = self.gen_id(); @@ -336,7 +340,7 @@ impl<'w> BlockContext<'w> { vector_size: size, kind: component_kind, width: 4, - pointer_class: None, + pointer_space: None, })); // Schmear the coordinates and index together. @@ -505,7 +509,7 @@ impl<'w> BlockContext<'w> { vector_size: None, kind: crate::ScalarKind::Sint, width: 4, - pointer_class: None, + pointer_space: None, })); // If `level` is `Some`, clamp it to fall within bounds. This must @@ -593,7 +597,7 @@ impl<'w> BlockContext<'w> { vector_size: None, kind: crate::ScalarKind::Sint, width: 4, - pointer_class: None, + pointer_space: None, })); let null_id = access.out_of_bounds_value(self); @@ -661,7 +665,7 @@ impl<'w> BlockContext<'w> { vector_size: coordinates.size, kind: crate::ScalarKind::Bool, width: 1, - pointer_class: None, + pointer_space: None, })); let coords_conds_id = self.gen_id(); selection.block().body.push(Instruction::binary( @@ -705,13 +709,15 @@ impl<'w> BlockContext<'w> { /// Generate code for an `ImageLoad` expression. /// /// The arguments are the components of an `Expression::ImageLoad` variant. + #[allow(clippy::too_many_arguments)] pub(super) fn write_image_load( &mut self, result_type_id: Word, image: Handle, coordinate: Handle, array_index: Option>, - level_or_sample: Option>, + level: Option>, + sample: Option>, block: &mut Block, ) -> Result { let image_id = self.get_image_id(image); @@ -724,18 +730,8 @@ impl<'w> BlockContext<'w> { let access = Load::from_image_expr(self, image_id, image_class, result_type_id)?; let coordinates = self.write_image_coordinates(coordinate, array_index, block)?; - // Figure out what the `level_or_sample` operand really means. - let level_or_sample_id = level_or_sample.map(|i| self.cached[i]); - let (level_id, sample_id) = match image_class { - crate::ImageClass::Sampled { multi, .. } | crate::ImageClass::Depth { multi } => { - if multi { - (None, level_or_sample_id) - } else { - (level_or_sample_id, None) - } - } - crate::ImageClass::Storage { .. } => (None, None), - }; + let level_id = level.map(|expr| self.cached[expr]); + let sample_id = sample.map(|expr| self.cached[expr]); // Perform the access, according to the bounds check policy. let access_id = match self.writer.bounds_check_policies.image { @@ -825,7 +821,7 @@ impl<'w> BlockContext<'w> { vector_size: Some(crate::VectorSize::Quad), kind: crate::ScalarKind::Float, width: 4, - pointer_class: None, + pointer_space: None, })) } else { result_type_id @@ -1029,12 +1025,14 @@ impl<'w> BlockContext<'w> { vector_size, kind: crate::ScalarKind::Sint, width: 4, - pointer_class: None, + pointer_space: None, })) }; let (query_op, level_id) = match class { - Ic::Storage { .. } => (spirv::Op::ImageQuerySize, None), + Ic::Sampled { multi: true, .. } + | Ic::Depth { multi: true } + | Ic::Storage { .. } => (spirv::Op::ImageQuerySize, None), _ => { let level_id = match level { Some(expr) => self.cached[expr], @@ -1097,7 +1095,7 @@ impl<'w> BlockContext<'w> { vector_size: Some(vec_size), kind: crate::ScalarKind::Sint, width: 4, - pointer_class: None, + pointer_space: None, })); let id_extended = self.gen_id(); let mut inst = Instruction::image_query( diff --git a/third_party/rust/naga/src/back/spv/index.rs b/third_party/rust/naga/src/back/spv/index.rs index c2b198048ad33..d2cbdf4d6dbd6 100644 --- a/third_party/rust/naga/src/back/spv/index.rs +++ b/third_party/rust/naga/src/back/spv/index.rs @@ -1,6 +1,11 @@ -//! Bounds-checking for SPIR-V output. - -use super::{selection::Selection, Block, BlockContext, Error, IdGenerator, Instruction, Word}; +/*! +Bounds-checking for SPIR-V output. +*/ + +use super::{ + helpers::global_needs_wrapper, selection::Selection, Block, BlockContext, Error, IdGenerator, + Instruction, Word, +}; use crate::{arena::Handle, proc::BoundsCheckPolicy}; /// The results of performing a bounds check. @@ -30,16 +35,18 @@ pub(super) enum MaybeKnown { impl<'w> BlockContext<'w> { /// Emit code to compute the length of a run-time array. /// - /// Given `array`, an expression referring to the final member of a struct, - /// where the member in question is a runtime-sized array, return the + /// Given `array`, an expression referring a runtime-sized array, return the /// instruction id for the array's length. pub(super) fn write_runtime_array_length( &mut self, array: Handle, block: &mut Block, ) -> Result { - // Look into the expression to find the value and type of the struct - // holding the dynamically-sized array. + // Naga IR permits runtime-sized arrays as global variables or as the + // final member of a struct that is a global variable. SPIR-V permits + // only the latter, so this back end wraps bare runtime-sized arrays + // in a made-up struct; see `helpers::global_needs_wrapper` and its uses. + // This code must handle both cases. let (structure_id, last_member_index) = match self.ir_function.expressions[array] { crate::Expression::AccessIndex { base, index } => { match self.ir_function.expressions[base] { @@ -50,6 +57,14 @@ impl<'w> BlockContext<'w> { _ => return Err(Error::Validation("array length expression")), } } + crate::Expression::GlobalVariable(handle) => { + let global = &self.ir_module.global_variables[handle]; + if !global_needs_wrapper(self.ir_module, global) { + return Err(Error::Validation("array length expression")); + } + + (self.writer.global_variables[handle.index()].var_id, 0) + } _ => return Err(Error::Validation("array length expression")), }; @@ -79,14 +94,18 @@ impl<'w> BlockContext<'w> { block: &mut Block, ) -> Result, Error> { let sequence_ty = self.fun_info[sequence].ty.inner_with(&self.ir_module.types); - match sequence_ty.indexable_length(self.ir_module)? { - crate::proc::IndexableLength::Known(known_length) => { + match sequence_ty.indexable_length(self.ir_module) { + Ok(crate::proc::IndexableLength::Known(known_length)) => { Ok(MaybeKnown::Known(known_length)) } - crate::proc::IndexableLength::Dynamic => { + Ok(crate::proc::IndexableLength::Dynamic) => { let length_id = self.write_runtime_array_length(sequence, block)?; Ok(MaybeKnown::Computed(length_id)) } + Err(err) => { + log::error!("Sequence length for {:?} failed: {}", sequence, err); + Err(Error::Validation("indexable length")) + } } } @@ -309,7 +328,7 @@ impl<'w> BlockContext<'w> { /// Emit code for bounds checks for an array, vector, or matrix access. /// /// This implements either `index_bounds_check_policy` or - /// `buffer_bounds_check_policy`, depending on the storage class of the + /// `buffer_bounds_check_policy`, depending on the address space of the /// pointer being accessed. /// /// Return a `BoundsCheckResult` indicating how the index should be diff --git a/third_party/rust/naga/src/back/spv/mod.rs b/third_party/rust/naga/src/back/spv/mod.rs index 8dc574dfe8cd1..538147ed1690c 100644 --- a/third_party/rust/naga/src/back/spv/mod.rs +++ b/third_party/rust/naga/src/back/spv/mod.rs @@ -1,5 +1,8 @@ -/*! Standard Portable Intermediate Representation (SPIR-V) backend -!*/ +/*! +Backend for [SPIR-V][spv] (Standard Portable Intermediate Representation). + +[spv]: https://www.khronos.org/registry/SPIR-V/ +*/ mod block; mod helpers; @@ -66,8 +69,6 @@ pub enum Error { FeatureNotImplemented(&'static str), #[error("module is not validated properly: {0}")] Validation(&'static str), - #[error(transparent)] - Proc(#[from] crate::proc::ProcError), } #[derive(Default)] @@ -269,7 +270,7 @@ enum LocalType { vector_size: Option, kind: crate::ScalarKind, width: crate::Bytes, - pointer_class: Option, + pointer_space: Option, }, /// A matrix of floating-point values. Matrix { @@ -335,14 +336,14 @@ fn make_local(inner: &crate::TypeInner) -> Option { vector_size: None, kind, width, - pointer_class: None, + pointer_space: None, } } crate::TypeInner::Vector { size, kind, width } => LocalType::Value { vector_size: Some(size), kind, width, - pointer_class: None, + pointer_space: None, }, crate::TypeInner::Matrix { columns, @@ -353,20 +354,20 @@ fn make_local(inner: &crate::TypeInner) -> Option { rows, width, }, - crate::TypeInner::Pointer { base, class } => LocalType::Pointer { + crate::TypeInner::Pointer { base, space } => LocalType::Pointer { base, - class: helpers::map_storage_class(class), + class: helpers::map_storage_class(space), }, crate::TypeInner::ValuePointer { size, kind, width, - class, + space, } => LocalType::Value { vector_size: size, kind, width, - pointer_class: Some(helpers::map_storage_class(class)), + pointer_space: Some(helpers::map_storage_class(space)), }, crate::TypeInner::Image { dim, @@ -432,12 +433,25 @@ impl recyclable::Recyclable for CachedExpressions { #[derive(Clone)] struct GlobalVariable { - /// ID of the variable. Not really used. + /// ID of the OpVariable that declares the global. + /// + /// If you need the variable's value, use [`access_id`] instead of this + /// field. If we wrapped the Naga IR `GlobalVariable`'s type in a struct to + /// comply with Vulkan's requirements, then this points to the `OpVariable` + /// with the synthesized struct type, whereas `access_id` points to the + /// field of said struct that holds the variable's actual value. + /// + /// This is used to compute the `access_id` pointer in function prologues, + /// and used for `ArrayLength` expressions, which do need the struct. + /// + /// [`access_id`]: GlobalVariable::access_id var_id: Word, - /// For `StorageClass::Handle` variables, this ID is recorded in the function + + /// For `AddressSpace::Handle` variables, this ID is recorded in the function /// prelude block (and reset before every function) as `OpLoad` of the variable. /// It is then used for all the global ops, such as `OpImageSample`. handle_id: Word, + /// Actual ID used to access this variable. /// For wrapped buffer variables, this ID is `OpAccessChain` into the /// wrapper. Otherwise, the same as `var_id`. @@ -629,17 +643,16 @@ impl Default for Options { } } -// A subset of options that are meant to be changed per pipeline. +// A subset of options meant to be changed per pipeline. #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub struct PipelineOptions { - /// The stage of the entry point + /// The stage of the entry point. pub shader_stage: crate::ShaderStage, - /// The name of the entry point + /// The name of the entry point. /// - /// If no entry point that matches is found a error will be thrown while creating a new instance - /// of [`Writer`](struct.Writer.html) + /// If no entry point that matches is found while creating a [`Writer`], a error will be thrown. pub entry_point: String, } diff --git a/third_party/rust/naga/src/back/spv/recyclable.rs b/third_party/rust/naga/src/back/spv/recyclable.rs index e8813497f35a0..6cedcd07864f5 100644 --- a/third_party/rust/naga/src/back/spv/recyclable.rs +++ b/third_party/rust/naga/src/back/spv/recyclable.rs @@ -1,4 +1,6 @@ -//! Reusing collections' previous allocations. +/*! +Reusing collections' previous allocations. +*/ /// A value that can be reset to its initial state, retaining its current allocations. /// diff --git a/third_party/rust/naga/src/back/spv/selection.rs b/third_party/rust/naga/src/back/spv/selection.rs index 5922deddeafff..788b1f10ab81f 100644 --- a/third_party/rust/naga/src/back/spv/selection.rs +++ b/third_party/rust/naga/src/back/spv/selection.rs @@ -1,59 +1,61 @@ -//! Generate SPIR-V conditional structures. -//! -//! Builders for `if` structures with `and`s. -//! -//! The types in this module track the information needed to emit SPIR-V code -//! for complex conditional structures, like those whose conditions involve -//! short-circuiting 'and' and 'or' structures. These track labels and can emit -//! `OpPhi` instructions to merge values produced along different paths. -//! -//! This currently only supports exactly the forms Naga uses, so it doesn't -//! support `or` or `else`, and only supports zero or one merged values. -//! -//! Naga needs to emit code roughly like this: -//! -//! ```ignore -//! -//! value = DEFAULT; -//! if COND1 && COND2 { -//! value = THEN_VALUE; -//! } -//! // use value -//! -//! ``` -//! -//! Assuming `ctx` and `block` are a mutable references to a [`BlockContext`] -//! and the current [`Block`], and `merge_type` is the SPIR-V type for the -//! merged value `value`, we can build SPIR-V for the code above like so: -//! -//! ```ignore -//! -//! let cond = Selection::start(block, merge_type); -//! // ... compute `cond1` ... -//! cond.if_true(ctx, cond1, DEFAULT); -//! // ... compute `cond2` ... -//! cond.if_true(ctx, cond2, DEFAULT); -//! // ... compute THEN_VALUE -//! let merged_value = cond.finish(ctx, THEN_VALUE); -//! -//! ``` -//! -//! After this, `merged_value` is either `DEFAULT` or `THEN_VALUE`, depending on -//! the path by which the merged block was reached. -//! -//! This takes care of writing all branch instructions, including an -//! `OpSelectionMerge` annotation in the header block; starting new blocks and -//! assigning them labels; and emitting the `OpPhi` that gathers together the -//! right sources for the merged values, for every path through the selection -//! construct. -//! -//! When there is no merged value to produce, you can pass `()` for `merge_type` -//! and the merge values. In this case no `OpPhi` instructions are produced, and -//! the `finish` method returns `()`. -//! -//! To enforce proper nesting, a `Selection` takes ownership of the `&mut Block` -//! pointer for the duration of its lifetime. To obtain the block for generating -//! code in the selection's body, call the `Selection::block` method. +/*! +Generate SPIR-V conditional structures. + +Builders for `if` structures with `and`s. + +The types in this module track the information needed to emit SPIR-V code +for complex conditional structures, like those whose conditions involve +short-circuiting 'and' and 'or' structures. These track labels and can emit +`OpPhi` instructions to merge values produced along different paths. + +This currently only supports exactly the forms Naga uses, so it doesn't +support `or` or `else`, and only supports zero or one merged values. + +Naga needs to emit code roughly like this: + +```ignore + + value = DEFAULT; + if COND1 && COND2 { + value = THEN_VALUE; + } + // use value + +``` + +Assuming `ctx` and `block` are a mutable references to a [`BlockContext`] +and the current [`Block`], and `merge_type` is the SPIR-V type for the +merged value `value`, we can build SPIR-V for the code above like so: + +```ignore + + let cond = Selection::start(block, merge_type); + // ... compute `cond1` ... + cond.if_true(ctx, cond1, DEFAULT); + // ... compute `cond2` ... + cond.if_true(ctx, cond2, DEFAULT); + // ... compute THEN_VALUE + let merged_value = cond.finish(ctx, THEN_VALUE); + +``` + +After this, `merged_value` is either `DEFAULT` or `THEN_VALUE`, depending on +the path by which the merged block was reached. + +This takes care of writing all branch instructions, including an +`OpSelectionMerge` annotation in the header block; starting new blocks and +assigning them labels; and emitting the `OpPhi` that gathers together the +right sources for the merged values, for every path through the selection +construct. + +When there is no merged value to produce, you can pass `()` for `merge_type` +and the merge values. In this case no `OpPhi` instructions are produced, and +the `finish` method returns `()`. + +To enforce proper nesting, a `Selection` takes ownership of the `&mut Block` +pointer for the duration of its lifetime. To obtain the block for generating +code in the selection's body, call the `Selection::block` method. +*/ use super::{Block, BlockContext, Instruction}; use spirv::Word; diff --git a/third_party/rust/naga/src/back/spv/writer.rs b/third_party/rust/naga/src/back/spv/writer.rs index 797e67e4e0366..dad763b243558 100644 --- a/third_party/rust/naga/src/back/spv/writer.rs +++ b/third_party/rust/naga/src/back/spv/writer.rs @@ -223,7 +223,7 @@ impl Writer { vector_size: None, kind: crate::ScalarKind::Uint, width: 4, - pointer_class: None, + pointer_space: None, }; self.get_type_id(local_type.into()) } @@ -233,7 +233,7 @@ impl Writer { vector_size: None, kind: crate::ScalarKind::Float, width: 4, - pointer_class: None, + pointer_space: None, }; self.get_type_id(local_type.into()) } @@ -243,7 +243,7 @@ impl Writer { vector_size: None, kind: crate::ScalarKind::Float, width: 4, - pointer_class: Some(class), + pointer_space: Some(class), }); if let Some(&id) = self.lookup_type.get(&lookup_type) { id @@ -262,7 +262,7 @@ impl Writer { vector_size: None, kind: crate::ScalarKind::Bool, width: 1, - pointer_class: None, + pointer_space: None, }; self.get_type_id(local_type.into()) } @@ -497,7 +497,7 @@ impl Writer { let mut gv = self.global_variables[handle.index()].clone(); // Handle globals are pre-emitted and should be loaded automatically. - if var.class == crate::StorageClass::Handle { + if var.space == crate::AddressSpace::Handle { let var_type_id = self.get_type_id(LookupType::Handle(var.ty)); let id = self.id_gen.next(); prelude @@ -506,7 +506,7 @@ impl Writer { gv.access_id = gv.var_id; gv.handle_id = id; } else if global_needs_wrapper(ir_module, var) { - let class = map_storage_class(var.class); + let class = map_storage_class(var.space); let pointer_type_id = self.get_pointer_id(&ir_module.types, var.ty, class)?; let index_id = self.get_index_constant(0); @@ -727,19 +727,19 @@ impl Writer { vector_size: None, kind, width, - pointer_class: None, + pointer_space: None, } => self.make_scalar(id, kind, width), LocalType::Value { vector_size: Some(size), kind, width, - pointer_class: None, + pointer_space: None, } => { let scalar_id = self.get_type_id(LookupType::Local(LocalType::Value { vector_size: None, kind, width, - pointer_class: None, + pointer_space: None, })); Instruction::type_vector(id, scalar_id, size) } @@ -752,7 +752,7 @@ impl Writer { vector_size: Some(rows), kind: crate::ScalarKind::Float, width, - pointer_class: None, + pointer_space: None, })); Instruction::type_matrix(id, vector_id, columns) } @@ -764,13 +764,13 @@ impl Writer { vector_size, kind, width, - pointer_class: Some(class), + pointer_space: Some(class), } => { let type_id = self.get_type_id(LookupType::Local(LocalType::Value { vector_size, kind, width, - pointer_class: None, + pointer_space: None, })); Instruction::type_pointer(id, class, type_id) } @@ -779,7 +779,7 @@ impl Writer { vector_size: None, kind: image.sampled_type, width: 4, - pointer_class: None, + pointer_space: None, }; let type_id = self.get_type_id(LookupType::Local(local_type)); Instruction::type_image(id, type_id, image.dim, image.flags, image.image_format) @@ -1018,7 +1018,7 @@ impl Writer { vector_size: None, kind: value.scalar_kind(), width, - pointer_class: None, + pointer_space: None, })); let (solo, pair); let instruction = match *value { @@ -1239,7 +1239,7 @@ impl Writer { use spirv::Decoration; let id = self.id_gen.next(); - let class = map_storage_class(global_variable.class); + let class = map_storage_class(global_variable.space); //self.check(class.required_capabilities())?; @@ -1249,8 +1249,8 @@ impl Writer { } } - let storage_access = match global_variable.class { - crate::StorageClass::Storage { access } => Some(access), + let storage_access = match global_variable.space { + crate::AddressSpace::Storage { access } => Some(access), _ => match ir_module.types[global_variable.ty].inner { crate::TypeInner::Image { class: crate::ImageClass::Storage { access, .. }, @@ -1298,10 +1298,11 @@ impl Writer { pointer_type_id } else { - // This is a global variable in a Storage class. The only way it could - // have `global_needs_wrapper() == false` is if it has a runtime-sized array. - // In this case, we need to decorate it with Block. - if let crate::StorageClass::Storage { .. } = global_variable.class { + // This is a global variable in the Storage address space. The only + // way it could have `global_needs_wrapper() == false` is if it has + // a runtime-sized array. In this case, we need to decorate it with + // Block. + if let crate::AddressSpace::Storage { .. } = global_variable.space { self.decorate(inner_type_id, Decoration::Block, &[]); } self.get_pointer_id(&ir_module.types, global_variable.ty, class)? @@ -1359,8 +1360,8 @@ impl Writer { ir_module .global_variables .iter() - .any(|(_, var)| match var.class { - crate::StorageClass::Storage { .. } => true, + .any(|(_, var)| match var.space { + crate::AddressSpace::Storage { .. } => true, _ => false, }); let has_view_index = ir_module diff --git a/third_party/rust/naga/src/back/wgsl/mod.rs b/third_party/rust/naga/src/back/wgsl/mod.rs index b934662e136f8..0a705691c6baa 100644 --- a/third_party/rust/naga/src/back/wgsl/mod.rs +++ b/third_party/rust/naga/src/back/wgsl/mod.rs @@ -1,3 +1,9 @@ +/*! +Backend for [WGSL][wgsl] (WebGPU Shading Language). + +[wgsl]: https://gpuweb.github.io/gpuweb/wgsl.html +*/ + mod writer; use thiserror::Error; diff --git a/third_party/rust/naga/src/back/wgsl/writer.rs b/third_party/rust/naga/src/back/wgsl/writer.rs index 59c7048c33708..9315e637579ba 100644 --- a/third_party/rust/naga/src/back/wgsl/writer.rs +++ b/third_party/rust/naga/src/back/wgsl/writer.rs @@ -17,7 +17,6 @@ enum Attribute { Interpolate(Option, Option), Location(u32), Stage(ShaderStage), - Stride(u32), WorkGroupSize([u32; 3]), } @@ -159,7 +158,7 @@ impl Writer { ], }; - self.write_attributes(&attributes, false)?; + self.write_attributes(&attributes)?; // Add a newline after attribute writeln!(self.out)?; @@ -244,11 +243,10 @@ impl Writer { for (index, arg) in func.arguments.iter().enumerate() { // Write argument attribute if a binding is present if let Some(ref binding) = arg.binding { - self.write_attributes( - &map_binding_to_attribute(binding, module.types[arg.ty].inner.scalar_kind()), - false, - )?; - write!(self.out, " ")?; + self.write_attributes(&map_binding_to_attribute( + binding, + module.types[arg.ty].inner.scalar_kind(), + ))?; } // Write argument name let argument_name = match func_ctx.ty { @@ -275,10 +273,10 @@ impl Writer { if let Some(ref result) = func.result { write!(self.out, " -> ")?; if let Some(ref binding) = result.binding { - self.write_attributes( - &map_binding_to_attribute(binding, module.types[result.ty].inner.scalar_kind()), - true, - )?; + self.write_attributes(&map_binding_to_attribute( + binding, + module.types[result.ty].inner.scalar_kind(), + ))?; } self.write_type(module, result.ty)?; } @@ -331,62 +329,39 @@ impl Writer { } /// Helper method to write a attribute - /// - /// # Notes - /// Adds an extra space if required - fn write_attributes(&mut self, attributes: &[Attribute], extra_space: bool) -> BackendResult { - write!(self.out, "[[")?; - - let mut need_last_comma = true; - if let Some(last_attrib) = attributes.last() { - // We duplicate the logic a little, but this will help to avoid extra heap allocation - match *last_attrib { - Attribute::BuiltIn(builtin_attrib) => { - need_last_comma = builtin_str(builtin_attrib).is_some(); - } - Attribute::Interpolate(interpolation, sampling) => { - need_last_comma = (sampling.is_some() - && sampling != Some(crate::Sampling::Center)) - || (interpolation.is_some() - && interpolation != Some(crate::Interpolation::Perspective)) - } - _ => {} - } - } - - for (index, attribute) in attributes.iter().enumerate() { + fn write_attributes(&mut self, attributes: &[Attribute]) -> BackendResult { + for attribute in attributes { match *attribute { - Attribute::Location(id) => write!(self.out, "location({})", id)?, + Attribute::Location(id) => write!(self.out, "@location({}) ", id)?, Attribute::BuiltIn(builtin_attrib) => { if let Some(builtin) = builtin_str(builtin_attrib) { - write!(self.out, "builtin({})", builtin)?; + write!(self.out, "@builtin({}) ", builtin)?; } else { log::warn!("Unsupported builtin attribute: {:?}", builtin_attrib); } } Attribute::Stage(shader_stage) => { let stage_str = match shader_stage { - ShaderStage::Vertex => "stage(vertex)", - ShaderStage::Fragment => "stage(fragment)", - ShaderStage::Compute => "stage(compute)", + ShaderStage::Vertex => "vertex", + ShaderStage::Fragment => "fragment", + ShaderStage::Compute => "compute", }; - write!(self.out, "{}", stage_str)?; + write!(self.out, "@stage({}) ", stage_str)?; } - Attribute::Stride(stride) => write!(self.out, "stride({})", stride)?, Attribute::WorkGroupSize(size) => { write!( self.out, - "workgroup_size({}, {}, {})", + "@workgroup_size({}, {}, {}) ", size[0], size[1], size[2] )?; } - Attribute::Binding(id) => write!(self.out, "binding({})", id)?, - Attribute::Group(id) => write!(self.out, "group({})", id)?, + Attribute::Binding(id) => write!(self.out, "@binding({}) ", id)?, + Attribute::Group(id) => write!(self.out, "@group({}) ", id)?, Attribute::Interpolate(interpolation, sampling) => { if sampling.is_some() && sampling != Some(crate::Sampling::Center) { write!( self.out, - "interpolate({}, {})", + "@interpolate({}, {}) ", interpolation_str( interpolation.unwrap_or(crate::Interpolation::Perspective) ), @@ -397,7 +372,7 @@ impl Writer { { write!( self.out, - "interpolate({})", + "@interpolate({}) ", interpolation_str( interpolation.unwrap_or(crate::Interpolation::Perspective) ) @@ -405,19 +380,7 @@ impl Writer { } } }; - - // Only write a comma if isn't the last element - if index + 1 != attributes.len() && need_last_comma { - // The leading space is for readability only - write!(self.out, ", ")?; - } - } - - write!(self.out, "]]")?; - if extra_space { - write!(self.out, " ")?; } - Ok(()) } @@ -447,25 +410,16 @@ impl Writer { // The indentation is only for readability write!(self.out, "{}", back::INDENT)?; if let Some(ref binding) = member.binding { - self.write_attributes( - &map_binding_to_attribute(binding, module.types[member.ty].inner.scalar_kind()), - true, - )?; + self.write_attributes(&map_binding_to_attribute( + binding, + module.types[member.ty].inner.scalar_kind(), + ))?; } // Write struct member name and type let member_name = &self.names[&NameKey::StructMember(handle, index as u32)]; write!(self.out, "{}: ", member_name)?; - // Write stride attribute for array struct member - if let TypeInner::Array { - base: _, - size: _, - stride, - } = module.types[member.ty].inner - { - self.write_attributes(&[Attribute::Stride(stride)], true)?; - } self.write_type(module, member.ty)?; - write!(self.out, ";")?; + write!(self.out, ",")?; writeln!(self.out)?; } @@ -558,7 +512,11 @@ impl Writer { TypeInner::Atomic { kind, .. } => { write!(self.out, "atomic<{}>", scalar_kind_str(kind))?; } - TypeInner::Array { base, size, .. } => { + TypeInner::Array { + base, + size, + stride: _, + } => { // More info https://gpuweb.github.io/gpuweb/wgsl/#array-types // array -- Constant array // array -- Dynamic array @@ -588,16 +546,16 @@ impl Writer { back::vector_size_str(rows), )?; } - TypeInner::Pointer { base, class } => { - let (storage, maybe_access) = storage_class_str(class); - // Everything but `StorageClass::Handle` gives us a `storage` name, but + TypeInner::Pointer { base, space } => { + let (address, maybe_access) = address_space_str(space); + // Everything but `AddressSpace::Handle` gives us a `address` name, but // Naga IR never produces pointers to handles, so it doesn't matter much // how we write such a type. Just write it as the base type alone. - if let Some(class) = storage { - write!(self.out, "ptr<{}, ", class)?; + if let Some(space) = address { + write!(self.out, "ptr<{}, ", space)?; } self.write_type(module, base)?; - if storage.is_some() { + if address.is_some() { if let Some(access) = maybe_access { write!(self.out, ", {}", access)?; } @@ -608,18 +566,18 @@ impl Writer { size: None, kind, width: _, - class, + space, } => { - let (storage, maybe_access) = storage_class_str(class); - if let Some(class) = storage { - write!(self.out, "ptr<{}, {}", class, scalar_kind_str(kind))?; + let (address, maybe_access) = address_space_str(space); + if let Some(space) = address { + write!(self.out, "ptr<{}, {}", space, scalar_kind_str(kind))?; if let Some(access) = maybe_access { write!(self.out, ", {}", access)?; } write!(self.out, ">")?; } else { return Err(Error::Unimplemented(format!( - "ValuePointer to StorageClass::Handle {:?}", + "ValuePointer to AddressSpace::Handle {:?}", inner ))); } @@ -628,14 +586,14 @@ impl Writer { size: Some(size), kind, width: _, - class, + space, } => { - let (storage, maybe_access) = storage_class_str(class); - if let Some(class) = storage { + let (address, maybe_access) = address_space_str(space); + if let Some(space) = address { write!( self.out, "ptr<{}, vec{}<{}>", - class, + space, back::vector_size_str(size), scalar_kind_str(kind) )?; @@ -645,7 +603,7 @@ impl Writer { write!(self.out, ">")?; } else { return Err(Error::Unimplemented(format!( - "ValuePointer to StorageClass::Handle {:?}", + "ValuePointer to AddressSpace::Handle {:?}", inner ))); } @@ -733,9 +691,9 @@ impl Writer { ref reject, } => { write!(self.out, "{}", level)?; - write!(self.out, "if (")?; + write!(self.out, "if ")?; self.write_expr(module, condition, func_ctx)?; - writeln!(self.out, ") {{")?; + writeln!(self.out, " {{")?; let l2 = level.next(); for sta in accept { @@ -887,9 +845,9 @@ impl Writer { } => { // Start the switch write!(self.out, "{}", level)?; - write!(self.out, "switch(")?; + write!(self.out, "switch ")?; self.write_expr(module, selector, func_ctx)?; - writeln!(self.out, ") {{")?; + writeln!(self.out, " {{")?; let type_postfix = match *func_ctx.info[selector].ty.inner_with(&module.types) { crate::TypeInner::Scalar { @@ -977,7 +935,7 @@ impl Writer { /// /// - The plain form of `GlobalVariable(g)` is simply `g`, which is usually a /// reference to the global variable's storage. However, globals in the - /// `Handle` storage class are immutable, and `GlobalVariable` expressions for + /// `Handle` address space are immutable, and `GlobalVariable` expressions for /// those produce the value directly, not a pointer to it. Such /// `GlobalVariable` expressions are `Ordinary`. /// @@ -1008,8 +966,8 @@ impl Writer { Ex::LocalVariable(_) => Indirection::Reference, Ex::GlobalVariable(handle) => { let global = &module.global_variables[handle]; - match global.class { - crate::StorageClass::Handle => Indirection::Ordinary, + match global.space { + crate::AddressSpace::Handle => Indirection::Ordinary, _ => Indirection::Reference, } } @@ -1207,7 +1165,7 @@ impl Writer { self.write_expr_with_indirection(module, base, func_ctx, indirection)?; let base_ty_handle = match *resolved { - TypeInner::Pointer { base, class: _ } => { + TypeInner::Pointer { base, space: _ } => { resolved = &module.types[base].inner; Some(base) } @@ -1377,7 +1335,8 @@ impl Writer { image, coordinate, array_index, - index, + sample, + level, } => { write!(self.out, "textureLoad(")?; self.write_expr(module, image, func_ctx)?; @@ -1387,7 +1346,7 @@ impl Writer { write!(self.out, ", ")?; self.write_expr(module, array_index, func_ctx)?; } - if let Some(index) = index { + if let Some(index) = sample.or(level) { write!(self.out, ", ")?; self.write_expr(module, index, func_ctx)?; } @@ -1568,8 +1527,8 @@ impl Writer { Mf::ReverseBits => Function::Regular("reverseBits"), Mf::ExtractBits => Function::Regular("extractBits"), Mf::InsertBits => Function::Regular("insertBits"), - Mf::FindLsb => Function::Regular("findLsb"), - Mf::FindMsb => Function::Regular("findMsb"), + Mf::FindLsb => Function::Regular("firstTrailingBit"), + Mf::FindMsb => Function::Regular("firstLeadingBit"), // data packing Mf::Pack4x8snorm => Function::Regular("pack4x8snorm"), Mf::Pack4x8unorm => Function::Regular("pack4x8unorm"), @@ -1716,21 +1675,18 @@ impl Writer { ) -> BackendResult { // Write group and dinding attributes if present if let Some(ref binding) = global.binding { - self.write_attributes( - &[ - Attribute::Group(binding.group), - Attribute::Binding(binding.binding), - ], - false, - )?; + self.write_attributes(&[ + Attribute::Group(binding.group), + Attribute::Binding(binding.binding), + ])?; writeln!(self.out)?; } - // First write global name and storage class if supported + // First write global name and address space if supported write!(self.out, "var")?; - let (storage, maybe_access) = storage_class_str(global.class); - if let Some(class) = storage { - write!(self.out, "<{}", class)?; + let (address, maybe_access) = address_space_str(global.space); + if let Some(space) = address { + write!(self.out, "<{}", space)?; if let Some(access) = maybe_access { write!(self.out, ", {}", access)?; } @@ -1991,26 +1947,24 @@ fn sampling_str(sampling: crate::Sampling) -> &'static str { } } -fn storage_class_str( - storage_class: crate::StorageClass, -) -> (Option<&'static str>, Option<&'static str>) { - use crate::StorageClass as Sc; +fn address_space_str(space: crate::AddressSpace) -> (Option<&'static str>, Option<&'static str>) { + use crate::AddressSpace as As; ( - Some(match storage_class { - Sc::Private => "private", - Sc::Uniform => "uniform", - Sc::Storage { access } => { + Some(match space { + As::Private => "private", + As::Uniform => "uniform", + As::Storage { access } => { if access.contains(crate::StorageAccess::STORE) { return (Some("storage"), Some("read_write")); } else { "storage" } } - Sc::PushConstant => "push_constant", - Sc::WorkGroup => "workgroup", - Sc::Handle => return (None, None), - Sc::Function => "function", + As::PushConstant => "push_constant", + As::WorkGroup => "workgroup", + As::Handle => return (None, None), + As::Function => "function", }), None, ) diff --git a/third_party/rust/naga/src/block.rs b/third_party/rust/naga/src/block.rs index 6a31301e113eb..e70202b8d190b 100644 --- a/third_party/rust/naga/src/block.rs +++ b/third_party/rust/naga/src/block.rs @@ -5,6 +5,7 @@ use std::ops::{Deref, DerefMut, RangeBounds}; #[derive(Debug, Clone, Default)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "serialize", serde(transparent))] +#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Block { body: Vec, #[cfg(feature = "span")] diff --git a/third_party/rust/naga/src/front/glsl/ast.rs b/third_party/rust/naga/src/front/glsl/ast.rs index 36cd777dc38d8..9f28b2bdd791b 100644 --- a/third_party/rust/naga/src/front/glsl/ast.rs +++ b/third_party/rust/naga/src/front/glsl/ast.rs @@ -1,9 +1,9 @@ -use std::fmt; +use std::{borrow::Cow, fmt}; use super::{builtins::MacroCall, context::ExprPos, Span}; use crate::{ - BinaryOperator, Binding, Constant, Expression, Function, GlobalVariable, Handle, Interpolation, - Sampling, StorageAccess, StorageClass, Type, UnaryOperator, + AddressSpace, BinaryOperator, Binding, Constant, Expression, Function, GlobalVariable, Handle, + Interpolation, Sampling, StorageAccess, Type, UnaryOperator, }; #[derive(Debug, Clone, Copy)] @@ -23,8 +23,8 @@ pub struct GlobalLookup { #[derive(Debug, Clone)] pub struct ParameterInfo { pub qualifier: ParameterQualifier, - /// Wether the parameter should be treated as a depth image instead of a - /// sampled image + /// Whether the parameter should be treated as a depth image instead of a + /// sampled image. pub depth: bool, } @@ -55,18 +55,35 @@ pub struct Overload { pub kind: FunctionKind, /// Wheter this function was already defined or is just a prototype pub defined: bool, + /// Wheter this overload is the one provided by the language or has + /// been redeclared by the user (builtins only) + pub internal: bool, /// Wheter or not this function returns void (nothing) pub void: bool, } +bitflags::bitflags! { + /// Tracks the variations of the builtin already generated, this is needed because some + /// builtins overloads can't be generated unless explicitly used, since they might cause + /// uneeded capabilities to be requested + #[derive(Default)] + pub struct BuiltinVariations: u32 { + /// Request the standard overloads + const STANDARD = 1 << 0; + /// Request overloads that use the double type + const DOUBLE = 1 << 1; + /// Request overloads that use samplerCubeArray(Shadow) + const CUBE_TEXTURES_ARRAY = 1 << 2; + /// Request overloads that use sampler2DMSArray + const D2_MULTI_TEXTURES_ARRAY = 1 << 3; + } +} + #[derive(Debug, Default)] pub struct FunctionDeclaration { pub overloads: Vec, - /// Wether or not this function has the name of a builtin - pub builtin: bool, - /// In case [`builtin`](Self::builtin) is true, this field indicates wether - /// this function already has double overloads added or not, otherwise is unused - pub double: bool, + /// Tracks the builtin overload variations that were already generated + pub variations: BuiltinVariations, } #[derive(Debug)] @@ -134,19 +151,121 @@ pub enum HirExprKind { }, } +#[derive(Debug, Hash, PartialEq, Eq)] +pub enum QualifierKey<'a> { + String(Cow<'a, str>), + /// Used for `std140` and `std430` layout qualifiers + Layout, + /// Used for image formats + Format, +} + #[derive(Debug)] -pub enum TypeQualifier { - StorageQualifier(StorageQualifier), - Interpolation(Interpolation), - Set(u32), - Binding(u32), - Location(u32), - WorkGroupSize(usize, u32), - Sampling(Sampling), +pub enum QualifierValue { + None, + Uint(u32), Layout(StructLayout), - Precision(Precision), - EarlyFragmentTests, - StorageAccess(StorageAccess), + Format(crate::StorageFormat), +} + +#[derive(Debug, Default)] +pub struct TypeQualifiers<'a> { + pub span: Span, + pub storage: (StorageQualifier, Span), + pub interpolation: Option<(Interpolation, Span)>, + pub precision: Option<(Precision, Span)>, + pub sampling: Option<(Sampling, Span)>, + pub storage_acess: Option<(StorageAccess, Span)>, + pub layout_qualifiers: crate::FastHashMap, (QualifierValue, Span)>, +} + +impl<'a> TypeQualifiers<'a> { + /// Appends `errors` with errors for all unused qualifiers + pub fn unused_errors(&self, errors: &mut Vec) { + if let Some((_, meta)) = self.interpolation { + errors.push(super::Error { + kind: super::ErrorKind::SemanticError( + "Interpolation qualifiers can only be used in in/out variables".into(), + ), + meta, + }); + } + + if let Some((_, meta)) = self.sampling { + errors.push(super::Error { + kind: super::ErrorKind::SemanticError( + "Sampling qualifiers can only be used in in/out variables".into(), + ), + meta, + }); + } + + if let Some((_, meta)) = self.storage_acess { + errors.push(super::Error { + kind: super::ErrorKind::SemanticError( + "Memory qualifiers can only be used in storage variables".into(), + ), + meta, + }); + } + + for &(_, meta) in self.layout_qualifiers.values() { + errors.push(super::Error { + kind: super::ErrorKind::SemanticError("Unexpected qualifier".into()), + meta, + }); + } + } + + /// Removes the layout qualifier with `name`, if it exists and adds an error if it isn't + /// a [`QualifierValue::Uint`] + pub fn uint_layout_qualifier( + &mut self, + name: &'a str, + errors: &mut Vec, + ) -> Option { + match self + .layout_qualifiers + .remove(&QualifierKey::String(name.into())) + { + Some((QualifierValue::Uint(v), _)) => Some(v), + Some((_, meta)) => { + errors.push(super::Error { + kind: super::ErrorKind::SemanticError("Qualifier expects a uint value".into()), + meta, + }); + // Return a dummy value instead of `None` to differentiate from + // the qualifier not existing, since some parts might require the + // qualifier to exist and throwing another error that it doesn't + // exist would be unhelpful + Some(0) + } + _ => None, + } + } + + /// Removes the layout qualifier with `name`, if it exists and adds an error if it isn't + /// a [`QualifierValue::None`] + pub fn none_layout_qualifier(&mut self, name: &'a str, errors: &mut Vec) -> bool { + match self + .layout_qualifiers + .remove(&QualifierKey::String(name.into())) + { + Some((QualifierValue::None, _)) => true, + Some((_, meta)) => { + errors.push(super::Error { + kind: super::ErrorKind::SemanticError( + "Qualifier doesn't expect a value".into(), + ), + meta, + }); + // Return a `true` to since the qualifier is defined and adding + // another error for it not being defined would be unhelpful + true + } + _ => false, + } + } } #[derive(Debug, Clone)] @@ -163,12 +282,18 @@ pub struct FunctionCall { #[derive(Debug, Clone, Copy, PartialEq)] pub enum StorageQualifier { - StorageClass(StorageClass), + AddressSpace(AddressSpace), Input, Output, Const, } +impl Default for StorageQualifier { + fn default() -> Self { + StorageQualifier::AddressSpace(AddressSpace::Function) + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum StructLayout { Std140, @@ -176,7 +301,7 @@ pub enum StructLayout { } // TODO: Encode precision hints in the IR -/// A precision hint used in glsl declarations +/// A precision hint used in GLSL declarations. /// /// Precision hints can be used to either speed up shader execution or control /// the precision of arithmetic operations. @@ -229,7 +354,7 @@ impl ParameterQualifier { } } -/// The glsl profile used by a shader +/// The GLSL profile used by a shader. #[derive(Debug, Clone, Copy, PartialEq)] pub enum Profile { /// The `core` profile, default when no profile is specified. diff --git a/third_party/rust/naga/src/front/glsl/builtins.rs b/third_party/rust/naga/src/front/glsl/builtins.rs index c2c3e290262f4..dedaf93dc197f 100644 --- a/third_party/rust/naga/src/front/glsl/builtins.rs +++ b/third_party/rust/naga/src/front/glsl/builtins.rs @@ -1,14 +1,27 @@ use super::{ - ast::{FunctionDeclaration, FunctionKind, Overload, ParameterInfo, ParameterQualifier}, + ast::{ + BuiltinVariations, FunctionDeclaration, FunctionKind, Overload, ParameterInfo, + ParameterQualifier, + }, context::Context, Error, ErrorKind, Parser, Result, }; use crate::{ BinaryOperator, Block, Constant, DerivativeAxis, Expression, Handle, ImageClass, - ImageDimension, ImageQuery, MathFunction, Module, RelationalFunction, SampleLevel, + ImageDimension as Dim, ImageQuery, MathFunction, Module, RelationalFunction, SampleLevel, ScalarKind as Sk, Span, Type, TypeInner, VectorSize, }; +impl crate::ScalarKind { + fn dummy_storage_format(&self) -> crate::StorageFormat { + match *self { + Sk::Sint => crate::StorageFormat::R16Sint, + Sk::Uint => crate::StorageFormat::R16Uint, + _ => crate::StorageFormat::R16Float, + } + } +} + impl Module { /// Helper function, to create a function prototype for a builtin fn add_builtin(&mut self, args: Vec, builtin: MacroCall) -> Overload { @@ -34,6 +47,7 @@ impl Module { parameters_info, kind: FunctionKind::Macro(builtin), defined: false, + internal: true, void: false, } } @@ -56,85 +70,36 @@ fn make_coords_arg(number_of_components: usize, kind: Sk) -> TypeInner { } } -/// Inject builtins into +/// Inject builtins into the declaration /// /// This is done to not add a large startup cost and not increase memory /// usage if it isn't needed. -/// -/// This version does not add builtins with arguments using the double type -/// [`inject_double_builtin`](inject_double_builtin) for builtins -/// using the double type -pub fn inject_builtin(declaration: &mut FunctionDeclaration, module: &mut Module, name: &str) { - use crate::ImageDimension as Dim; +pub fn inject_builtin( + declaration: &mut FunctionDeclaration, + module: &mut Module, + name: &str, + mut variations: BuiltinVariations, +) { + log::trace!( + "{} variations: {:?} {:?}", + name, + variations, + declaration.variations + ); + // Don't regeneate variations + variations.remove(declaration.variations); + declaration.variations |= variations; + + if variations.contains(BuiltinVariations::STANDARD) { + inject_standard_builtins(declaration, module, name) + } + + if variations.contains(BuiltinVariations::DOUBLE) { + inject_double_builtin(declaration, module, name) + } - declaration.builtin = true; let width = 4; match name { - "sampler1D" | "sampler1DArray" | "sampler2D" | "sampler2DArray" | "sampler2DMS" - | "sampler2DMSArray" | "sampler3D" | "samplerCube" | "samplerCubeArray" => { - declaration.overloads.push(module.add_builtin( - vec![ - TypeInner::Image { - dim: match name { - "sampler1D" | "sampler1DArray" => Dim::D1, - "sampler2D" | "sampler2DArray" | "sampler2DMS" | "sampler2DMSArray" => { - Dim::D2 - } - "sampler3D" => Dim::D3, - _ => Dim::Cube, - }, - arrayed: matches!( - name, - "sampler1DArray" - | "sampler2DArray" - | "sampler2DMSArray" - | "samplerCubeArray" - ), - class: ImageClass::Sampled { - kind: Sk::Float, - multi: matches!(name, "sampler2DMS" | "sampler2DMSArray"), - }, - }, - TypeInner::Sampler { comparison: false }, - ], - MacroCall::Sampler, - )) - } - "sampler1DShadow" - | "sampler1DArrayShadow" - | "sampler2DShadow" - | "sampler2DArrayShadow" - | "samplerCubeShadow" - | "samplerCubeArrayShadow" => { - let dim = match name { - "sampler1DShadow" | "sampler1DArrayShadow" => Dim::D1, - "sampler2DShadow" | "sampler2DArrayShadow" => Dim::D2, - _ => Dim::Cube, - }; - let arrayed = matches!( - name, - "sampler1DArrayShadow" | "sampler2DArrayShadow" | "samplerCubeArrayShadow" - ); - - for i in 0..2 { - let ty = TypeInner::Image { - dim, - arrayed, - class: match i { - 0 => ImageClass::Sampled { - kind: Sk::Float, - multi: false, - }, - _ => ImageClass::Depth { multi: false }, - }, - }; - - declaration.overloads.push(module.add_builtin( - vec![ty, TypeInner::Sampler { comparison: true }], - MacroCall::SamplerShadow, - )) - } - } "texture" | "textureGrad" | "textureGradOffset" @@ -147,356 +112,423 @@ pub fn inject_builtin(declaration: &mut FunctionDeclaration, module: &mut Module | "textureProjLod" | "textureProjLodOffset" | "textureProjOffset" => { - // bits layout - // bits 0 through 1 - dims - // bit 2 - shadow - // bit 3 - array - // bit 4 - extra variant - // bit 5 - bias - - for bits in 0..(0b1000000) { - let dim = bits & 0b11; - let shadow = bits & 0b100 == 0b100; - let arrayed = bits & 0b1000 == 0b1000; - let variant = bits & 0b10000 == 0b10000; - let bias = bits & 0b100000 == 0b100000; - - let builtin = match name { - // texture(gsampler, gvec P, [float bias]); - "texture" => MacroCall::Texture { - proj: false, - offset: false, - shadow, - level_type: TextureLevelType::None, - }, - // textureGrad(gsampler, gvec P, gvec dPdx, gvec dPdy); - "textureGrad" => MacroCall::Texture { - proj: false, - offset: false, - shadow, - level_type: TextureLevelType::Grad, - }, - // textureGradOffset(gsampler, gvec P, gvec dPdx, gvec dPdy, ivec offset); - "textureGradOffset" => MacroCall::Texture { - proj: false, - offset: true, - shadow, - level_type: TextureLevelType::Grad, - }, - // textureLod(gsampler, gvec P, float lod); - "textureLod" => MacroCall::Texture { - proj: false, - offset: false, - shadow, - level_type: TextureLevelType::Lod, - }, - // textureLodOffset(gsampler, gvec P, float lod, ivec offset); - "textureLodOffset" => MacroCall::Texture { - proj: false, - offset: true, - shadow, - level_type: TextureLevelType::Lod, - }, - // textureOffset(gsampler, gvec+1 P, ivec offset, [float bias]); - "textureOffset" => MacroCall::Texture { - proj: false, - offset: true, - shadow, - level_type: TextureLevelType::None, - }, - // textureProj(gsampler, gvec+1 P, [float bias]); - "textureProj" => MacroCall::Texture { - proj: true, - offset: false, - shadow, - level_type: TextureLevelType::None, - }, - // textureProjGrad(gsampler, gvec+1 P, gvec dPdx, gvec dPdy); - "textureProjGrad" => MacroCall::Texture { - proj: true, - offset: false, - shadow, - level_type: TextureLevelType::Grad, - }, - // textureProjGradOffset(gsampler, gvec+1 P, gvec dPdx, gvec dPdy, ivec offset); - "textureProjGradOffset" => MacroCall::Texture { - proj: true, - offset: true, - shadow, - level_type: TextureLevelType::Grad, - }, - // textureProjLod(gsampler, gvec+1 P, float lod); - "textureProjLod" => MacroCall::Texture { - proj: true, - offset: false, - shadow, - level_type: TextureLevelType::Lod, - }, - // textureProjLodOffset(gsampler, gvec+1 P, gvec dPdx, gvec dPdy, ivec offset); - "textureProjLodOffset" => MacroCall::Texture { - proj: true, - offset: true, - shadow, - level_type: TextureLevelType::Lod, - }, - // textureProjOffset(gsampler, gvec+1 P, ivec offset, [float bias]); - "textureProjOffset" => MacroCall::Texture { - proj: true, - offset: true, + let f = |kind, dim, arrayed, multi, shadow| { + for bits in 0..=0b11 { + let variant = bits & 0b1 != 0; + let bias = bits & 0b10 != 0; + + let (proj, offset, level_type) = match name { + // texture(gsampler, gvec P, [float bias]); + "texture" => (false, false, TextureLevelType::None), + // textureGrad(gsampler, gvec P, gvec dPdx, gvec dPdy); + "textureGrad" => (false, false, TextureLevelType::Grad), + // textureGradOffset(gsampler, gvec P, gvec dPdx, gvec dPdy, ivec offset); + "textureGradOffset" => (false, true, TextureLevelType::Grad), + // textureLod(gsampler, gvec P, float lod); + "textureLod" => (false, false, TextureLevelType::Lod), + // textureLodOffset(gsampler, gvec P, float lod, ivec offset); + "textureLodOffset" => (false, true, TextureLevelType::Lod), + // textureOffset(gsampler, gvec+1 P, ivec offset, [float bias]); + "textureOffset" => (false, true, TextureLevelType::None), + // textureProj(gsampler, gvec+1 P, [float bias]); + "textureProj" => (true, false, TextureLevelType::None), + // textureProjGrad(gsampler, gvec+1 P, gvec dPdx, gvec dPdy); + "textureProjGrad" => (true, false, TextureLevelType::Grad), + // textureProjGradOffset(gsampler, gvec+1 P, gvec dPdx, gvec dPdy, ivec offset); + "textureProjGradOffset" => (true, true, TextureLevelType::Grad), + // textureProjLod(gsampler, gvec+1 P, float lod); + "textureProjLod" => (true, false, TextureLevelType::Lod), + // textureProjLodOffset(gsampler, gvec+1 P, gvec dPdx, gvec dPdy, ivec offset); + "textureProjLodOffset" => (true, true, TextureLevelType::Lod), + // textureProjOffset(gsampler, gvec+1 P, ivec offset, [float bias]); + "textureProjOffset" => (true, true, TextureLevelType::None), + _ => unreachable!(), + }; + + let builtin = MacroCall::Texture { + proj, + offset, shadow, - level_type: TextureLevelType::None, - }, - _ => unreachable!(), - }; + level_type, + }; - // Parse out the variant settings. - let proj = matches!(builtin, MacroCall::Texture { proj: true, .. }); - let grad = matches!( - builtin, - MacroCall::Texture { - level_type: TextureLevelType::Grad, - .. - } - ); - let lod = matches!( - builtin, - MacroCall::Texture { - level_type: TextureLevelType::Lod, - .. + // Parse out the variant settings. + let grad = level_type == TextureLevelType::Grad; + let lod = level_type == TextureLevelType::Lod; + + let supports_variant = proj && !shadow; + if variant && !supports_variant { + continue; } - ); - let offset = matches!(builtin, MacroCall::Texture { offset: true, .. }); - let supports_variant = proj && !shadow; - if variant && !supports_variant { - continue; - } + if bias && !matches!(level_type, TextureLevelType::None) { + continue; + } - let supports_bias = matches!( - builtin, - MacroCall::Texture { - level_type: TextureLevelType::None, - .. + // Proj doesn't work with arrayed or Cube + if proj && (arrayed || dim == Dim::Cube) { + continue; } - ) && !shadow; - if bias && !supports_bias { - continue; - } - // Proj doesn't work with arrayed, Cube or 3D samplers - if proj && (arrayed || dim == 0b10 || dim == 0b11) { - continue; - } + // texture operations with offset are not supported for cube maps + if dim == Dim::Cube && offset { + continue; + } - // 3DArray and 3DShadow are not valid texture types - if dim == 0b11 && (arrayed || shadow) { - continue; - } + // sampler2DArrayShadow can't be used in textureLod or in texture with bias + if (lod || bias) && arrayed && shadow && dim == Dim::D2 { + continue; + } - // It seems that textureGradOffset(samplerCube) is not defined by GLSL for some reason... - if dim == 0b10 && grad && offset { - continue; - } + // TODO: glsl supports using bias with depth samplers but naga doesn't + if bias && shadow { + continue; + } - let class = match shadow { - true => ImageClass::Depth { multi: false }, - false => ImageClass::Sampled { - kind: Sk::Float, - multi: false, - }, - }; + let class = match shadow { + true => ImageClass::Depth { multi }, + false => ImageClass::Sampled { kind, multi }, + }; - let image = TypeInner::Image { - dim: match dim { - 0b00 => Dim::D1, - 0b01 => Dim::D2, - 0b10 => Dim::Cube, - _ => Dim::D3, - }, - arrayed, - class, - }; + let image = TypeInner::Image { + dim, + arrayed, + class, + }; - let num_coords_from_dim = (dim + 1).min(3); - let mut num_coords = num_coords_from_dim; + let num_coords_from_dim = image_dims_to_coords_size(dim).min(3); + let mut num_coords = num_coords_from_dim; - if shadow && proj { - num_coords = 4; - } else if shadow { - num_coords += 1; - } else if proj { - if variant && num_coords == 4 { - // Normal form already has 4 components, no need to have a variant form. - continue; - } else if variant { + if shadow && proj { num_coords = 4; - } else { + } else if dim == Dim::D1 && shadow { + num_coords = 3; + } else if shadow { num_coords += 1; + } else if proj { + if variant && num_coords == 4 { + // Normal form already has 4 components, no need to have a variant form. + continue; + } else if variant { + num_coords = 4; + } else { + num_coords += 1; + } } - } - num_coords += arrayed as usize; + if !(dim == Dim::D1 && shadow) { + num_coords += arrayed as usize; + } - // Special case: texture(gsamplerCubeArrayShadow) kicks the shadow compare ref to a separate argument, - // since it would otherwise take five arguments. It also can't take a bias, nor can it be proj/grad/lod/offset - // (presumably because nobody asked for it, and implementation complexity?) - if num_coords >= 5 { - if lod || grad || offset || proj || bias { - continue; + // Special case: texture(gsamplerCubeArrayShadow) kicks the shadow compare ref to a separate argument, + // since it would otherwise take five arguments. It also can't take a bias, nor can it be proj/grad/lod/offset + // (presumably because nobody asked for it, and implementation complexity?) + if num_coords >= 5 { + if lod || grad || offset || proj || bias { + continue; + } + debug_assert!(dim == Dim::Cube && shadow && arrayed); } - debug_assert!(dim == 0b10 && shadow && arrayed); - } - debug_assert!(num_coords <= 5); + debug_assert!(num_coords <= 5); - let vector = make_coords_arg(num_coords, Sk::Float); - let mut args = vec![image, vector]; + let vector = make_coords_arg(num_coords, Sk::Float); + let mut args = vec![image, vector]; - if num_coords == 5 { - args.push(TypeInner::Scalar { - kind: Sk::Float, - width, - }); - } - - match builtin { - MacroCall::Texture { - level_type: TextureLevelType::Lod, - .. - } => { + if num_coords == 5 { args.push(TypeInner::Scalar { kind: Sk::Float, width, }); } - MacroCall::Texture { - level_type: TextureLevelType::Grad, - .. - } => { - args.push(make_coords_arg(num_coords_from_dim, Sk::Float)); - args.push(make_coords_arg(num_coords_from_dim, Sk::Float)); + + match level_type { + TextureLevelType::Lod => { + args.push(TypeInner::Scalar { + kind: Sk::Float, + width, + }); + } + TextureLevelType::Grad => { + args.push(make_coords_arg(num_coords_from_dim, Sk::Float)); + args.push(make_coords_arg(num_coords_from_dim, Sk::Float)); + } + _ => {} + }; + + if offset { + args.push(make_coords_arg(num_coords_from_dim, Sk::Sint)); + } + + if bias { + args.push(TypeInner::Scalar { + kind: Sk::Float, + width, + }); } - _ => {} - }; - if offset { - args.push(make_coords_arg(num_coords_from_dim, Sk::Sint)); + declaration + .overloads + .push(module.add_builtin(args, builtin)); } + }; - if bias { + texture_args_generator(TextureArgsOptions::SHADOW | variations.into(), f) + } + "textureSize" => { + let f = |kind, dim, arrayed, multi, shadow| { + let class = match shadow { + true => ImageClass::Depth { multi }, + false => ImageClass::Sampled { kind, multi }, + }; + + let image = TypeInner::Image { + dim, + arrayed, + class, + }; + + let mut args = vec![image]; + + if !multi { args.push(TypeInner::Scalar { - kind: Sk::Float, + kind: Sk::Sint, width, - }); + }) } declaration .overloads - .push(module.add_builtin(args, builtin)); - } + .push(module.add_builtin(args, MacroCall::TextureSize { arrayed })) + }; + + texture_args_generator( + TextureArgsOptions::SHADOW | TextureArgsOptions::MULTI | variations.into(), + f, + ) } - "textureSize" => { - // bits layout - // bits 0 trough 1 - dims - // bit 2 - shadow - // bit 3 - array - for bits in 0..(0b10000) { - let dim = bits & 0b11; - let shadow = bits & 0b100 == 0b100; - let arrayed = bits & 0b1000 == 0b1000; - - // Shadow, arrayed or both 3D images are not allowed - if (shadow || arrayed) && dim == 0b11 { - continue; + "texelFetch" | "texelFetchOffset" => { + let offset = "texelFetchOffset" == name; + let f = |kind, dim, arrayed, multi, _shadow| { + // Cube images aren't supported + if let Dim::Cube = dim { + return; } - let class = match shadow { - true => ImageClass::Depth { multi: false }, - false => ImageClass::Sampled { - kind: Sk::Float, - multi: false, - }, - }; - let image = TypeInner::Image { - dim: match dim { - 0b00 => Dim::D1, - 0b01 => Dim::D2, - 0b10 => Dim::Cube, - _ => Dim::D3, - }, + dim, arrayed, - class, + class: ImageClass::Sampled { kind, multi }, }; - let args = vec![ + let dim_value = image_dims_to_coords_size(dim); + let coordinates = make_coords_arg(dim_value + arrayed as usize, Sk::Sint); + + let mut args = vec![ image, + coordinates, TypeInner::Scalar { kind: Sk::Sint, width, }, ]; + if offset { + args.push(make_coords_arg(dim_value, Sk::Sint)); + } + declaration .overloads - .push(module.add_builtin(args, MacroCall::TextureSize)) - } + .push(module.add_builtin(args, MacroCall::ImageLoad { multi })) + }; + + // Don't generate shadow images since they aren't supported + texture_args_generator(TextureArgsOptions::MULTI | variations.into(), f) } - "texelFetch" => { - // bits layout - // bit 0 - dim part 1 - 1D/2D - // bit 1 - array - // bit 2 - dim part 2 - 3D - // - // 0b100 is the latest since 3D arrayed images aren't allowed - for bits in 0..(0b101) { - let dim = bits & 0b1 | (bits & 0b100) >> 1; - let arrayed = bits & 0b10 == 0b10; + "imageSize" => { + let f = |kind: Sk, dim, arrayed, _, _| { + // Naga doesn't support cube images and it's usefulness + // is questionable, so they won't be supported for now + if dim == Dim::Cube { + return; + } let image = TypeInner::Image { - dim: match dim { - 0b00 => Dim::D1, - 0b01 => Dim::D2, - _ => Dim::D3, - }, + dim, arrayed, - class: ImageClass::Sampled { - kind: Sk::Float, - multi: false, + class: ImageClass::Storage { + format: kind.dummy_storage_format(), + access: crate::StorageAccess::empty(), }, }; - let vector = match (dim, arrayed) { - (0b00, false) => TypeInner::Scalar { - kind: Sk::Sint, - width, + declaration + .overloads + .push(module.add_builtin(vec![image], MacroCall::TextureSize { arrayed })) + }; + + texture_args_generator(variations.into(), f) + } + "imageLoad" => { + let f = |kind: Sk, dim, arrayed, _, _| { + // Naga doesn't support cube images and it's usefulness + // is questionable, so they won't be supported for now + if dim == Dim::Cube { + return; + } + + let image = TypeInner::Image { + dim, + arrayed, + class: ImageClass::Storage { + format: kind.dummy_storage_format(), + access: crate::StorageAccess::LOAD, }, - (_, _) => { - let size = match dim + arrayed as u32 { - 1 => VectorSize::Bi, - 2 => VectorSize::Tri, - _ => VectorSize::Quad, - }; + }; - TypeInner::Vector { - size, - kind: Sk::Sint, - width, - } - } + let dim_value = image_dims_to_coords_size(dim); + let mut coord_size = dim_value + arrayed as usize; + // > Every OpenGL API call that operates on cubemap array + // > textures takes layer-faces, not array layers + // + // So this means that imageCubeArray only takes a three component + // vector coordinate and the third component is a layer index. + if Dim::Cube == dim && arrayed { + coord_size = 3 + } + let coordinates = make_coords_arg(coord_size, Sk::Sint); + + let args = vec![image, coordinates]; + + declaration + .overloads + .push(module.add_builtin(args, MacroCall::ImageLoad { multi: false })) + }; + + // Don't generate shadow nor multisampled images since they aren't supported + texture_args_generator(variations.into(), f) + } + "imageStore" => { + let f = |kind: Sk, dim, arrayed, _, _| { + // Naga doesn't support cube images and it's usefulness + // is questionable, so they won't be supported for now + if dim == Dim::Cube { + return; + } + + let image = TypeInner::Image { + dim, + arrayed, + class: ImageClass::Storage { + format: kind.dummy_storage_format(), + access: crate::StorageAccess::STORE, + }, }; + let dim_value = image_dims_to_coords_size(dim); + let mut coord_size = dim_value + arrayed as usize; + // > Every OpenGL API call that operates on cubemap array + // > textures takes layer-faces, not array layers + // + // So this means that imageCubeArray only takes a three component + // vector coordinate and the third component is a layer index. + if Dim::Cube == dim && arrayed { + coord_size = 3 + } + let coordinates = make_coords_arg(coord_size, Sk::Sint); + let args = vec![ image, - vector, - TypeInner::Scalar { - kind: Sk::Sint, + coordinates, + TypeInner::Vector { + size: VectorSize::Quad, + kind, width, }, ]; - declaration - .overloads - .push(module.add_builtin(args, MacroCall::TexelFetch)) + let mut overload = module.add_builtin(args, MacroCall::ImageStore); + overload.void = true; + declaration.overloads.push(overload) + }; + + // Don't generate shadow nor multisampled images since they aren't supported + texture_args_generator(variations.into(), f) + } + _ => {} + } +} + +/// Injects the builtins into declaration that don't need any special variations +fn inject_standard_builtins( + declaration: &mut FunctionDeclaration, + module: &mut Module, + name: &str, +) { + let width = 4; + match name { + "sampler1D" | "sampler1DArray" | "sampler2D" | "sampler2DArray" | "sampler2DMS" + | "sampler2DMSArray" | "sampler3D" | "samplerCube" | "samplerCubeArray" => { + declaration.overloads.push(module.add_builtin( + vec![ + TypeInner::Image { + dim: match name { + "sampler1D" | "sampler1DArray" => Dim::D1, + "sampler2D" | "sampler2DArray" | "sampler2DMS" | "sampler2DMSArray" => { + Dim::D2 + } + "sampler3D" => Dim::D3, + _ => Dim::Cube, + }, + arrayed: matches!( + name, + "sampler1DArray" + | "sampler2DArray" + | "sampler2DMSArray" + | "samplerCubeArray" + ), + class: ImageClass::Sampled { + kind: Sk::Float, + multi: matches!(name, "sampler2DMS" | "sampler2DMSArray"), + }, + }, + TypeInner::Sampler { comparison: false }, + ], + MacroCall::Sampler, + )) + } + "sampler1DShadow" + | "sampler1DArrayShadow" + | "sampler2DShadow" + | "sampler2DArrayShadow" + | "samplerCubeShadow" + | "samplerCubeArrayShadow" => { + let dim = match name { + "sampler1DShadow" | "sampler1DArrayShadow" => Dim::D1, + "sampler2DShadow" | "sampler2DArrayShadow" => Dim::D2, + _ => Dim::Cube, + }; + let arrayed = matches!( + name, + "sampler1DArrayShadow" | "sampler2DArrayShadow" | "samplerCubeArrayShadow" + ); + + for i in 0..2 { + let ty = TypeInner::Image { + dim, + arrayed, + class: match i { + 0 => ImageClass::Sampled { + kind: Sk::Float, + multi: false, + }, + _ => ImageClass::Depth { multi: false }, + }, + }; + + declaration.overloads.push(module.add_builtin( + vec![ty, TypeInner::Sampler { comparison: true }], + MacroCall::SamplerShadow, + )) } } "sin" | "exp" | "exp2" | "sinh" | "cos" | "cosh" | "tan" | "tanh" | "acos" | "asin" @@ -968,13 +1000,8 @@ pub fn inject_builtin(declaration: &mut FunctionDeclaration, module: &mut Module } } -/// Double version of [`inject_builtin`](inject_builtin) -pub fn inject_double_builtin( - declaration: &mut FunctionDeclaration, - module: &mut Module, - name: &str, -) { - declaration.double = true; +/// Injects the builtins into declaration that need doubles +fn inject_double_builtin(declaration: &mut FunctionDeclaration, module: &mut Module, name: &str) { let width = 8; match name { "abs" | "sign" => { @@ -1121,6 +1148,7 @@ pub fn inject_double_builtin( } } +/// Injects the builtins into declaration that can used either float or doubles fn inject_common_builtin( declaration: &mut FunctionDeclaration, module: &mut Module, @@ -1353,6 +1381,7 @@ fn inject_common_builtin( ], kind: FunctionKind::Macro(fun), defined: false, + internal: true, void: false, }) } @@ -1518,7 +1547,7 @@ fn inject_common_builtin( } } // The function isn't a builtin or we don't yet support it - _ => declaration.builtin = false, + _ => {} } } @@ -1540,8 +1569,13 @@ pub enum MacroCall { shadow: bool, level_type: TextureLevelType, }, - TextureSize, - TexelFetch, + TextureSize { + arrayed: bool, + }, + ImageLoad { + multi: bool, + }, + ImageStore, MathFunction(MathFunction), BitfieldExtract, BitfieldInsert, @@ -1565,17 +1599,17 @@ impl MacroCall { body: &mut Block, args: &mut [Handle], meta: Span, - ) -> Result> { - match *self { + ) -> Result>> { + Ok(Some(match *self { MacroCall::Sampler => { ctx.samplers.insert(args[0], args[1]); - Ok(args[0]) + args[0] } MacroCall::SamplerShadow => { sampled_to_depth(&mut parser.module, ctx, args[0], meta, &mut parser.errors); parser.invalidate_expression(ctx, args[0], meta)?; ctx.samplers.insert(args[0], args[1]); - Ok(args[0]) + args[0] } MacroCall::Texture { proj, @@ -1698,33 +1732,107 @@ impl MacroCall { .map_or(SampleLevel::Auto, SampleLevel::Bias); } - texture_call(ctx, args[0], level, comps, texture_offset, body, meta) + texture_call(ctx, args[0], level, comps, texture_offset, body, meta)? } - MacroCall::TextureSize => Ok(ctx.add_expression( - Expression::ImageQuery { - image: args[0], - query: ImageQuery::Size { - level: args.get(1).copied(), + + MacroCall::TextureSize { arrayed } => { + let mut expr = ctx.add_expression( + Expression::ImageQuery { + image: args[0], + query: ImageQuery::Size { + level: args.get(1).copied(), + }, }, - }, - Span::default(), - body, - )), - MacroCall::TexelFetch => { + Span::default(), + body, + ); + + if arrayed { + let mut components = Vec::with_capacity(4); + + let size = match *parser.resolve_type(ctx, expr, meta)? { + TypeInner::Vector { size: ori_size, .. } => { + for index in 0..(ori_size as u32) { + components.push(ctx.add_expression( + Expression::AccessIndex { base: expr, index }, + Span::default(), + body, + )) + } + + match ori_size { + VectorSize::Bi => VectorSize::Tri, + _ => VectorSize::Quad, + } + } + _ => { + components.push(expr); + VectorSize::Bi + } + }; + + components.push(ctx.add_expression( + Expression::ImageQuery { + image: args[0], + query: ImageQuery::NumLayers, + }, + Span::default(), + body, + )); + + let ty = parser.module.types.insert( + Type { + name: None, + inner: TypeInner::Vector { + size, + kind: crate::ScalarKind::Sint, + width: 4, + }, + }, + Span::default(), + ); + + expr = ctx.add_expression(Expression::Compose { components, ty }, meta, body) + } + + expr + } + MacroCall::ImageLoad { multi } => { let comps = parser.coordinate_components(ctx, args[0], args[1], None, meta, body)?; - Ok(ctx.add_expression( + let (sample, level) = match (multi, args.get(2)) { + (_, None) => (None, None), + (true, Some(&arg)) => (Some(arg), None), + (false, Some(&arg)) => (None, Some(arg)), + }; + ctx.add_expression( Expression::ImageLoad { image: args[0], coordinate: comps.coordinate, array_index: comps.array_index, - index: Some(args[2]), + sample, + level, }, Span::default(), body, - )) + ) } - MacroCall::MathFunction(fun) => Ok(ctx.add_expression( + MacroCall::ImageStore => { + let comps = + parser.coordinate_components(ctx, args[0], args[1], None, meta, body)?; + ctx.emit_flush(body); + body.push( + crate::Statement::ImageStore { + image: args[0], + coordinate: comps.coordinate, + array_index: comps.array_index, + value: args[2], + }, + meta, + ); + return Ok(None); + } + MacroCall::MathFunction(fun) => ctx.add_expression( Expression::Math { fun, arg: args[0], @@ -1734,7 +1842,7 @@ impl MacroCall { }, Span::default(), body, - )), + ), MacroCall::BitfieldInsert => { let conv_arg_2 = ctx.add_expression( Expression::As { @@ -1754,7 +1862,7 @@ impl MacroCall { Span::default(), body, ); - Ok(ctx.add_expression( + ctx.add_expression( Expression::Math { fun: MathFunction::InsertBits, arg: args[0], @@ -1764,7 +1872,7 @@ impl MacroCall { }, Span::default(), body, - )) + ) } MacroCall::BitfieldExtract => { let conv_arg_1 = ctx.add_expression( @@ -1785,7 +1893,7 @@ impl MacroCall { Span::default(), body, ); - Ok(ctx.add_expression( + ctx.add_expression( Expression::Math { fun: MathFunction::ExtractBits, arg: args[0], @@ -1795,17 +1903,17 @@ impl MacroCall { }, Span::default(), body, - )) + ) } - MacroCall::Relational(fun) => Ok(ctx.add_expression( + MacroCall::Relational(fun) => ctx.add_expression( Expression::Relational { fun, argument: args[0], }, Span::default(), body, - )), - MacroCall::Binary(op) => Ok(ctx.add_expression( + ), + MacroCall::Binary(op) => ctx.add_expression( Expression::Binary { op, left: args[0], @@ -1813,11 +1921,11 @@ impl MacroCall { }, Span::default(), body, - )), + ), MacroCall::Mod(size) => { ctx.implicit_splat(parser, &mut args[1], meta, size)?; - Ok(ctx.add_expression( + ctx.add_expression( Expression::Binary { op: BinaryOperator::Modulo, left: args[0], @@ -1825,12 +1933,12 @@ impl MacroCall { }, Span::default(), body, - )) + ) } MacroCall::Splatted(fun, size, i) => { ctx.implicit_splat(parser, &mut args[i], meta, size)?; - Ok(ctx.add_expression( + ctx.add_expression( Expression::Math { fun, arg: args[0], @@ -1840,9 +1948,9 @@ impl MacroCall { }, Span::default(), body, - )) + ) } - MacroCall::MixBoolean => Ok(ctx.add_expression( + MacroCall::MixBoolean => ctx.add_expression( Expression::Select { condition: args[2], accept: args[1], @@ -1850,12 +1958,12 @@ impl MacroCall { }, Span::default(), body, - )), + ), MacroCall::Clamp(size) => { ctx.implicit_splat(parser, &mut args[1], meta, size)?; ctx.implicit_splat(parser, &mut args[2], meta, size)?; - Ok(ctx.add_expression( + ctx.add_expression( Expression::Math { fun: MathFunction::Clamp, arg: args[0], @@ -1865,9 +1973,9 @@ impl MacroCall { }, Span::default(), body, - )) + ) } - MacroCall::BitCast(kind) => Ok(ctx.add_expression( + MacroCall::BitCast(kind) => ctx.add_expression( Expression::As { expr: args[0], kind, @@ -1875,16 +1983,16 @@ impl MacroCall { }, Span::default(), body, - )), - MacroCall::Derivate(axis) => Ok(ctx.add_expression( + ), + MacroCall::Derivate(axis) => ctx.add_expression( Expression::Derivative { axis, expr: args[0], }, Span::default(), body, - )), - } + ), + })) } } @@ -1955,18 +2063,19 @@ impl Parser { } = *self.resolve_type(ctx, image, meta)? { let image_size = match dim { - ImageDimension::D1 => None, - ImageDimension::D2 => Some(VectorSize::Bi), - ImageDimension::D3 => Some(VectorSize::Tri), - ImageDimension::Cube => Some(VectorSize::Tri), + Dim::D1 => None, + Dim::D2 => Some(VectorSize::Bi), + Dim::D3 => Some(VectorSize::Tri), + Dim::Cube => Some(VectorSize::Tri), }; let coord_size = match *self.resolve_type(ctx, coord, meta)? { TypeInner::Vector { size, .. } => Some(size), _ => None, }; - let shadow = match class { - ImageClass::Depth { .. } => true, - _ => false, + let (shadow, storage) = match class { + ImageClass::Depth { .. } => (true, false), + ImageClass::Storage { .. } => (false, true), + _ => (false, false), }; let coordinate = match (image_size, coord_size) { @@ -1986,18 +2095,17 @@ impl Parser { let mut coord_index = image_size.map_or(1, |s| s as u32); - let array_index = match arrayed { - true => { - let index = coord_index; - coord_index += 1; + let array_index = if arrayed && !(storage && dim == Dim::Cube) { + let index = coord_index; + coord_index += 1; - Some(ctx.add_expression( - Expression::AccessIndex { base: coord, index }, - Span::default(), - body, - )) - } - _ => None, + Some(ctx.add_expression( + Expression::AccessIndex { base: coord, index }, + Span::default(), + body, + )) + } else { + None }; let mut used_extra = false; let depth_ref = match shadow { @@ -2093,3 +2201,99 @@ pub fn sampled_to_depth( }), }; } + +bitflags::bitflags! { + /// Influences the operation `texture_args_generator` + struct TextureArgsOptions: u32 { + /// Generates multisampled variants of images + const MULTI = 1 << 0; + /// Generates shadow variants of images + const SHADOW = 1 << 1; + /// Generates standard images + const STANDARD = 1 << 2; + /// Generates cube arrayed images + const CUBE_ARRAY = 1 << 3; + /// Generates cube arrayed images + const D2_MULTI_ARRAY = 1 << 4; + } +} + +impl From for TextureArgsOptions { + fn from(variations: BuiltinVariations) -> Self { + let mut options = TextureArgsOptions::empty(); + if variations.contains(BuiltinVariations::STANDARD) { + options |= TextureArgsOptions::STANDARD + } + if variations.contains(BuiltinVariations::CUBE_TEXTURES_ARRAY) { + options |= TextureArgsOptions::CUBE_ARRAY + } + if variations.contains(BuiltinVariations::D2_MULTI_TEXTURES_ARRAY) { + options |= TextureArgsOptions::D2_MULTI_ARRAY + } + options + } +} + +/// Helper function to generate the image components for texture/image builtins +/// +/// Calls the passed function `f` with: +/// ```text +/// f(ScalarKind, ImageDimension, arrayed, multi, shadow) +/// ``` +/// +/// `options` controls extra image variants generation like multisampling and depth, +/// see the struct documentation +fn texture_args_generator( + options: TextureArgsOptions, + mut f: impl FnMut(crate::ScalarKind, Dim, bool, bool, bool), +) { + for kind in [Sk::Float, Sk::Uint, Sk::Sint].iter().copied() { + for dim in [Dim::D1, Dim::D2, Dim::D3, Dim::Cube].iter().copied() { + for arrayed in [false, true].iter().copied() { + if dim == Dim::Cube && arrayed { + if !options.contains(TextureArgsOptions::CUBE_ARRAY) { + continue; + } + } else if Dim::D2 == dim + && options.contains(TextureArgsOptions::MULTI) + && arrayed + && options.contains(TextureArgsOptions::D2_MULTI_ARRAY) + { + // multisampling for sampler2DMSArray + f(kind, dim, arrayed, true, false); + } else if !options.contains(TextureArgsOptions::STANDARD) { + continue; + } + + f(kind, dim, arrayed, false, false); + + // 3D images can't be neither arrayed nor shadow + // so we break out early, this way arrayed will always + // be false and we won't hit the shadow branch + if let Dim::D3 = dim { + break; + } + + if Dim::D2 == dim && options.contains(TextureArgsOptions::MULTI) && !arrayed { + // multisampling + f(kind, dim, arrayed, true, false); + } + + if Sk::Float == kind && options.contains(TextureArgsOptions::SHADOW) { + // shadow + f(kind, dim, arrayed, false, true); + } + } + } + } +} + +/// Helper functions used to convert from a image dimension into a integer representing the +/// number of components needed for the coordinates vector (1 means scalar instead of vector) +fn image_dims_to_coords_size(dim: Dim) -> usize { + match dim { + Dim::D1 => 1, + Dim::D2 => 2, + _ => 3, + } +} diff --git a/third_party/rust/naga/src/front/glsl/context.rs b/third_party/rust/naga/src/front/glsl/context.rs index eefef012b7def..781c9c7677089 100644 --- a/third_party/rust/naga/src/front/glsl/context.rs +++ b/third_party/rust/naga/src/front/glsl/context.rs @@ -9,9 +9,9 @@ use super::{ }; use crate::{ front::{Emitter, Typifier}, - Arena, BinaryOperator, Block, Constant, Expression, FastHashMap, FunctionArgument, Handle, - LocalVariable, RelationalFunction, ScalarKind, ScalarValue, Span, Statement, StorageClass, - Type, TypeInner, VectorSize, + AddressSpace, Arena, BinaryOperator, Block, Constant, Expression, FastHashMap, + FunctionArgument, Handle, LocalVariable, RelationalFunction, ScalarKind, ScalarValue, Span, + Statement, Type, TypeInner, VectorSize, }; use std::{convert::TryFrom, ops::Index}; @@ -107,7 +107,7 @@ impl Context { let span = parser.module.global_variables.get_span(v); let res = ( self.expressions.append(Expression::GlobalVariable(v), span), - parser.module.global_variables[v].class != StorageClass::Handle, + parser.module.global_variables[v].space != AddressSpace::Handle, None, ); self.emit_start(); @@ -262,7 +262,7 @@ impl Context { name: None, inner: TypeInner::Pointer { base: arg.ty, - class: StorageClass::Function, + space: AddressSpace::Function, }, }, span, @@ -540,7 +540,7 @@ impl Context { if ExprPos::Rhs == pos { let resolved = parser.resolve_type(self, pointer, meta)?; - if resolved.pointer_class().is_some() { + if resolved.pointer_space().is_some() { return Ok(( Some(self.add_expression(Expression::Load { pointer }, meta, body)), meta, @@ -579,8 +579,165 @@ impl Context { let right_inner = self.typifier.get(right, &parser.module.types); match (left_inner, right_inner) { - (&TypeInner::Vector { .. }, &TypeInner::Vector { .. }) - | (&TypeInner::Matrix { .. }, &TypeInner::Matrix { .. }) => match op { + ( + &TypeInner::Matrix { + columns: left_columns, + rows: left_rows, + width: left_width, + }, + &TypeInner::Matrix { + columns: right_columns, + rows: right_rows, + width: right_width, + }, + ) => { + // Check that the two arguments have the same dimensions + if left_columns != right_columns + || left_rows != right_rows + || left_width != right_width + { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + format!( + "Cannot apply operation to {:?} and {:?}", + left_inner, right_inner + ) + .into(), + ), + meta, + }) + } + + match op { + BinaryOperator::Divide => { + // Naga IR doesn't support matrix division so we need to + // divide the columns individually and reassemble the matrix + let mut components = Vec::with_capacity(left_columns as usize); + + for index in 0..left_columns as u32 { + // Get the column vectors + let left_vector = self.add_expression( + Expression::AccessIndex { base: left, index }, + meta, + body, + ); + let right_vector = self.add_expression( + Expression::AccessIndex { base: right, index }, + meta, + body, + ); + + // Divide the vectors + let column = self.expressions.append( + Expression::Binary { + op, + left: left_vector, + right: right_vector, + }, + meta, + ); + + components.push(column) + } + + // Rebuild the matrix from the divided vectors + self.expressions.append( + Expression::Compose { + ty: parser.module.types.insert( + Type { + name: None, + inner: TypeInner::Matrix { + columns: left_columns, + rows: left_rows, + width: left_width, + }, + }, + Span::default(), + ), + components, + }, + meta, + ) + } + BinaryOperator::Equal | BinaryOperator::NotEqual => { + // Naga IR doesn't support matrix comparisons so we need to + // compare the columns individually and then fold them together + // + // The folding is done using a logical and for equality and + // a logical or for inequality + let equals = op == BinaryOperator::Equal; + + let (op, combine, fun) = match equals { + true => ( + BinaryOperator::Equal, + BinaryOperator::LogicalAnd, + RelationalFunction::All, + ), + false => ( + BinaryOperator::NotEqual, + BinaryOperator::LogicalOr, + RelationalFunction::Any, + ), + }; + + let mut root = None; + + for index in 0..left_columns as u32 { + // Get the column vectors + let left_vector = self.add_expression( + Expression::AccessIndex { base: left, index }, + meta, + body, + ); + let right_vector = self.add_expression( + Expression::AccessIndex { base: right, index }, + meta, + body, + ); + + let argument = self.expressions.append( + Expression::Binary { + op, + left: left_vector, + right: right_vector, + }, + meta, + ); + + // The result of comparing two vectors is a boolean vector + // so use a relational function like all to get a single + // boolean value + let compare = self.add_expression( + Expression::Relational { fun, argument }, + meta, + body, + ); + + // Fold the result + root = Some(match root { + Some(right) => self.add_expression( + Expression::Binary { + op: combine, + left: compare, + right, + }, + meta, + body, + ), + None => compare, + }); + } + + root.unwrap() + } + _ => self.add_expression( + Expression::Binary { left, op, right }, + meta, + body, + ), + } + } + (&TypeInner::Vector { .. }, &TypeInner::Vector { .. }) => match op { BinaryOperator::Equal | BinaryOperator::NotEqual => { let equals = op == BinaryOperator::Equal; @@ -659,6 +816,189 @@ impl Context { self.add_expression(Expression::Binary { left, op, right }, meta, body) } }, + ( + &TypeInner::Scalar { + width: left_width, .. + }, + &TypeInner::Matrix { + rows, + columns, + width: right_width, + }, + ) => { + // Check that the two arguments have the same width + if left_width != right_width { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + format!( + "Cannot apply operation to {:?} and {:?}", + left_inner, right_inner + ) + .into(), + ), + meta, + }) + } + + match op { + BinaryOperator::Divide + | BinaryOperator::Add + | BinaryOperator::Subtract => { + // Naga IR doesn't support all matrix by scalar operations so + // we need for some to turn the scalar into a vector by + // splatting it and then for each column vector apply the + // operation and finally reconstruct the matrix + let scalar_vector = self.add_expression( + Expression::Splat { + size: rows, + value: left, + }, + meta, + body, + ); + + let mut components = Vec::with_capacity(columns as usize); + + for index in 0..columns as u32 { + // Get the column vector + let matrix_column = self.add_expression( + Expression::AccessIndex { base: right, index }, + meta, + body, + ); + + // Apply the operation to the splatted vector and + // the column vector + let column = self.expressions.append( + Expression::Binary { + op, + left: scalar_vector, + right: matrix_column, + }, + meta, + ); + + components.push(column) + } + + // Rebuild the matrix from the operation result vectors + self.expressions.append( + Expression::Compose { + ty: parser.module.types.insert( + Type { + name: None, + inner: TypeInner::Matrix { + columns, + rows, + width: left_width, + }, + }, + Span::default(), + ), + components, + }, + meta, + ) + } + _ => self.add_expression( + Expression::Binary { left, op, right }, + meta, + body, + ), + } + } + ( + &TypeInner::Matrix { + rows, + columns, + width: left_width, + }, + &TypeInner::Scalar { + width: right_width, .. + }, + ) => { + // Check that the two arguments have the same width + if left_width != right_width { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + format!( + "Cannot apply operation to {:?} and {:?}", + left_inner, right_inner + ) + .into(), + ), + meta, + }) + } + + match op { + BinaryOperator::Divide + | BinaryOperator::Add + | BinaryOperator::Subtract => { + // Naga IR doesn't support all matrix by scalar operations so + // we need for some to turn the scalar into a vector by + // splatting it and then for each column vector apply the + // operation and finally reconstruct the matrix + + let scalar_vector = self.add_expression( + Expression::Splat { + size: rows, + value: right, + }, + meta, + body, + ); + + let mut components = Vec::with_capacity(columns as usize); + + for index in 0..columns as u32 { + // Get the column vector + let matrix_column = self.add_expression( + Expression::AccessIndex { base: left, index }, + meta, + body, + ); + + // Apply the operation to the splatted vector and + // the column vector + let column = self.expressions.append( + Expression::Binary { + op, + left: matrix_column, + right: scalar_vector, + }, + meta, + ); + + components.push(column) + } + + // Rebuild the matrix from the operation result vectors + self.expressions.append( + Expression::Compose { + ty: parser.module.types.insert( + Type { + name: None, + inner: TypeInner::Matrix { + columns, + rows, + width: left_width, + }, + }, + Span::default(), + ), + components, + }, + meta, + ) + } + _ => self.add_expression( + Expression::Binary { left, op, right }, + meta, + body, + ), + } + } _ => self.add_expression(Expression::Binary { left, op, right }, meta, body), } } diff --git a/third_party/rust/naga/src/front/glsl/error.rs b/third_party/rust/naga/src/front/glsl/error.rs index 132a4208f9e3d..cd0577a6e86c5 100644 --- a/third_party/rust/naga/src/front/glsl/error.rs +++ b/third_party/rust/naga/src/front/glsl/error.rs @@ -17,22 +17,22 @@ fn join_with_comma(list: &[ExpectedToken]) -> String { string } -/// One of the expected tokens returned in [`InvalidToken`](ErrorKind::InvalidToken) +/// One of the expected tokens returned in [`InvalidToken`](ErrorKind::InvalidToken). #[derive(Debug, PartialEq)] pub enum ExpectedToken { - /// A specific token was expected + /// A specific token was expected. Token(TokenValue), - /// A type was expected + /// A type was expected. TypeName, - /// An identifier was expected + /// An identifier was expected. Identifier, - /// An integer literal was expected + /// An integer literal was expected. IntLiteral, - /// A float literal was expected + /// A float literal was expected. FloatLiteral, - /// A boolean literal was expected + /// A boolean literal was expected. BoolLiteral, - /// The end of file was expected + /// The end of file was expected. Eof, } impl From for ExpectedToken { @@ -54,7 +54,7 @@ impl std::fmt::Display for ExpectedToken { } } -/// Information about the cause of an error +/// Information about the cause of an error. #[derive(Debug, Error)] #[cfg_attr(test, derive(PartialEq))] pub enum ErrorKind { @@ -104,6 +104,11 @@ pub enum ErrorKind { /// An error was returned by the preprocessor. #[error("{0:?}")] PreprocessorError(PreprocessorError), + /// The parser entered an illegal state and exited + /// + /// This obviously is a bug and as such should be reported in the github issue tracker + #[error("Internal error: {0}")] + InternalError(&'static str), } impl From for ErrorKind { @@ -112,7 +117,7 @@ impl From for ErrorKind { } } -/// Error returned during shader parsing +/// Error returned during shader parsing. #[derive(Debug, Error)] #[error("{kind}")] #[cfg_attr(test, derive(PartialEq))] diff --git a/third_party/rust/naga/src/front/glsl/functions.rs b/third_party/rust/naga/src/front/glsl/functions.rs index 14f30bdfb74bf..a6dd97e999922 100644 --- a/third_party/rust/naga/src/front/glsl/functions.rs +++ b/third_party/rust/naga/src/front/glsl/functions.rs @@ -1,15 +1,15 @@ use super::{ ast::*, - builtins::{inject_builtin, inject_double_builtin, sampled_to_depth}, + builtins::{inject_builtin, sampled_to_depth}, context::{Context, ExprPos, StmtContext}, error::{Error, ErrorKind}, types::scalar_components, Parser, Result, }; use crate::{ - front::glsl::types::type_power, proc::ensure_block_returns, Arena, Block, Constant, - ConstantInner, EntryPoint, Expression, FastHashMap, Function, FunctionArgument, FunctionResult, - Handle, LocalVariable, ScalarKind, ScalarValue, Span, Statement, StorageClass, StructMember, + front::glsl::types::type_power, proc::ensure_block_returns, AddressSpace, Arena, Block, + Constant, ConstantInner, EntryPoint, Expression, FastHashMap, Function, FunctionArgument, + FunctionResult, Handle, LocalVariable, ScalarKind, ScalarValue, Span, Statement, StructMember, Type, TypeInner, }; use std::iter; @@ -602,26 +602,26 @@ impl Parser { raw_args: &[Handle], meta: Span, ) -> Result>> { - // If the name for the function hasn't yet been initialized check if any - // builtin can be injected. - if self.lookup_function.get(&name).is_none() { - let declaration = self.lookup_function.entry(name.clone()).or_default(); - inject_builtin(declaration, &mut self.module, &name); + // Grow the typifier to be able to index it later without needing + // to hold the context mutably + for &(expr, span) in args.iter() { + self.typifier_grow(ctx, expr, span)?; } - // Check if any argument uses a double type - let has_double = args - .iter() - .any(|&(expr, meta)| self.resolve_type(ctx, expr, meta).map_or(false, is_double)); - - // At this point a declaration is guaranteed - let declaration = self.lookup_function.get_mut(&name).unwrap(); + // Check if the passed arguments require any special variations + let mut variations = builtin_required_variations( + args.iter() + .map(|&(expr, _)| ctx.typifier.get(expr, &self.module.types)), + ); - if declaration.builtin && !declaration.double && has_double { - inject_double_builtin(declaration, &mut self.module, &name); - } + // Initiate the declaration if it wasn't previously initialized and inject builtins + let declaration = self.lookup_function.entry(name.clone()).or_insert_with(|| { + variations |= BuiltinVariations::STANDARD; + Default::default() + }); + inject_builtin(declaration, &mut self.module, &name, variations); - // Borrow again but without mutability + // Borrow again but without mutability, at this point a declaration is guaranteed let declaration = self.lookup_function.get(&name).unwrap(); // Possibly contains the overload to be used in the call @@ -674,8 +674,63 @@ impl Parser { let overload_param_ty = &self.module.types[*overload_parameter].inner; let call_arg_ty = self.resolve_type(ctx, call_argument.0, call_argument.1)?; - // If the types match there's no need to check for conversions so continue - if overload_param_ty == call_arg_ty { + // Storage images cannot be directly compared since while the access is part of the + // type in naga's IR, in glsl they are a qualifier and don't enter in the match as + // long as the access needed is satisfied. + if let ( + &TypeInner::Image { + class: + crate::ImageClass::Storage { + format: overload_format, + access: overload_access, + }, + dim: overload_dim, + arrayed: overload_arrayed, + }, + &TypeInner::Image { + class: + crate::ImageClass::Storage { + format: call_format, + access: call_access, + }, + dim: call_dim, + arrayed: call_arrayed, + }, + ) = (overload_param_ty, call_arg_ty) + { + // Images size must match otherwise the overload isn't what we want + let good_size = call_dim == overload_dim && call_arrayed == overload_arrayed; + // Glsl requires the formats to strictly match unless you are builtin + // function overload and have not been replaced, in which case we only + // check that the format scalar kind matches + let good_format = overload_format == call_format + || (overload.internal + && ScalarKind::from(overload_format) == ScalarKind::from(call_format)); + if !(good_size && good_format) { + continue 'outer; + } + + // While storage access mismatch is an error it isn't one that causes + // the overload matching to fail so we defer the error and consider + // that the images match exactly + if !call_access.contains(overload_access) { + self.errors.push(Error { + kind: ErrorKind::SemanticError( + format!( + "'{}': image needs {:?} access but only {:?} was provided", + name, overload_access, call_access + ) + .into(), + ), + meta, + }); + } + + // The images satisfy the conditions to be considered as an exact match + new_conversions[i] = Conversion::Exact; + continue; + } else if overload_param_ty == call_arg_ty { + // If the types match there's no need to check for conversions so continue new_conversions[i] = Conversion::Exact; continue; } @@ -811,10 +866,10 @@ impl Parser { ), handle, ), - // If the argument is a pointer whose storage class isn't `Function` an - // indirection trough a local variable is needed to align the storage - // classes of the call argument and the overload parameter - TypeInner::Pointer { base, class } if class != StorageClass::Function => ( + // If the argument is a pointer whose address space isn't `Function`, an + // indirection through a local variable is needed to align the address + // spaces of the call argument and the overload parameter. + TypeInner::Pointer { base, space } if space != AddressSpace::Function => ( base, ctx.add_expression( Expression::Load { pointer: handle }, @@ -826,8 +881,8 @@ impl Parser { size, kind, width, - class, - } if class != StorageClass::Function => { + space, + } if space != AddressSpace::Function => { let inner = match size { Some(size) => TypeInner::Vector { size, kind, width }, None => TypeInner::Scalar { kind, width }, @@ -957,9 +1012,9 @@ impl Parser { Ok(result) } - FunctionKind::Macro(builtin) => builtin - .call(self, ctx, body, arguments.as_mut_slice(), meta) - .map(Some), + FunctionKind::Macro(builtin) => { + builtin.call(self, ctx, body, arguments.as_mut_slice(), meta) + } } } @@ -971,11 +1026,6 @@ impl Parser { mut body: Block, meta: Span, ) { - if self.lookup_function.get(&name).is_none() { - let declaration = self.lookup_function.entry(name.clone()).or_default(); - inject_builtin(declaration, &mut self.module, &name); - } - ensure_block_returns(&mut body); let void = result.is_none(); @@ -986,7 +1036,16 @@ impl Parser { .. } = self; - let declaration = lookup_function.entry(name.clone()).or_default(); + // Check if the passed arguments require any special variations + let mut variations = + builtin_required_variations(ctx.parameters.iter().map(|&arg| &module.types[arg].inner)); + + // Initiate the declaration if it wasn't previously initialized and inject builtins + let declaration = lookup_function.entry(name.clone()).or_insert_with(|| { + variations |= BuiltinVariations::STANDARD; + Default::default() + }); + inject_builtin(declaration, module, &name, variations); let Context { expressions, @@ -997,15 +1056,6 @@ impl Parser { .. } = ctx; - if declaration.builtin - && !declaration.double - && parameters - .iter() - .any(|ty| is_double(&module.types[*ty].inner)) - { - inject_double_builtin(declaration, module, &name); - } - let function = Function { name: Some(name), arguments, @@ -1055,6 +1105,7 @@ impl Parser { parameters_info, kind: FunctionKind::Call(handle), defined: true, + internal: false, void, }); } @@ -1066,11 +1117,6 @@ impl Parser { result: Option, meta: Span, ) { - if self.lookup_function.get(&name).is_none() { - let declaration = self.lookup_function.entry(name.clone()).or_default(); - inject_builtin(declaration, &mut self.module, &name); - } - let void = result.is_none(); let &mut Parser { @@ -1079,7 +1125,16 @@ impl Parser { .. } = self; - let declaration = lookup_function.entry(name.clone()).or_default(); + // Check if the passed arguments require any special variations + let mut variations = + builtin_required_variations(ctx.parameters.iter().map(|&arg| &module.types[arg].inner)); + + // Initiate the declaration if it wasn't previously initialized and inject builtins + let declaration = lookup_function.entry(name.clone()).or_insert_with(|| { + variations |= BuiltinVariations::STANDARD; + Default::default() + }); + inject_builtin(declaration, module, &name, variations); let Context { arguments, @@ -1088,15 +1143,6 @@ impl Parser { .. } = ctx; - if declaration.builtin - && !declaration.double - && parameters - .iter() - .any(|ty| is_double(&module.types[*ty].inner)) - { - inject_double_builtin(declaration, module, &name); - } - let function = Function { name: Some(name), arguments, @@ -1130,6 +1176,7 @@ impl Parser { parameters_info, kind: FunctionKind::Call(handle), defined: false, + internal: false, void, }); } @@ -1161,6 +1208,59 @@ impl Parser { ), ) { match self.module.types[ty].inner { + TypeInner::Array { + base, + size: crate::ArraySize::Constant(constant), + .. + } => { + let mut location = match binding { + crate::Binding::Location { location, .. } => location, + _ => return, + }; + + // TODO: Better error reporting + // right now we just don't walk the array if the size isn't known at + // compile time and let validation catch it + let size = match self.module.constants[constant].to_array_length() { + Some(val) => val, + None => return f(name, pointer, ty, binding, expressions), + }; + + let interpolation = + self.module.types[base] + .inner + .scalar_kind() + .map(|kind| match kind { + ScalarKind::Float => crate::Interpolation::Perspective, + _ => crate::Interpolation::Flat, + }); + + for index in 0..size { + let member_pointer = expressions.append( + Expression::AccessIndex { + base: pointer, + index, + }, + crate::Span::default(), + ); + + let binding = crate::Binding::Location { + location, + interpolation, + sampling: None, + }; + location += 1; + + self.arg_type_walker( + name.clone(), + binding, + member_pointer, + base, + expressions, + f, + ) + } + } TypeInner::Struct { ref members, .. } => { let mut location = match binding { crate::Binding::Location { location, .. } => location, @@ -1293,7 +1393,7 @@ impl Parser { offset: span, }); - span += self.module.types[ty].inner.span(&self.module.constants); + span += self.module.types[ty].inner.size(&self.module.constants); let len = expressions.len(); let load = expressions.append(Expression::Load { pointer }, Default::default()); @@ -1347,16 +1447,6 @@ impl Parser { } } -fn is_double(ty: &TypeInner) -> bool { - match *ty { - TypeInner::ValuePointer { kind, width, .. } - | TypeInner::Scalar { kind, width } - | TypeInner::Vector { kind, width, .. } => kind == ScalarKind::Float && width == 8, - TypeInner::Matrix { width, .. } => width == 8, - _ => false, - } -} - /// Helper enum containing the type of conversion need for a call #[derive(PartialEq, Eq, Clone, Copy, Debug)] enum Conversion { @@ -1441,3 +1531,42 @@ fn conversion(target: &TypeInner, source: &TypeInner) -> Option { }, ) } + +/// Helper method returning all the non standard builtin variations needed +/// to process the function call with the passed arguments +fn builtin_required_variations<'a>(args: impl Iterator) -> BuiltinVariations { + let mut variations = BuiltinVariations::empty(); + + for ty in args { + match *ty { + TypeInner::ValuePointer { kind, width, .. } + | TypeInner::Scalar { kind, width } + | TypeInner::Vector { kind, width, .. } => { + if kind == ScalarKind::Float && width == 8 { + variations |= BuiltinVariations::DOUBLE + } + } + TypeInner::Matrix { width, .. } => { + if width == 8 { + variations |= BuiltinVariations::DOUBLE + } + } + TypeInner::Image { + dim, + arrayed, + class, + } => { + if dim == crate::ImageDimension::Cube && arrayed { + variations |= BuiltinVariations::CUBE_TEXTURES_ARRAY + } + + if dim == crate::ImageDimension::D2 && arrayed && class.is_multisampled() { + variations |= BuiltinVariations::D2_MULTI_TEXTURES_ARRAY + } + } + _ => {} + } + } + + variations +} diff --git a/third_party/rust/naga/src/front/glsl/mod.rs b/third_party/rust/naga/src/front/glsl/mod.rs index 1d4c6c1a94863..ee5d68deda602 100644 --- a/third_party/rust/naga/src/front/glsl/mod.rs +++ b/third_party/rust/naga/src/front/glsl/mod.rs @@ -1,16 +1,22 @@ -//! Front end for consuming the OpenGl Shading language (GLSL). -//! -//! To begin take a look at the documentation for the [`Parser`](Parser). -//! -//! # Supported versions -//! Currently only the versions 450 and 460 are supported and 440 is partially -//! supported, furthermore the vulkan flavor is assumed. +/*! +Frontend for [GLSL][glsl] (OpenGL Shading Language). + +To begin, take a look at the documentation for the [`Parser`](Parser). + +# Supported versions +## Vulkan +- 440 (partial) +- 450 +- 460 + +[glsl]: https://www.khronos.org/registry/OpenGL/index_gl.php +*/ pub use ast::{Precision, Profile}; pub use error::{Error, ErrorKind, ExpectedToken}; pub use token::TokenValue; -use crate::{FastHashMap, FastHashSet, Handle, Module, ShaderStage, Span, Type}; +use crate::{proc::Layouter, FastHashMap, FastHashSet, Handle, Module, ShaderStage, Span, Type}; use ast::{EntryArg, FunctionDeclaration, GlobalLookup}; use parser::ParsingContext; @@ -31,7 +37,7 @@ mod variables; type Result = std::result::Result; -/// Per shader options passed to [`parse`](Parser::parse) +/// Per-shader options passed to [`parse`](Parser::parse). /// /// The [`From`](From) trait is implemented for [`ShaderStage`](ShaderStage) to /// provide a quick way to create a Options instance. @@ -61,16 +67,16 @@ impl From for Options { } } -/// Additional information about the glsl shader +/// Additional information about the GLSL shader. /// -/// Stores additional information about the glsl shader which might not be +/// Stores additional information about the GLSL shader which might not be /// stored in the shader [`Module`](Module). #[derive(Debug)] pub struct ShaderMetadata { - /// The glsl version specified in the shader trought the use of the + /// The GLSL version specified in the shader trought the use of the /// `#version` preprocessor directive. pub version: u16, - /// The glsl profile specified in the shader trought the use of the + /// The GLSL profile specified in the shader trought the use of the /// `#version` preprocessor directive. pub profile: Profile, /// The shader stage in the pipeline, passed to the [`parse`](Parser::parse) @@ -80,8 +86,8 @@ pub struct ShaderMetadata { /// The workgroup size for compute shaders, defaults to `[1; 3]` for /// compute shaders and `[0; 3]` for non compute shaders. pub workgroup_size: [u32; 3], - /// Wether or not early fragment tests where requested by the shader, - /// defaults to `false`. + /// Whether or not early fragment tests where requested by the shader. + /// Defaults to `false`. pub early_fragment_tests: bool, /// The shader can request extensions via the @@ -118,7 +124,7 @@ impl Default for ShaderMetadata { } } -/// The `Parser` is the central structure of the glsl frontend. +/// The `Parser` is the central structure of the GLSL frontend. /// /// To instantiate a new `Parser` the [`Default`](Default) trait is used, so a /// call to the associated function [`Parser::default`](Parser::default) will @@ -166,6 +172,8 @@ pub struct Parser { entry_args: Vec, + layouter: Layouter, + errors: Vec, module: Module, @@ -179,6 +187,7 @@ impl Parser { self.lookup_type.clear(); self.global_variables.clear(); self.entry_args.clear(); + self.layouter.clear(); // This is necessary because if the last parsing errored out, the module // wouldn't have been swapped diff --git a/third_party/rust/naga/src/front/glsl/offset.rs b/third_party/rust/naga/src/front/glsl/offset.rs index dd8ecbfea949d..56ee4ab144313 100644 --- a/third_party/rust/naga/src/front/glsl/offset.rs +++ b/third_party/rust/naga/src/front/glsl/offset.rs @@ -1,13 +1,16 @@ -//! Module responsible for calculating the offset and span for types. -//! -//! There exists two types of layouts std140 and std430 (there's technically -//! two more layouts, shared and packed. Shared is not supported by spirv. Packed is -//! implementation dependent and for now it's just implemented as an alias to -//! std140). -//! -//! The OpenGl spec (the layout rules are defined by the OpenGl spec in section -//! 7.6.2.2 as opposed to the GLSL spec) uses the term basic machine units which are -//! equivalent to bytes. +/*! +Module responsible for calculating the offset and span for types. + +There exists two types of layouts std140 and std430 (there's technically +two more layouts, shared and packed. Shared is not supported by spirv. Packed is +implementation dependent and for now it's just implemented as an alias to +std140). + +The OpenGl spec (the layout rules are defined by the OpenGl spec in section +7.6.2.2 as opposed to the GLSL spec) uses the term basic machine units which are +equivalent to bytes. +*/ + use super::{ ast::StructLayout, error::{Error, ErrorKind}, diff --git a/third_party/rust/naga/src/front/glsl/parser.rs b/third_party/rust/naga/src/front/glsl/parser.rs index 2180b9b6ecd22..c159e80eecdc8 100644 --- a/third_party/rust/naga/src/front/glsl/parser.rs +++ b/third_party/rust/naga/src/front/glsl/parser.rs @@ -1,5 +1,5 @@ use super::{ - ast::{FunctionKind, Profile, TypeQualifier}, + ast::{FunctionKind, Profile, TypeQualifiers}, context::{Context, ExprPos}, error::ExpectedToken, error::{Error, ErrorKind}, @@ -21,6 +21,8 @@ mod types; pub struct ParsingContext<'source> { lexer: Peekable>, + /// Used to store tokens already consumed by the parser but that need to be backtracked + backtracked_token: Option, last_meta: Span, } @@ -28,10 +30,32 @@ impl<'source> ParsingContext<'source> { pub fn new(lexer: Lexer<'source>) -> Self { ParsingContext { lexer: lexer.peekable(), + backtracked_token: None, last_meta: Span::default(), } } + /// Helper method for backtracking from a consumed token + /// + /// This method should always be used instead of assigning to `backtracked_token` since + /// it validates that backtracking hasn't ocurred more than one time in a row + /// + /// # Panics + /// - If the parser already backtracked without bumping in between + pub fn backtrack(&mut self, token: Token) -> Result<()> { + // This should never happen + if let Some(ref prev_token) = self.backtracked_token { + return Err(Error { + kind: ErrorKind::InternalError("The parser tried to backtrack twice in a row"), + meta: prev_token.meta, + }); + } + + self.backtracked_token = Some(token); + + Ok(()) + } + pub fn expect_ident(&mut self, parser: &mut Parser) -> Result<(String, Span)> { let token = self.bump(parser)?; @@ -59,6 +83,11 @@ impl<'source> ParsingContext<'source> { pub fn next(&mut self, parser: &mut Parser) -> Option { loop { + if let Some(token) = self.backtracked_token.take() { + self.last_meta = token.meta; + break Some(token); + } + let res = self.lexer.next()?; match res.kind { @@ -94,30 +123,34 @@ impl<'source> ParsingContext<'source> { } pub fn peek(&mut self, parser: &mut Parser) -> Option<&Token> { - match self.lexer.peek()?.kind { - LexerResultKind::Token(_) => { - let res = self.lexer.peek()?; - - match res.kind { - LexerResultKind::Token(ref token) => Some(token), - _ => unreachable!(), - } + loop { + if let Some(ref token) = self.backtracked_token { + break Some(token); } - LexerResultKind::Error(_) | LexerResultKind::Directive(_) => { - let res = self.lexer.next()?; - match res.kind { - LexerResultKind::Directive(directive) => { - parser.handle_directive(directive, res.meta) + match self.lexer.peek()?.kind { + LexerResultKind::Token(_) => { + let res = self.lexer.peek()?; + + match res.kind { + LexerResultKind::Token(ref token) => break Some(token), + _ => unreachable!(), } - LexerResultKind::Error(error) => parser.errors.push(Error { - kind: ErrorKind::PreprocessorError(error), - meta: res.meta, - }), - _ => unreachable!(), } + LexerResultKind::Error(_) | LexerResultKind::Directive(_) => { + let res = self.lexer.next()?; - self.peek(parser) + match res.kind { + LexerResultKind::Directive(directive) => { + parser.handle_directive(directive, res.meta) + } + LexerResultKind::Error(error) => parser.errors.push(Error { + kind: ErrorKind::PreprocessorError(error), + meta: res.meta, + }), + _ => unreachable!(), + } + } } } } @@ -366,15 +399,15 @@ impl Parser { } } -pub struct DeclarationContext<'ctx> { - qualifiers: Vec<(TypeQualifier, Span)>, +pub struct DeclarationContext<'ctx, 'qualifiers> { + qualifiers: TypeQualifiers<'qualifiers>, external: bool, ctx: &'ctx mut Context, body: &'ctx mut Block, } -impl<'ctx> DeclarationContext<'ctx> { +impl<'ctx, 'qualifiers> DeclarationContext<'ctx, 'qualifiers> { fn add_var( &mut self, parser: &mut Parser, @@ -384,7 +417,7 @@ impl<'ctx> DeclarationContext<'ctx> { meta: Span, ) -> Result> { let decl = VarDeclaration { - qualifiers: &self.qualifiers, + qualifiers: &mut self.qualifiers, ty, name: Some(name), init, diff --git a/third_party/rust/naga/src/front/glsl/parser/declarations.rs b/third_party/rust/naga/src/front/glsl/parser/declarations.rs index 6a1cc2ddbad56..acc200ba257e6 100644 --- a/third_party/rust/naga/src/front/glsl/parser/declarations.rs +++ b/third_party/rust/naga/src/front/glsl/parser/declarations.rs @@ -1,8 +1,8 @@ use crate::{ front::glsl::{ ast::{ - GlobalLookup, GlobalLookupKind, Precision, StorageQualifier, StructLayout, - TypeQualifier, + GlobalLookup, GlobalLookupKind, Precision, QualifierKey, QualifierValue, + StorageQualifier, StructLayout, TypeQualifiers, }, context::{Context, ExprPos}, error::ExpectedToken, @@ -12,7 +12,7 @@ use crate::{ variables::{GlobalOrConstant, VarDeclaration}, Error, ErrorKind, Parser, Span, }, - Block, Expression, FunctionResult, Handle, ScalarKind, Statement, StorageClass, StructMember, + AddressSpace, Block, Expression, FunctionResult, Handle, ScalarKind, Statement, StructMember, Type, TypeInner, }; @@ -121,7 +121,6 @@ impl<'source> ParsingContext<'source> { &mut self, parser: &mut Parser, ty: Handle, - mut fallthrough: Option, ctx: &mut DeclarationContext, ) -> Result<()> { // init_declarator_list: @@ -139,20 +138,15 @@ impl<'source> ParsingContext<'source> { // fully_specified_type IDENTIFIER EQUAL initializer // Consume any leading comma, e.g. this is valid: `float, a=1;` - if fallthrough - .as_ref() - .or_else(|| self.peek(parser)) - .filter(|t| t.value == TokenValue::Comma) - .is_some() + if self + .peek(parser) + .map_or(false, |t| t.value == TokenValue::Comma) { - fallthrough.take().or_else(|| self.next(parser)); + self.next(parser); } loop { - let token = fallthrough - .take() - .ok_or(ErrorKind::EndOfFile) - .or_else(|_| self.bump(parser))?; + let token = self.bump(parser)?; let name = match token.value { TokenValue::Semicolon => break, TokenValue::Identifier(name) => name, @@ -249,7 +243,7 @@ impl<'source> ParsingContext<'source> { // type_qualifier IDENTIFIER identifier_list SEMICOLON if self.peek_type_qualifier(parser) || self.peek_type_name(parser) { - let qualifiers = self.parse_type_qualifiers(parser)?; + let mut qualifiers = self.parse_type_qualifiers(parser)?; if self.peek_type_name(parser) { // This branch handles variables and function prototypes and if @@ -339,7 +333,8 @@ impl<'source> ParsingContext<'source> { body, }; - self.parse_init_declarator_list(parser, ty, Some(token_fallthrough), &mut ctx)?; + self.backtrack(token_fallthrough)?; + self.parse_init_declarator_list(parser, ty, &mut ctx)?; } else { parser.errors.push(Error { kind: ErrorKind::SemanticError("Declaration cannot have void type".into()), @@ -361,7 +356,7 @@ impl<'source> ParsingContext<'source> { parser, ctx, body, - &qualifiers, + &mut qualifiers, ty_name, token.meta, ) @@ -377,33 +372,28 @@ impl<'source> ParsingContext<'source> { } } TokenValue::Semicolon => { - let mut meta_all = token.meta; - for &(ref qualifier, meta) in qualifiers.iter() { - meta_all.subsume(meta); - match *qualifier { - TypeQualifier::WorkGroupSize(i, value) => { - parser.meta.workgroup_size[i] = value - } - TypeQualifier::EarlyFragmentTests => { - parser.meta.early_fragment_tests = true; - } - TypeQualifier::StorageQualifier(_) => { - // TODO: Maybe add some checks here - // This is needed because of cases like - // layout(early_fragment_tests) in; - } - _ => { - parser.errors.push(Error { - kind: ErrorKind::SemanticError( - "Qualifier not supported as standalone".into(), - ), - meta, - }); - } - } + if let Some(value) = + qualifiers.uint_layout_qualifier("local_size_x", &mut parser.errors) + { + parser.meta.workgroup_size[0] = value; + } + if let Some(value) = + qualifiers.uint_layout_qualifier("local_size_y", &mut parser.errors) + { + parser.meta.workgroup_size[1] = value; } + if let Some(value) = + qualifiers.uint_layout_qualifier("local_size_z", &mut parser.errors) + { + parser.meta.workgroup_size[2] = value; + } + + parser.meta.early_fragment_tests |= qualifiers + .none_layout_qualifier("early_fragment_tests", &mut parser.errors); + + qualifiers.unused_errors(&mut parser.errors); - Ok(Some(meta_all)) + Ok(Some(qualifiers.span)) } _ => Err(Error { kind: ErrorKind::InvalidToken( @@ -471,27 +461,22 @@ impl<'source> ParsingContext<'source> { parser: &mut Parser, ctx: &mut Context, body: &mut Block, - qualifiers: &[(TypeQualifier, Span)], + qualifiers: &mut TypeQualifiers, ty_name: String, meta: Span, ) -> Result { - let mut storage = None; - let mut layout = None; - - for &(ref qualifier, _) in qualifiers { - match *qualifier { - TypeQualifier::StorageQualifier(StorageQualifier::StorageClass(c)) => { - storage = Some(c) + let layout = match qualifiers.layout_qualifiers.remove(&QualifierKey::Layout) { + Some((QualifierValue::Layout(l), _)) => l, + None => { + if let StorageQualifier::AddressSpace(AddressSpace::Storage { .. }) = + qualifiers.storage.0 + { + StructLayout::Std430 + } else { + StructLayout::Std140 } - TypeQualifier::Layout(l) => layout = Some(l), - _ => continue, } - } - - let layout = match (layout, storage) { - (Some(layout), _) => layout, - (None, Some(StorageClass::Storage { .. })) => StructLayout::Std430, - _ => StructLayout::Std140, + _ => unreachable!(), }; let mut members = Vec::new(); diff --git a/third_party/rust/naga/src/front/glsl/parser/functions.rs b/third_party/rust/naga/src/front/glsl/parser/functions.rs index 6483db052111a..797e48dea55bc 100644 --- a/third_party/rust/naga/src/front/glsl/parser/functions.rs +++ b/third_party/rust/naga/src/front/glsl/parser/functions.rs @@ -42,17 +42,28 @@ impl<'source> ParsingContext<'source> { body: &mut Block, terminator: &mut Option, ) -> Result> { - // TODO: This prevents snippets like the following from working - // ```glsl - // vec4(1.0); - // ``` - // But this would require us to add lookahead to also support - // declarations and since this statement is very unlikely and most - // likely an error, for now we don't support it - if self.peek_type_name(parser) || self.peek_type_qualifier(parser) { + // Type qualifiers always identify a declaration statement + if self.peek_type_qualifier(parser) { return self.parse_declaration(parser, ctx, body, false); } + // Type names can identify either declaration statements or type constructors + // depending on wether the token following the type name is a `(` (LeftParen) + if self.peek_type_name(parser) { + // Start by consuming the type name so that we can peek the token after it + let token = self.bump(parser)?; + // Peek the next token and check if it's a `(` (LeftParen) if so the statement + // is a constructor, otherwise it's a declaration. We need to do the check + // beforehand and not in the if since we will backtrack before the if + let declaration = TokenValue::LeftParen != self.expect_peek(parser)?.value; + + self.backtrack(token)?; + + if declaration { + return self.parse_declaration(parser, ctx, body, false); + } + } + let new_break = || { let mut block = Block::new(); block.push(Statement::Break, crate::Span::default()); @@ -396,7 +407,7 @@ impl<'source> ParsingContext<'source> { if self.bump_if(parser, TokenValue::Semicolon).is_none() { let (expr, expr_meta) = if self.peek_type_name(parser) || self.peek_type_qualifier(parser) { - let qualifiers = self.parse_type_qualifiers(parser)?; + let mut qualifiers = self.parse_type_qualifiers(parser)?; let (ty, mut meta) = self.parse_type_non_void(parser)?; let name = self.expect_ident(parser)?.0; @@ -407,7 +418,7 @@ impl<'source> ParsingContext<'source> { meta.subsume(end_meta); let decl = VarDeclaration { - qualifiers: &qualifiers, + qualifiers: &mut qualifiers, ty, name: Some(name), init: None, @@ -486,12 +497,21 @@ impl<'source> ParsingContext<'source> { let mut block = Block::new(); ctx.push_scope(); - let meta = - self.parse_compound_statement(meta, parser, ctx, &mut block, terminator)?; + let mut block_terminator = None; + let meta = self.parse_compound_statement( + meta, + parser, + ctx, + &mut block, + &mut block_terminator, + )?; ctx.remove_current_scope(); body.push(Statement::Block(block), meta); + if block_terminator.is_some() { + terminator.get_or_insert(body.len()); + } meta } diff --git a/third_party/rust/naga/src/front/glsl/parser/types.rs b/third_party/rust/naga/src/front/glsl/parser/types.rs index ad537e9594353..47ad230d3936c 100644 --- a/third_party/rust/naga/src/front/glsl/parser/types.rs +++ b/third_party/rust/naga/src/front/glsl/parser/types.rs @@ -1,12 +1,12 @@ use crate::{ front::glsl::{ - ast::{StorageQualifier, StructLayout, TypeQualifier}, + ast::{QualifierKey, QualifierValue, StorageQualifier, StructLayout, TypeQualifiers}, error::ExpectedToken, parser::ParsingContext, token::{Token, TokenValue}, Error, ErrorKind, Parser, Result, }, - ArraySize, Handle, Span, StorageClass, Type, TypeInner, + AddressSpace, ArraySize, Handle, Span, Type, TypeInner, }; impl<'source> ParsingContext<'source> { @@ -128,11 +128,8 @@ impl<'source> ParsingContext<'source> { }) } - pub fn parse_type_qualifiers( - &mut self, - parser: &mut Parser, - ) -> Result> { - let mut qualifiers = Vec::new(); + pub fn parse_type_qualifiers<'a>(&mut self, parser: &mut Parser) -> Result> { + let mut qualifiers = TypeQualifiers::default(); while self.peek_type_qualifier(parser) { let token = self.bump(parser)?; @@ -143,31 +140,104 @@ impl<'source> ParsingContext<'source> { continue; } - qualifiers.push(( - match token.value { - TokenValue::Interpolation(i) => TypeQualifier::Interpolation(i), - TokenValue::Const => TypeQualifier::StorageQualifier(StorageQualifier::Const), - TokenValue::In => TypeQualifier::StorageQualifier(StorageQualifier::Input), - TokenValue::Out => TypeQualifier::StorageQualifier(StorageQualifier::Output), - TokenValue::Uniform => TypeQualifier::StorageQualifier( - StorageQualifier::StorageClass(StorageClass::Uniform), - ), - TokenValue::Shared => TypeQualifier::StorageQualifier( - StorageQualifier::StorageClass(StorageClass::WorkGroup), - ), - TokenValue::Buffer => TypeQualifier::StorageQualifier( - StorageQualifier::StorageClass(StorageClass::Storage { - access: crate::StorageAccess::default(), - }), - ), - TokenValue::Sampling(s) => TypeQualifier::Sampling(s), - TokenValue::PrecisionQualifier(p) => TypeQualifier::Precision(p), - TokenValue::StorageAccess(access) => TypeQualifier::StorageAccess(access), - TokenValue::Restrict => continue, - _ => unreachable!(), - }, - token.meta, - )) + qualifiers.span.subsume(token.meta); + + match token.value { + TokenValue::Interpolation(i) => { + if qualifiers.interpolation.is_some() { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + "Cannot use more than one interpolation qualifier per declaration" + .into(), + ), + meta: token.meta, + }) + } + + qualifiers.interpolation = Some((i, token.meta)); + } + TokenValue::Const + | TokenValue::In + | TokenValue::Out + | TokenValue::Uniform + | TokenValue::Shared + | TokenValue::Buffer => { + let storage = match token.value { + TokenValue::Const => StorageQualifier::Const, + TokenValue::In => StorageQualifier::Input, + TokenValue::Out => StorageQualifier::Output, + TokenValue::Uniform => { + StorageQualifier::AddressSpace(AddressSpace::Uniform) + } + TokenValue::Shared => { + StorageQualifier::AddressSpace(AddressSpace::WorkGroup) + } + TokenValue::Buffer => { + StorageQualifier::AddressSpace(AddressSpace::Storage { + access: crate::StorageAccess::all(), + }) + } + _ => unreachable!(), + }; + + if StorageQualifier::AddressSpace(AddressSpace::Function) + != qualifiers.storage.0 + { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + "Cannot use more than one storage qualifier per declaration".into(), + ), + meta: token.meta, + }); + } + + qualifiers.storage = (storage, token.meta); + } + TokenValue::Sampling(s) => { + if qualifiers.sampling.is_some() { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + "Cannot use more than one sampling qualifier per declaration" + .into(), + ), + meta: token.meta, + }) + } + + qualifiers.sampling = Some((s, token.meta)); + } + TokenValue::PrecisionQualifier(p) => { + if qualifiers.interpolation.is_some() { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + "Cannot use more than one precision qualifier per declaration" + .into(), + ), + meta: token.meta, + }) + } + + qualifiers.precision = Some((p, token.meta)); + } + TokenValue::StorageAccess(access) => { + let storage_access = qualifiers + .storage_acess + .get_or_insert((crate::StorageAccess::empty(), Span::default())); + if storage_access.0.contains(access) { + parser.errors.push(Error { + kind: ErrorKind::SemanticError( + "The same memory qualifier can only be used once".into(), + ), + meta: token.meta, + }) + } + + storage_access.0 |= access; + storage_access.1.subsume(token.meta); + } + TokenValue::Restrict => continue, + _ => unreachable!(), + }; } Ok(qualifiers) @@ -176,11 +246,11 @@ impl<'source> ParsingContext<'source> { pub fn parse_layout_qualifier_id_list( &mut self, parser: &mut Parser, - qualifiers: &mut Vec<(TypeQualifier, Span)>, + qualifiers: &mut TypeQualifiers, ) -> Result<()> { self.expect(parser, TokenValue::LeftParen)?; loop { - self.parse_layout_qualifier_id(parser, qualifiers)?; + self.parse_layout_qualifier_id(parser, &mut qualifiers.layout_qualifiers)?; if self.bump_if(parser, TokenValue::Comma).is_some() { continue; @@ -188,7 +258,8 @@ impl<'source> ParsingContext<'source> { break; } - self.expect(parser, TokenValue::RightParen)?; + let token = self.expect(parser, TokenValue::RightParen)?; + qualifiers.span.subsume(token.meta); Ok(()) } @@ -196,7 +267,7 @@ impl<'source> ParsingContext<'source> { pub fn parse_layout_qualifier_id( &mut self, parser: &mut Parser, - qualifiers: &mut Vec<(TypeQualifier, Span)>, + qualifiers: &mut crate::FastHashMap, ) -> Result<()> { // layout_qualifier_id: // IDENTIFIER @@ -205,60 +276,42 @@ impl<'source> ParsingContext<'source> { let mut token = self.bump(parser)?; match token.value { TokenValue::Identifier(name) => { - if self.bump_if(parser, TokenValue::Assign).is_some() { - let (value, end_meta) = self.parse_uint_constant(parser)?; - token.meta.subsume(end_meta); - - qualifiers.push(( - match name.as_str() { - "location" => TypeQualifier::Location(value), - "set" => TypeQualifier::Set(value), - "binding" => TypeQualifier::Binding(value), - "local_size_x" => TypeQualifier::WorkGroupSize(0, value), - "local_size_y" => TypeQualifier::WorkGroupSize(1, value), - "local_size_z" => TypeQualifier::WorkGroupSize(2, value), - _ => { - parser.errors.push(Error { - kind: ErrorKind::UnknownLayoutQualifier(name), - meta: token.meta, - }); - return Ok(()); - } - }, - token.meta, - )) - } else { - qualifiers.push(( - match name.as_str() { - "push_constant" => { - qualifiers.push(( - TypeQualifier::Layout(StructLayout::Std430), - token.meta, - )); - qualifiers.push(( - TypeQualifier::StorageQualifier( - StorageQualifier::StorageClass(StorageClass::PushConstant), - ), - token.meta, - )); - return Ok(()); - } - "std140" => TypeQualifier::Layout(StructLayout::Std140), - "std430" => TypeQualifier::Layout(StructLayout::Std430), - "early_fragment_tests" => TypeQualifier::EarlyFragmentTests, - _ => { - parser.errors.push(Error { - kind: ErrorKind::UnknownLayoutQualifier(name), - meta: token.meta, - }); - return Ok(()); - } - }, - token.meta, - )); + let (key, value) = match name.as_str() { + "std140" => ( + QualifierKey::Layout, + QualifierValue::Layout(StructLayout::Std140), + ), + "std430" => ( + QualifierKey::Layout, + QualifierValue::Layout(StructLayout::Std430), + ), + word => { + if let Some(format) = map_image_format(word) { + (QualifierKey::Format, QualifierValue::Format(format)) + } else { + let key = QualifierKey::String(name.into()); + let value = if self.bump_if(parser, TokenValue::Assign).is_some() { + let (value, end_meta) = match self.parse_uint_constant(parser) { + Ok(v) => v, + Err(e) => { + parser.errors.push(e); + (0, Span::default()) + } + }; + token.meta.subsume(end_meta); + + QualifierValue::Uint(value) + } else { + QualifierValue::None + }; + + (key, value) + } + } }; + + qualifiers.insert(key, (value, token.meta)); } - // TODO: handle Shared? _ => parser.errors.push(Error { kind: ErrorKind::InvalidToken(token.value, vec![ExpectedToken::Identifier]), meta: token.meta, @@ -277,3 +330,56 @@ impl<'source> ParsingContext<'source> { }) } } + +fn map_image_format(word: &str) -> Option { + use crate::StorageFormat as Sf; + + let format = match word { + // float-image-format-qualifier: + "rgba32f" => Sf::Rgba32Float, + "rgba16f" => Sf::Rgba16Float, + "rg32f" => Sf::Rg32Float, + "rg16f" => Sf::Rg16Float, + "r11f_g11f_b10f" => Sf::Rg11b10Float, + "r32f" => Sf::R32Float, + "r16f" => Sf::R16Float, + "rgba16" => Sf::Rgba16Float, + "rgb10_a2" => Sf::Rgb10a2Unorm, + "rgba8" => Sf::Rgba8Unorm, + "rg16" => Sf::Rg16Float, + "rg8" => Sf::Rg8Unorm, + "r16" => Sf::R16Float, + "r8" => Sf::R8Unorm, + "rgba8_snorm" => Sf::Rgba8Snorm, + "rg8_snorm" => Sf::Rg8Snorm, + "r8_snorm" => Sf::R8Snorm, + // int-image-format-qualifier: + "rgba32i" => Sf::Rgba32Sint, + "rgba16i" => Sf::Rgba16Sint, + "rgba8i" => Sf::Rgba8Sint, + "rg32i" => Sf::Rg32Sint, + "rg16i" => Sf::Rg16Sint, + "rg8i" => Sf::Rg8Sint, + "r32i" => Sf::R32Sint, + "r16i" => Sf::R16Sint, + "r8i" => Sf::R8Sint, + // uint-image-format-qualifier: + "rgba32ui" => Sf::Rgba32Uint, + "rgba16ui" => Sf::Rgba16Uint, + "rgba8ui" => Sf::Rgba8Uint, + "rg32ui" => Sf::Rg32Uint, + "rg16ui" => Sf::Rg16Uint, + "rg8ui" => Sf::Rg8Uint, + "r32ui" => Sf::R32Uint, + "r16ui" => Sf::R16Uint, + "r8ui" => Sf::R8Uint, + // TODO: These next ones seem incorrect to me + // "rgba16_snorm" => Sf::Rgba16Float, + // "rg16_snorm" => Sf::Rg16Float, + // "r16_snorm" => Sf::R16Float, + // "rgb10_a2ui" => Sf::Rgb10a2Unorm, + _ => return None, + }; + + Some(format) +} diff --git a/third_party/rust/naga/src/front/glsl/token.rs b/third_party/rust/naga/src/front/glsl/token.rs index 148f105a14f73..e522f3f16be71 100644 --- a/third_party/rust/naga/src/front/glsl/token.rs +++ b/third_party/rust/naga/src/front/glsl/token.rs @@ -16,7 +16,7 @@ pub struct Token { pub meta: Span, } -/// A token passed from the lexing used in the parsing +/// A token passed from the lexing used in the parsing. /// /// This type is exported since it's returned in the /// [`InvalidToken`](super::ErrorKind::InvalidToken) error. diff --git a/third_party/rust/naga/src/front/glsl/types.rs b/third_party/rust/naga/src/front/glsl/types.rs index e008ec3822718..3900fe12d8b42 100644 --- a/third_party/rust/naga/src/front/glsl/types.rs +++ b/third_party/rust/naga/src/front/glsl/types.rs @@ -150,9 +150,56 @@ pub fn parse_type(type_name: &str) -> Option { }) }; + let image_parse = |word: &str| { + let mut iter = word.split("image"); + + let texture_kind = |ty| { + Some(match ty { + "" => ScalarKind::Float, + "i" => ScalarKind::Sint, + "u" => ScalarKind::Uint, + _ => return None, + }) + }; + + let kind = iter.next()?; + let size = iter.next()?; + // TODO: Check that the texture format and the kind match + let _ = texture_kind(kind)?; + + let class = ImageClass::Storage { + format: crate::StorageFormat::R8Uint, + access: crate::StorageAccess::all(), + }; + + // TODO: glsl support multisampled storage images, naga doesn't + let (dim, arrayed) = match size { + "1D" => (ImageDimension::D1, false), + "1DArray" => (ImageDimension::D1, true), + "2D" => (ImageDimension::D2, false), + "2DArray" => (ImageDimension::D2, true), + "3D" => (ImageDimension::D3, false), + // Naga doesn't support cube images and it's usefulness + // is questionable, so they won't be supported for now + // "Cube" => (ImageDimension::Cube, false), + // "CubeArray" => (ImageDimension::Cube, true), + _ => return None, + }; + + Some(Type { + name: None, + inner: TypeInner::Image { + dim, + arrayed, + class, + }, + }) + }; + vec_parse(word) .or_else(|| mat_parse(word)) .or_else(|| texture_parse(word)) + .or_else(|| image_parse(word)) } } } @@ -259,21 +306,22 @@ impl Parser { mut meta: Span, array_specifier: Option<(ArraySize, Span)>, ) -> Handle { - array_specifier - .map(|(size, size_meta)| { + match array_specifier { + Some((size, size_meta)) => { meta.subsume(size_meta); + self.layouter + .update(&self.module.types, &self.module.constants) + .unwrap(); + let stride = self.layouter[base].to_stride(); self.module.types.insert( Type { name: None, - inner: TypeInner::Array { - base, - size, - stride: self.module.types[base].inner.span(&self.module.constants), - }, + inner: TypeInner::Array { base, size, stride }, }, meta, ) - }) - .unwrap_or(base) + } + None => base, + } } } diff --git a/third_party/rust/naga/src/front/glsl/variables.rs b/third_party/rust/naga/src/front/glsl/variables.rs index d4043c033fef3..182097b74b6cb 100644 --- a/third_party/rust/naga/src/front/glsl/variables.rs +++ b/third_party/rust/naga/src/front/glsl/variables.rs @@ -5,41 +5,28 @@ use super::{ Parser, Result, Span, }; use crate::{ - Binding, Block, BuiltIn, Constant, Expression, GlobalVariable, Handle, Interpolation, - LocalVariable, ResourceBinding, ScalarKind, ShaderStage, StorageAccess, StorageClass, - SwizzleComponent, Type, TypeInner, VectorSize, + AddressSpace, Binding, Block, BuiltIn, Constant, Expression, GlobalVariable, Handle, + Interpolation, LocalVariable, ResourceBinding, ScalarKind, ShaderStage, SwizzleComponent, Type, + TypeInner, VectorSize, }; -macro_rules! qualifier_arm { - ($src:expr, $tgt:expr, $meta:expr, $msg:literal, $errors:expr $(,)?) => {{ - if $tgt.is_some() { - $errors.push(Error { - kind: ErrorKind::SemanticError($msg.into()), - meta: $meta, - }) - } - - $tgt = Some($src); - }}; -} - -pub struct VarDeclaration<'a> { - pub qualifiers: &'a [(TypeQualifier, Span)], +pub struct VarDeclaration<'a, 'key> { + pub qualifiers: &'a mut TypeQualifiers<'key>, pub ty: Handle, pub name: Option, pub init: Option>, pub meta: Span, } -/// Information about a builtin used in [`add_builtin`](Parser::add_builtin) +/// Information about a builtin used in [`add_builtin`](Parser::add_builtin). struct BuiltInData { - /// The type of the builtin + /// The type of the builtin. inner: TypeInner, - /// The builtin class associated with + /// The associated builtin class. builtin: BuiltIn, - /// Wether it should be allowed to write to the builtin or not + /// Whether the builtin can be written to or not. mutable: bool, - /// The storage used for the builtin + /// The storage used for the builtin. storage: StorageQualifier, } @@ -69,7 +56,7 @@ impl Parser { let handle = self.module.global_variables.append( GlobalVariable { name: Some(name.into()), - class: StorageClass::Private, + space: AddressSpace::Private, binding: None, ty, init: None, @@ -406,319 +393,235 @@ impl Parser { body: &mut Block, VarDeclaration { qualifiers, - ty, + mut ty, name, init, meta, }: VarDeclaration, ) -> Result { - let mut storage = StorageQualifier::StorageClass(StorageClass::Private); - let mut interpolation = None; - let mut set = None; - let mut binding = None; - let mut location = None; - let mut sampling = None; - let mut layout = None; - let mut precision = None; - let mut access = StorageAccess::all(); - - for &(ref qualifier, meta) in qualifiers { - match *qualifier { - TypeQualifier::StorageQualifier(s) => { - if StorageQualifier::StorageClass(StorageClass::PushConstant) == storage - && s == StorageQualifier::StorageClass(StorageClass::Uniform) - { - // Ignore the Uniform qualifier if the class was already set to PushConstant - continue; - } else if StorageQualifier::StorageClass(StorageClass::Private) != storage { - self.errors.push(Error { - kind: ErrorKind::SemanticError( - "Cannot use more than one storage qualifier per declaration".into(), - ), - meta, - }); - } - - storage = s; - } - TypeQualifier::Interpolation(i) => qualifier_arm!( - i, - interpolation, - meta, - "Cannot use more than one interpolation qualifier per declaration", - self.errors - ), - TypeQualifier::Binding(r) => qualifier_arm!( - r, - binding, - meta, - "Cannot use more than one binding per declaration", - self.errors - ), - TypeQualifier::Set(s) => qualifier_arm!( - s, - set, - meta, - "Cannot use more than one binding per declaration", - self.errors - ), - TypeQualifier::Location(l) => qualifier_arm!( - l, - location, - meta, - "Cannot use more than one binding per declaration", - self.errors - ), - TypeQualifier::Sampling(s) => qualifier_arm!( - s, - sampling, - meta, - "Cannot use more than one sampling qualifier per declaration", - self.errors - ), - TypeQualifier::Layout(ref l) => qualifier_arm!( - l, - layout, - meta, - "Cannot use more than one layout qualifier per declaration", - self.errors - ), - TypeQualifier::Precision(ref p) => qualifier_arm!( - p, - precision, - meta, - "Cannot use more than one precision qualifier per declaration", - self.errors - ), - TypeQualifier::StorageAccess(a) => access &= a, - _ => { - self.errors.push(Error { - kind: ErrorKind::SemanticError("Qualifier not supported in globals".into()), - meta, - }); - } - } - } - - match storage { - StorageQualifier::StorageClass(StorageClass::PushConstant) => { - if set.is_some() { - self.errors.push(Error { - kind: ErrorKind::SemanticError( - "set cannot be used to decorate push constant".into(), - ), - meta, + let storage = qualifiers.storage.0; + let (ret, lookup) = match storage { + StorageQualifier::Input | StorageQualifier::Output => { + let input = storage == StorageQualifier::Input; + // TODO: glslang seems to use a counter for variables without + // explicit location (even if that causes collisions) + let location = qualifiers + .uint_layout_qualifier("location", &mut self.errors) + .unwrap_or(0); + let interpolation = qualifiers.interpolation.take().map(|(i, _)| i).or_else(|| { + let kind = self.module.types[ty].inner.scalar_kind()?; + Some(match kind { + ScalarKind::Float => Interpolation::Perspective, + _ => Interpolation::Flat, }) - } - } - StorageQualifier::StorageClass(StorageClass::Uniform) - | StorageQualifier::StorageClass(StorageClass::Storage { .. }) => { - if binding.is_none() { - self.errors.push(Error { - kind: ErrorKind::SemanticError( - "uniform/buffer blocks require layout(binding=X)".into(), - ), - meta, - }) - } - } - _ => { - if set.is_some() || binding.is_some() { - self.errors.push(Error { - kind: ErrorKind::SemanticError( - "set/binding can only be applied to uniform/buffer blocks".into(), - ), - meta, - }) - } - } - } - - if (sampling.is_some() || interpolation.is_some()) && location.is_none() { - return Err(Error { - kind: ErrorKind::SemanticError( - "Sampling and interpolation qualifiers can only be used in in/out variables" - .into(), - ), - meta, - }); - } - - if let Some(location) = location { - let input = storage == StorageQualifier::Input; - let interpolation = interpolation.or_else(|| { - let kind = self.module.types[ty].inner.scalar_kind()?; - Some(match kind { - ScalarKind::Float => Interpolation::Perspective, - _ => Interpolation::Flat, - }) - }); + }); + let sampling = qualifiers.sampling.take().map(|(s, _)| s); + + let handle = self.module.global_variables.append( + GlobalVariable { + name: name.clone(), + space: AddressSpace::Private, + binding: None, + ty, + init, + }, + meta, + ); - let handle = self.module.global_variables.append( - GlobalVariable { + let idx = self.entry_args.len(); + self.entry_args.push(EntryArg { name: name.clone(), - class: StorageClass::Private, - binding: None, - ty, - init, - }, - meta, - ); - - let idx = self.entry_args.len(); - self.entry_args.push(EntryArg { - name: name.clone(), - binding: Binding::Location { - location, - interpolation, - sampling, - }, - handle, - storage, - }); + binding: Binding::Location { + location, + interpolation, + sampling, + }, + handle, + storage, + }); - if let Some(name) = name { let lookup = GlobalLookup { kind: GlobalLookupKind::Variable(handle), entry_arg: Some(idx), mutable: !input, }; - ctx.add_global(self, &name, lookup, body); - self.global_variables.push((name, lookup)); + (GlobalOrConstant::Global(handle), lookup) } + StorageQualifier::Const => { + let init = init.ok_or_else(|| Error { + kind: ErrorKind::SemanticError("const values must have an initializer".into()), + meta, + })?; - return Ok(GlobalOrConstant::Global(handle)); - } else if let StorageQualifier::Const = storage { - let init = init.ok_or_else(|| Error { - kind: ErrorKind::SemanticError("const values must have an initializer".into()), - meta, - })?; - if let Some(name) = name { let lookup = GlobalLookup { kind: GlobalLookupKind::Constant(init, ty), entry_arg: None, mutable: false, }; - ctx.add_global(self, &name, lookup, body); - self.global_variables.push((name, lookup)); + (GlobalOrConstant::Constant(init), lookup) } - return Ok(GlobalOrConstant::Constant(init)); - } + StorageQualifier::AddressSpace(mut space) => { + match space { + AddressSpace::Storage { ref mut access } => { + if let Some((restricted_access, _)) = qualifiers.storage_acess.take() { + access.remove(restricted_access); + } + } + AddressSpace::Uniform => match self.module.types[ty].inner { + TypeInner::Image { + class, + dim, + arrayed, + } => { + if let crate::ImageClass::Storage { + mut access, + mut format, + } = class + { + if let Some((restricted_access, _)) = + qualifiers.storage_acess.take() + { + access.remove(restricted_access); + } - let class = match self.module.types[ty].inner { - TypeInner::Image { .. } => StorageClass::Handle, - TypeInner::Sampler { .. } => StorageClass::Handle, - _ => { - if let StorageQualifier::StorageClass(StorageClass::Storage { .. }) = storage { - StorageClass::Storage { access } - } else { - match storage { - StorageQualifier::StorageClass(class) => class, - _ => StorageClass::Private, + match qualifiers.layout_qualifiers.remove(&QualifierKey::Format) { + Some((QualifierValue::Format(f), _)) => format = f, + // TODO: glsl supports images without format qualifier + // if they are `writeonly` + None => self.errors.push(Error { + kind: ErrorKind::SemanticError( + "image types require a format layout qualifier".into(), + ), + meta, + }), + _ => unreachable!(), + } + + ty = self.module.types.insert( + Type { + name: None, + inner: TypeInner::Image { + dim, + arrayed, + class: crate::ImageClass::Storage { format, access }, + }, + }, + meta, + ); + } + + space = AddressSpace::Handle + } + TypeInner::Sampler { .. } => space = AddressSpace::Handle, + _ => { + if qualifiers.none_layout_qualifier("push_constant", &mut self.errors) { + space = AddressSpace::PushConstant + } + } + }, + AddressSpace::Function => space = AddressSpace::Private, + _ => {} + }; + + let binding = match space { + AddressSpace::Uniform | AddressSpace::Storage { .. } | AddressSpace::Handle => { + let binding = qualifiers.uint_layout_qualifier("binding", &mut self.errors); + if binding.is_none() { + self.errors.push(Error { + kind: ErrorKind::SemanticError( + "uniform/buffer blocks require layout(binding=X)".into(), + ), + meta, + }); + } + let set = qualifiers.uint_layout_qualifier("set", &mut self.errors); + binding.map(|binding| ResourceBinding { + group: set.unwrap_or(0), + binding, + }) } - } + _ => None, + }; + + let handle = self.module.global_variables.append( + GlobalVariable { + name: name.clone(), + space, + binding, + ty, + init, + }, + meta, + ); + + let lookup = GlobalLookup { + kind: GlobalLookupKind::Variable(handle), + entry_arg: None, + mutable: true, + }; + + (GlobalOrConstant::Global(handle), lookup) } }; - let handle = self.module.global_variables.append( - GlobalVariable { - name: name.clone(), - class, - binding: binding.map(|binding| ResourceBinding { - group: set.unwrap_or(0), - binding, - }), - ty, - init, - }, - meta, - ); - if let Some(name) = name { - let lookup = GlobalLookup { - kind: GlobalLookupKind::Variable(handle), - entry_arg: None, - mutable: true, - }; ctx.add_global(self, &name, lookup, body); self.global_variables.push((name, lookup)); } - Ok(GlobalOrConstant::Global(handle)) + qualifiers.unused_errors(&mut self.errors); + + Ok(ret) } pub(crate) fn add_local_var( &mut self, ctx: &mut Context, body: &mut Block, - #[cfg_attr(not(feature = "glsl-validate"), allow(unused_variables))] - VarDeclaration { - qualifiers, - ty, - name, - init, - meta, - }: VarDeclaration, + decl: VarDeclaration, ) -> Result> { #[cfg(feature = "glsl-validate")] - if let Some(ref name) = name { + if let Some(ref name) = decl.name { if ctx.lookup_local_var_current_scope(name).is_some() { self.errors.push(Error { kind: ErrorKind::VariableAlreadyDeclared(name.clone()), - meta, + meta: decl.meta, }) } } - let mut mutable = true; - let mut precision = None; - - for &(ref qualifier, meta) in qualifiers { - match *qualifier { - TypeQualifier::StorageQualifier(StorageQualifier::Const) => { - if !mutable { - self.errors.push(Error { - kind: ErrorKind::SemanticError( - "Cannot use more than one constant qualifier per declaration" - .into(), - ), - meta, - }) - } - - mutable = false; - } - TypeQualifier::Precision(ref p) => qualifier_arm!( - p, - precision, - meta, - "Cannot use more than one precision qualifier per declaration", - self.errors - ), - _ => self.errors.push(Error { - kind: ErrorKind::SemanticError("Qualifier not supported in locals".into()), - meta, - }), + let storage = decl.qualifiers.storage; + let mutable = match storage.0 { + StorageQualifier::AddressSpace(AddressSpace::Function) => true, + StorageQualifier::Const => false, + _ => { + self.errors.push(Error { + kind: ErrorKind::SemanticError("Locals cannot have a storage qualifier".into()), + meta: storage.1, + }); + true } - } + }; let handle = ctx.locals.append( LocalVariable { - name: name.clone(), - ty, - init, + name: decl.name.clone(), + ty: decl.ty, + init: decl.init, }, - meta, + decl.meta, ); - let expr = ctx.add_expression(Expression::LocalVariable(handle), meta, body); + let expr = ctx.add_expression(Expression::LocalVariable(handle), decl.meta, body); - if let Some(name) = name { + if let Some(name) = decl.name { ctx.add_local_var(name, expr, mutable); } + decl.qualifiers.unused_errors(&mut self.errors); + Ok(expr) } } diff --git a/third_party/rust/naga/src/front/interpolator.rs b/third_party/rust/naga/src/front/interpolator.rs index 491ca5a0bbb02..0482d75a0eece 100644 --- a/third_party/rust/naga/src/front/interpolator.rs +++ b/third_party/rust/naga/src/front/interpolator.rs @@ -1,4 +1,6 @@ -//! Interpolation defaults. +/*! +Interpolation defaults. +*/ impl crate::Binding { /// Apply the usual default interpolation for `ty` to `binding`. diff --git a/third_party/rust/naga/src/front/mod.rs b/third_party/rust/naga/src/front/mod.rs index 3264f0c352fe2..d340dcad4d623 100644 --- a/third_party/rust/naga/src/front/mod.rs +++ b/third_party/rust/naga/src/front/mod.rs @@ -1,4 +1,6 @@ -//! Parsers which load shaders into memory. +/*! +Frontend parsers that consume binary and text shaders and load them into [`Module`](super::Module)s. +*/ mod interpolator; @@ -94,7 +96,8 @@ impl Typifier { ) -> Result<(), ResolveError> { if self.resolutions.len() <= expr_handle.index() { for (eh, expr) in expressions.iter().skip(self.resolutions.len()) { - let resolution = ctx.resolve(expr, |h| &self.resolutions[h.index()])?; + //Note: the closure can't `Err` by construction + let resolution = ctx.resolve(expr, |h| Ok(&self.resolutions[h.index()]))?; log::debug!("Resolving {:?} = {:?} : {:?}", eh, expr, resolution); self.resolutions.push(resolution); } @@ -116,7 +119,8 @@ impl Typifier { self.grow(expr_handle, expressions, ctx) } else { let expr = &expressions[expr_handle]; - let resolution = ctx.resolve(expr, |h| &self.resolutions[h.index()])?; + //Note: the closure can't `Err` by construction + let resolution = ctx.resolve(expr, |h| Ok(&self.resolutions[h.index()]))?; self.resolutions[expr_handle.index()] = resolution; Ok(()) } diff --git a/third_party/rust/naga/src/front/spv/convert.rs b/third_party/rust/naga/src/front/spv/convert.rs index bdc8a6d248528..22283fff06f39 100644 --- a/third_party/rust/naga/src/front/spv/convert.rs +++ b/third_party/rust/naga/src/front/spv/convert.rs @@ -155,19 +155,19 @@ pub(super) fn map_storage_class(word: spirv::Word) -> Result Ec::Global(crate::StorageClass::Function), + Some(Sc::Function) => Ec::Global(crate::AddressSpace::Function), Some(Sc::Input) => Ec::Input, Some(Sc::Output) => Ec::Output, - Some(Sc::Private) => Ec::Global(crate::StorageClass::Private), - Some(Sc::UniformConstant) => Ec::Global(crate::StorageClass::Handle), - Some(Sc::StorageBuffer) => Ec::Global(crate::StorageClass::Storage { + Some(Sc::Private) => Ec::Global(crate::AddressSpace::Private), + Some(Sc::UniformConstant) => Ec::Global(crate::AddressSpace::Handle), + Some(Sc::StorageBuffer) => Ec::Global(crate::AddressSpace::Storage { //Note: this is restricted by decorations later access: crate::StorageAccess::all(), }), // we expect the `Storage` case to be filtered out before calling this function. - Some(Sc::Uniform) => Ec::Global(crate::StorageClass::Uniform), - Some(Sc::Workgroup) => Ec::Global(crate::StorageClass::WorkGroup), - Some(Sc::PushConstant) => Ec::Global(crate::StorageClass::PushConstant), + Some(Sc::Uniform) => Ec::Global(crate::AddressSpace::Uniform), + Some(Sc::Workgroup) => Ec::Global(crate::AddressSpace::WorkGroup), + Some(Sc::PushConstant) => Ec::Global(crate::AddressSpace::PushConstant), _ => return Err(Error::UnsupportedStorageClass(word)), }) } diff --git a/third_party/rust/naga/src/front/spv/function.rs b/third_party/rust/naga/src/front/spv/function.rs index 23c47688e799c..efc78530475ba 100644 --- a/third_party/rust/naga/src/front/spv/function.rs +++ b/third_party/rust/naga/src/front/spv/function.rs @@ -464,9 +464,9 @@ impl> super::Parser { *component = function.expressions.append(load_expr, span); } - match &members[..] { + match members[..] { [] => {} - [member] => { + [ref member] => { function.body.extend(emitter.finish(&function.expressions)); let span = function.expressions.get_span(components[0]); function.body.push( diff --git a/third_party/rust/naga/src/front/spv/image.rs b/third_party/rust/naga/src/front/spv/image.rs index e797a516a193c..c45288ab15524 100644 --- a/third_party/rust/naga/src/front/spv/image.rs +++ b/third_party/rust/naga/src/front/spv/image.rs @@ -332,7 +332,8 @@ impl> super::Parser { 0 }; - let mut index = None; + let mut sample = None; + let mut level = None; while image_ops != 0 { let bit = 1 << image_ops.trailing_zeros(); match spirv::ImageOperands::from_bits_truncate(bit) { @@ -341,13 +342,13 @@ impl> super::Parser { let lod_lexp = self.lookup_expression.lookup(lod_expr)?; let lod_handle = self.get_expr_handle(lod_expr, lod_lexp, ctx, emitter, block, body_idx); - index = Some(lod_handle); + level = Some(lod_handle); words_left -= 1; } spirv::ImageOperands::SAMPLE => { let sample_expr = self.next()?; let sample_handle = self.lookup_expression.lookup(sample_expr)?.handle; - index = Some(sample_handle); + sample = Some(sample_handle); words_left -= 1; } other => { @@ -393,7 +394,8 @@ impl> super::Parser { image: image_lexp.handle, coordinate, array_index, - index, + sample, + level, }; self.lookup_expression.insert( result_id, diff --git a/third_party/rust/naga/src/front/spv/mod.rs b/third_party/rust/naga/src/front/spv/mod.rs index e1de8bdaf6e75..95e8a7487c596 100644 --- a/third_party/rust/naga/src/front/spv/mod.rs +++ b/third_party/rust/naga/src/front/spv/mod.rs @@ -1,4 +1,5 @@ -/*! SPIR-V frontend +/*! +Frontend for [SPIR-V][spv] (Standard Portable Intermediate Representation). ## ID lookups @@ -23,7 +24,9 @@ Instead, we detect when such matrix is accessed in the `OpAccessChain`, and we generate a parallel expression that loads the value, but transposed. This value then gets used instead of `OpLoad` result later on. -!*/ +[spv]: https://www.khronos.org/registry/SPIR-V/ +*/ + mod convert; mod error; mod function; @@ -330,7 +333,7 @@ enum LookupLoadOverride { #[derive(PartialEq)] enum ExtendedClass { - Global(crate::StorageClass), + Global(crate::AddressSpace), Input, Output, } @@ -4004,19 +4007,19 @@ impl> Parser { let decor = self.future_decor.remove(&id); let base_lookup_ty = self.lookup_type.lookup(type_id)?; let base_inner = &module.types[base_lookup_ty.handle].inner; - let class = if let Some(class) = base_inner.pointer_class() { - class + let space = if let Some(space) = base_inner.pointer_space() { + space } else if self .lookup_storage_buffer_types .contains_key(&base_lookup_ty.handle) { - crate::StorageClass::Storage { + crate::AddressSpace::Storage { access: crate::StorageAccess::default(), } } else { match map_storage_class(storage_class)? { - ExtendedClass::Global(class) => class, - ExtendedClass::Input | ExtendedClass::Output => crate::StorageClass::Private, + ExtendedClass::Global(space) => space, + ExtendedClass::Input | ExtendedClass::Output => crate::AddressSpace::Private, } }; @@ -4028,8 +4031,8 @@ impl> Parser { .. } = *base_inner { - match class { - crate::StorageClass::Storage { .. } => {} + match space { + crate::AddressSpace::Storage { .. } => {} _ => { return Err(Error::UnsupportedRuntimeArrayStorageClass); } @@ -4037,7 +4040,7 @@ impl> Parser { } // Don't bother with pointer stuff for `Handle` types. - let lookup_ty = if class == crate::StorageClass::Handle { + let lookup_ty = if space == crate::AddressSpace::Handle { base_lookup_ty.clone() } else { LookupType { @@ -4046,7 +4049,7 @@ impl> Parser { name: decor.and_then(|dec| dec.name), inner: crate::TypeInner::Pointer { base: base_lookup_ty.handle, - class, + space, }, }, self.span_from_with_op(start), @@ -4073,12 +4076,15 @@ impl> Parser { let decor = self.future_decor.remove(&id).unwrap_or_default(); let base = self.lookup_type.lookup(type_id)?.handle; + self.layouter + .update(&module.types, &module.constants) + .unwrap(); let inner = crate::TypeInner::Array { base, size: crate::ArraySize::Constant(length_const.handle), stride: match decor.array_stride { Some(stride) => stride.get(), - None => module.types[base].inner.span(&module.constants), + None => self.layouter[base].to_stride(), }, }; self.lookup_type.insert( @@ -4110,12 +4116,15 @@ impl> Parser { let decor = self.future_decor.remove(&id).unwrap_or_default(); let base = self.lookup_type.lookup(type_id)?.handle; + self.layouter + .update(&module.types, &module.constants) + .unwrap(); let inner = crate::TypeInner::Array { base: self.lookup_type.lookup(type_id)?.handle, size: crate::ArraySize::Dynamic, stride: match decor.array_stride { Some(stride) => stride.get(), - None => module.types[base].inner.span(&module.constants), + None => self.layouter[base].to_stride(), }, }; self.lookup_type.insert( @@ -4576,7 +4585,7 @@ impl> Parser { let original_ty = self.lookup_type.lookup(type_id)?.handle; let mut effective_ty = original_ty; - if let crate::TypeInner::Pointer { base, class: _ } = module.types[original_ty].inner { + if let crate::TypeInner::Pointer { base, space: _ } = module.types[original_ty].inner { effective_ty = base; }; if let crate::TypeInner::Image { @@ -4601,7 +4610,7 @@ impl> Parser { } let ext_class = match self.lookup_storage_buffer_types.get(&effective_ty) { - Some(&access) => ExtendedClass::Global(crate::StorageClass::Storage { access }), + Some(&access) => ExtendedClass::Global(crate::AddressSpace::Storage { access }), None => map_storage_class(storage_class)?, }; @@ -4617,14 +4626,14 @@ impl> Parser { } let (inner, var) = match ext_class { - ExtendedClass::Global(mut class) => { - if let crate::StorageClass::Storage { ref mut access } = class { + ExtendedClass::Global(mut space) => { + if let crate::AddressSpace::Storage { ref mut access } = space { *access &= dec.flags.to_storage_access(); } let var = crate::GlobalVariable { binding: dec.resource_binding(), name: dec.name, - class, + space, ty: effective_ty, init, }; @@ -4667,7 +4676,7 @@ impl> Parser { let var = crate::GlobalVariable { name: dec.name.clone(), - class: crate::StorageClass::Private, + space: crate::AddressSpace::Private, binding: None, ty: effective_ty, init: None, @@ -4745,7 +4754,7 @@ impl> Parser { let var = crate::GlobalVariable { name: dec.name, - class: crate::StorageClass::Private, + space: crate::AddressSpace::Private, binding: None, ty: effective_ty, init, diff --git a/third_party/rust/naga/src/front/wgsl/conv.rs b/third_party/rust/naga/src/front/wgsl/conv.rs index 840dc2b056a93..a4cf149a2e574 100644 --- a/third_party/rust/naga/src/front/wgsl/conv.rs +++ b/third_party/rust/naga/src/front/wgsl/conv.rs @@ -1,16 +1,16 @@ use super::{Error, Span}; -pub fn map_storage_class(word: &str, span: Span) -> Result> { +pub fn map_address_space(word: &str, span: Span) -> Result> { match word { - "private" => Ok(crate::StorageClass::Private), - "workgroup" => Ok(crate::StorageClass::WorkGroup), - "uniform" => Ok(crate::StorageClass::Uniform), - "storage" => Ok(crate::StorageClass::Storage { + "private" => Ok(crate::AddressSpace::Private), + "workgroup" => Ok(crate::AddressSpace::WorkGroup), + "uniform" => Ok(crate::AddressSpace::Uniform), + "storage" => Ok(crate::AddressSpace::Storage { access: crate::StorageAccess::default(), }), - "push_constant" => Ok(crate::StorageClass::PushConstant), - "function" => Ok(crate::StorageClass::Function), - _ => Err(Error::UnknownStorageClass(span)), + "push_constant" => Ok(crate::AddressSpace::PushConstant), + "function" => Ok(crate::AddressSpace::Function), + _ => Err(Error::UnknownAddressSpace(span)), } } @@ -201,8 +201,8 @@ pub fn map_standard_fun(word: &str) -> Option { "reverseBits" => Mf::ReverseBits, "extractBits" => Mf::ExtractBits, "insertBits" => Mf::InsertBits, - "findLsb" => Mf::FindLsb, - "findMsb" => Mf::FindMsb, + "firstTrailingBit" => Mf::FindLsb, + "firstLeadingBit" => Mf::FindMsb, // data packing "pack4x8snorm" => Mf::Pack4x8snorm, "pack4x8unorm" => Mf::Pack4x8unorm, diff --git a/third_party/rust/naga/src/front/wgsl/lexer.rs b/third_party/rust/naga/src/front/wgsl/lexer.rs index be419fd42b755..bdebb74d6c4e5 100644 --- a/third_party/rust/naga/src/front/wgsl/lexer.rs +++ b/third_party/rust/naga/src/front/wgsl/lexer.rs @@ -9,7 +9,7 @@ fn _consume_str<'a>(input: &'a str, what: &str) -> Option<&'a str> { } fn consume_any(input: &str, what: impl Fn(char) -> bool) -> (&str, &str) { - let pos = input.find(|c| !what(c)).unwrap_or_else(|| input.len()); + let pos = input.find(|c| !what(c)).unwrap_or(input.len()); input.split_at(pos) } @@ -96,10 +96,12 @@ fn consume_number(input: &str) -> (Token, &str) { let mut what = |c| { match state { + NumberLexerState { + uint_suffix: true, .. + } => return false, // Scanning is done once we've reached a type suffix. NumberLexerState { hex, digit_state: NLDigitState::Nothing, - uint_suffix: false, .. } => match c { '0' => { @@ -121,7 +123,6 @@ fn consume_number(input: &str) -> (Token, &str) { NumberLexerState { hex, digit_state: NLDigitState::LeadingZero, - uint_suffix: false, .. } => match c { '0' => { @@ -153,7 +154,6 @@ fn consume_number(input: &str) -> (Token, &str) { NumberLexerState { hex, digit_state: NLDigitState::DigitBeforeDot, - uint_suffix: false, .. } => match c { '0'..='9' => { @@ -181,7 +181,6 @@ fn consume_number(input: &str) -> (Token, &str) { NumberLexerState { hex, digit_state: NLDigitState::OnlyDot, - uint_suffix: false, .. } => match c { '0'..='9' => { @@ -196,13 +195,11 @@ fn consume_number(input: &str) -> (Token, &str) { NumberLexerState { hex, digit_state: NLDigitState::DigitsThenDot, - uint_suffix: false, .. } | NumberLexerState { hex, digit_state: NLDigitState::DigitAfterDot, - uint_suffix: false, .. } => match c { '0'..='9' => { @@ -222,7 +219,6 @@ fn consume_number(input: &str) -> (Token, &str) { NumberLexerState { digit_state: NLDigitState::Exponent, - uint_suffix: false, .. } => match c { '0'..='9' => { @@ -236,12 +232,10 @@ fn consume_number(input: &str) -> (Token, &str) { NumberLexerState { digit_state: NLDigitState::SignAfterExponent, - uint_suffix: false, .. } | NumberLexerState { digit_state: NLDigitState::DigitAfterExponent, - uint_suffix: false, .. } => match c { '0'..='9' => { @@ -249,10 +243,6 @@ fn consume_number(input: &str) -> (Token, &str) { } _ => return false, }, - - NumberLexerState { - uint_suffix: true, .. - } => return false, // Scanning is done once we've reached a type suffix. } // No match branch has rejected this yet, so we are still in a number literal @@ -261,7 +251,7 @@ fn consume_number(input: &str) -> (Token, &str) { let pos = working_substr .find(|c| !what(c)) - .unwrap_or_else(|| working_substr.len()); + .unwrap_or(working_substr.len()); let (value, rest) = input.split_at(pos + minus_offset + hex_offset); // NOTE: This code can use string slicing, @@ -286,7 +276,6 @@ fn consume_number(input: &str) -> (Token, &str) { } else { NumberType::Sint }, - width: None, }, rest, ) @@ -315,7 +304,8 @@ fn consume_token(mut input: &str, generic: bool) -> (Token<'_>, &str) { _ => (Token::Separator(cur), og_chars), } } - '(' | ')' | '{' | '}' => (Token::Paren(cur), chars.as_str()), + '@' => (Token::Attribute, chars.as_str()), + '(' | ')' | '{' | '}' | '[' | ']' => (Token::Paren(cur), chars.as_str()), '<' | '>' => { input = chars.as_str(); let next = chars.next(); @@ -332,14 +322,6 @@ fn consume_token(mut input: &str, generic: bool) -> (Token<'_>, &str) { (Token::Paren(cur), input) } } - '[' | ']' => { - input = chars.as_str(); - if chars.next() == Some(cur) { - (Token::DoubleParen(cur), chars.as_str()) - } else { - (Token::Paren(cur), input) - } - } '0'..='9' => consume_number(input), '_' | 'a'..='z' | 'A'..='Z' => { let (word, rest) = consume_any(input, |c| c.is_ascii_alphanumeric() || c == '_'); @@ -356,9 +338,47 @@ fn consume_token(mut input: &str, generic: bool) -> (Token<'_>, &str) { (Token::UnterminatedString, quote_content) } } - '/' if chars.as_str().starts_with('/') => { - let _ = chars.position(|c| c == '\n' || c == '\r'); - (Token::Trivia, chars.as_str()) + '/' => { + input = chars.as_str(); + match chars.next() { + Some('/') => { + let _ = chars.position(|c| c == '\n' || c == '\r'); + (Token::Trivia, chars.as_str()) + } + Some('*') => { + input = chars.as_str(); + + let mut depth = 1; + let mut prev = '\0'; + + for c in &mut chars { + match (prev, c) { + ('*', '/') => { + prev = '\0'; + depth -= 1; + if depth == 0 { + break; + } + } + ('/', '*') => { + prev = '\0'; + depth += 1; + } + _ => { + prev = c; + } + } + } + + if depth > 0 { + (Token::UnterminatedBlockComment, input) + } else { + (Token::Trivia, chars.as_str()) + } + } + Some('=') => (Token::AssignmentOperation(cur), chars.as_str()), + _ => (Token::Operation(cur), input), + } } '-' => { let sub_input = chars.as_str(); @@ -369,7 +389,7 @@ fn consume_token(mut input: &str, generic: bool) -> (Token<'_>, &str) { _ => (Token::Operation(cur), sub_input), } } - '+' | '*' | '/' | '%' | '^' => { + '+' | '*' | '%' | '^' => { input = chars.as_str(); if chars.next() == Some('=') { (Token::AssignmentOperation(cur), chars.as_str()) @@ -633,7 +653,6 @@ fn test_tokens() { Token::Number { value: "92", ty: NumberType::Sint, - width: None, }, Token::Word("No"), ], @@ -644,12 +663,10 @@ fn test_tokens() { Token::Number { value: "2", ty: NumberType::Uint, - width: None, }, Token::Number { value: "3", ty: NumberType::Sint, - width: None, }, Token::Word("o"), ], @@ -660,7 +677,6 @@ fn test_tokens() { Token::Number { value: "2.4", ty: NumberType::Float, - width: None, }, Token::Word("f44po"), ], @@ -673,23 +689,29 @@ fn test_tokens() { sub_test("No好", &[Token::Word("No"), Token::Unknown('好')]); sub_test("_No", &[Token::Word("_No")]); sub_test("\"\u{2}ПЀ\u{0}\"", &[Token::String("\u{2}ПЀ\u{0}")]); // https://github.com/gfx-rs/naga/issues/90 + sub_test( + "*/*/***/*//=/*****//", + &[ + Token::Operation('*'), + Token::AssignmentOperation('/'), + Token::Operation('/'), + ], + ); } #[test] fn test_variable_decl() { sub_test( - "[[ group(0 )]] var< uniform> texture: texture_multisampled_2d ;", + "@group(0 ) var< uniform> texture: texture_multisampled_2d ;", &[ - Token::DoubleParen('['), + Token::Attribute, Token::Word("group"), Token::Paren('('), Token::Number { value: "0", ty: NumberType::Sint, - width: None, }, Token::Paren(')'), - Token::DoubleParen(']'), Token::Word("var"), Token::Paren('<'), Token::Word("uniform"), diff --git a/third_party/rust/naga/src/front/wgsl/mod.rs b/third_party/rust/naga/src/front/wgsl/mod.rs index 5b7c343554706..3f2348b98b48d 100644 --- a/third_party/rust/naga/src/front/wgsl/mod.rs +++ b/third_party/rust/naga/src/front/wgsl/mod.rs @@ -1,6 +1,8 @@ -//! Front end for consuming [WebGPU Shading Language][wgsl]. -//! -//! [wgsl]: https://gpuweb.github.io/gpuweb/wgsl.html +/*! +Frontend for [WGSL][wgsl] (WebGPU Shading Language). + +[wgsl]: https://gpuweb.github.io/gpuweb/wgsl.html +*/ mod conv; mod lexer; @@ -57,12 +59,8 @@ pub enum Token<'a> { Separator(char), DoubleColon, Paren(char), - DoubleParen(char), - Number { - value: &'a str, - ty: NumberType, - width: Option, - }, + Attribute, + Number { value: &'a str, ty: NumberType }, String(&'a str), Word(&'a str), Operation(char), @@ -72,6 +70,7 @@ pub enum Token<'a> { Arrow, Unknown(char), UnterminatedString, + UnterminatedBlockComment, Trivia, End, } @@ -88,11 +87,9 @@ pub enum ExpectedToken<'a> { Constant, /// Expected: constant, parenthesized expression, identifier PrimaryExpression, - /// Expected: ']]', ',' - AttributeSeparator, /// Expected: '}', identifier FieldName, - /// Expected: ']]', 'access', 'stride' + /// Expected: attribute for a type TypeAttribute, /// Expected: ';', '{', word Statement, @@ -102,8 +99,6 @@ pub enum ExpectedToken<'a> { WorkgroupSizeSeparator, /// Expected: 'struct', 'let', 'var', 'type', ';', 'fn', eof GlobalItem, - /// Expected: ']]', 'size', 'align' - StructAttribute, } #[derive(Clone, Debug, Error)] @@ -151,7 +146,7 @@ pub enum Error<'a> { InvalidForInitializer(Span), InvalidGatherComponent(Span, i32), ReservedIdentifierPrefix(Span), - UnknownStorageClass(Span), + UnknownAddressSpace(Span), UnknownAttribute(Span), UnknownBuiltin(Span), UnknownAccess(Span), @@ -161,12 +156,12 @@ pub enum Error<'a> { UnknownType(Span), UnknownStorageFormat(Span), UnknownConservativeDepth(Span), - ZeroStride(Span), ZeroSizeOrAlign(Span), InconsistentBinding(Span), UnknownLocalFunction(Span), InitializationTypeMismatch(Span, String), MissingType(Span), + MissingAttribute(&'static str, Span), InvalidAtomicPointer(Span), InvalidAtomicOperandType(Span), Pointer(&'static str, Span), @@ -190,7 +185,7 @@ impl<'a> Error<'a> { Token::Separator(c) => format!("'{}'", c), Token::DoubleColon => "'::'".to_string(), Token::Paren(c) => format!("'{}'", c), - Token::DoubleParen(c) => format!("'{}{}'", c, c), + Token::Attribute => "@".to_string(), Token::Number { value, .. } => { format!("number ({})", value) } @@ -204,6 +199,7 @@ impl<'a> Error<'a> { Token::Arrow => "->".to_string(), Token::Unknown(c) => format!("unknown ('{}')", c), Token::UnterminatedString => "unterminated string".to_string(), + Token::UnterminatedBlockComment => "unterminated block comment".to_string(), Token::Trivia => "trivia".to_string(), Token::End => "end".to_string(), } @@ -232,14 +228,12 @@ impl<'a> Error<'a> { ExpectedToken::Integer => "unsigned/signed integer literal".to_string(), ExpectedToken::Constant => "constant".to_string(), ExpectedToken::PrimaryExpression => "expression".to_string(), - ExpectedToken::AttributeSeparator => "attribute separator (',') or an end of the attribute list (']]')".to_string(), ExpectedToken::FieldName => "field name or a closing curly bracket to signify the end of the struct".to_string(), - ExpectedToken::TypeAttribute => "type attribute ('stride') or an end of the attribute list (']]')".to_string(), + ExpectedToken::TypeAttribute => "type attribute".to_string(), ExpectedToken::Statement => "statement".to_string(), ExpectedToken::SwitchItem => "switch item ('case' or 'default') or a closing curly bracket to signify the end of the switch statement ('}')".to_string(), ExpectedToken::WorkgroupSizeSeparator => "workgroup size separator (',') or a closing parenthesis".to_string(), ExpectedToken::GlobalItem => "global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file".to_string(), - ExpectedToken::StructAttribute => "struct attribute ('size' or 'align') or an end of the attribute list (']]')".to_string(), }; ParseError { message: format!( @@ -356,9 +350,9 @@ impl<'a> Error<'a> { labels: vec![(bad_span.clone(), "invalid identifier".into())], notes: vec![], }, - Error::UnknownStorageClass(ref bad_span) => ParseError { - message: format!("unknown storage class: '{}'", &source[bad_span.clone()]), - labels: vec![(bad_span.clone(), "unknown storage class".into())], + Error::UnknownAddressSpace(ref bad_span) => ParseError { + message: format!("unknown address space: '{}'", &source[bad_span.clone()]), + labels: vec![(bad_span.clone(), "unknown address space".into())], notes: vec![], }, Error::UnknownAttribute(ref bad_span) => ParseError { @@ -396,11 +390,6 @@ impl<'a> Error<'a> { labels: vec![(bad_span.clone(), "unknown type".into())], notes: vec![], }, - Error::ZeroStride(ref bad_span) => ParseError { - message: "array stride must not be zero".to_string(), - labels: vec![(bad_span.clone(), "array stride must not be zero".into())], - notes: vec![], - }, Error::ZeroSizeOrAlign(ref bad_span) => ParseError { message: "struct member size or alignment must not be 0".to_string(), labels: vec![(bad_span.clone(), "struct member size or alignment must not be 0".into())], @@ -426,6 +415,11 @@ impl<'a> Error<'a> { labels: vec![(name_span.clone(), format!("definition of `{}`", &source[name_span.clone()]).into())], notes: vec![], }, + Error::MissingAttribute(name, ref name_span) => ParseError { + message: format!("variable `{}` needs a '{}' attribute", &source[name_span.clone()], name), + labels: vec![(name_span.clone(), format!("definition of `{}`", &source[name_span.clone()]).into())], + notes: vec![], + }, Error::InvalidAtomicPointer(ref span) => ParseError { message: "atomic operation is done on a pointer to a non-atomic".to_string(), labels: vec![(span.clone(), "atomic pointer is invalid".into())], @@ -671,7 +665,7 @@ mod type_inner_tests { let ptr = crate::TypeInner::Pointer { base: mytype2, - class: crate::StorageClass::Storage { + space: crate::AddressSpace::Storage { access: crate::StorageAccess::default(), }, }; @@ -1046,7 +1040,9 @@ impl Composition { #[derive(Default)] struct TypeAttributes { - stride: Option, + // Although WGSL nas no type attributes at the moment, it had them in the past +// (`[[stride]]`) and may as well acquire some again in the future. +// Therefore, we are leaving the plumbing in for now. } #[derive(Clone, Debug, PartialEq)] @@ -1137,7 +1133,7 @@ impl BindingParser { struct ParsedVariable<'a> { name: &'a str, name_span: Span, - class: Option, + space: Option, ty: Handle, init: Option>, } @@ -1183,7 +1179,7 @@ impl ParseError { pub fn emit_to_stderr_with_path(&self, source: &str, path: &str) { let files = SimpleFile::new(path, source); let config = codespan_reporting::term::Config::default(); - let writer = StandardStream::stderr(ColorChoice::Always); + let writer = StandardStream::stderr(ColorChoice::Auto); term::emit(&mut writer.lock(), &config, &files, &self.diagnostic()) .expect("cannot write error"); } @@ -1242,6 +1238,13 @@ impl Parser { } } + fn reset(&mut self) { + self.scopes.clear(); + self.module_scope_identifiers.clear(); + self.lookup_type.clear(); + self.layouter.clear(); + } + fn push_scope(&mut self, scope: Scope, lexer: &Lexer<'_>) { self.scopes.push((scope, lexer.current_byte_offset())); } @@ -1259,18 +1262,10 @@ impl Parser { fn get_constant_inner<'a>( word: &'a str, ty: NumberType, - width: Option, token_span: TokenSpan<'a>, ) -> Result> { let span = token_span.1; - if let Some(width) = width { - if width != 4 { - // Only 32-bit literals supported by the spec and naga for now! - return Err(Error::BadScalarWidth(span, width)); - } - } - let value = match ty { NumberType::Sint => { get_i32_literal(word, span).map(|val| crate::ScalarValue::Sint(val as i64))? @@ -1283,25 +1278,13 @@ impl Parser { } }; - Ok(crate::ConstantInner::Scalar { - value, - width: width.unwrap_or(4), - }) + Ok(crate::ConstantInner::Scalar { value, width: 4 }) } fn parse_switch_value<'a>(lexer: &mut Lexer<'a>, uint: bool) -> Result> { let token_span = lexer.next(); let word = match token_span.0 { - Token::Number { value, width, .. } => { - if let Some(width) = width { - if width != 4 { - // Only 32-bit literals supported by the spec and naga for now! - return Err(Error::BadScalarWidth(token_span.1, width)); - } - } - - value - } + Token::Number { value, .. } => value, _ => return Err(Error::Unexpected(token_span, ExpectedToken::Integer)), }; @@ -1849,7 +1832,6 @@ impl Parser { Token::Number { value, ty: NumberType::Sint, - width: None, }, span, ) = lexer.peek() @@ -1946,20 +1928,25 @@ impl Parser { } else { None }; - let index = match class { - crate::ImageClass::Storage { .. } => None, - // it's the MSAA index for multi-sampled, and LOD for the others - crate::ImageClass::Sampled { .. } | crate::ImageClass::Depth { .. } => { - lexer.expect(Token::Separator(','))?; - Some(self.parse_general_expression(lexer, ctx.reborrow())?) - } + let level = if class.is_mipmapped() { + lexer.expect(Token::Separator(','))?; + Some(self.parse_general_expression(lexer, ctx.reborrow())?) + } else { + None + }; + let sample = if class.is_multisampled() { + lexer.expect(Token::Separator(','))?; + Some(self.parse_general_expression(lexer, ctx.reborrow())?) + } else { + None }; lexer.close_arguments()?; crate::Expression::ImageLoad { image, coordinate, array_index, - index, + sample, + level, } } "textureDimensions" => { @@ -2211,8 +2198,8 @@ impl Parser { let inner = match first_token_span { (Token::Word("true"), _) => crate::ConstantInner::boolean(true), (Token::Word("false"), _) => crate::ConstantInner::boolean(false), - (Token::Number { value, ty, width }, _) => { - Self::get_constant_inner(value, ty, width, first_token_span)? + (Token::Number { value, ty }, _) => { + Self::get_constant_inner(value, ty, first_token_span)? } (Token::Word(name), name_span) => { // look for an existing constant first @@ -2547,7 +2534,7 @@ impl Parser { // An expression like `&*ptr` may generate no Naga IR at all, but WGSL requires // an error if `ptr` is not a pointer. So we have to type-check this ourselves. - if ctx.resolve_type(pointer)?.pointer_class().is_none() { + if ctx.resolve_type(pointer)?.pointer_space().is_none() { let span = ctx .expressions .get_span(pointer) @@ -2774,11 +2761,11 @@ impl Parser { const_arena: &mut Arena, ) -> Result, Error<'a>> { self.push_scope(Scope::VariableDecl, lexer); - let mut class = None; + let mut space = None; if lexer.skip(Token::Paren('<')) { let (class_str, span) = lexer.next_ident_with_span()?; - class = Some(match class_str { + space = Some(match class_str { "storage" => { let access = if lexer.skip(Token::Separator(',')) { lexer.next_storage_access()? @@ -2786,9 +2773,9 @@ impl Parser { // defaulting to `read` crate::StorageAccess::LOAD }; - crate::StorageClass::Storage { access } + crate::AddressSpace::Storage { access } } - _ => conv::map_storage_class(class_str, span)?, + _ => conv::map_address_space(class_str, span)?, }); lexer.expect(Token::Paren('>'))?; } @@ -2807,7 +2794,7 @@ impl Parser { Ok(ParsedVariable { name, name_span, - class, + space, ty, init, }) @@ -2824,65 +2811,40 @@ impl Parser { let mut members = Vec::new(); lexer.expect(Token::Paren('{'))?; - loop { + let mut ready = true; + while !lexer.skip(Token::Paren('}')) { + if !ready { + return Err(Error::Unexpected( + lexer.next(), + ExpectedToken::Token(Token::Separator(',')), + )); + } let (mut size, mut align) = (None, None); self.push_scope(Scope::Attribute, lexer); let mut bind_parser = BindingParser::default(); - if lexer.skip(Token::DoubleParen('[')) { - let mut ready = true; - loop { - match lexer.next() { - (Token::DoubleParen(']'), _) => { - break; - } - (Token::Separator(','), _) if !ready => { - ready = true; - } - (Token::Word(word), word_span) if ready => { - match word { - "size" => { - lexer.expect(Token::Paren('('))?; - let (value, span) = lexer.capture_span(|lexer| { - parse_non_negative_sint_literal(lexer, 4) - })?; - lexer.expect(Token::Paren(')'))?; - size = Some( - NonZeroU32::new(value) - .ok_or(Error::ZeroSizeOrAlign(span))?, - ); - } - "align" => { - lexer.expect(Token::Paren('('))?; - let (value, span) = lexer.capture_span(|lexer| { - parse_non_negative_sint_literal(lexer, 4) - })?; - lexer.expect(Token::Paren(')'))?; - align = Some( - NonZeroU32::new(value) - .ok_or(Error::ZeroSizeOrAlign(span))?, - ); - } - _ => bind_parser.parse(lexer, word, word_span)?, - } - ready = false; - } - other if ready => { - return Err(Error::Unexpected(other, ExpectedToken::StructAttribute)) - } - other => { - return Err(Error::Unexpected(other, ExpectedToken::AttributeSeparator)) - } + while lexer.skip(Token::Attribute) { + match lexer.next_ident_with_span()? { + ("size", _) => { + lexer.expect(Token::Paren('('))?; + let (value, span) = lexer + .capture_span(|lexer| parse_non_negative_sint_literal(lexer, 4))?; + lexer.expect(Token::Paren(')'))?; + size = Some(NonZeroU32::new(value).ok_or(Error::ZeroSizeOrAlign(span))?); + } + ("align", _) => { + lexer.expect(Token::Paren('('))?; + let (value, span) = lexer + .capture_span(|lexer| parse_non_negative_sint_literal(lexer, 4))?; + lexer.expect(Token::Paren(')'))?; + align = Some(NonZeroU32::new(value).ok_or(Error::ZeroSizeOrAlign(span))?); } + (word, word_span) => bind_parser.parse(lexer, word, word_span)?, } } let bind_span = self.pop_scope(lexer); let (name, span) = match lexer.next() { (Token::Word(word), span) => (word, span), - (Token::Paren('}'), _) => { - let span = Layouter::round_up(alignment, offset); - return Ok((members, span)); - } other => return Err(Error::Unexpected(other, ExpectedToken::FieldName)), }; if crate::keywords::wgsl::RESERVED.contains(&name) { @@ -2890,7 +2852,7 @@ impl Parser { } lexer.expect(Token::Separator(':'))?; let (ty, _access) = self.parse_type_decl(lexer, None, type_arena, const_arena)?; - lexer.expect(Token::Separator(';'))?; + ready = lexer.skip(Token::Separator(',')); self.layouter.update(type_arena, const_arena).unwrap(); @@ -2909,12 +2871,15 @@ impl Parser { offset: range.start, }); } + + let span = Layouter::round_up(alignment, offset); + Ok((members, span)) } fn parse_type_decl_impl<'a>( &mut self, lexer: &mut Lexer<'a>, - attribute: TypeAttributes, + _attribute: TypeAttributes, word: &'a str, type_arena: &mut UniqueArena, const_arena: &mut Arena, @@ -3026,10 +2991,10 @@ impl Parser { "ptr" => { lexer.expect_generic_paren('<')?; let (ident, span) = lexer.next_ident_with_span()?; - let mut class = conv::map_storage_class(ident, span)?; + let mut space = conv::map_address_space(ident, span)?; lexer.expect(Token::Separator(','))?; let (base, _access) = self.parse_type_decl(lexer, None, type_arena, const_arena)?; - if let crate::StorageClass::Storage { ref mut access } = class { + if let crate::AddressSpace::Storage { ref mut access } = space { *access = if lexer.skip(Token::Separator(',')) { lexer.next_storage_access()? } else { @@ -3037,7 +3002,7 @@ impl Parser { }; } lexer.expect_generic_paren('>')?; - crate::TypeInner::Pointer { base, class } + crate::TypeInner::Pointer { base, space } } "array" => { lexer.expect_generic_paren('<')?; @@ -3050,15 +3015,11 @@ impl Parser { crate::ArraySize::Dynamic }; lexer.expect_generic_paren('>')?; - let stride = match attribute.stride { - Some(stride) => stride.get(), - None => { - self.layouter.update(type_arena, const_arena).unwrap(); - let layout = &self.layouter[base]; - Layouter::round_up(layout.alignment, layout.size) - } - }; + let stride = { + self.layouter.update(type_arena, const_arena).unwrap(); + self.layouter[base].to_stride() + }; crate::TypeInner::Array { base, size, stride } } "sampler" => crate::TypeInner::Sampler { comparison: false }, @@ -3266,25 +3227,11 @@ impl Parser { const_arena: &mut Arena, ) -> Result<(Handle, crate::StorageAccess), Error<'a>> { self.push_scope(Scope::TypeDecl, lexer); - let mut attribute = TypeAttributes::default(); + let attribute = TypeAttributes::default(); - if lexer.skip(Token::DoubleParen('[')) { - self.push_scope(Scope::Attribute, lexer); - loop { - match lexer.next() { - (Token::Word("stride"), _) => { - lexer.expect(Token::Paren('('))?; - let (stride, span) = lexer - .capture_span(|lexer| parse_non_negative_sint_literal(lexer, 4))?; - attribute.stride = - Some(NonZeroU32::new(stride).ok_or(Error::ZeroStride(span))?); - lexer.expect(Token::Paren(')'))?; - } - (Token::DoubleParen(']'), _) => break, - other => return Err(Error::Unexpected(other, ExpectedToken::TypeAttribute)), - } - } - self.pop_scope(lexer); + if lexer.skip(Token::Attribute) { + let other = lexer.next(); + return Err(Error::Unexpected(other, ExpectedToken::TypeAttribute)); } let storage_access = crate::StorageAccess::default(); @@ -3648,14 +3595,12 @@ impl Parser { } "if" => { let _ = lexer.next(); - lexer.expect(Token::Paren('('))?; emitter.start(context.expressions); let condition = self.parse_general_expression( lexer, context.as_expression(block, &mut emitter), )?; block.extend(emitter.finish(context.expressions)); - lexer.expect(Token::Paren(')'))?; let accept = self.parse_block(lexer, context.reborrow(), false)?; @@ -3674,14 +3619,12 @@ impl Parser { // ... else if (...) { ... } let mut sub_emitter = super::Emitter::default(); - lexer.expect(Token::Paren('('))?; sub_emitter.start(context.expressions); let other_condition = self.parse_general_expression( lexer, context.as_expression(block, &mut sub_emitter), )?; let other_emit = sub_emitter.finish(context.expressions); - lexer.expect(Token::Paren(')'))?; let other_block = self.parse_block(lexer, context.reborrow(), false)?; elsif_stack.push(( elseif_span_start, @@ -3717,7 +3660,6 @@ impl Parser { "switch" => { let _ = lexer.next(); emitter.start(context.expressions); - lexer.expect(Token::Paren('('))?; let selector = self.parse_general_expression( lexer, context.as_expression(block, &mut emitter), @@ -3727,7 +3669,6 @@ impl Parser { .as_expression(block, &mut emitter) .resolve_type(selector)? .scalar_kind(); - lexer.expect(Token::Paren(')'))?; block.extend(emitter.finish(context.expressions)); lexer.expect(Token::Paren('{'))?; let mut cases = Vec::new(); @@ -4006,24 +3947,12 @@ impl Parser { &mut self, lexer: &mut Lexer<'a>, ) -> Result, Error<'a>> { + let mut bind_parser = BindingParser::default(); self.push_scope(Scope::Attribute, lexer); - if !lexer.skip(Token::DoubleParen('[')) { - self.pop_scope(lexer); - return Ok(None); - } - - let mut bind_parser = BindingParser::default(); - loop { + while lexer.skip(Token::Attribute) { let (word, span) = lexer.next_ident_with_span()?; bind_parser.parse(lexer, word, span)?; - match lexer.next() { - (Token::DoubleParen(']'), _) => { - break; - } - (Token::Separator(','), _) => {} - other => return Err(Error::Unexpected(other, ExpectedToken::AttributeSeparator)), - } } let span = self.pop_scope(lexer); @@ -4058,7 +3987,7 @@ impl Parser { let (span, is_reference) = match *expression { crate::Expression::GlobalVariable(handle) => ( module.global_variables.get_span(handle), - module.global_variables[handle].class != crate::StorageClass::Handle, + module.global_variables[handle].space != crate::AddressSpace::Handle, ), crate::Expression::Constant(handle) => (module.constants.get_span(handle), false), _ => unreachable!(), @@ -4172,83 +4101,77 @@ impl Parser { ) -> Result> { // read attributes let mut binding = None; - // Perspective is the default qualifier. let mut stage = None; let mut workgroup_size = [0u32; 3]; let mut early_depth_test = None; + let (mut bind_index, mut bind_group) = (None, None); - if lexer.skip(Token::DoubleParen('[')) { - let (mut bind_index, mut bind_group) = (None, None); - self.push_scope(Scope::Attribute, lexer); - loop { - match lexer.next_ident_with_span()? { - ("binding", _) => { - lexer.expect(Token::Paren('('))?; - bind_index = Some(parse_non_negative_sint_literal(lexer, 4)?); - lexer.expect(Token::Paren(')'))?; - } - ("group", _) => { - lexer.expect(Token::Paren('('))?; - bind_group = Some(parse_non_negative_sint_literal(lexer, 4)?); - lexer.expect(Token::Paren(')'))?; - } - ("stage", _) => { - lexer.expect(Token::Paren('('))?; - let (ident, ident_span) = lexer.next_ident_with_span()?; - stage = Some(conv::map_shader_stage(ident, ident_span)?); - lexer.expect(Token::Paren(')'))?; - } - ("workgroup_size", _) => { - lexer.expect(Token::Paren('('))?; - for (i, size) in workgroup_size.iter_mut().enumerate() { - *size = parse_generic_non_negative_int_literal(lexer, 4)?; - match lexer.next() { - (Token::Paren(')'), _) => break, - (Token::Separator(','), _) if i != 2 => (), - other => { - return Err(Error::Unexpected( - other, - ExpectedToken::WorkgroupSizeSeparator, - )) - } - } - } - for size in workgroup_size.iter_mut() { - if *size == 0 { - *size = 1; + self.push_scope(Scope::Attribute, lexer); + while lexer.skip(Token::Attribute) { + match lexer.next_ident_with_span()? { + ("binding", _) => { + lexer.expect(Token::Paren('('))?; + bind_index = Some(parse_non_negative_sint_literal(lexer, 4)?); + lexer.expect(Token::Paren(')'))?; + } + ("group", _) => { + lexer.expect(Token::Paren('('))?; + bind_group = Some(parse_non_negative_sint_literal(lexer, 4)?); + lexer.expect(Token::Paren(')'))?; + } + ("stage", _) => { + lexer.expect(Token::Paren('('))?; + let (ident, ident_span) = lexer.next_ident_with_span()?; + stage = Some(conv::map_shader_stage(ident, ident_span)?); + lexer.expect(Token::Paren(')'))?; + } + ("workgroup_size", _) => { + lexer.expect(Token::Paren('('))?; + for (i, size) in workgroup_size.iter_mut().enumerate() { + *size = parse_generic_non_negative_int_literal(lexer, 4)?; + match lexer.next() { + (Token::Paren(')'), _) => break, + (Token::Separator(','), _) if i != 2 => (), + other => { + return Err(Error::Unexpected( + other, + ExpectedToken::WorkgroupSizeSeparator, + )) } } } - ("early_depth_test", _) => { - let conservative = if lexer.skip(Token::Paren('(')) { - let (ident, ident_span) = lexer.next_ident_with_span()?; - let value = conv::map_conservative_depth(ident, ident_span)?; - lexer.expect(Token::Paren(')'))?; - Some(value) - } else { - None - }; - early_depth_test = Some(crate::EarlyDepthTest { conservative }); + for size in workgroup_size.iter_mut() { + if *size == 0 { + *size = 1; + } } - (_, word_span) => return Err(Error::UnknownAttribute(word_span)), } - match lexer.next() { - (Token::DoubleParen(']'), _) => { - break; - } - (Token::Separator(','), _) => {} - other => { - return Err(Error::Unexpected(other, ExpectedToken::AttributeSeparator)) - } + ("early_depth_test", _) => { + let conservative = if lexer.skip(Token::Paren('(')) { + let (ident, ident_span) = lexer.next_ident_with_span()?; + let value = conv::map_conservative_depth(ident, ident_span)?; + lexer.expect(Token::Paren(')'))?; + Some(value) + } else { + None + }; + early_depth_test = Some(crate::EarlyDepthTest { conservative }); } + (_, word_span) => return Err(Error::UnknownAttribute(word_span)), } - if let (Some(group), Some(index)) = (bind_group, bind_index) { + } + + let attrib_scope = self.pop_scope(lexer); + match (bind_group, bind_index) { + (Some(group), Some(index)) => { binding = Some(crate::ResourceBinding { group, binding: index, }); } - self.pop_scope(lexer); + (Some(_), None) => return Err(Error::MissingAttribute("binding", attrib_scope)), + (None, Some(_)) => return Err(Error::MissingAttribute("group", attrib_scope)), + (None, None) => {} } // read items @@ -4374,7 +4297,7 @@ impl Parser { let var_handle = module.global_variables.append( crate::GlobalVariable { name: Some(pvar.name.to_owned()), - class: pvar.class.unwrap_or(crate::StorageClass::Handle), + space: pvar.space.unwrap_or(crate::AddressSpace::Handle), binding: binding.take(), ty: pvar.ty, init: pvar.init, @@ -4414,9 +4337,7 @@ impl Parser { } pub fn parse(&mut self, source: &str) -> Result { - self.scopes.clear(); - self.lookup_type.clear(); - self.layouter.clear(); + self.reset(); let mut module = crate::Module::default(); let mut lexer = Lexer::new(source); diff --git a/third_party/rust/naga/src/front/wgsl/number_literals.rs b/third_party/rust/naga/src/front/wgsl/number_literals.rs index 9279989e94ce3..6691ab2d05f04 100644 --- a/third_party/rust/naga/src/front/wgsl/number_literals.rs +++ b/third_party/rust/naga/src/front/wgsl/number_literals.rs @@ -85,10 +85,9 @@ pub(super) fn _parse_uint_literal<'a>( Token::Number { value, ty: NumberType::Uint, - width: token_width, }, span, - ) if token_width.unwrap_or(4) == width => get_u32_literal(value, span), + ) => get_u32_literal(value, span), other => Err(Error::Unexpected( other, ExpectedToken::Number { @@ -117,10 +116,9 @@ pub(super) fn parse_non_negative_sint_literal<'a>( Token::Number { value, ty: NumberType::Sint, - width: token_width, }, span, - ) if token_width.unwrap_or(4) == width => { + ) => { let i32_val = get_i32_literal(value, span.clone())?; u32::try_from(i32_val).map_err(|_| Error::NegativeInt(span)) } @@ -153,10 +151,9 @@ pub(super) fn parse_generic_non_negative_int_literal<'a>( Token::Number { value, ty: NumberType::Sint, - width: token_width, }, span, - ) if token_width.unwrap_or(4) == width => { + ) => { let i32_val = get_i32_literal(value, span.clone())?; u32::try_from(i32_val).map_err(|_| Error::NegativeInt(span)) } @@ -164,10 +161,9 @@ pub(super) fn parse_generic_non_negative_int_literal<'a>( Token::Number { value, ty: NumberType::Uint, - width: token_width, }, span, - ) if token_width.unwrap_or(4) == width => get_u32_literal(value, span), + ) => get_u32_literal(value, span), other => Err(Error::Unexpected( other, ExpectedToken::Number { @@ -194,10 +190,9 @@ pub(super) fn _parse_float_literal<'a>( Token::Number { value, ty: NumberType::Float, - width: token_width, }, span, - ) if token_width.unwrap_or(4) == width => get_f32_literal(value, span), + ) => get_f32_literal(value, span), other => Err(Error::Unexpected( other, ExpectedToken::Number { diff --git a/third_party/rust/naga/src/front/wgsl/tests.rs b/third_party/rust/naga/src/front/wgsl/tests.rs index 60c02c4e6dc2c..906311248f323 100644 --- a/third_party/rust/naga/src/front/wgsl/tests.rs +++ b/third_party/rust/naga/src/front/wgsl/tests.rs @@ -157,11 +157,11 @@ fn parse_type_cast() { fn parse_struct() { parse_str( " - struct Foo { x: i32; }; + struct Foo { x: i32 }; struct Bar { - [[size(16)]] x: vec2; - [[align(16)]] y: f32; - [[size(32), align(8)]] z: vec3; + @size(16) x: vec2, + @align(16) y: f32, + @size(32) @align(8) z: vec3, }; struct Empty {}; var s: Foo; @@ -206,6 +206,26 @@ fn parse_statement() { #[test] fn parse_if() { + parse_str( + " + fn main() { + if true { + discard; + } else {} + if 0 != 1 {} + if false { + return; + } else if true { + return; + } else {} + } + ", + ) + .unwrap(); +} + +#[test] +fn parse_parentheses_if() { parse_str( " fn main() { @@ -231,11 +251,11 @@ fn parse_loop() { fn main() { var i: i32 = 0; loop { - if (i == 1) { break; } + if i == 1 { break; } continuing { i = 1; } } loop { - if (i == 0) { continue; } + if i == 0 { continue; } break; } } @@ -283,6 +303,21 @@ fn parse_switch() { .unwrap(); } +#[test] +fn parse_parentheses_switch() { + parse_str( + " + fn main() { + var pos: f32; + switch pos > 1.0 { + default: { pos = 3.0; } + } + } + ", + ) + .unwrap(); +} + #[test] fn parse_texture_load() { parse_str( @@ -380,11 +415,11 @@ fn parse_struct_instantiation() { parse_str( " struct Foo { - a: f32; - b: vec3; + a: f32, + b: vec3, }; - [[stage(fragment)]] + @stage(fragment) fn fs_main() { var foo: Foo = Foo(0.0, vec3(0.0, 1.0, 42.0)); } @@ -398,13 +433,13 @@ fn parse_array_length() { parse_str( " struct Foo { - data: [[stride(4)]] array; + data: array }; // this is used as both input and output for convenience - [[group(0), binding(0)]] + @group(0) @binding(0) var foo: Foo; - [[group(0), binding(1)]] + @group(0) @binding(1) var bar: array; fn baz() { @@ -420,28 +455,28 @@ fn parse_array_length() { fn parse_storage_buffers() { parse_str( " - [[group(0), binding(0)]] + @group(0) @binding(0) var foo: array; ", ) .unwrap(); parse_str( " - [[group(0), binding(0)]] + @group(0) @binding(0) var foo: array; ", ) .unwrap(); parse_str( " - [[group(0), binding(0)]] + @group(0) @binding(0) var foo: array; ", ) .unwrap(); parse_str( " - [[group(0), binding(0)]] + @group(0) @binding(0) var foo: array; ", ) diff --git a/third_party/rust/naga/src/keywords/mod.rs b/third_party/rust/naga/src/keywords/mod.rs index 4f959bcd0898f..d54a1704f7df9 100644 --- a/third_party/rust/naga/src/keywords/mod.rs +++ b/third_party/rust/naga/src/keywords/mod.rs @@ -1,2 +1,6 @@ +/*! +Lists of reserved keywords for each shading language with a [frontend][crate::front] or [backend][crate::back]. +*/ + #[cfg(any(feature = "wgsl-in", feature = "wgsl-out"))] pub mod wgsl; diff --git a/third_party/rust/naga/src/keywords/wgsl.rs b/third_party/rust/naga/src/keywords/wgsl.rs index 16e11ea3d7915..2ceb8830093ff 100644 --- a/third_party/rust/naga/src/keywords/wgsl.rs +++ b/third_party/rust/naga/src/keywords/wgsl.rs @@ -1,4 +1,11 @@ +/*! +Reserved keywords for [WGSL][wgsl] (WebGPU Shading Language). + +[wgsl]: https://gpuweb.github.io/gpuweb/wgsl.html +*/ + // https://gpuweb.github.io/gpuweb/wgsl/#keyword-summary +/// Reserved keywords. pub const RESERVED: &[&str] = &[ // type-defining keywords "array", diff --git a/third_party/rust/naga/src/lib.rs b/third_party/rust/naga/src/lib.rs index 6e7083082f275..9873d2330507c 100644 --- a/third_party/rust/naga/src/lib.rs +++ b/third_party/rust/naga/src/lib.rs @@ -92,7 +92,7 @@ Naga's rules for when `Expression`s are evaluated are as follows: does not. - A `GlobalVariable` expression referring to a global in the - [`StorageClass::Handle`] storage class produces the value directly, not + [`AddressSpace::Handle`] address space produces the value directly, not a pointer. Such global variables hold opaque types like shaders or images, and cannot be assigned to. @@ -182,8 +182,7 @@ tree. [`Validator::validate`]: valid::Validator::validate [`ModuleInfo`]: valid::ModuleInfo - -!*/ +*/ // TODO: use `strip_prefix` instead when Rust 1.45 <= MSRV #![allow( @@ -217,6 +216,8 @@ pub mod valid; pub use crate::arena::{Arena, Handle, Range, UniqueArena}; pub use crate::span::{Span, SpanContext, WithSpan}; +#[cfg(feature = "arbitrary")] +use arbitrary::Arbitrary; #[cfg(feature = "deserialize")] use serde::Deserialize; #[cfg(feature = "serialize")] @@ -233,39 +234,48 @@ pub type FastHashSet = rustc_hash::FxHashSet; /// Map of expressions that have associated variable names pub(crate) type NamedExpressions = FastHashMap, String>; -/// Early fragment tests. In a standard situation if a driver determines that it is possible to -/// switch on early depth test it will. Typical situations when early depth test is switched off: -/// - Calling ```discard``` in a shader. +/// Early fragment tests. +/// +/// In a standard situation, if a driver determines that it is possible to switch on early depth test, it will. +/// +/// Typical situations when early depth test is switched off: +/// - Calling `discard` in a shader. /// - Writing to the depth buffer, unless ConservativeDepth is enabled. /// -/// SPIR-V: ExecutionMode EarlyFragmentTests -/// In GLSL: layout(early_fragment_tests) in; -/// HLSL: Attribute earlydepthstencil +/// To use in a shader: +/// - GLSL: `layout(early_fragment_tests) in;` +/// - HLSL: `Attribute earlydepthstencil` +/// - SPIR-V: `ExecutionMode EarlyFragmentTests` /// /// For more, see: /// - /// - +/// - #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct EarlyDepthTest { conservative: Option, } /// Enables adjusting depth without disabling early Z. /// -/// SPIR-V: ExecutionMode DepthGreater/DepthLess/DepthUnchanged -/// GLSL: layout (depth_) out float gl_FragDepth; -/// - ```depth_any``` option behaves as if the layout qualifier was not present. -/// HLSL: SV_Depth/SV_DepthGreaterEqual/SV_DepthLessEqual +/// To use in a shader: +/// - GLSL: `layout (depth_) out float gl_FragDepth;` +/// - `depth_any` option behaves as if the layout qualifier was not present. +/// - HLSL: `SV_DepthGreaterEqual`/`SV_DepthLessEqual`/`SV_Depth` +/// - SPIR-V: `ExecutionMode Depth` /// /// For more, see: /// - /// - +/// - #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ConservativeDepth { - /// Shader may rewrite depth only with a value greater than calculated; + /// Shader may rewrite depth only with a value greater than calculated. GreaterEqual, /// Shader may rewrite depth smaller than one that would have been written without the modification. @@ -279,6 +289,7 @@ pub enum ConservativeDepth { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[allow(missing_docs)] // The names are self evident pub enum ShaderStage { Vertex, @@ -286,11 +297,12 @@ pub enum ShaderStage { Compute, } -/// Class of storage for variables. +/// Addressing space of variables. #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] -pub enum StorageClass { +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +pub enum AddressSpace { /// Function locals. Function, /// Private data, per invocation, mutable. @@ -311,6 +323,7 @@ pub enum StorageClass { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum BuiltIn { Position, ViewIndex, @@ -345,6 +358,7 @@ pub type Bytes = u8; #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum VectorSize { /// 2D vector Bi = 2, @@ -359,6 +373,7 @@ pub enum VectorSize { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ScalarKind { /// Signed integer type. Sint, @@ -375,6 +390,7 @@ pub enum ScalarKind { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ArraySize { /// The array size is constant. Constant(Handle), @@ -386,6 +402,7 @@ pub enum ArraySize { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum Interpolation { /// The value will be interpolated in a perspective-correct fashion. /// Also known as "smooth" in glsl. @@ -402,6 +419,7 @@ pub enum Interpolation { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum Sampling { /// Interpolate the value at the center of the pixel. Center, @@ -421,6 +439,7 @@ pub enum Sampling { #[derive(Clone, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct StructMember { pub name: Option, /// Type of the field. @@ -435,6 +454,7 @@ pub struct StructMember { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ImageDimension { /// 1D image D1, @@ -450,6 +470,7 @@ bitflags::bitflags! { /// Flags describing an image. #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] + #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[derive(Default)] pub struct StorageAccess: u32 { /// Storage can be used as a source for load ops. @@ -459,10 +480,11 @@ bitflags::bitflags! { } } -// Storage image format. +/// Image storage format. #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum StorageFormat { // 8-bit formats R8Unorm, @@ -513,6 +535,7 @@ pub enum StorageFormat { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ImageClass { /// Regular sampled image. Sampled { @@ -540,6 +563,7 @@ pub enum ImageClass { #[derive(Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct Type { /// The name of the type, if any. pub name: Option, @@ -551,6 +575,7 @@ pub struct Type { #[derive(Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum TypeInner { /// Number of integral or floating-point kind. Scalar { kind: ScalarKind, width: Bytes }, @@ -596,7 +621,7 @@ pub enum TypeInner { /// [`AccessIndex`]: Expression::AccessIndex Pointer { base: Handle, - class: StorageClass, + space: AddressSpace, }, /// Pointer to a scalar or vector. @@ -615,7 +640,7 @@ pub enum TypeInner { size: Option, kind: ScalarKind, width: Bytes, - class: StorageClass, + space: AddressSpace, }, /// Homogenous list of elements. @@ -627,7 +652,8 @@ pub enum TypeInner { /// An `Array` is [`SIZED`] unless its `size` is [`Dynamic`]. /// Dynamically-sized arrays may only appear in a few situations: /// - /// - They may appear as the last member of a [`Struct`]. + /// - They may appear as the type of a [`GlobalVariable`], or as the last + /// member of a [`Struct`]. /// /// - They may appear as the base type of a [`Pointer`]. An /// [`AccessIndex`] expression referring to a struct's final @@ -680,6 +706,7 @@ pub enum TypeInner { #[derive(Debug, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct Constant { pub name: Option, pub specialization: Option, @@ -690,6 +717,7 @@ pub struct Constant { #[derive(Debug, Clone, Copy, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ScalarValue { Sint(i64), Uint(u64), @@ -701,6 +729,7 @@ pub enum ScalarValue { #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ConstantInner { Scalar { width: Bytes, @@ -716,6 +745,7 @@ pub enum ConstantInner { #[derive(Clone, Debug, Eq, PartialEq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum Binding { /// Built-in shader variable. BuiltIn(BuiltIn), @@ -747,6 +777,7 @@ pub enum Binding { #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct ResourceBinding { /// The bind group index. pub group: u32, @@ -758,11 +789,12 @@ pub struct ResourceBinding { #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct GlobalVariable { /// Name of the variable, if any. pub name: Option, /// How this variable is to be stored. - pub class: StorageClass, + pub space: AddressSpace, /// For resources, defines the binding point. pub binding: Option, /// The type of this variable. @@ -775,6 +807,7 @@ pub struct GlobalVariable { #[derive(Clone, Debug)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct LocalVariable { /// Name of the variable, if any. pub name: Option, @@ -788,6 +821,7 @@ pub struct LocalVariable { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum UnaryOperator { Negate, Not, @@ -797,6 +831,7 @@ pub enum UnaryOperator { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum BinaryOperator { Add, Subtract, @@ -827,6 +862,7 @@ pub enum BinaryOperator { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum AtomicFunction { Add, Subtract, @@ -842,6 +878,7 @@ pub enum AtomicFunction { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum DerivativeAxis { X, Y, @@ -852,6 +889,7 @@ pub enum DerivativeAxis { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum RelationalFunction { All, Any, @@ -865,6 +903,7 @@ pub enum RelationalFunction { #[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum MathFunction { // comparison Abs, @@ -948,6 +987,7 @@ pub enum MathFunction { #[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum SampleLevel { Auto, Zero, @@ -963,6 +1003,7 @@ pub enum SampleLevel { #[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum ImageQuery { /// Get the size at the specified level. Size { @@ -982,6 +1023,7 @@ pub enum ImageQuery { #[derive(Clone, Copy, Debug, PartialEq, PartialOrd)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum SwizzleComponent { /// X = 0, @@ -997,11 +1039,12 @@ bitflags::bitflags! { /// Memory barrier flags. #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] + #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[derive(Default)] pub struct Barrier: u32 { - /// Barrier affects all `StorageClass::Storage` accesses. + /// Barrier affects all `AddressSpace::Storage` accesses. const STORAGE = 0x1; - /// Barrier affects all `StorageClass::WorkGroup` accesses. + /// Barrier affects all `AddressSpace::WorkGroup` accesses. const WORK_GROUP = 0x2; } } @@ -1013,6 +1056,7 @@ bitflags::bitflags! { #[cfg_attr(test, derive(PartialEq))] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum Expression { /// Array access with a computed index. /// @@ -1028,7 +1072,7 @@ pub enum Expression { /// Indexing a [`Matrix`] produces a [`Vector`]. /// /// Indexing a [`Pointer`] to any of the above produces a pointer to the - /// element/component type, in the same [`class`]. In the case of [`Array`], + /// element/component type, in the same [`space`]. In the case of [`Array`], /// the result is an actual [`Pointer`], but for vectors and matrices, there /// may not be any type in the arena representing the component's type, so /// those produce [`ValuePointer`] types equivalent to the appropriate @@ -1057,7 +1101,7 @@ pub enum Expression { /// [`Matrix`]: TypeInner::Matrix /// [`Array`]: TypeInner::Array /// [`Pointer`]: TypeInner::Pointer - /// [`class`]: TypeInner::Pointer::class + /// [`space`]: TypeInner::Pointer::space /// [`ValuePointer`]: TypeInner::ValuePointer /// [`Float`]: ScalarKind::Float Access { @@ -1102,16 +1146,16 @@ pub enum Expression { /// Reference a global variable. /// - /// If the given `GlobalVariable`'s [`class`] is [`StorageClass::Handle`], + /// If the given `GlobalVariable`'s [`space`] is [`AddressSpace::Handle`], /// then the variable stores some opaque type like a sampler or an image, /// and a `GlobalVariable` expression referring to it produces the /// variable's value directly. /// - /// For any other storage class, a `GlobalVariable` expression produces a + /// For any other address space, a `GlobalVariable` expression produces a /// pointer to the variable's value. You must use a [`Load`] expression to /// retrieve its value, or a [`Store`] statement to assign it a new value. /// - /// [`class`]: GlobalVariable::class + /// [`space`]: GlobalVariable::space /// [`Load`]: Expression::Load /// [`Store`]: Statement::Store GlobalVariable(Handle), @@ -1190,37 +1234,22 @@ pub enum Expression { /// [`Sint`]: ScalarKind::Sint array_index: Option>, - /// The sample within a particular texel. - /// - /// The meaning of this value depends on the [`class`] of `image`: - /// - /// - [`Storage`] images hold exactly one sample per texel, so `index` must - /// be `None`. - /// - /// - [`Depth`] and [`Sampled`] images may be multisampled or have - /// mipmaps, but not both. Which one is indicated by the variant's - /// [`multi`] field: + /// A sample index, for multisampled [`Sampled`] and [`Depth`] images. /// - /// - If `multi` is `true`, then the image has multiple samples per - /// texel, and `index` must be `Some(sample)`, where `sample` is - /// the index of the sample to retrieve. - /// - /// - If `multi` is `false`, then the image may have mipmaps. In - /// this case, `index` must be `Some(level)`, where `level` - /// identifies the level of detail. Even if the image has only the - /// full-sized version, `level` must still be present; its only - /// in-range value is zero. + /// [`Sampled`]: ImageClass::Sampled + /// [`Depth`]: ImageClass::Depth + sample: Option>, + + /// A level of detail, for mipmapped images. /// - /// When `index` is `Some` the value must be a `Sint` scalar value. If - /// it identifes a level of detail, zero represents the full resolution - /// mipmap. + /// This must be present when accessing non-multisampled + /// [`Sampled`] and [`Depth`] images, even if only the + /// full-resolution level is present (in which case the only + /// valid level is zero). /// - /// [`class`]: TypeInner::Image::class /// [`Sampled`]: ImageClass::Sampled - /// [`Storage`]: ImageClass::Storage /// [`Depth`]: ImageClass::Depth - /// [`multi`]: ImageClass::Sampled::multi - index: Option>, + level: Option>, }, /// Query information from an image. @@ -1296,11 +1325,12 @@ pub enum Expression { pub use block::Block; -/// The value of the switch case +/// The value of the switch case. // Clone is used only for error reporting and is not intended for end users #[derive(Clone, Debug)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum SwitchValue { Integer(i32), Default, @@ -1311,6 +1341,7 @@ pub enum SwitchValue { #[derive(Clone, Debug)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct SwitchCase { /// Value, upon which the case is considered true. pub value: SwitchValue, @@ -1327,6 +1358,7 @@ pub struct SwitchCase { #[derive(Clone, Debug)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub enum Statement { /// Emit a range of expressions, visible to all statements that follow in this block. /// @@ -1429,7 +1461,8 @@ pub enum Statement { /// The `image`, `coordinate`, and `array_index` fields have the same /// meanings as the corresponding operands of an [`ImageLoad`] expression; /// see that documentation for details. Storing into multisampled images or - /// images with mipmaps is not supported, so there is no `index`operand. + /// images with mipmaps is not supported, so there are no `level` or + /// `sample` operands. /// /// This statement is a barrier for any operations on the corresponding /// [`Expression::GlobalVariable`] for this image. @@ -1470,6 +1503,7 @@ pub enum Statement { #[derive(Clone, Debug)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct FunctionArgument { /// Name of the argument, if any. pub name: Option, @@ -1480,9 +1514,11 @@ pub struct FunctionArgument { pub binding: Option, } +/// A function result. #[derive(Clone, Debug)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct FunctionResult { /// Type of the result. pub ty: Handle, @@ -1495,6 +1531,7 @@ pub struct FunctionResult { #[derive(Debug, Default)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct Function { /// Name of the function, if any. pub name: Option, @@ -1558,6 +1595,7 @@ pub struct Function { #[derive(Debug)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct EntryPoint { /// Name of this entry point, visible externally. /// @@ -1587,14 +1625,15 @@ pub struct EntryPoint { #[derive(Debug, Default)] #[cfg_attr(feature = "serialize", derive(Serialize))] #[cfg_attr(feature = "deserialize", derive(Deserialize))] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] pub struct Module { - /// Storage for the types defined in this module. + /// Arena for the types defined in this module. pub types: UniqueArena, - /// Storage for the constants defined in this module. + /// Arena for the constants defined in this module. pub constants: Arena, - /// Storage for the global variables defined in this module. + /// Arena for the global variables defined in this module. pub global_variables: Arena, - /// Storage for the functions defined in this module. + /// Arena for the functions defined in this module. /// /// Each function must appear in this arena strictly before all its callers. /// Recursion is not supported. diff --git a/third_party/rust/naga/src/proc/index.rs b/third_party/rust/naga/src/proc/index.rs index ae20cc5d6e536..b0939b0e72b90 100644 --- a/third_party/rust/naga/src/proc/index.rs +++ b/third_party/rust/naga/src/proc/index.rs @@ -1,8 +1,8 @@ -//! Definitions for index bounds checking. +/*! +Definitions for index bounds checking. +*/ -use super::ProcError; -use crate::valid; -use crate::{Handle, UniqueArena}; +use crate::{valid, Handle, UniqueArena}; use bit_set::BitSet; /// How should code generated by Naga do bounds checks? @@ -72,13 +72,13 @@ pub struct BoundsCheckPolicies { /// How should the generated code handle array, vector, or matrix indices /// that are out of range, when those values live in a [`GlobalVariable`] in - /// the [`Storage`] or [`Uniform`] storage classes? + /// the [`Storage`] or [`Uniform`] address spaces? /// /// Some graphics hardware provides "robust buffer access", a feature that /// ensures that using a pointer cannot access memory outside the 'buffer' /// that it was derived from. In Naga terms, this means that the hardware /// ensures that pointers computed by applying [`Access`] and - /// [`AccessIndex`] expressions to a [`GlobalVariable`] whose [`class`] is + /// [`AccessIndex`] expressions to a [`GlobalVariable`] whose [`space`] is /// [`Storage`] or [`Uniform`] will never read or write memory outside that /// global variable. /// @@ -96,13 +96,13 @@ pub struct BoundsCheckPolicies { /// the same as `index_bounds_check_policy`. /// /// [`GlobalVariable`]: crate::GlobalVariable - /// [`class`]: crate::GlobalVariable::class + /// [`space`]: crate::GlobalVariable::space /// [`Restrict`]: crate::back::BoundsCheckPolicy::Restrict /// [`ReadZeroSkipWrite`]: crate::back::BoundsCheckPolicy::ReadZeroSkipWrite /// [`Access`]: crate::Expression::Access /// [`AccessIndex`]: crate::Expression::AccessIndex - /// [`Storage`]: crate::StorageClass::Storage - /// [`Uniform`]: crate::StorageClass::Uniform + /// [`Storage`]: crate::AddressSpace::Storage + /// [`Uniform`]: crate::AddressSpace::Uniform #[cfg_attr(feature = "deserialize", serde(default))] pub buffer: BoundsCheckPolicy, @@ -140,10 +140,10 @@ impl BoundsCheckPolicies { types: &UniqueArena, info: &valid::FunctionInfo, ) -> BoundsCheckPolicy { - match info[access].ty.inner_with(types).pointer_class() { - Some(crate::StorageClass::Storage { access: _ }) - | Some(crate::StorageClass::Uniform) => self.buffer, - // This covers other storage classes, but also accessing vectors and + match info[access].ty.inner_with(types).pointer_space() { + Some(crate::AddressSpace::Storage { access: _ }) + | Some(crate::AddressSpace::Uniform) => self.buffer, + // This covers other address spaces, but also accessing vectors and // matrices by value, where no pointer is involved. _ => self.index, } @@ -178,26 +178,39 @@ pub enum GuardedIndex { /// /// Such index expressions will be used twice in the generated code: first for the /// comparison to see if the index is in bounds, and then for the access itself, should -/// the comparison succeed. To avoid computing the expressions twice, they should be -/// cached in temporary variables. +/// the comparison succeed. To avoid computing the expressions twice, the generated code +/// should cache them in temporary variables. /// -/// Why do we need to build such a set before processing a function's statements? Whether -/// an expression needs to be cached depends on whether it appears as the [`index`] -/// operand of any [`Access`] expression, and on the index bounds check policies that -/// apply to those accesses. But [`Emit`] statements just identify a range of expressions -/// by index; there's no good way to tell what an expression is used for. The only way to -/// do it is to just iterate over all the expressions looking for relevant `Access` -/// expressions --- which is what this function does. +/// Why do we need to build such a set in advance, instead of just processing access +/// expressions as we encounter them? Whether an expression needs to be cached depends on +/// whether it appears as something like the [`index`] operand of an [`Access`] expression +/// or the [`level`] operand of an [`ImageLoad`] expression, and on the index bounds check +/// policies that apply to those accesses. But [`Emit`] statements just identify a range +/// of expressions by index; there's no good way to tell what an expression is used +/// for. The only way to do it is to just iterate over all the expressions looking for +/// relevant `Access` expressions --- which is what this function does. /// /// Simple expressions like variable loads and constants don't make sense to cache: it's /// no better than just re-evaluating them. But constants are not covered by `Emit` /// statements, and `Load`s are always cached to ensure they occur at the right time, so /// we don't bother filtering them out from this set. /// +/// Fortunately, we don't need to deal with [`ImageStore`] statements here. When we emit +/// code for a statement, the writer isn't in the middle of an expression, so we can just +/// emit declarations for temporaries, initialized appropriately. +/// +/// None of these concerns apply for SPIR-V output, since it's easy to just reuse an +/// instruction ID in two places; that has the same semantics as a temporary variable, and +/// it's inherent in the design of SPIR-V. This function is more useful for text-based +/// back ends. +/// /// [`ReadZeroSkipWrite`]: BoundsCheckPolicy::ReadZeroSkipWrite /// [`index`]: crate::Expression::Access::index /// [`Access`]: crate::Expression::Access +/// [`level`]: crate::Expression::ImageLoad::level +/// [`ImageLoad`]: crate::Expression::ImageLoad /// [`Emit`]: crate::Statement::Emit +/// [`ImageStore`]: crate::Statement::ImageStore pub fn find_checked_indexes( module: &crate::Module, function: &crate::Function, @@ -213,20 +226,43 @@ pub fn find_checked_indexes( for (_handle, expr) in function.expressions.iter() { // There's no need to handle `AccessIndex` expressions, as their // indices never need to be cached. - if let Ex::Access { base, index } = *expr { - if policies.choose_policy(base, &module.types, info) - == BoundsCheckPolicy::ReadZeroSkipWrite - && access_needs_check( - base, - GuardedIndex::Expression(index), - module, - function, - info, - ) - .is_some() - { - guarded_indices.insert(index.index()); + match *expr { + Ex::Access { base, index } => { + if policies.choose_policy(base, &module.types, info) + == BoundsCheckPolicy::ReadZeroSkipWrite + && access_needs_check( + base, + GuardedIndex::Expression(index), + module, + function, + info, + ) + .is_some() + { + guarded_indices.insert(index.index()); + } + } + Ex::ImageLoad { + coordinate, + array_index, + sample, + level, + .. + } => { + if policies.image == BoundsCheckPolicy::ReadZeroSkipWrite { + guarded_indices.insert(coordinate.index()); + if let Some(array_index) = array_index { + guarded_indices.insert(array_index.index()); + } + if let Some(sample) = sample { + guarded_indices.insert(sample.index()); + } + if let Some(level) = level { + guarded_indices.insert(level.index()); + } + } } + _ => {} } } } @@ -300,6 +336,14 @@ impl GuardedIndex { } } +#[derive(Clone, Copy, Debug, thiserror::Error, PartialEq)] +pub enum IndexableLengthError { + #[error("Type is not indexable, and has no length (validation error)")] + TypeNotIndexable, + #[error("Array length constant {0:?} is invalid")] + InvalidArrayLength(Handle), +} + impl crate::TypeInner { /// Return the length of a subscriptable type. /// @@ -312,7 +356,10 @@ impl crate::TypeInner { /// The value returned is appropriate for bounds checks on subscripting. /// /// Return an error if `self` does not describe a subscriptable type at all. - pub fn indexable_length(&self, module: &crate::Module) -> Result { + pub fn indexable_length( + &self, + module: &crate::Module, + ) -> Result { use crate::TypeInner as Ti; let known_length = match *self { Ti::Vector { size, .. } => size as _, @@ -332,10 +379,10 @@ impl crate::TypeInner { Ti::Vector { size, .. } => size as _, Ti::Matrix { columns, .. } => columns as _, Ti::Array { size, .. } => return size.to_indexable_length(module), - _ => return Err(ProcError::TypeNotIndexable), + _ => return Err(IndexableLengthError::TypeNotIndexable), } } - _ => return Err(ProcError::TypeNotIndexable), + _ => return Err(IndexableLengthError::TypeNotIndexable), }; Ok(IndexableLength::Known(known_length)) } @@ -355,25 +402,23 @@ pub enum IndexableLength { } impl crate::ArraySize { - pub fn to_indexable_length(self, module: &crate::Module) -> Result { - use crate::Constant as K; + pub fn to_indexable_length( + self, + module: &crate::Module, + ) -> Result { Ok(match self { - Self::Constant(k) => match module.constants[k] { - K { - specialization: Some(_), - .. - } => { + Self::Constant(k) => { + let constant = &module.constants[k]; + if constant.specialization.is_some() { // Specializable constants are not supported as array lengths. // See valid::TypeError::UnsupportedSpecializedArrayLength. - return Err(ProcError::InvalidArraySizeConstant(k)); - } - ref unspecialized => { - let length = unspecialized - .to_array_length() - .ok_or(ProcError::InvalidArraySizeConstant(k))?; - IndexableLength::Known(length) + return Err(IndexableLengthError::InvalidArrayLength(k)); } - }, + let length = constant + .to_array_length() + .ok_or(IndexableLengthError::InvalidArrayLength(k))?; + IndexableLength::Known(length) + } Self::Dynamic => IndexableLength::Dynamic, }) } diff --git a/third_party/rust/naga/src/proc/layouter.rs b/third_party/rust/naga/src/proc/layouter.rs index 5f6559f08e2ba..f03823a8161b0 100644 --- a/third_party/rust/naga/src/proc/layouter.rs +++ b/third_party/rust/naga/src/proc/layouter.rs @@ -1,9 +1,9 @@ -use crate::arena::{Arena, Handle, UniqueArena}; +use crate::arena::{Arena, BadHandle, Handle, UniqueArena}; use std::{num::NonZeroU32, ops}; pub type Alignment = NonZeroU32; -/// Alignment information for a type. +/// Size and alignment information for a type. #[derive(Clone, Copy, Debug, Hash, PartialEq)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] @@ -12,13 +12,27 @@ pub struct TypeLayout { pub alignment: Alignment, } +impl TypeLayout { + /// Produce the stride as if this type is a base of an array. + pub fn to_stride(&self) -> u32 { + Layouter::round_up(self.alignment, self.size) + } +} + /// Helper processor that derives the sizes of all types. -/// It uses the default layout algorithm/table, described in -/// +/// +/// `Layouter` uses the default layout algorithm/table, described in +/// [WGSL §4.3.7, "Memory Layout"] +/// +/// A `Layouter` may be indexed by `Handle` values: `layouter[handle]` is the +/// layout of the type whose handle is `handle`. +/// +/// [WGSL §4.3.7, "Memory Layout"](https://gpuweb.github.io/gpuweb/wgsl/#memory-layouts) #[derive(Debug, Default)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub struct Layouter { + /// Layouts for types in an arena, indexed by `Handle` index. layouts: Vec, } @@ -30,14 +44,37 @@ impl ops::Index> for Layouter { } #[derive(Clone, Copy, Debug, PartialEq, thiserror::Error)] -#[error("Base type {0:?} is out of bounds")] -pub struct InvalidBaseType(pub Handle); +pub enum LayoutErrorInner { + #[error("Array element type {0:?} doesn't exist")] + InvalidArrayElementType(Handle), + #[error("Struct member[{0}] type {1:?} doesn't exist")] + InvalidStructMemberType(u32, Handle), + #[error("Zero width is not supported")] + ZeroWidth, + #[error("Array size is a bad handle")] + BadHandle(#[from] BadHandle), +} + +#[derive(Clone, Copy, Debug, PartialEq, thiserror::Error)] +#[error("Error laying out type {ty:?}: {inner}")] +pub struct LayoutError { + pub ty: Handle, + pub inner: LayoutErrorInner, +} + +impl LayoutErrorInner { + fn with(self, ty: Handle) -> LayoutError { + LayoutError { ty, inner: self } + } +} impl Layouter { + /// Remove all entries from this `Layouter`, retaining storage. pub fn clear(&mut self) { self.layouts.clear(); } + /// Round `offset` up to the nearest `alignment` boundary. pub fn round_up(alignment: Alignment, offset: u32) -> u32 { match offset & (alignment.get() - 1) { 0 => offset, @@ -45,6 +82,15 @@ impl Layouter { } } + /// Return the offset and span of a struct member. + /// + /// The member must fall at or after `offset`. The member's alignment and + /// size are `align` and `size` if given, defaulting to the values this + /// `Layouter` has previously determined for `ty`. + /// + /// The return value is the range of offsets within the containing struct to + /// reserve for this member, along with the alignment used. The containing + /// struct must have sufficient space and alignment to accommodate these. pub fn member_placement( &self, offset: u32, @@ -62,19 +108,37 @@ impl Layouter { (start..start + span, alignment) } + /// Extend this `Layouter` with layouts for any new entries in `types`. + /// + /// Ensure that every type in `types` has a corresponding [TypeLayout] in + /// [`self.layouts`]. + /// + /// Some front ends need to be able to compute layouts for existing types + /// while module construction is still in progress and new types are still + /// being added. This function assumes that the `TypeLayout` values already + /// present in `self.layouts` cover their corresponding entries in `types`, + /// and extends `self.layouts` as needed to cover the rest. Thus, a front + /// end can call this function at any time, passing its current type and + /// constant arenas, and then assume that layouts are available for all + /// types. + #[allow(clippy::or_fun_call)] pub fn update( &mut self, types: &UniqueArena, constants: &Arena, - ) -> Result<(), InvalidBaseType> { + ) -> Result<(), LayoutError> { use crate::TypeInner as Ti; for (ty_handle, ty) in types.iter().skip(self.layouts.len()) { - let size = ty.inner.span(constants); + let size = ty + .inner + .try_size(constants) + .map_err(|error| LayoutErrorInner::BadHandle(error).with(ty_handle))?; let layout = match ty.inner { Ti::Scalar { width, .. } | Ti::Atomic { width, .. } => TypeLayout { size, - alignment: Alignment::new(width as u32).unwrap(), + alignment: Alignment::new(width as u32) + .ok_or(LayoutErrorInner::ZeroWidth.with(ty_handle))?, }, Ti::Vector { size: vec_size, @@ -88,7 +152,8 @@ impl Layouter { } else { 2 }; - Alignment::new((count * width) as u32).unwrap() + Alignment::new(count * width as u32) + .ok_or(LayoutErrorInner::ZeroWidth.with(ty_handle))? }, }, Ti::Matrix { @@ -99,7 +164,8 @@ impl Layouter { size, alignment: { let count = if rows >= crate::VectorSize::Tri { 4 } else { 2 }; - Alignment::new((count * width) as u32).unwrap() + Alignment::new(count * width as u32) + .ok_or(LayoutErrorInner::ZeroWidth.with(ty_handle))? }, }, Ti::Pointer { .. } | Ti::ValuePointer { .. } => TypeLayout { @@ -115,16 +181,20 @@ impl Layouter { alignment: if base < ty_handle { self[base].alignment } else { - return Err(InvalidBaseType(base)); + return Err(LayoutErrorInner::InvalidArrayElementType(base).with(ty_handle)); }, }, Ti::Struct { span, ref members } => { let mut alignment = Alignment::new(1).unwrap(); - for member in members { + for (index, member) in members.iter().enumerate() { alignment = if member.ty < ty_handle { alignment.max(self[member.ty].alignment) } else { - return Err(InvalidBaseType(member.ty)); + return Err(LayoutErrorInner::InvalidStructMemberType( + index as u32, + member.ty, + ) + .with(ty_handle)); }; } TypeLayout { @@ -137,7 +207,7 @@ impl Layouter { alignment: Alignment::new(1).unwrap(), }, }; - debug_assert!(ty.inner.span(constants) <= layout.size); + debug_assert!(size <= layout.size); self.layouts.push(layout); } diff --git a/third_party/rust/naga/src/proc/mod.rs b/third_party/rust/naga/src/proc/mod.rs index 13883df909257..15cc3a7fc514b 100644 --- a/third_party/rust/naga/src/proc/mod.rs +++ b/third_party/rust/naga/src/proc/mod.rs @@ -1,4 +1,6 @@ -//! Module processing functionality. +/*! +[`Module`](super::Module) processing functionality. +*/ pub mod index; mod layouter; @@ -8,20 +10,12 @@ mod typifier; use std::cmp::PartialEq; -pub use index::{BoundsCheckPolicies, BoundsCheckPolicy, IndexableLength}; -pub use layouter::{Alignment, InvalidBaseType, Layouter, TypeLayout}; +pub use index::{BoundsCheckPolicies, BoundsCheckPolicy, IndexableLength, IndexableLengthError}; +pub use layouter::{Alignment, LayoutError, LayoutErrorInner, Layouter, TypeLayout}; pub use namer::{EntryPointIndex, NameKey, Namer}; pub use terminator::ensure_block_returns; pub use typifier::{ResolveContext, ResolveError, TypeResolution}; -#[derive(Clone, Debug, thiserror::Error, PartialEq)] -pub enum ProcError { - #[error("type is not indexable, and has no length (validation error)")] - TypeNotIndexable, - #[error("array length is wrong kind of constant (validation error)")] - InvalidArraySizeConstant(crate::Handle), -} - impl From for super::ScalarKind { fn from(format: super::StorageFormat) -> Self { use super::{ScalarKind as Sk, StorageFormat as Sf}; @@ -86,22 +80,25 @@ impl super::TypeInner { } } - pub fn pointer_class(&self) -> Option { + pub fn pointer_space(&self) -> Option { match *self { - Self::Pointer { class, .. } => Some(class), - Self::ValuePointer { class, .. } => Some(class), + Self::Pointer { space, .. } => Some(space), + Self::ValuePointer { space, .. } => Some(space), _ => None, } } - pub fn span(&self, constants: &super::Arena) -> u32 { - match *self { + pub fn try_size( + &self, + constants: &super::Arena, + ) -> Result { + Ok(match *self { Self::Scalar { kind: _, width } | Self::Atomic { kind: _, width } => width as u32, Self::Vector { size, kind: _, width, - } => (size as u8 * width) as u32, + } => size as u32 * width as u32, // matrices are treated as arrays of aligned columns Self::Matrix { columns, @@ -119,8 +116,8 @@ impl super::TypeInner { } => { let count = match size { super::ArraySize::Constant(handle) => { - // Bad array lengths will be caught during validation. - constants[handle].to_array_length().unwrap_or(1) + let constant = constants.try_get(handle)?; + constant.to_array_length().unwrap_or(1) } // A dynamically-sized array has to have at least one element super::ArraySize::Dynamic => 1, @@ -129,7 +126,13 @@ impl super::TypeInner { } Self::Struct { span, .. } => span, Self::Image { .. } | Self::Sampler { .. } => 0, - } + }) + } + + /// Get the size of this type. Panics if the `constants` doesn't contain + /// a referenced handle. This may not happen in a properly validated IR module. + pub fn size(&self, constants: &super::Arena) -> u32 { + self.try_size(constants).unwrap() } /// Return the canoncal form of `self`, or `None` if it's already in @@ -146,18 +149,18 @@ impl super::TypeInner { ) -> Option { use crate::TypeInner as Ti; match *self { - Ti::Pointer { base, class } => match types[base].inner { + Ti::Pointer { base, space } => match types[base].inner { Ti::Scalar { kind, width } => Some(Ti::ValuePointer { size: None, kind, width, - class, + space, }), Ti::Vector { size, kind, width } => Some(Ti::ValuePointer { size: Some(size), kind, width, - class, + space, }), _ => None, }, @@ -184,17 +187,17 @@ impl super::TypeInner { } } -impl super::StorageClass { +impl super::AddressSpace { pub fn access(self) -> crate::StorageAccess { use crate::StorageAccess as Sa; match self { - crate::StorageClass::Function - | crate::StorageClass::Private - | crate::StorageClass::WorkGroup => Sa::LOAD | Sa::STORE, - crate::StorageClass::Uniform => Sa::LOAD, - crate::StorageClass::Storage { access } => access, - crate::StorageClass::Handle => Sa::LOAD, - crate::StorageClass::PushConstant => Sa::LOAD, + crate::AddressSpace::Function + | crate::AddressSpace::Private + | crate::AddressSpace::WorkGroup => Sa::LOAD | Sa::STORE, + crate::AddressSpace::Uniform => Sa::LOAD, + crate::AddressSpace::Storage { access } => access, + crate::AddressSpace::Handle => Sa::LOAD, + crate::AddressSpace::PushConstant => Sa::LOAD, } } } @@ -438,6 +441,22 @@ impl super::SwizzleComponent { } } +impl super::ImageClass { + pub fn is_multisampled(self) -> bool { + match self { + crate::ImageClass::Sampled { multi, .. } | crate::ImageClass::Depth { multi } => multi, + crate::ImageClass::Storage { .. } => false, + } + } + + pub fn is_mipmapped(self) -> bool { + match self { + crate::ImageClass::Sampled { multi, .. } | crate::ImageClass::Depth { multi } => !multi, + crate::ImageClass::Storage { .. } => false, + } + } +} + #[test] fn test_matrix_size() { let constants = crate::Arena::new(); @@ -447,7 +466,7 @@ fn test_matrix_size() { rows: crate::VectorSize::Tri, width: 4 } - .span(&constants), - 48 + .size(&constants), + 48, ); } diff --git a/third_party/rust/naga/src/proc/typifier.rs b/third_party/rust/naga/src/proc/typifier.rs index 7a1d7a46e0389..f2ad51805fd09 100644 --- a/third_party/rust/naga/src/proc/typifier.rs +++ b/third_party/rust/naga/src/proc/typifier.rs @@ -1,4 +1,4 @@ -use crate::arena::{Arena, Handle, UniqueArena}; +use crate::arena::{Arena, BadHandle, Handle, UniqueArena}; use thiserror::Error; @@ -54,7 +54,7 @@ use thiserror::Error; /// }) /// ``` /// -/// and the type of an access to a pointer of storage class `class` to such a +/// and the type of an access to a pointer of address space `space` to such a /// matrix might be: /// /// ```ignore @@ -62,7 +62,7 @@ use thiserror::Error; /// size: Some(rows), /// kind: ScalarKind::Float, /// width, -/// class +/// space, /// }) /// ``` /// @@ -130,17 +130,17 @@ impl Clone for TypeResolution { columns, width, }, - Ti::Pointer { base, class } => Ti::Pointer { base, class }, + Ti::Pointer { base, space } => Ti::Pointer { base, space }, Ti::ValuePointer { size, kind, width, - class, + space, } => Ti::ValuePointer { size, kind, width, - class, + space, }, _ => unreachable!("Unexpected clone type: {:?}", v), }), @@ -162,6 +162,8 @@ impl crate::ConstantInner { #[derive(Clone, Debug, Error, PartialEq)] pub enum ResolveError { + #[error(transparent)] + BadHandle(#[from] BadHandle), #[error("Index {index} is out of bounds for expression {expr:?}")] OutOfBoundsIndex { expr: Handle, @@ -189,10 +191,12 @@ pub enum ResolveError { FunctionNotDefined { name: String }, #[error("Function without return type")] FunctionReturnsVoid, - #[error("Type is not found in the given immutable arena")] - TypeNotFound, #[error("Incompatible operands: {0}")] IncompatibleOperands(String), + #[error("Function argument {0} doesn't exist")] + FunctionArgumentNotFound(u32), + #[error("Expression {0:?} depends on expressions that follow")] + ExpressionForwardDependency(Handle), } pub struct ResolveContext<'a> { @@ -223,12 +227,12 @@ impl<'a> ResolveContext<'a> { pub fn resolve( &self, expr: &crate::Expression, - past: impl Fn(Handle) -> &'a TypeResolution, + past: impl Fn(Handle) -> Result<&'a TypeResolution, ResolveError>, ) -> Result { use crate::TypeInner as Ti; let types = self.types; Ok(match *expr { - crate::Expression::Access { base, .. } => match *past(base).inner_with(types) { + crate::Expression::Access { base, .. } => match *past(base)?.inner_with(types) { // Arrays and matrices can only be indexed dynamically behind a // pointer, but that's a validation error, not a type error, so // go ahead provide a type here. @@ -247,16 +251,16 @@ impl<'a> ResolveContext<'a> { size: Some(_), kind, width, - class, + space, } => TypeResolution::Value(Ti::ValuePointer { size: None, kind, width, - class, + space, }), - Ti::Pointer { base, class } => { + Ti::Pointer { base, space } => { TypeResolution::Value(match types[base].inner { - Ti::Array { base, .. } => Ti::Pointer { base, class }, + Ti::Array { base, .. } => Ti::Pointer { base, space }, Ti::Vector { size: _, kind, @@ -265,7 +269,7 @@ impl<'a> ResolveContext<'a> { size: None, kind, width, - class, + space, }, // Matrices are only dynamically indexed behind a pointer Ti::Matrix { @@ -276,7 +280,7 @@ impl<'a> ResolveContext<'a> { kind: crate::ScalarKind::Float, size: Some(rows), width, - class, + space, }, ref other => { log::error!("Access sub-type {:?}", other); @@ -295,116 +299,123 @@ impl<'a> ResolveContext<'a> { }); } }, - crate::Expression::AccessIndex { base, index } => match *past(base).inner_with(types) { - Ti::Vector { size, kind, width } => { - if index >= size as u32 { - return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); - } - TypeResolution::Value(Ti::Scalar { kind, width }) - } - Ti::Matrix { - columns, - rows, - width, - } => { - if index >= columns as u32 { - return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); - } - TypeResolution::Value(crate::TypeInner::Vector { - size: rows, - kind: crate::ScalarKind::Float, - width, - }) - } - Ti::Array { base, .. } => TypeResolution::Handle(base), - Ti::Struct { ref members, .. } => { - let member = members - .get(index as usize) - .ok_or(ResolveError::OutOfBoundsIndex { expr: base, index })?; - TypeResolution::Handle(member.ty) - } - Ti::ValuePointer { - size: Some(size), - kind, - width, - class, - } => { - if index >= size as u32 { - return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); - } - TypeResolution::Value(Ti::ValuePointer { - size: None, - kind, - width, - class, - }) - } - Ti::Pointer { - base: ty_base, - class, - } => TypeResolution::Value(match types[ty_base].inner { - Ti::Array { base, .. } => Ti::Pointer { base, class }, + crate::Expression::AccessIndex { base, index } => { + match *past(base)?.inner_with(types) { Ti::Vector { size, kind, width } => { if index >= size as u32 { return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); } - Ti::ValuePointer { - size: None, - kind, - width, - class, - } + TypeResolution::Value(Ti::Scalar { kind, width }) } Ti::Matrix { - rows, columns, + rows, width, } => { if index >= columns as u32 { return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); } - Ti::ValuePointer { - size: Some(rows), + TypeResolution::Value(crate::TypeInner::Vector { + size: rows, kind: crate::ScalarKind::Float, width, - class, - } + }) } + Ti::Array { base, .. } => TypeResolution::Handle(base), Ti::Struct { ref members, .. } => { let member = members .get(index as usize) .ok_or(ResolveError::OutOfBoundsIndex { expr: base, index })?; - Ti::Pointer { - base: member.ty, - class, + TypeResolution::Handle(member.ty) + } + Ti::ValuePointer { + size: Some(size), + kind, + width, + space, + } => { + if index >= size as u32 { + return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); } + TypeResolution::Value(Ti::ValuePointer { + size: None, + kind, + width, + space, + }) } + Ti::Pointer { + base: ty_base, + space, + } => TypeResolution::Value(match types[ty_base].inner { + Ti::Array { base, .. } => Ti::Pointer { base, space }, + Ti::Vector { size, kind, width } => { + if index >= size as u32 { + return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); + } + Ti::ValuePointer { + size: None, + kind, + width, + space, + } + } + Ti::Matrix { + rows, + columns, + width, + } => { + if index >= columns as u32 { + return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); + } + Ti::ValuePointer { + size: Some(rows), + kind: crate::ScalarKind::Float, + width, + space, + } + } + Ti::Struct { ref members, .. } => { + let member = members + .get(index as usize) + .ok_or(ResolveError::OutOfBoundsIndex { expr: base, index })?; + Ti::Pointer { + base: member.ty, + space, + } + } + ref other => { + log::error!("Access index sub-type {:?}", other); + return Err(ResolveError::InvalidSubAccess { + ty: ty_base, + indexed: true, + }); + } + }), ref other => { - log::error!("Access index sub-type {:?}", other); - return Err(ResolveError::InvalidSubAccess { - ty: ty_base, + log::error!("Access index type {:?}", other); + return Err(ResolveError::InvalidAccess { + expr: base, indexed: true, }); } - }), - ref other => { - log::error!("Access index type {:?}", other); - return Err(ResolveError::InvalidAccess { - expr: base, - indexed: true, - }); } - }, - crate::Expression::Constant(h) => match self.constants[h].inner { - crate::ConstantInner::Scalar { width, ref value } => { - TypeResolution::Value(Ti::Scalar { - kind: value.scalar_kind(), - width, - }) + } + crate::Expression::Constant(h) => { + let constant = self.constants.try_get(h)?; + match constant.inner { + crate::ConstantInner::Scalar { width, ref value } => { + TypeResolution::Value(Ti::Scalar { + kind: value.scalar_kind(), + width, + }) + } + crate::ConstantInner::Composite { ty, components: _ } => { + TypeResolution::Handle(ty) + } } - crate::ConstantInner::Composite { ty, components: _ } => TypeResolution::Handle(ty), - }, - crate::Expression::Splat { size, value } => match *past(value).inner_with(types) { + } + crate::Expression::Splat { size, value } => match *past(value)?.inner_with(types) { Ti::Scalar { kind, width } => { TypeResolution::Value(Ti::Vector { size, kind, width }) } @@ -417,7 +428,7 @@ impl<'a> ResolveContext<'a> { size, vector, pattern: _, - } => match *past(vector).inner_with(types) { + } => match *past(vector)?.inner_with(types) { Ti::Vector { size: _, kind, @@ -430,28 +441,32 @@ impl<'a> ResolveContext<'a> { }, crate::Expression::Compose { ty, .. } => TypeResolution::Handle(ty), crate::Expression::FunctionArgument(index) => { - TypeResolution::Handle(self.arguments[index as usize].ty) + let arg = self + .arguments + .get(index as usize) + .ok_or(ResolveError::FunctionArgumentNotFound(index))?; + TypeResolution::Handle(arg.ty) } crate::Expression::GlobalVariable(h) => { - let var = &self.global_vars[h]; - if var.class == crate::StorageClass::Handle { + let var = self.global_vars.try_get(h)?; + if var.space == crate::AddressSpace::Handle { TypeResolution::Handle(var.ty) } else { TypeResolution::Value(Ti::Pointer { base: var.ty, - class: var.class, + space: var.space, }) } } crate::Expression::LocalVariable(h) => { - let var = &self.local_vars[h]; + let var = self.local_vars.try_get(h)?; TypeResolution::Value(Ti::Pointer { base: var.ty, - class: crate::StorageClass::Function, + space: crate::AddressSpace::Function, }) } - crate::Expression::Load { pointer } => match *past(pointer).inner_with(types) { - Ti::Pointer { base, class: _ } => { + crate::Expression::Load { pointer } => match *past(pointer)?.inner_with(types) { + Ti::Pointer { base, space: _ } => { if let Ti::Atomic { kind, width } = types[base].inner { TypeResolution::Value(Ti::Scalar { kind, width }) } else { @@ -462,7 +477,7 @@ impl<'a> ResolveContext<'a> { size, kind, width, - class: _, + space: _, } => TypeResolution::Value(match size { Some(size) => Ti::Vector { size, kind, width }, None => Ti::Scalar { kind, width }, @@ -476,7 +491,7 @@ impl<'a> ResolveContext<'a> { image, gather: Some(_), .. - } => match *past(image).inner_with(types) { + } => match *past(image)?.inner_with(types) { Ti::Image { class, .. } => TypeResolution::Value(Ti::Vector { kind: match class { crate::ImageClass::Sampled { kind, multi: _ } => kind, @@ -491,7 +506,7 @@ impl<'a> ResolveContext<'a> { } }, crate::Expression::ImageSample { image, .. } - | crate::Expression::ImageLoad { image, .. } => match *past(image).inner_with(types) { + | crate::Expression::ImageLoad { image, .. } => match *past(image)?.inner_with(types) { Ti::Image { class, .. } => TypeResolution::Value(match class { crate::ImageClass::Depth { multi: _ } => Ti::Scalar { kind: crate::ScalarKind::Float, @@ -514,7 +529,7 @@ impl<'a> ResolveContext<'a> { } }, crate::Expression::ImageQuery { image, query } => TypeResolution::Value(match query { - crate::ImageQuery::Size { level: _ } => match *past(image).inner_with(types) { + crate::ImageQuery::Size { level: _ } => match *past(image)?.inner_with(types) { Ti::Image { dim, .. } => match dim { crate::ImageDimension::D1 => Ti::Scalar { kind: crate::ScalarKind::Sint, @@ -543,14 +558,14 @@ impl<'a> ResolveContext<'a> { width: 4, }, }), - crate::Expression::Unary { expr, .. } => past(expr).clone(), + crate::Expression::Unary { expr, .. } => past(expr)?.clone(), crate::Expression::Binary { op, left, right } => match op { crate::BinaryOperator::Add | crate::BinaryOperator::Subtract | crate::BinaryOperator::Divide - | crate::BinaryOperator::Modulo => past(left).clone(), + | crate::BinaryOperator::Modulo => past(left)?.clone(), crate::BinaryOperator::Multiply => { - let (res_left, res_right) = (past(left), past(right)); + let (res_left, res_right) = (past(left)?, past(right)?); match (res_left.inner_with(types), res_right.inner_with(types)) { ( &Ti::Matrix { @@ -609,7 +624,7 @@ impl<'a> ResolveContext<'a> { | crate::BinaryOperator::LogicalOr => { let kind = crate::ScalarKind::Bool; let width = crate::BOOL_WIDTH; - let inner = match *past(left).inner_with(types) { + let inner = match *past(left)?.inner_with(types) { Ti::Scalar { .. } => Ti::Scalar { kind, width }, Ti::Vector { size, .. } => Ti::Vector { size, kind, width }, ref other => { @@ -625,7 +640,7 @@ impl<'a> ResolveContext<'a> { | crate::BinaryOperator::ExclusiveOr | crate::BinaryOperator::InclusiveOr | crate::BinaryOperator::ShiftLeft - | crate::BinaryOperator::ShiftRight => past(left).clone(), + | crate::BinaryOperator::ShiftRight => past(left)?.clone(), }, crate::Expression::AtomicResult { kind, @@ -642,8 +657,8 @@ impl<'a> ResolveContext<'a> { TypeResolution::Value(Ti::Scalar { kind, width }) } } - crate::Expression::Select { accept, .. } => past(accept).clone(), - crate::Expression::Derivative { axis: _, expr } => past(expr).clone(), + crate::Expression::Select { accept, .. } => past(accept)?.clone(), + crate::Expression::Derivative { axis: _, expr } => past(expr)?.clone(), crate::Expression::Relational { fun, argument } => match fun { crate::RelationalFunction::All | crate::RelationalFunction::Any => { TypeResolution::Value(Ti::Scalar { @@ -654,7 +669,7 @@ impl<'a> ResolveContext<'a> { crate::RelationalFunction::IsNan | crate::RelationalFunction::IsInf | crate::RelationalFunction::IsFinite - | crate::RelationalFunction::IsNormal => match *past(argument).inner_with(types) { + | crate::RelationalFunction::IsNormal => match *past(argument)?.inner_with(types) { Ti::Scalar { .. } => TypeResolution::Value(Ti::Scalar { kind: crate::ScalarKind::Bool, width: crate::BOOL_WIDTH, @@ -680,7 +695,7 @@ impl<'a> ResolveContext<'a> { arg3: _, } => { use crate::MathFunction as Mf; - let res_arg = past(arg); + let res_arg = past(arg)?; match fun { // comparison Mf::Abs | @@ -734,7 +749,7 @@ impl<'a> ResolveContext<'a> { let arg1 = arg1.ok_or_else(|| ResolveError::IncompatibleOperands( format!("{:?}(_, None)", fun) ))?; - match (res_arg.inner_with(types), past(arg1).inner_with(types)) { + match (res_arg.inner_with(types), past(arg1)?.inner_with(types)) { (&Ti::Vector {kind: _, size: columns,width}, &Ti::Vector{ size: rows, .. }) => TypeResolution::Value(Ti::Matrix { columns, rows, width }), (left, right) => return Err(ResolveError::IncompatibleOperands( @@ -833,7 +848,7 @@ impl<'a> ResolveContext<'a> { expr, kind, convert, - } => match *past(expr).inner_with(types) { + } => match *past(expr)?.inner_with(types) { Ti::Scalar { kind: _, width } => TypeResolution::Value(Ti::Scalar { kind, width: convert.unwrap_or(width), diff --git a/third_party/rust/naga/src/span.rs b/third_party/rust/naga/src/span.rs index 6d541210b9431..f9fb1111398af 100644 --- a/third_party/rust/naga/src/span.rs +++ b/third_party/rust/naga/src/span.rs @@ -3,6 +3,7 @@ use std::{error::Error, fmt, ops::Range}; /// A source code span, used for error reporting. #[derive(Clone, Copy, Debug, PartialEq, Default)] +#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Span { start: u32, end: u32, @@ -54,7 +55,7 @@ impl Span { } } - /// Check wether `self` was defined or is a default/unknown span + /// Check whether `self` was defined or is a default/unknown span pub fn is_defined(&self) -> bool { *self != Self::default() } diff --git a/third_party/rust/naga/src/valid/analyzer.rs b/third_party/rust/naga/src/valid/analyzer.rs index ab4d77c4216f8..28a0f8a8abd1f 100644 --- a/third_party/rust/naga/src/valid/analyzer.rs +++ b/third_party/rust/naga/src/valid/analyzer.rs @@ -10,7 +10,7 @@ use super::{CallError, ExpressionError, FunctionError, ModuleInfo, ShaderStages, use crate::span::{AddSpan as _, WithSpan}; use crate::{ arena::{Arena, Handle}, - proc::{ResolveContext, TypeResolution}, + proc::{ResolveContext, ResolveError, TypeResolution}, }; use std::ops; @@ -199,17 +199,51 @@ pub struct FunctionInfo { pub uniformity: Uniformity, /// Function may kill the invocation. pub may_kill: bool, - /// Set of image-sampler pais used with sampling. + + /// All pairs of (texture, sampler) globals that may be used together in + /// sampling operations by this function and its callees. This includes + /// pairings that arise when this function passes textures and samplers as + /// arguments to its callees. + /// + /// This table does not include uses of textures and samplers passed as + /// arguments to this function itself, since we do not know which globals + /// those will be. However, this table *is* exhaustive when computed for an + /// entry point function: entry points never receive textures or samplers as + /// arguments, so all an entry point's sampling can be reported in terms of + /// globals. + /// + /// The GLSL back end uses this table to construct reflection info that + /// clients need to construct texture-combined sampler values. pub sampling_set: crate::FastHashSet, - /// Vector of global variable usages. + + /// How this function and its callees use this module's globals. /// - /// Each item corresponds to a global variable in the module. + /// This is indexed by `Handle` indices. However, + /// `FunctionInfo` implements `std::ops::Index>`, + /// so you can simply index this struct with a global handle to retrieve + /// its usage information. global_uses: Box<[GlobalUse]>, - /// Vector of expression infos. + + /// Information about each expression in this function's body. /// - /// Each item corresponds to an expression in the function. + /// This is indexed by `Handle` indices. However, `FunctionInfo` + /// implements `std::ops::Index>`, so you can simply + /// index this struct with an expression handle to retrieve its + /// `ExpressionInfo`. expressions: Box<[ExpressionInfo]>, - /// HashSet with information about sampling realized by the function + + /// All (texture, sampler) pairs that may be used together in sampling + /// operations by this function and its callees, whether they are accessed + /// as globals or passed as arguments. + /// + /// Participants are represented by [`GlobalVariable`] handles whenever + /// possible, and otherwise by indices of this function's arguments. + /// + /// When analyzing a function call, we combine this data about the callee + /// with the actual arguments being passed to produce the callers' own + /// `sampling_set` and `sampling` tables. + /// + /// [`GlobalVariable`]: crate::GlobalVariable sampling: crate::FastHashSet, } @@ -266,7 +300,10 @@ impl FunctionInfo { handle: Handle, global_use: GlobalUse, ) -> NonUniformResult { - let info = &mut self.expressions[handle.index()]; + //Note: if the expression doesn't exist, this function + // will return `None`, but the later validation of + // expressions should detect this and error properly. + let info = self.expressions.get_mut(handle.index())?; info.ref_count += 1; // mark the used global as read if let Some(global) = info.assignable_global { @@ -290,7 +327,8 @@ impl FunctionInfo { handle: Handle, assignable_global: &mut Option>, ) -> NonUniformResult { - let info = &mut self.expressions[handle.index()]; + //Note: similarly to `add_ref_impl`, this ignores invalid expressions. + let info = self.expressions.get_mut(handle.index())?; info.ref_count += 1; // propagate the assignable global up the chain, till it either hits // a value-type expression, or the assignment statement. @@ -305,14 +343,15 @@ impl FunctionInfo { /// Inherit information from a called function. fn process_call( &mut self, - info: &Self, + callee: &Self, arguments: &[Handle], expression_arena: &Arena, ) -> Result> { - for key in info.sampling_set.iter() { - self.sampling_set.insert(key.clone()); - } - for sampling in info.sampling.iter() { + self.sampling_set + .extend(callee.sampling_set.iter().cloned()); + for sampling in callee.sampling.iter() { + // If the callee was passed the texture or sampler as an argument, + // we may now be able to determine which globals those referred to. let image_storage = match sampling.image { GlobalOrArgument::Global(var) => GlobalOrArgument::Global(var), GlobalOrArgument::Argument(i) => { @@ -339,6 +378,10 @@ impl FunctionInfo { } }; + // If we've managed to pin both the image and sampler down to + // specific globals, record that in our `sampling_set`. Otherwise, + // record as much as we do know in our own `sampling` table, for our + // callers to sort out. match (image_storage, sampler_storage) { (GlobalOrArgument::Global(image), GlobalOrArgument::Global(sampler)) => { self.sampling_set.insert(SamplingKey { image, sampler }); @@ -348,12 +391,15 @@ impl FunctionInfo { } } } - for (mine, other) in self.global_uses.iter_mut().zip(info.global_uses.iter()) { + + // Inherit global use from our callees. + for (mine, other) in self.global_uses.iter_mut().zip(callee.global_uses.iter()) { *mine |= *other; } + Ok(FunctionUniformity { - result: info.uniformity.clone(), - exit: if info.may_kill { + result: callee.uniformity.clone(), + exit: if callee.may_kill { ExitFlags::MAY_KILL } else { ExitFlags::empty() @@ -430,21 +476,21 @@ impl FunctionInfo { requirements: UniformityRequirements::empty(), } } - // depends on the storage class + // depends on the address space E::GlobalVariable(gh) => { - use crate::StorageClass as Sc; + use crate::AddressSpace as As; assignable_global = Some(gh); let var = &resolve_context.global_vars[gh]; - let uniform = match var.class { + let uniform = match var.space { // local data is non-uniform - Sc::Function | Sc::Private => false, + As::Function | As::Private => false, // workgroup memory is exclusively accessed by the group - Sc::WorkGroup => true, + As::WorkGroup => true, // uniform data - Sc::Uniform | Sc::PushConstant => true, + As::Uniform | As::PushConstant => true, // storage data is only uniform when read-only - Sc::Storage { access } => !access.contains(crate::StorageAccess::STORE), - Sc::Handle => false, + As::Storage { access } => !access.contains(crate::StorageAccess::STORE), + As::Handle => false, }; Uniformity { non_uniform_result: if uniform { None } else { Some(handle) }, @@ -511,16 +557,19 @@ impl FunctionInfo { image, coordinate, array_index, - index, + sample, + level, } => { let array_nur = array_index.and_then(|h| self.add_ref(h)); - let index_nur = index.and_then(|h| self.add_ref(h)); + let sample_nur = sample.and_then(|h| self.add_ref(h)); + let level_nur = level.and_then(|h| self.add_ref(h)); Uniformity { non_uniform_result: self .add_ref(image) .or(self.add_ref(coordinate)) .or(array_nur) - .or(index_nur), + .or(sample_nur) + .or(level_nur), requirements: UniformityRequirements::empty(), } } @@ -594,7 +643,12 @@ impl FunctionInfo { }, }; - let ty = resolve_context.resolve(expression, |h| &self.expressions[h.index()].ty)?; + let ty = resolve_context.resolve(expression, |h| { + self.expressions + .get(h.index()) + .map(|ei| &ei.ty) + .ok_or(ResolveError::ExpressionForwardDependency(h)) + })?; self.expressions[handle.index()] = ExpressionInfo { uniformity, ref_count: 0, @@ -629,7 +683,10 @@ impl FunctionInfo { S::Emit(ref range) => { let mut requirements = UniformityRequirements::empty(); for expr in range.clone() { - let req = self.expressions[expr.index()].uniformity.requirements; + let req = match self.expressions.get(expr.index()) { + Some(expr) => expr.uniformity.requirements, + None => UniformityRequirements::empty(), + }; #[cfg(feature = "validate")] if self .flags @@ -893,7 +950,7 @@ fn uniform_control_flow() { name: None, init: None, ty, - class: crate::StorageClass::Handle, + space: crate::AddressSpace::Handle, binding: None, }, Default::default(), @@ -904,7 +961,7 @@ fn uniform_control_flow() { init: None, ty, binding: None, - class: crate::StorageClass::Uniform, + space: crate::AddressSpace::Uniform, }, Default::default(), ); diff --git a/third_party/rust/naga/src/valid/compose.rs b/third_party/rust/naga/src/valid/compose.rs index 23599b5a040af..6e5c499223352 100644 --- a/third_party/rust/naga/src/valid/compose.rs +++ b/third_party/rust/naga/src/valid/compose.rs @@ -4,13 +4,13 @@ use crate::{ proc::TypeResolution, }; -use crate::Handle; +use crate::arena::{BadHandle, Handle}; #[derive(Clone, Debug, thiserror::Error)] #[cfg_attr(test, derive(PartialEq))] pub enum ComposeError { - #[error("Compose type {0:?} doesn't exist")] - TypeDoesntExist(Handle), + #[error(transparent)] + BadHandle(#[from] BadHandle), #[error("Composing of type {0:?} can't be done")] Type(Handle), #[error("Composing expects {expected} components but {given} were given")] @@ -28,9 +28,7 @@ pub fn validate_compose( ) -> Result<(), ComposeError> { use crate::TypeInner as Ti; - let self_ty = type_arena - .get_handle(self_ty_handle) - .ok_or(ComposeError::TypeDoesntExist(self_ty_handle))?; + let self_ty = type_arena.get_handle(self_ty_handle)?; match self_ty.inner { // vectors are composed from scalars or other vectors Ti::Vector { size, kind, width } => { diff --git a/third_party/rust/naga/src/valid/expression.rs b/third_party/rust/naga/src/valid/expression.rs index 4e59a9ef4bb12..7fb64ab988891 100644 --- a/third_party/rust/naga/src/valid/expression.rs +++ b/third_party/rust/naga/src/valid/expression.rs @@ -4,8 +4,8 @@ use super::{compose::validate_compose, FunctionInfo, ShaderStages, TypeFlags}; use crate::arena::UniqueArena; use crate::{ - arena::Handle, - proc::{ProcError, ResolveError}, + arena::{BadHandle, Handle}, + proc::{IndexableLengthError, ResolveError}, }; #[derive(Clone, Debug, thiserror::Error)] @@ -17,6 +17,8 @@ pub enum ExpressionError { NotInScope, #[error("Depends on {0:?}, which has not been processed yet")] ForwardDependency(Handle), + #[error(transparent)] + BadDependency(#[from] BadHandle), #[error("Base type {0:?} is not compatible with this expression")] InvalidBaseType(Handle), #[error("Accessing with index {0:?} can't be done")] @@ -27,12 +29,6 @@ pub enum ExpressionError { IndexMustBeConstant(Handle), #[error("Function argument {0:?} doesn't exist")] FunctionArgumentDoesntExist(u32), - #[error("Constant {0:?} doesn't exist")] - ConstantDoesntExist(Handle), - #[error("Global variable {0:?} doesn't exist")] - GlobalVarDoesntExist(Handle), - #[error("Local variable {0:?} doesn't exist")] - LocalVarDoesntExist(Handle), #[error("Loading of {0:?} can't be done")] InvalidPointerType(Handle), #[error("Array length of {0:?} can't be done")] @@ -46,7 +42,7 @@ pub enum ExpressionError { #[error(transparent)] Compose(#[from] super::ComposeError), #[error(transparent)] - Proc(#[from] ProcError), + IndexableLength(#[from] IndexableLengthError), #[error("Operation {0:?} can't work with {1:?}")] InvalidUnaryOperandType(crate::UnaryOperator, Handle), #[error("Operation {0:?} can't work with {1:?} and {2:?}")] @@ -79,11 +75,11 @@ pub enum ExpressionError { InvalidDerivative, #[error("Image array index parameter is misplaced")] InvalidImageArrayIndex, - #[error("Image other index parameter is misplaced")] + #[error("Inappropriate sample or level-of-detail index for texel access")] InvalidImageOtherIndex, #[error("Image array index type of {0:?} is not an integer scalar")] InvalidImageArrayIndexType(Handle), - #[error("Image other index type of {0:?} is not an integer scalar")] + #[error("Image sample or level-of-detail index's type of {0:?} is not an integer scalar")] InvalidImageOtherIndexType(Handle), #[error("Image coordinate type of {1:?} does not match dimension {0:?}")] InvalidImageCoordinateType(crate::ImageDimension, Handle), @@ -266,10 +262,7 @@ impl super::Validator { ShaderStages::all() } E::Constant(handle) => { - let _ = module - .constants - .try_get(handle) - .ok_or(ExpressionError::ConstantDoesntExist(handle))?; + let _ = module.constants.try_get(handle)?; ShaderStages::all() } E::Splat { size: _, value } => match *resolver.resolve(value)? { @@ -319,17 +312,11 @@ impl super::Validator { ShaderStages::all() } E::GlobalVariable(handle) => { - let _ = module - .global_variables - .try_get(handle) - .ok_or(ExpressionError::GlobalVarDoesntExist(handle))?; + let _ = module.global_variables.try_get(handle)?; ShaderStages::all() } E::LocalVariable(handle) => { - let _ = function - .local_variables - .try_get(handle) - .ok_or(ExpressionError::LocalVarDoesntExist(handle))?; + let _ = function.local_variables.try_get(handle)?; ShaderStages::all() } E::Load { pointer } => { @@ -550,7 +537,8 @@ impl super::Validator { image, coordinate, array_index, - index, + sample, + level, } => { let ty = match function.expressions[image] { crate::Expression::GlobalVariable(var_handle) => { @@ -573,16 +561,9 @@ impl super::Validator { )) } }; - let needs_index = match class { - crate::ImageClass::Storage { .. } => false, - _ => true, - }; if arrayed != array_index.is_some() { return Err(ExpressionError::InvalidImageArrayIndex); } - if needs_index != index.is_some() { - return Err(ExpressionError::InvalidImageOtherIndex); - } if let Some(expr) = array_index { match *resolver.resolve(expr)? { Ti::Scalar { @@ -592,13 +573,30 @@ impl super::Validator { _ => return Err(ExpressionError::InvalidImageArrayIndexType(expr)), } } - if let Some(expr) = index { - match *resolver.resolve(expr)? { - Ti::Scalar { - kind: Sk::Sint, - width: _, - } => {} - _ => return Err(ExpressionError::InvalidImageOtherIndexType(expr)), + + match (sample, class.is_multisampled()) { + (None, false) => {} + (Some(sample), true) => { + if resolver.resolve(sample)?.scalar_kind() != Some(Sk::Sint) { + return Err(ExpressionError::InvalidImageOtherIndexType( + sample, + )); + } + } + _ => { + return Err(ExpressionError::InvalidImageOtherIndex); + } + } + + match (level, class.is_mipmapped()) { + (None, false) => {} + (Some(level), true) => { + if resolver.resolve(level)?.scalar_kind() != Some(Sk::Sint) { + return Err(ExpressionError::InvalidImageOtherIndexType(level)); + } + } + _ => { + return Err(ExpressionError::InvalidImageOtherIndex); } } } @@ -616,18 +614,12 @@ impl super::Validator { }; match module.types[ty].inner { Ti::Image { class, arrayed, .. } => { - let can_level = match class { - crate::ImageClass::Sampled { multi, .. } => !multi, - crate::ImageClass::Depth { multi } => !multi, - crate::ImageClass::Storage { .. } => false, - }; let good = match query { crate::ImageQuery::NumLayers => arrayed, crate::ImageQuery::Size { level: None } => true, crate::ImageQuery::Size { level: Some(_) } - | crate::ImageQuery::NumLevels => can_level, - //TODO: forbid on storage images - crate::ImageQuery::NumSamples => !can_level, + | crate::ImageQuery::NumLevels => class.is_mipmapped(), + crate::ImageQuery::NumSamples => class.is_multisampled(), }; if !good { return Err(ExpressionError::InvalidImageClass(class)); @@ -1055,12 +1047,12 @@ impl super::Validator { _ => return Err(ExpressionError::InvalidArgumentType(fun, 0, arg)), }; let good = match *arg1_ty { - Ti::Pointer { base, class: _ } => module.types[base].inner == *arg_ty, + Ti::Pointer { base, space: _ } => module.types[base].inner == *arg_ty, Ti::ValuePointer { size, kind: Sk::Float, width, - class: _, + space: _, } => size == size0 && width == width0, _ => false, }; @@ -1072,7 +1064,28 @@ impl super::Validator { )); } } - Mf::Dot | Mf::Outer | Mf::Cross | Mf::Reflect => { + Mf::Dot => { + let arg1_ty = match (arg1_ty, arg2_ty, arg3_ty) { + (Some(ty1), None, None) => ty1, + _ => return Err(ExpressionError::WrongArgumentCount(fun)), + }; + match *arg_ty { + Ti::Vector { + kind: Sk::Float, .. + } + | Ti::Vector { kind: Sk::Sint, .. } + | Ti::Vector { kind: Sk::Uint, .. } => {} + _ => return Err(ExpressionError::InvalidArgumentType(fun, 0, arg)), + } + if arg1_ty != arg_ty { + return Err(ExpressionError::InvalidArgumentType( + fun, + 1, + arg1.unwrap(), + )); + } + } + Mf::Outer | Mf::Cross | Mf::Reflect => { let arg1_ty = match (arg1_ty, arg2_ty, arg3_ty) { (Some(ty1), None, None) => ty1, _ => return Err(ExpressionError::WrongArgumentCount(fun)), @@ -1396,10 +1409,11 @@ impl super::Validator { } E::ArrayLength(expr) => match *resolver.resolve(expr)? { Ti::Pointer { base, .. } => { - if let Some(&Ti::Array { + let base_ty = resolver.types.get_handle(base)?; + if let Ti::Array { size: crate::ArraySize::Dynamic, .. - }) = resolver.types.get_handle(base).map(|ty| &ty.inner) + } = base_ty.inner { ShaderStages::all() } else { diff --git a/third_party/rust/naga/src/valid/function.rs b/third_party/rust/naga/src/valid/function.rs index 0254775ec560e..4c1262ec7470c 100644 --- a/third_party/rust/naga/src/valid/function.rs +++ b/third_party/rust/naga/src/valid/function.rs @@ -1,6 +1,6 @@ -use crate::arena::Handle; #[cfg(feature = "validate")] use crate::arena::{Arena, UniqueArena}; +use crate::arena::{BadHandle, Handle}; use super::{ analyzer::{UniformityDisruptor, UniformityRequirements}, @@ -16,8 +16,8 @@ use bit_set::BitSet; #[derive(Clone, Debug, thiserror::Error)] #[cfg_attr(test, derive(PartialEq))] pub enum CallError { - #[error("Bad function")] - InvalidFunction, + #[error(transparent)] + BadHandle(#[from] BadHandle), #[error("The callee is declared after the caller")] ForwardDeclaredFunction, #[error("Argument {index} expression is invalid")] @@ -67,6 +67,8 @@ pub enum LocalVariableError { #[derive(Clone, Debug, thiserror::Error)] #[cfg_attr(test, derive(PartialEq))] pub enum FunctionError { + #[error(transparent)] + BadHandle(#[from] BadHandle), #[error("Expression {handle:?} is invalid")] Expression { handle: Handle, @@ -84,11 +86,11 @@ pub enum FunctionError { }, #[error("Argument '{name}' at index {index} has a type that can't be passed into functions.")] InvalidArgumentType { index: usize, name: String }, - #[error("Argument '{name}' at index {index} is a pointer of class {class:?}, which can't be passed into functions.")] - InvalidArgumentPointerClass { + #[error("Argument '{name}' at index {index} is a pointer of space {space:?}, which can't be passed into functions.")] + InvalidArgumentPointerSpace { index: usize, name: String, - class: crate::StorageClass, + space: crate::AddressSpace, }, #[error("There are instructions after `return`/`break`/`continue`")] InstructionsAfterReturn, @@ -121,8 +123,6 @@ pub enum FunctionError { pointer: Handle, value: Handle, }, - #[error("The expression {0:?} is currupted")] - InvalidExpression(Handle), #[error("Image store parameters are invalid")] InvalidImageStore(#[source] ExpressionError), #[error("Call to {function:?} is invalid")] @@ -201,9 +201,7 @@ impl<'a> BlockContext<'a> { &self, handle: Handle, ) -> Result<&'a crate::Expression, FunctionError> { - self.expressions - .try_get(handle) - .ok_or(FunctionError::InvalidExpression(handle)) + Ok(self.expressions.try_get(handle)?) } fn resolve_type_impl( @@ -256,7 +254,7 @@ impl super::Validator { let fun = context .functions .try_get(function) - .ok_or(CallError::InvalidFunction) + .map_err(CallError::BadHandle) .map_err(WithSpan::new)?; if fun.arguments.len() != arguments.len() { return Err(CallError::ArgumentCount { @@ -612,7 +610,7 @@ impl super::Validator { .map_err(|e| e.with_span())?; let good = match *pointer_ty { - Ti::Pointer { base, class: _ } => match context.types[base].inner { + Ti::Pointer { base, space: _ } => match context.types[base].inner { Ti::Atomic { kind, width } => *value_ty == Ti::Scalar { kind, width }, ref other => value_ty == other, }, @@ -620,13 +618,13 @@ impl super::Validator { size: Some(size), kind, width, - class: _, + space: _, } => *value_ty == Ti::Vector { size, kind, width }, Ti::ValuePointer { size: None, kind, width, - class: _, + space: _, } => *value_ty == Ti::Scalar { kind, width }, _ => false, }; @@ -637,8 +635,8 @@ impl super::Validator { .with_handle(value, context.expressions)); } - if let Some(class) = pointer_ty.pointer_class() { - if !class.access().contains(crate::StorageAccess::STORE) { + if let Some(space) = pointer_ty.pointer_space() { + if !space.access().contains(crate::StorageAccess::STORE) { return Err(FunctionError::InvalidStorePointer(pointer) .with_span_static( context.expressions.get_span(pointer), @@ -786,12 +784,17 @@ impl super::Validator { constants: &Arena, ) -> Result<(), LocalVariableError> { log::debug!("var {:?}", var); - if !self.types[var.ty.index()] + let type_info = self + .types + .get(var.ty.index()) + .ok_or(LocalVariableError::InvalidType(var.ty))?; + if !type_info .flags .contains(super::TypeFlags::DATA | super::TypeFlags::SIZED) { return Err(LocalVariableError::InvalidType(var.ty)); } + if let Some(const_handle) = var.init { match constants[const_handle].inner { crate::ConstantInner::Scalar { width, ref value } => { @@ -819,13 +822,8 @@ impl super::Validator { module: &crate::Module, mod_info: &ModuleInfo, ) -> Result> { - #[cfg(feature = "validate")] - let mut info = mod_info - .process_function(fun, module, self.flags) - .map_err(WithSpan::into_other)?; - - #[cfg(not(feature = "validate"))] - let info = mod_info.process_function(fun, module, self.flags)?; + #[cfg_attr(not(feature = "validate"), allow(unused_mut))] + let mut info = mod_info.process_function(fun, module, self.flags)?; #[cfg(feature = "validate")] for (var_handle, var) in fun.local_variables.iter() { @@ -843,16 +841,19 @@ impl super::Validator { #[cfg(feature = "validate")] for (index, argument) in fun.arguments.iter().enumerate() { - match module.types[argument.ty].inner.pointer_class() { - Some(crate::StorageClass::Private) - | Some(crate::StorageClass::Function) - | Some(crate::StorageClass::WorkGroup) + let ty = module.types.get_handle(argument.ty).map_err(|err| { + FunctionError::from(err).with_span_handle(argument.ty, &module.types) + })?; + match ty.inner.pointer_space() { + Some(crate::AddressSpace::Private) + | Some(crate::AddressSpace::Function) + | Some(crate::AddressSpace::WorkGroup) | None => {} Some(other) => { - return Err(FunctionError::InvalidArgumentPointerClass { + return Err(FunctionError::InvalidArgumentPointerSpace { index, name: argument.name.clone().unwrap_or_default(), - class: other, + space: other, } .with_span_handle(argument.ty, &module.types)) } diff --git a/third_party/rust/naga/src/valid/interface.rs b/third_party/rust/naga/src/valid/interface.rs index 72c6561abdc77..9b3393e5eb830 100644 --- a/third_party/rust/naga/src/valid/interface.rs +++ b/third_party/rust/naga/src/valid/interface.rs @@ -2,7 +2,7 @@ use super::{ analyzer::{FunctionInfo, GlobalUse}, Capabilities, Disalignment, FunctionError, ModuleInfo, }; -use crate::arena::{Handle, UniqueArena}; +use crate::arena::{BadHandle, Handle, UniqueArena}; use crate::span::{AddSpan as _, MapErrWithSpan as _, SpanProvider as _, WithSpan}; use bit_set::BitSet; @@ -12,10 +12,12 @@ const MAX_WORKGROUP_SIZE: u32 = 0x4000; #[derive(Clone, Debug, thiserror::Error)] pub enum GlobalVariableError { - #[error("Usage isn't compatible with the storage class")] - InvalidUsage, - #[error("Type isn't compatible with the storage class")] - InvalidType, + #[error(transparent)] + BadHandle(#[from] BadHandle), + #[error("Usage isn't compatible with address space {0:?}")] + InvalidUsage(crate::AddressSpace), + #[error("Type isn't compatible with address space {0:?}")] + InvalidType(crate::AddressSpace), #[error("Type flags {seen:?} do not meet the required {required:?}")] MissingTypeFlags { required: super::TypeFlags, @@ -25,8 +27,12 @@ pub enum GlobalVariableError { UnsupportedCapability(Capabilities), #[error("Binding decoration is missing or not applicable")] InvalidBinding, - #[error("Alignment requirements for this storage class are not met by {0:?}")] - Alignment(Handle, #[source] Disalignment), + #[error("Alignment requirements for address space {0:?} are not met by {1:?}")] + Alignment( + crate::AddressSpace, + Handle, + #[source] Disalignment, + ), } #[derive(Clone, Debug, thiserror::Error)] @@ -332,22 +338,35 @@ impl super::Validator { use super::TypeFlags; log::debug!("var {:?}", var); - let type_info = &self.types[var.ty.index()]; - - let (required_type_flags, is_resource) = match var.class { - crate::StorageClass::Function => return Err(GlobalVariableError::InvalidUsage), - crate::StorageClass::Storage { .. } => { + let type_info = self.types.get(var.ty.index()).ok_or_else(|| BadHandle { + kind: "type", + index: var.ty.index(), + })?; + + let (required_type_flags, is_resource) = match var.space { + crate::AddressSpace::Function => { + return Err(GlobalVariableError::InvalidUsage(var.space)) + } + crate::AddressSpace::Storage { .. } => { if let Err((ty_handle, disalignment)) = type_info.storage_layout { if self.flags.contains(super::ValidationFlags::STRUCT_LAYOUTS) { - return Err(GlobalVariableError::Alignment(ty_handle, disalignment)); + return Err(GlobalVariableError::Alignment( + var.space, + ty_handle, + disalignment, + )); } } (TypeFlags::DATA | TypeFlags::HOST_SHARED, true) } - crate::StorageClass::Uniform => { + crate::AddressSpace::Uniform => { if let Err((ty_handle, disalignment)) = type_info.uniform_layout { if self.flags.contains(super::ValidationFlags::STRUCT_LAYOUTS) { - return Err(GlobalVariableError::Alignment(ty_handle, disalignment)); + return Err(GlobalVariableError::Alignment( + var.space, + ty_handle, + disalignment, + )); } } ( @@ -355,11 +374,19 @@ impl super::Validator { true, ) } - crate::StorageClass::Handle => (TypeFlags::empty(), true), - crate::StorageClass::Private | crate::StorageClass::WorkGroup => { + crate::AddressSpace::Handle => { + match types[var.ty].inner { + crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } => {} + _ => { + return Err(GlobalVariableError::InvalidType(var.space)); + } + }; + (TypeFlags::empty(), true) + } + crate::AddressSpace::Private | crate::AddressSpace::WorkGroup => { (TypeFlags::DATA | TypeFlags::SIZED, false) } - crate::StorageClass::PushConstant => { + crate::AddressSpace::PushConstant => { if !self.capabilities.contains(Capabilities::PUSH_CONSTANT) { return Err(GlobalVariableError::UnsupportedCapability( Capabilities::PUSH_CONSTANT, @@ -372,16 +399,6 @@ impl super::Validator { } }; - let is_handle = var.class == crate::StorageClass::Handle; - let good_type = match types[var.ty].inner { - crate::TypeInner::Struct { .. } => !is_handle, - crate::TypeInner::Image { .. } | crate::TypeInner::Sampler { .. } => is_handle, - _ => false, - }; - if is_resource && !good_type { - return Err(GlobalVariableError::InvalidType); - } - if !type_info.flags.contains(required_type_flags) { return Err(GlobalVariableError::MissingTypeFlags { seen: type_info.flags, @@ -483,19 +500,19 @@ impl super::Validator { continue; } - let allowed_usage = match var.class { - crate::StorageClass::Function => unreachable!(), - crate::StorageClass::Uniform => GlobalUse::READ | GlobalUse::QUERY, - crate::StorageClass::Storage { access } => storage_usage(access), - crate::StorageClass::Handle => match module.types[var.ty].inner { + let allowed_usage = match var.space { + crate::AddressSpace::Function => unreachable!(), + crate::AddressSpace::Uniform => GlobalUse::READ | GlobalUse::QUERY, + crate::AddressSpace::Storage { access } => storage_usage(access), + crate::AddressSpace::Handle => match module.types[var.ty].inner { crate::TypeInner::Image { class: crate::ImageClass::Storage { access, .. }, .. } => storage_usage(access), _ => GlobalUse::READ | GlobalUse::QUERY, }, - crate::StorageClass::Private | crate::StorageClass::WorkGroup => GlobalUse::all(), - crate::StorageClass::PushConstant => GlobalUse::READ, + crate::AddressSpace::Private | crate::AddressSpace::WorkGroup => GlobalUse::all(), + crate::AddressSpace::PushConstant => GlobalUse::READ, }; if !allowed_usage.contains(usage) { log::warn!("\tUsage error for: {:?}", var); diff --git a/third_party/rust/naga/src/valid/mod.rs b/third_party/rust/naga/src/valid/mod.rs index 6b2c804757403..bc1a8dc6e8332 100644 --- a/third_party/rust/naga/src/valid/mod.rs +++ b/third_party/rust/naga/src/valid/mod.rs @@ -1,3 +1,7 @@ +/*! +Shader validator. +*/ + mod analyzer; mod compose; mod expression; @@ -9,8 +13,8 @@ mod r#type; use crate::arena::{Arena, UniqueArena}; use crate::{ - arena::Handle, - proc::{InvalidBaseType, Layouter}, + arena::{BadHandle, Handle}, + proc::{LayoutError, Layouter}, FastHashSet, }; use bit_set::BitSet; @@ -63,7 +67,7 @@ bitflags::bitflags! { #[cfg_attr(feature = "serialize", derive(serde::Serialize))] #[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] pub struct Capabilities: u8 { - /// Support for `StorageClass:PushConstant`. + /// Support for `AddressSpace:PushConstant`. const PUSH_CONSTANT = 0x1; /// Float values with width = 8. const FLOAT64 = 0x2; @@ -114,6 +118,8 @@ pub struct Validator { #[derive(Clone, Debug, thiserror::Error)] pub enum ConstantError { + #[error(transparent)] + BadHandle(#[from] BadHandle), #[error("The type doesn't match the constant")] InvalidType, #[error("The component handle {0:?} can not be resolved")] @@ -127,7 +133,7 @@ pub enum ConstantError { #[derive(Clone, Debug, thiserror::Error)] pub enum ValidationError { #[error(transparent)] - Layouter(#[from] InvalidBaseType), + Layouter(#[from] LayoutError), #[error("Type {handle:?} '{name}' is invalid")] Type { handle: Handle, @@ -225,6 +231,17 @@ impl Validator { } } + /// Reset the validator internals + pub fn reset(&mut self) { + self.types.clear(); + self.layouter.clear(); + self.location_mask.clear(); + self.bind_group_masks.clear(); + self.select_cases.clear(); + self.valid_expression_list.clear(); + self.valid_expression_set.clear(); + } + #[cfg(feature = "validate")] fn validate_constant( &self, @@ -240,7 +257,7 @@ impl Validator { } } crate::ConstantInner::Composite { ty, ref components } => { - match types[ty].inner { + match types.get_handle(ty)?.inner { crate::TypeInner::Array { size: crate::ArraySize::Constant(size_handle), .. @@ -270,11 +287,13 @@ impl Validator { &mut self, module: &crate::Module, ) -> Result> { + self.reset(); self.reset_types(module.types.len()); + self.layouter .update(&module.types, &module.constants) .map_err(|e| { - let InvalidBaseType(handle) = e; + let handle = e.ty; ValidationError::from(e).with_span_handle(handle, &module.types) })?; diff --git a/third_party/rust/naga/src/valid/type.rs b/third_party/rust/naga/src/valid/type.rs index cda1fa64a01f8..aae4fbd11be38 100644 --- a/third_party/rust/naga/src/valid/type.rs +++ b/third_party/rust/naga/src/valid/type.rs @@ -1,6 +1,6 @@ use super::Capabilities; use crate::{ - arena::{Arena, Handle, UniqueArena}, + arena::{Arena, BadHandle, Handle, UniqueArena}, proc::Alignment, }; @@ -72,6 +72,8 @@ pub enum Disalignment { #[derive(Clone, Debug, thiserror::Error)] pub enum TypeError { + #[error(transparent)] + BadHandle(#[from] BadHandle), #[error("The {0:?} scalar width {1} is not supported")] InvalidWidth(crate::ScalarKind, crate::Bytes), #[error("The {0:?} scalar width {1} is not supported for an atomic")] @@ -80,10 +82,10 @@ pub enum TypeError { UnresolvedBase(Handle), #[error("Invalid type for pointer target {0:?}")] InvalidPointerBase(Handle), - #[error("Unsized types like {base:?} must be in the `Storage` storage class, not `{class:?}`")] + #[error("Unsized types like {base:?} must be in the `Storage` address space, not `{space:?}`")] InvalidPointerToUnsized { base: Handle, - class: crate::StorageClass, + space: crate::AddressSpace, }, #[error("Expected data type, found {0:?}")] InvalidData(Handle), @@ -95,8 +97,8 @@ pub enum TypeError { UnsupportedSpecializedArrayLength(Handle), #[error("Array type {0:?} must have a length of one or more")] NonPositiveArrayLength(Handle), - #[error("Array stride {stride} is smaller than the base element size {base_size}")] - InsufficientArrayStride { stride: u32, base_size: u32 }, + #[error("Array stride {stride} does not match the expected {expected}")] + InvalidArrayStride { stride: u32, expected: u32 }, #[error("Field '{0}' can't be dynamically-sized, has type {1:?}")] InvalidDynamicArray(String, Handle), #[error("Structure member[{index}] at {offset} overlaps the previous member")] @@ -255,8 +257,8 @@ impl super::Validator { width as u32, ) } - Ti::Pointer { base, class } => { - use crate::StorageClass as Sc; + Ti::Pointer { base, space } => { + use crate::AddressSpace as As; if base >= handle { return Err(TypeError::UnresolvedBase(base)); @@ -268,8 +270,8 @@ impl super::Validator { } // Runtime-sized values can only live in the `Storage` storage - // class, so it's useless to have a pointer to such a type in - // any other class. + // space, so it's useless to have a pointer to such a type in + // any other space. // // Detecting this problem here prevents the definition of // functions like: @@ -279,25 +281,25 @@ impl super::Validator { // which would otherwise be permitted, but uncallable. (They // may also present difficulties in code generation). if !base_info.flags.contains(TypeFlags::SIZED) { - match class { - Sc::Storage { .. } => {} + match space { + As::Storage { .. } => {} _ => { - return Err(TypeError::InvalidPointerToUnsized { base, class }); + return Err(TypeError::InvalidPointerToUnsized { base, space }); } } } // Pointers passed as arguments to user-defined functions must // be in the `Function`, `Private`, or `Workgroup` storage - // class. We only mark pointers in those classes as `ARGUMENT`. + // space. We only mark pointers in those spaces as `ARGUMENT`. // // `Validator::validate_function` actually checks the storage - // class of pointer arguments explicitly before checking the + // space of pointer arguments explicitly before checking the // `ARGUMENT` flag, to give better error messages. But it seems // best to set `ARGUMENT` accurately anyway. - let argument_flag = match class { - Sc::Function | Sc::Private | Sc::WorkGroup => TypeFlags::ARGUMENT, - Sc::Uniform | Sc::Storage { .. } | Sc::Handle | Sc::PushConstant => { + let argument_flag = match space { + As::Function | As::Private | As::WorkGroup => TypeFlags::ARGUMENT, + As::Uniform | As::Storage { .. } | As::Handle | As::PushConstant => { TypeFlags::empty() } }; @@ -310,7 +312,7 @@ impl super::Validator { size: _, kind, width, - class: _, + space: _, } => { if !self.check_width(kind, width) { return Err(TypeError::InvalidWidth(kind, width)); @@ -326,18 +328,20 @@ impl super::Validator { return Err(TypeError::InvalidArrayBaseType(base)); } - let base_size = types[base].inner.span(constants); - if stride < base_size { - return Err(TypeError::InsufficientArrayStride { stride, base_size }); + let base_layout = self.layouter[base]; + let expected_stride = base_layout.to_stride(); + if stride != expected_stride { + return Err(TypeError::InvalidArrayStride { + stride, + expected: expected_stride, + }); } - let general_alignment = self.layouter[base].alignment; + let general_alignment = base_layout.alignment.get(); let uniform_layout = match base_info.uniform_layout { Ok(base_alignment) => { // combine the alignment requirements - let align = ((base_alignment.unwrap().get() - 1) - | (general_alignment.get() - 1)) - + 1; + let align = base_alignment.unwrap().get().max(general_alignment); if stride % align != 0 { Err(( handle, @@ -354,9 +358,7 @@ impl super::Validator { }; let storage_layout = match base_info.storage_layout { Ok(base_alignment) => { - let align = ((base_alignment.unwrap().get() - 1) - | (general_alignment.get() - 1)) - + 1; + let align = base_alignment.unwrap().get().max(general_alignment); if stride % align != 0 { Err(( handle, @@ -374,11 +376,12 @@ impl super::Validator { let sized_flag = match size { crate::ArraySize::Constant(const_handle) => { - let length_is_positive = match constants.try_get(const_handle) { - Some(&crate::Constant { + let constant = constants.try_get(const_handle)?; + let length_is_positive = match *constant { + crate::Constant { specialization: Some(_), .. - }) => { + } => { // Many of our back ends don't seem to support // specializable array lengths. If you want to try to make // this work, be sure to address all uses of @@ -388,28 +391,28 @@ impl super::Validator { const_handle, )); } - Some(&crate::Constant { + crate::Constant { inner: crate::ConstantInner::Scalar { width: _, value: crate::ScalarValue::Uint(length), }, .. - }) => length > 0, + } => length > 0, // Accept a signed integer size to avoid // requiring an explicit uint // literal. Type inference should make // this unnecessary. - Some(&crate::Constant { + crate::Constant { inner: crate::ConstantInner::Scalar { width: _, value: crate::ScalarValue::Sint(length), }, .. - }) => length > 0, - other => { - log::warn!("Array size {:?}", other); + } => length > 0, + _ => { + log::warn!("Array size {:?}", constant); return Err(TypeError::InvalidArraySizeConstant(const_handle)); } }; @@ -478,7 +481,9 @@ impl super::Validator { }); } } - let base_size = types[member.ty].inner.span(constants); + + //Note: `unwrap()` is fine because `Layouter` goes first and checks this + let base_size = types[member.ty].inner.size(constants); min_offset = member.offset + base_size; if min_offset > span { return Err(TypeError::MemberOutOfBounds { diff --git a/third_party/rust/wgpu-core/.cargo-checksum.json b/third_party/rust/wgpu-core/.cargo-checksum.json index 3e11c84585c9d..e6fd7c4a70a72 100644 --- a/third_party/rust/wgpu-core/.cargo-checksum.json +++ b/third_party/rust/wgpu-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"ecd9ed8e37868ab1c02cbb4452f738690e2f1632240ac35136460b4680b4343a","build.rs":"cf35ffe778a6f1f54e6adecce7401353827f468730703aa1531343cbbe4a3269","src/binding_model.rs":"218bfaa87b291be693c27ea496111c4a66edcbc585ce2661c060d5996822334b","src/command/bind.rs":"309f3f1b1719d25115d385368cff0a2c85e94da825b2930141db78235901c673","src/command/bundle.rs":"4519a28c5acc4a70de274ad7e577073beb85c5b273d7e6081b7e78e87154ae93","src/command/clear.rs":"88fa908ee5d887c37ff580a9b1bc01d6768d9420c51b50171583ae9b91425d68","src/command/compute.rs":"dc2d923fe1da2e16650f3a8525654f101c530709e4e15feafbad89480e0987a4","src/command/draw.rs":"e0215f58c3e669bf1a8048735ba89157fea3d6c20dcbb74e318eacf540f49e72","src/command/memory_init.rs":"f7c73879b9fa728039a45d78f1f865e4eca863c860b3775a4542c973dfdb68c5","src/command/mod.rs":"993b8a9806fa55f6d24eb6d49db353ab1ae1fc16cac5f4fb2557f6a3286df758","src/command/query.rs":"18659df22356493697ce1c5b56fe2ca0e2f3f1ef29bdf00d65f064eeecba5130","src/command/render.rs":"a394e2ca411d5615d6a3ff01a55eb1d122e1d05827b24fbdff2c50e84019b7c1","src/command/transfer.rs":"9bc55af0c4ad328250908fcbdac7d97a730d73bcf44532fdfbca05d639d08ba9","src/conv.rs":"15d87cd2a91cb9514273e86441940b86380861ec146796e5f214e95e4124d975","src/device/life.rs":"a418aaa4ba73a57cc069b9697925e308c5ecf04c022245221b9a2c9a4af9d204","src/device/mod.rs":"54aaa5bd53f5a92968d77309a1a324a5df2db3e4238ff52175e03301e4b63d3a","src/device/queue.rs":"c428e5ffdb5681711343ad99cf3590565cea24a6a0075820ff3726c1a150946a","src/device/trace.rs":"de575a8213c8ae9df711e4b6afe5736d71ac65bf141375fe044d3b6c4375e039","src/error.rs":"34a4adbb6ec669d8de22b932363506eeef1b1115c422bcc8daa3b26f62378518","src/hub.rs":"91db4c98ab653c3dd246153165f50b29df1076a419394426de86d21f1b157ebd","src/id.rs":"b8a834c2f508b52b581345a68ccd56726296f3e7c36a4b6b77b3d6531084b645","src/init_tracker/buffer.rs":"ccdddaace101f921463bf6c62ed5aca01a6520717a850b5d4442c3551e9f1875","src/init_tracker/mod.rs":"eb8fd33c95baaee5e618e6ae3c0d7b886eb23e7d94db1844d825c14cbbf48619","src/init_tracker/texture.rs":"75cf8753d850792ebc11da8ed7936836a23e12cbcdd52213a5e85ea3ff1412c1","src/instance.rs":"934a5a77024c5ad47ff7efbe45c7ea40dc062f56590caf75bf07cecf65731d8c","src/lib.rs":"6c88700dac8c08da9adaa098e37e4e6ef10bb6d3f0a7d5d5dd43f11ffdcbcb39","src/pipeline.rs":"ffabdc74656717276241b1ca2ed043fabf18795662a523828193aea99d7a9ef5","src/present.rs":"3e00e8545ce4ce808e2933516a73480ad89f9ed6733152df48215b551a2f5103","src/resource.rs":"c7af97875dc34bc56012bf59b3752af986cd7fdbc920767b733b973cb174797b","src/track/buffer.rs":"58828fa4bb6d9ca0f4c2549fd271b1ada738598675cc13714db99ef676c9332a","src/track/mod.rs":"372bda71187958b1db8689079a48dbc9cdbb6e011396b5851a4d6689cc279d80","src/track/range.rs":"d24340a235103fd18e740236ebfe59b434023bc07abaeebc11c4d7b44057e267","src/track/texture.rs":"f64028e06c215d7dc9d1ac293acbcc40e88b9dbf7eb0e010214f0327d4569794","src/validation.rs":"65c883b3fbc8e4c29fc57be98b6278593f8c51350d9fedea0b95dd990ab551f3"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"231910edbb16e23970a923b8e98840753b6c4f47af96265e5b6193836505a397","build.rs":"fedccfe06a4d75ba68233f0756de4161213c5d25851963f5b0521d8b7292b395","src/binding_model.rs":"218bfaa87b291be693c27ea496111c4a66edcbc585ce2661c060d5996822334b","src/command/bind.rs":"309f3f1b1719d25115d385368cff0a2c85e94da825b2930141db78235901c673","src/command/bundle.rs":"4519a28c5acc4a70de274ad7e577073beb85c5b273d7e6081b7e78e87154ae93","src/command/clear.rs":"9578d006d0707042e3ad89a6c9f5a1cd1eb363b16d2f73cfd2a708071b20e78f","src/command/compute.rs":"775d08b85c27cadfe7123b6312386099a165a72e1ff8fbdb25e9e84e23ca5623","src/command/draw.rs":"c04bdbcdabfdf5e3b4524bf155089b20185e283847ecfd628acc983101b2cbba","src/command/memory_init.rs":"f7c73879b9fa728039a45d78f1f865e4eca863c860b3775a4542c973dfdb68c5","src/command/mod.rs":"993b8a9806fa55f6d24eb6d49db353ab1ae1fc16cac5f4fb2557f6a3286df758","src/command/query.rs":"18659df22356493697ce1c5b56fe2ca0e2f3f1ef29bdf00d65f064eeecba5130","src/command/render.rs":"a394e2ca411d5615d6a3ff01a55eb1d122e1d05827b24fbdff2c50e84019b7c1","src/command/transfer.rs":"6277878f4d99516bd7db5612aaf4fac280a46d48c44575a7c5f501d6fbae5c61","src/conv.rs":"15d87cd2a91cb9514273e86441940b86380861ec146796e5f214e95e4124d975","src/device/life.rs":"72ae33cc066ca1537c89ba1c7b12dab89957ea0449a4348e007a73aad471f4a5","src/device/mod.rs":"3a4141ac6cc017f1232f06626be0f2e00c6572db7172e136d0e65bf6d128f356","src/device/queue.rs":"3d3da38dc47530e0692afdc011055e8453c8366146e134fa7df3000755c3511c","src/device/trace.rs":"de575a8213c8ae9df711e4b6afe5736d71ac65bf141375fe044d3b6c4375e039","src/error.rs":"34a4adbb6ec669d8de22b932363506eeef1b1115c422bcc8daa3b26f62378518","src/hub.rs":"5b6094b56b02c1a799e64ca6121f87dbb446e9e5bf1f7f3f2792a34b68c5d109","src/id.rs":"420ef1442ce4663b4f8c011117bdc20682aaea4ad7bfa08c526ea3022a7b6d27","src/init_tracker/buffer.rs":"ccdddaace101f921463bf6c62ed5aca01a6520717a850b5d4442c3551e9f1875","src/init_tracker/mod.rs":"273c6ee67a927784a617899c6fe5560e47108248ab67cabdc2eebcba53133364","src/init_tracker/texture.rs":"75cf8753d850792ebc11da8ed7936836a23e12cbcdd52213a5e85ea3ff1412c1","src/instance.rs":"30890e69af605c18c0402134cd7475ee504694e69d2ae1a50432053d3e90448c","src/lib.rs":"f7101b4e0476e90d1ab7be5575d26855e074afb868a2f6f8dbcff04040e56689","src/pipeline.rs":"ffabdc74656717276241b1ca2ed043fabf18795662a523828193aea99d7a9ef5","src/present.rs":"9967f14eb3163525bcd382e12995e0a99886e611ec52d325eafeb5429fd2723a","src/resource.rs":"2eb571779b9e1f3adaa67861a8d982ab58ade510023e6910936a0a1a952fd9e8","src/track/buffer.rs":"58828fa4bb6d9ca0f4c2549fd271b1ada738598675cc13714db99ef676c9332a","src/track/mod.rs":"753e8041bc4d10da311b95544e768f5f6dab235763305708632d8ad5a3f7984c","src/track/range.rs":"d24340a235103fd18e740236ebfe59b434023bc07abaeebc11c4d7b44057e267","src/track/texture.rs":"f64028e06c215d7dc9d1ac293acbcc40e88b9dbf7eb0e010214f0327d4569794","src/validation.rs":"ffcf231ad426c7937bb4d040965a60eb6016e8482a5a9a2ec9bfd413019d99e3"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-core/Cargo.toml b/third_party/rust/wgpu-core/Cargo.toml index 4460086e262bb..9d059ea58851d 100644 --- a/third_party/rust/wgpu-core/Cargo.toml +++ b/third_party/rust/wgpu-core/Cargo.toml @@ -20,6 +20,8 @@ trace = ["ron", "serde", "wgt/trace", "arrayvec/serde", "naga/serialize"] replay = ["serde", "wgt/replay", "arrayvec/serde", "naga/deserialize"] # Enable serializable compute/render passes, and bundle encoders. serial-pass = ["serde", "wgt/serde", "arrayvec/serde"] +id32 = [] +vulkan-portability = ["hal/vulkan"] [dependencies] arrayvec = "0.7" @@ -38,7 +40,7 @@ thiserror = "1" [dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "c0b7ac7" +rev = "f90e563" #version = "0.8" features = ["span", "validate", "wgsl-in"] @@ -63,7 +65,10 @@ hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.12", features = hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.12", features = ["vulkan", "gles", "renderdoc"] } [target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies] -hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.12", features = ["vulkan", "dx12", "renderdoc"] } +hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.12", features = ["vulkan", "dx12", "dx11", "renderdoc"] } + +[target.'cfg(target_os = "emscripten")'.dependencies] +hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.12", features = ["emscripten"] } [build-dependencies] cfg_aliases = "0.1" diff --git a/third_party/rust/wgpu-core/build.rs b/third_party/rust/wgpu-core/build.rs index ed0959da81827..445ea245d26b6 100644 --- a/third_party/rust/wgpu-core/build.rs +++ b/third_party/rust/wgpu-core/build.rs @@ -7,10 +7,10 @@ fn main() { unix_wo_apple: {all(unix, not(apple))}, // Backends - vulkan: { all(not(wasm), any(windows, unix_wo_apple)) }, + vulkan: { all(not(wasm), any(windows, unix_wo_apple, feature = "vulkan-portability")) }, metal: { all(not(wasm), apple) }, dx12: { all(not(wasm), windows) }, - dx11: { all(false, not(wasm), windows) }, + dx11: { all(not(wasm), windows) }, gl: { any( unix_wo_apple, diff --git a/third_party/rust/wgpu-core/src/command/clear.rs b/third_party/rust/wgpu-core/src/command/clear.rs index 42d742ab5c21f..6a4ec982260bb 100644 --- a/third_party/rust/wgpu-core/src/command/clear.rs +++ b/third_party/rust/wgpu-core/src/command/clear.rs @@ -3,7 +3,6 @@ use std::{num::NonZeroU32, ops::Range}; #[cfg(feature = "trace")] use crate::device::trace::Command as TraceCommand; use crate::{ - align_to, command::CommandBuffer, device::Device, get_lowest_common_denom, @@ -14,7 +13,7 @@ use crate::{ track::{ResourceTracker, TextureSelector, TextureState}, }; -use hal::CommandEncoder as _; +use hal::{auxil::align_to, CommandEncoder as _}; use thiserror::Error; use wgt::{BufferAddress, BufferSize, BufferUsages, ImageSubresourceRange, TextureAspect}; diff --git a/third_party/rust/wgpu-core/src/command/compute.rs b/third_party/rust/wgpu-core/src/command/compute.rs index 4037bc1f3dcbe..8ffff41aa5ce7 100644 --- a/third_party/rust/wgpu-core/src/command/compute.rs +++ b/third_party/rust/wgpu-core/src/command/compute.rs @@ -117,7 +117,7 @@ pub struct ComputePassDescriptor<'a> { pub enum DispatchError { #[error("compute pipeline must be set")] MissingPipeline, - #[error("current compute pipeline has a layout which is incompatible with a currently set bind group, first differing at entry index {index}")] + #[error("the pipeline layout, associated with the current compute pipeline, contains a bind group layout at index {index} which is incompatible with the bind group layout associated with the bind group at {index}")] IncompatibleBindGroup { index: u32, //expected: BindGroupLayoutId, diff --git a/third_party/rust/wgpu-core/src/command/draw.rs b/third_party/rust/wgpu-core/src/command/draw.rs index b70a4de92e8c8..e8e53e3ade8f2 100644 --- a/third_party/rust/wgpu-core/src/command/draw.rs +++ b/third_party/rust/wgpu-core/src/command/draw.rs @@ -26,7 +26,7 @@ pub enum DrawError { MissingVertexBuffer { index: u32 }, #[error("index buffer must be set")] MissingIndexBuffer, - #[error("current render pipeline has a layout which is incompatible with a currently set bind group, first differing at entry index {index}")] + #[error("the pipeline layout, associated with the current render pipeline, contains a bind group layout at index {index} which is incompatible with the bind group layout associated with the bind group at {index}")] IncompatibleBindGroup { index: u32, //expected: BindGroupLayoutId, diff --git a/third_party/rust/wgpu-core/src/command/transfer.rs b/third_party/rust/wgpu-core/src/command/transfer.rs index 9e19828375e21..1033feecee0ce 100644 --- a/third_party/rust/wgpu-core/src/command/transfer.rs +++ b/third_party/rust/wgpu-core/src/command/transfer.rs @@ -3,7 +3,7 @@ use crate::device::trace::Command as TraceCommand; use crate::{ command::{CommandBuffer, CommandEncoderError}, conv, - device::Device, + device::{Device, MissingDownlevelFlags}, error::{ErrorFormatter, PrettyError}, hub::{Global, GlobalIdentityHandlerFactory, HalApi, Storage, Token}, id::{BufferId, CommandEncoderId, Id, TextureId, Valid}, @@ -108,6 +108,8 @@ pub enum TransferError { }, #[error(transparent)] MemoryInitFailure(#[from] super::ClearError), + #[error("Cannot encode this copy because of a missing downelevel flag")] + MissingDownlevelFlags(#[from] MissingDownlevelFlags), } impl PrettyError for TransferError { @@ -839,6 +841,18 @@ impl Global { ); } + if format_desc.sample_type == wgt::TextureSampleType::Depth + && !device + .downlevel + .flags + .contains(wgt::DownlevelFlags::DEPTH_TEXTURE_AND_BUFFER_COPIES) + { + return Err(TransferError::MissingDownlevelFlags(MissingDownlevelFlags( + wgt::DownlevelFlags::DEPTH_TEXTURE_AND_BUFFER_COPIES, + )) + .into()); + } + cmd_buf .buffer_memory_init_actions .extend(dst_buffer.initialization_status.create_action( diff --git a/third_party/rust/wgpu-core/src/device/life.rs b/third_party/rust/wgpu-core/src/device/life.rs index 91756ec776f89..9d0c8d96e36d9 100644 --- a/third_party/rust/wgpu-core/src/device/life.rs +++ b/third_party/rust/wgpu-core/src/device/life.rs @@ -81,7 +81,7 @@ impl SuspectedResources { } } -/// A struct that keeps lists of resources that are no longer needed. +/// Raw backend resources that should be freed shortly. #[derive(Debug)] struct NonReferencedResources { buffers: Vec, @@ -189,10 +189,29 @@ impl NonReferencedResources { } } +/// Resources used by a queue submission, and work to be done once it completes. struct ActiveSubmission { + /// The index of the submission we track. + /// + /// When `Device::fence`'s value is greater than or equal to this, our queue + /// submission has completed. index: SubmissionIndex, + + /// Resources to be freed once this queue submission has completed. + /// + /// When the device is polled, for completed submissions, + /// `triage_submissions` merges these into + /// `LifetimeTracker::free_resources`. From there, + /// `LifetimeTracker::cleanup` passes them to the hal to be freed. + /// + /// This includes things like temporary resources and resources that are + /// used by submitted commands but have been dropped by the user (meaning that + /// this submission is their last reference.) last_resources: NonReferencedResources, + + /// Buffers to be mapped once this submission has completed. mapped: Vec>, + encoders: Vec>, work_done_closures: SmallVec<[SubmittedWorkDoneClosure; 1]>, } @@ -205,31 +224,75 @@ pub enum WaitIdleError { StuckGpu, } -/// A struct responsible for tracking resource lifetimes. +/// Resource tracking for a device. +/// +/// ## Host mapping buffers +/// +/// A buffer cannot be mapped until all active queue submissions that use it +/// have completed. To that end: +/// +/// - Each buffer's `LifeGuard::submission_index` records the index of the +/// most recent queue submission that uses that buffer. +/// +/// - Calling `map_async` adds the buffer to `self.mapped`, and changes +/// `Buffer::map_state` to prevent it from being used in any new +/// submissions. +/// +/// - When the device is polled, the following `LifetimeTracker` methods decide +/// what should happen next: +/// +/// 1) `triage_mapped` drains `self.mapped`, checking the submission index +/// of each buffer against the queue submissions that have finished +/// execution. Buffers used by submissions still in flight go in +/// `self.active[index].mapped`, and the rest go into +/// `self.ready_to_map`. +/// +/// 2) `triage_submissions` moves entries in `self.active[i]` for completed +/// submissions to `self.ready_to_map`. At this point, both +/// `self.active` and `self.ready_to_map` are up to date with the given +/// submission index. /// -/// Here is how host mapping is handled: -/// 1. When mapping is requested we add the buffer to the life_tracker list of `mapped` buffers. -/// 2. When `triage_suspected` is called, it checks the last submission index associated with each of the mapped buffer, -/// and register the buffer with either a submission in flight, or straight into `ready_to_map` vector. -/// 3. When `ActiveSubmission` is retired, the mapped buffers associated with it are moved to `ready_to_map` vector. -/// 4. Finally, `handle_mapping` issues all the callbacks. +/// 3) `handle_mapping` drains `self.ready_to_map` and actually maps the +/// buffers, collecting a list of notification closures to call. But any +/// buffers that were dropped by the user get moved to +/// `self.free_resources`. +/// +/// 4) `cleanup` frees everything in `free_resources`. +/// +/// Only `self.mapped` holds a `RefCount` for the buffer; it is dropped by +/// `triage_mapped`. pub(super) struct LifetimeTracker { - /// Resources that the user has requested be mapped, but are still in use. + /// Resources that the user has requested be mapped, but which are used by + /// queue submissions still in flight. mapped: Vec>, + /// Buffers can be used in a submission that is yet to be made, by the /// means of `write_buffer()`, so we have a special place for them. pub future_suspected_buffers: Vec>, + /// Textures can be used in the upcoming submission by `write_texture`. pub future_suspected_textures: Vec>, + /// Resources that are suspected for destruction. pub suspected_resources: SuspectedResources, - /// Resources that are not referenced any more but still used by GPU. - /// Grouped by submissions associated with a fence and a submission index. - /// The active submissions have to be stored in FIFO order: oldest come first. + + /// Resources used by queue submissions still in flight. One entry per + /// submission, with older submissions appearing before younger. + /// + /// Entries are added by `track_submission` and drained by + /// `LifetimeTracker::triage_submissions`. Lots of methods contribute data + /// to particular entries. active: Vec>, - /// Resources that are neither referenced or used, just life_tracker - /// actual deletion. + + /// Raw backend resources that are neither referenced nor used. + /// + /// These are freed by `LifeTracker::cleanup`, which is called from periodic + /// maintenance functions like `Global::device_poll`, and when a device is + /// destroyed. free_resources: NonReferencedResources, + + /// Buffers the user has asked us to map, and which are not used by any + /// queue submission still in flight. ready_to_map: Vec>, } @@ -246,6 +309,12 @@ impl LifetimeTracker { } } + /// Return true if there are no queue submissions still in flight. + pub fn queue_empty(&self) -> bool { + self.active.is_empty() + } + + /// Start tracking resources associated with a new queue submission. pub fn track_submission( &mut self, index: SubmissionIndex, @@ -289,7 +358,27 @@ impl LifetimeTracker { self.mapped.push(Stored { value, ref_count }); } - /// Returns the last submission index that is done. + /// Sort out the consequences of completed submissions. + /// + /// Assume that all submissions up through `last_done` have completed. + /// + /// - Buffers used by those submissions are now ready to map, if + /// requested. Add any buffers in the submission's [`mapped`] list to + /// [`self.ready_to_map`], where [`LifetimeTracker::handle_mapping`] will find + /// them. + /// + /// - Resources whose final use was in those submissions are now ready to + /// free. Add any resources in the submission's [`last_resources`] table + /// to [`self.free_resources`], where [`LifetimeTracker::cleanup`] will find + /// them. + /// + /// Return a list of [`SubmittedWorkDoneClosure`]s to run. + /// + /// [`mapped`]: ActiveSubmission::mapped + /// [`self.ready_to_map`]: LifetimeTracker::ready_to_map + /// [`last_resources`]: ActiveSubmission::last_resources + /// [`self.free_resources`]: LifetimeTracker::free_resources + /// [`SubmittedWorkDoneClosure`]: crate::device::queue::SubmittedWorkDoneClosure #[must_use] pub fn triage_submissions( &mut self, @@ -304,7 +393,7 @@ impl LifetimeTracker { .active .iter() .position(|a| a.index > last_done) - .unwrap_or_else(|| self.active.len()); + .unwrap_or(self.active.len()); let mut work_done_closures = SmallVec::new(); for a in self.active.drain(..done_count) { @@ -360,6 +449,45 @@ impl LifetimeTracker { } impl LifetimeTracker { + /// Identify resources to free, according to `trackers` and `self.suspected_resources`. + /// + /// Given `trackers`, the [`TrackerSet`] belonging to same [`Device`] as + /// `self`, and `hub`, the [`Hub`] to which that `Device` belongs: + /// + /// Remove from `trackers` each resource mentioned in + /// [`self.suspected_resources`]. If `trackers` held the final reference to + /// that resource, add it to the appropriate free list, to be destroyed by + /// the hal: + /// + /// - Add resources used by queue submissions still in flight to the + /// [`last_resources`] table of the last such submission's entry in + /// [`self.active`]. When that submission has finished execution. the + /// [`triage_submissions`] method will move them to + /// [`self.free_resources`]. + /// + /// - Add resources that can be freed right now to [`self.free_resources`] + /// directly. [`LifetimeTracker::cleanup`] will take care of them as + /// part of this poll. + /// + /// ## Entrained resources + /// + /// This function finds resources that are used only by other resources + /// ready to be freed, and adds those to the free lists as well. For + /// example, if there's some texture `T` used only by some texture view + /// `TV`, then if `TV` can be freed, `T` gets added to the free lists too. + /// + /// Since `wgpu-core` resource ownership patterns are acyclic, we can visit + /// each type that can be owned after all types that could possibly own + /// it. This way, we can detect all free-able objects in a single pass, + /// simply by starting with types that are roots of the ownership DAG (like + /// render bundles) and working our way towards leaf types (like buffers). + /// + /// [`Device`]: super::Device + /// [`self.suspected_resources`]: LifetimeTracker::suspected_resources + /// [`last_resources`]: ActiveSubmission::last_resources + /// [`self.active`]: LifetimeTracker::active + /// [`triage_submissions`]: LifetimeTracker::triage_submissions + /// [`self.free_resources`]: LifetimeTracker::free_resources pub(super) fn triage_suspected( &mut self, hub: &Hub, @@ -375,6 +503,7 @@ impl LifetimeTracker { while let Some(id) = self.suspected_resources.render_bundles.pop() { if trackers.bundles.remove_abandoned(id) { + log::debug!("Bundle {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyRenderBundle(id.0)); @@ -393,6 +522,7 @@ impl LifetimeTracker { while let Some(id) = self.suspected_resources.bind_groups.pop() { if trackers.bind_groups.remove_abandoned(id) { + log::debug!("Bind group {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyBindGroup(id.0)); @@ -424,6 +554,7 @@ impl LifetimeTracker { let mut list = mem::take(&mut self.suspected_resources.texture_views); for id in list.drain(..) { if trackers.views.remove_abandoned(id) { + log::debug!("Texture view {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyTextureView(id.0)); @@ -450,6 +581,7 @@ impl LifetimeTracker { for id in self.suspected_resources.textures.drain(..) { if trackers.textures.remove_abandoned(id) { + log::debug!("Texture {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyTexture(id.0)); @@ -486,6 +618,7 @@ impl LifetimeTracker { for id in self.suspected_resources.samplers.drain(..) { if trackers.samplers.remove_abandoned(id) { + log::debug!("Sampler {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroySampler(id.0)); @@ -510,11 +643,11 @@ impl LifetimeTracker { for id in self.suspected_resources.buffers.drain(..) { if trackers.buffers.remove_abandoned(id) { + log::debug!("Buffer {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyBuffer(id.0)); } - log::debug!("Buffer {:?} is detached", id); if let Some(res) = hub.buffers.unregister_locked(id.0, &mut *guard) { let submit_index = res.life_guard.life_count(); @@ -538,6 +671,7 @@ impl LifetimeTracker { for id in self.suspected_resources.compute_pipelines.drain(..) { if trackers.compute_pipes.remove_abandoned(id) { + log::debug!("Compute pipeline {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyComputePipeline(id.0)); @@ -562,6 +696,7 @@ impl LifetimeTracker { for id in self.suspected_resources.render_pipelines.drain(..) { if trackers.render_pipes.remove_abandoned(id) { + log::debug!("Render pipeline {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyRenderPipeline(id.0)); @@ -590,6 +725,7 @@ impl LifetimeTracker { { //Note: this has to happen after all the suspected pipelines are destroyed if ref_count.load() == 1 { + log::debug!("Pipeline layout {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyPipelineLayout(id.0)); @@ -614,6 +750,7 @@ impl LifetimeTracker { //Note: same BGL can appear multiple times in the list, but only the last // encounter could drop the refcount to 0. if guard[id].multi_ref_count.dec_and_check_empty() { + log::debug!("Bind group layout {:?} will be destroyed", id); #[cfg(feature = "trace")] if let Some(t) = trace { t.lock().add(trace::Action::DestroyBindGroupLayout(id.0)); @@ -631,6 +768,7 @@ impl LifetimeTracker { for id in self.suspected_resources.query_sets.drain(..) { if trackers.query_sets.remove_abandoned(id) { + log::debug!("Query set {:?} will be destroyed", id); // #[cfg(feature = "trace")] // trace.map(|t| t.lock().add(trace::Action::DestroyComputePipeline(id.0))); if let Some(res) = hub.query_sets.unregister_locked(id.0, &mut *guard) { @@ -647,6 +785,10 @@ impl LifetimeTracker { } } + /// Determine which buffers are ready to map, and which must wait for the + /// GPU. + /// + /// See the documentation for [`LifetimeTracker`] for details. pub(super) fn triage_mapped( &mut self, hub: &Hub, @@ -677,6 +819,11 @@ impl LifetimeTracker { } } + /// Map the buffers in `self.ready_to_map`. + /// + /// Return a list of mapping notifications to send. + /// + /// See the documentation for [`LifetimeTracker`] for details. #[must_use] pub(super) fn handle_mapping( &mut self, diff --git a/third_party/rust/wgpu-core/src/device/mod.rs b/third_party/rust/wgpu-core/src/device/mod.rs index 057f0751f40c6..62fa2386c42da 100644 --- a/third_party/rust/wgpu-core/src/device/mod.rs +++ b/third_party/rust/wgpu-core/src/device/mod.rs @@ -10,8 +10,8 @@ use crate::{ instance, pipeline, present, resource, track::{BufferState, TextureSelector, TextureState, TrackerSet, UsageConflict}, validation::{self, check_buffer_usage, check_texture_usage}, - FastHashMap, Label, LabelHelpers as _, LifeGuard, MultiRefCount, Stored, SubmissionIndex, - DOWNLEVEL_ERROR_MESSAGE, + FastHashMap, Label, LabelHelpers as _, LifeGuard, MultiRefCount, RefCount, Stored, + SubmissionIndex, DOWNLEVEL_ERROR_MESSAGE, }; use arrayvec::ArrayVec; @@ -76,21 +76,23 @@ pub(crate) struct RenderPassContext { } #[derive(Clone, Debug, Error)] pub enum RenderPassCompatibilityError { - #[error("Incompatible color attachment: {0:?} != {1:?}")] + #[error("Incompatible color attachment: the renderpass expected {0:?} but was given {1:?}")] IncompatibleColorAttachment( ArrayVec, ArrayVec, ), - #[error("Incompatible depth-stencil attachment: {0:?} != {1:?}")] + #[error( + "Incompatible depth-stencil attachment: the renderpass expected {0:?} but was given {1:?}" + )] IncompatibleDepthStencilAttachment(Option, Option), - #[error("Incompatible sample count: {0:?} != {1:?}")] + #[error("Incompatible sample count: the renderpass expected {0:?} but was given {1:?}")] IncompatibleSampleCount(u32, u32), - #[error("Incompatible multiview: {0:?} != {1:?}")] + #[error("Incompatible multiview: the renderpass expected {0:?} but was given {1:?}")] IncompatibleMultiview(Option, Option), } impl RenderPassContext { - // Assumed the renderpass only contains one subpass + // Assumes the renderpass only contains one subpass pub(crate) fn check_compatible( &self, other: &Self, @@ -264,13 +266,26 @@ pub struct Device { //desc_allocator: Mutex>, //Note: The submission index here corresponds to the last submission that is done. pub(crate) life_guard: LifeGuard, + + /// A clone of `life_guard.ref_count`. + /// + /// Holding a separate clone of the `RefCount` here lets us tell whether the + /// device is referenced by other resources, even if `life_guard.ref_count` + /// was set to `None` by a call to `device_drop`. + ref_count: RefCount, + command_allocator: Mutex>, pub(crate) active_submission_index: SubmissionIndex, fence: A::Fence, + + /// All live resources allocated with this [`Device`]. + /// /// Has to be locked temporarily only (locked last) pub(crate) trackers: Mutex, // Life tracker should be locked right after the device and before anything else. life_tracker: Mutex>, + /// Temporary storage for resource management functions. Cleared at the end + /// of every call (unless an error occurs). temp_suspected: life::SuspectedResources, pub(crate) alignments: hal::Alignments, pub(crate) limits: wgt::Limits, @@ -367,12 +382,15 @@ impl Device { })); } + let life_guard = LifeGuard::new(""); + let ref_count = life_guard.add_ref(); Ok(Self { raw: open.device, adapter_id, queue: open.queue, zero_buffer, - life_guard: LifeGuard::new(""), + life_guard, + ref_count, command_allocator: Mutex::new(com_alloc), active_submission_index: 0, fence, @@ -409,15 +427,30 @@ impl Device { self.life_tracker.lock() } + /// Check this device for completed commands. + /// + /// Return a pair `(closures, queue_empty)`, where: + /// + /// - `closures` is a list of actions to take: mapping buffers, notifying the user + /// + /// - `queue_empty` is a boolean indicating whether there are more queue + /// submissions still in flight. (We have to take the locks needed to + /// produce this information for other reasons, so we might as well just + /// return it to our callers.) fn maintain<'this, 'token: 'this, G: GlobalIdentityHandlerFactory>( &'this self, hub: &Hub, force_wait: bool, token: &mut Token<'token, Self>, - ) -> Result { + ) -> Result<(UserClosures, bool), WaitIdleError> { profiling::scope!("maintain", "Device"); let mut life_tracker = self.lock_life(token); + // Normally, `temp_suspected` exists only to save heap + // allocations: it's cleared at the start of the function + // call, and cleared by the end. But `Global::queue_submit` is + // fallible; if it exits early, it may leave some resources in + // `temp_suspected`. life_tracker .suspected_resources .extend(&self.temp_suspected); @@ -452,10 +485,11 @@ impl Device { let mapping_closures = life_tracker.handle_mapping(hub, &self.raw, &self.trackers, token); life_tracker.cleanup(&self.raw); - Ok(UserClosures { + let closures = UserClosures { mappings: mapping_closures, submissions: submission_closures, - }) + }; + Ok((closures, life_tracker.queue_empty())) } fn untrack<'this, 'token: 'this, G: GlobalIdentityHandlerFactory>( @@ -637,14 +671,29 @@ impl Device { ) -> Result, resource::CreateTextureError> { let format_desc = desc.format.describe(); - // Depth textures can only be 2D - if format_desc.sample_type == wgt::TextureSampleType::Depth - && desc.dimension != wgt::TextureDimension::D2 - { - return Err(resource::CreateTextureError::InvalidDepthKind( - desc.dimension, - desc.format, - )); + if desc.dimension != wgt::TextureDimension::D2 { + // Depth textures can only be 2D + if format_desc.sample_type == wgt::TextureSampleType::Depth { + return Err(resource::CreateTextureError::InvalidDepthDimension( + desc.dimension, + desc.format, + )); + } + // Renderable textures can only be 2D + if desc.usage.contains(wgt::TextureUsages::RENDER_ATTACHMENT) { + return Err(resource::CreateTextureError::InvalidDimensionUsages( + wgt::TextureUsages::RENDER_ATTACHMENT, + desc.dimension, + )); + } + + // Compressed textures can only be 2D + if format_desc.is_compressed() { + return Err(resource::CreateTextureError::InvalidCompressedDimension( + desc.dimension, + desc.format, + )); + } } let format_features = self @@ -657,7 +706,7 @@ impl Device { let missing_allowed_usages = desc.usage - format_features.allowed_usages; if !missing_allowed_usages.is_empty() { - return Err(resource::CreateTextureError::InvalidUsages( + return Err(resource::CreateTextureError::InvalidFormatUsages( missing_allowed_usages, desc.format, )); @@ -994,6 +1043,10 @@ impl Device { self.require_features(wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER)?; } + if desc.border_color == Some(wgt::SamplerBorderColor::Zero) { + self.require_features(wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO)?; + } + let lod_clamp = if desc.lod_min_clamp > 0.0 || desc.lod_max_clamp < 32.0 { Some(desc.lod_min_clamp..desc.lod_max_clamp) } else { @@ -2300,7 +2353,7 @@ impl Device { .any(|ct| ct.write_mask != first.write_mask || ct.blend != first.blend) } { log::info!("Color targets: {:?}", color_targets); - self.require_downlevel_flags(wgt::DownlevelFlags::INDEPENDENT_BLENDING)?; + self.require_downlevel_flags(wgt::DownlevelFlags::INDEPENDENT_BLEND)?; } let mut io = validation::StageIo::default(); @@ -2722,10 +2775,13 @@ impl Device { let format_desc = format.describe(); self.require_features(format_desc.required_features)?; - if self + let using_device_features = self .features - .contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES) - { + .contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES); + // If we're running downlevel, we need to manually ask the backend what we can use as we can't trust WebGPU. + let downlevel = !self.downlevel.is_webgpu_compliant(); + + if using_device_features || downlevel { Ok(adapter.get_texture_format_features(format)) } else { Ok(format_desc.guaranteed_format_features) @@ -3289,11 +3345,11 @@ impl Global { pub fn buffer_drop(&self, buffer_id: id::BufferId, wait: bool) { profiling::scope!("drop", "Buffer"); + log::debug!("buffer {:?} is dropped", buffer_id); let hub = A::hub(self); let mut token = Token::root(); - log::info!("Buffer {:?} is dropped", buffer_id); let (ref_count, last_submit_index, device_id) = { let (mut buffer_guard, _) = hub.buffers.write(&mut token); match buffer_guard.get_mut(buffer_id) { @@ -3531,6 +3587,7 @@ impl Global { pub fn texture_drop(&self, texture_id: id::TextureId, wait: bool) { profiling::scope!("drop", "Texture"); + log::debug!("texture {:?} is dropped", texture_id); let hub = A::hub(self); let mut token = Token::root(); @@ -3636,6 +3693,7 @@ impl Global { wait: bool, ) -> Result<(), resource::TextureViewDestroyError> { profiling::scope!("drop", "TextureView"); + log::debug!("texture view {:?} is dropped", texture_view_id); let hub = A::hub(self); let mut token = Token::root(); @@ -3729,6 +3787,7 @@ impl Global { pub fn sampler_drop(&self, sampler_id: id::SamplerId) { profiling::scope!("drop", "Sampler"); + log::debug!("sampler {:?} is dropped", sampler_id); let hub = A::hub(self); let mut token = Token::root(); @@ -3828,6 +3887,7 @@ impl Global { pub fn bind_group_layout_drop(&self, bind_group_layout_id: id::BindGroupLayoutId) { profiling::scope!("drop", "BindGroupLayout"); + log::debug!("bind group layout {:?} is dropped", bind_group_layout_id); let hub = A::hub(self); let mut token = Token::root(); @@ -3901,6 +3961,7 @@ impl Global { pub fn pipeline_layout_drop(&self, pipeline_layout_id: id::PipelineLayoutId) { profiling::scope!("drop", "PipelineLayout"); + log::debug!("pipeline layout {:?} is dropped", pipeline_layout_id); let hub = A::hub(self); let mut token = Token::root(); @@ -3995,6 +4056,7 @@ impl Global { pub fn bind_group_drop(&self, bind_group_id: id::BindGroupId) { profiling::scope!("drop", "BindGroup"); + log::debug!("bind group {:?} is dropped", bind_group_id); let hub = A::hub(self); let mut token = Token::root(); @@ -4135,6 +4197,7 @@ impl Global { pub fn shader_module_drop(&self, shader_module_id: id::ShaderModuleId) { profiling::scope!("drop", "ShaderModule"); + log::debug!("shader module {:?} is dropped", shader_module_id); let hub = A::hub(self); let mut token = Token::root(); @@ -4209,6 +4272,7 @@ impl Global { pub fn command_encoder_drop(&self, command_encoder_id: id::CommandEncoderId) { profiling::scope!("drop", "CommandEncoder"); + log::debug!("command encoder {:?} is dropped", command_encoder_id); let hub = A::hub(self); let mut token = Token::root(); @@ -4225,6 +4289,7 @@ impl Global { pub fn command_buffer_drop(&self, command_buffer_id: id::CommandBufferId) { profiling::scope!("drop", "CommandBuffer"); + log::debug!("command buffer {:?} is dropped", command_buffer_id); self.command_encoder_drop::(command_buffer_id) } @@ -4303,6 +4368,7 @@ impl Global { pub fn render_bundle_drop(&self, render_bundle_id: id::RenderBundleId) { profiling::scope!("drop", "RenderBundle"); + log::debug!("render bundle {:?} is dropped", render_bundle_id); let hub = A::hub(self); let mut token = Token::root(); @@ -4379,6 +4445,7 @@ impl Global { pub fn query_set_drop(&self, query_set_id: id::QuerySetId) { profiling::scope!("drop", "QuerySet"); + log::debug!("query set {:?} is dropped", query_set_id); let hub = A::hub(self); let mut token = Token::root(); @@ -4453,8 +4520,17 @@ impl Global { Ok(pair) => pair, Err(e) => break e, }; + let ref_count = pipeline.life_guard.add_ref(); let id = fid.assign(pipeline, &mut token); + log::info!("Created render pipeline {:?} with {:?}", id, desc); + + device + .trackers + .lock() + .render_pipes + .init(id, ref_count, PhantomData) + .unwrap(); return (id.0, None); }; @@ -4511,6 +4587,7 @@ impl Global { pub fn render_pipeline_drop(&self, render_pipeline_id: id::RenderPipelineId) { profiling::scope!("drop", "RenderPipeline"); + log::debug!("render pipeline {:?} is dropped", render_pipeline_id); let hub = A::hub(self); let mut token = Token::root(); let (device_guard, mut token) = hub.devices.read(&mut token); @@ -4584,8 +4661,17 @@ impl Global { Ok(pair) => pair, Err(e) => break e, }; + let ref_count = pipeline.life_guard.add_ref(); let id = fid.assign(pipeline, &mut token); + log::info!("Created compute pipeline {:?} with {:?}", id, desc); + + device + .trackers + .lock() + .compute_pipes + .init(id, ref_count, PhantomData) + .unwrap(); return (id.0, None); }; @@ -4642,6 +4728,7 @@ impl Global { pub fn compute_pipeline_drop(&self, compute_pipeline_id: id::ComputePipelineId) { profiling::scope!("drop", "ComputePipeline"); + log::debug!("compute pipeline {:?} is dropped", compute_pipeline_id); let hub = A::hub(self); let mut token = Token::root(); let (device_guard, mut token) = hub.devices.read(&mut token); @@ -4837,12 +4924,13 @@ impl Global { Ok(()) } + /// Check `device_id` for freeable resources and completed buffer mappings. pub fn device_poll( &self, device_id: id::DeviceId, force_wait: bool, ) -> Result<(), WaitIdleError> { - let closures = { + let (closures, _) = { let hub = A::hub(self); let mut token = Token::root(); let (device_guard, mut token) = hub.devices.read(&mut token); @@ -4857,6 +4945,9 @@ impl Global { Ok(()) } + /// Poll all devices belonging to the backend `A`. + /// + /// If `force_wait` is true, block until all buffer mappings are done. fn poll_devices( &self, force_wait: bool, @@ -4865,15 +4956,33 @@ impl Global { profiling::scope!("poll_devices"); let hub = A::hub(self); - let mut token = Token::root(); - let (device_guard, mut token) = hub.devices.read(&mut token); - for (_, device) in device_guard.iter(A::VARIANT) { - let cbs = device.maintain(hub, force_wait, &mut token)?; - closures.extend(cbs); + let mut devices_to_drop = vec![]; + { + let mut token = Token::root(); + let (device_guard, mut token) = hub.devices.read(&mut token); + + for (id, device) in device_guard.iter(A::VARIANT) { + let (cbs, queue_empty) = device.maintain(hub, force_wait, &mut token)?; + + // If the device's own `RefCount` clone is the only one left, and + // its submission queue is empty, then it can be freed. + if queue_empty && device.ref_count.load() == 1 { + devices_to_drop.push(id); + } + closures.extend(cbs); + } } + + for device_id in devices_to_drop { + self.exit_device::(device_id); + } + Ok(()) } + /// Poll all devices on all backends. + /// + /// This is the implementation of `wgpu::Instance::poll_all`. pub fn poll_all_devices(&self, force_wait: bool) -> Result<(), WaitIdleError> { let mut closures = UserClosures::default(); @@ -4929,22 +5038,49 @@ impl Global { pub fn device_drop(&self, device_id: id::DeviceId) { profiling::scope!("drop", "Device"); + log::debug!("device {:?} is dropped", device_id); + + let hub = A::hub(self); + let mut token = Token::root(); + // For now, just drop the `RefCount` in `device.life_guard`, which + // stands for the user's reference to the device. We'll take care of + // cleaning up the device when we're polled, once its queue submissions + // have completed and it is no longer needed by other resources. + let (mut device_guard, _) = hub.devices.write(&mut token); + if let Ok(device) = device_guard.get_mut(device_id) { + device.life_guard.ref_count.take().unwrap(); + } + } + + /// Exit the unreferenced, inactive device `device_id`. + fn exit_device(&self, device_id: id::DeviceId) { let hub = A::hub(self); let mut token = Token::root(); - let (device, _) = hub.devices.unregister(device_id, &mut token); - if let Some(mut device) = device { - device.prepare_to_die(); - - // Adapter is only referenced by the device and itself. - // This isn't a robust way to destroy them, we should find a better one. - if device.adapter_id.ref_count.load() == 1 { - let _ = hub - .adapters - .unregister(device.adapter_id.value.0, &mut token); + let mut free_adapter_id = None; + { + let (device, mut _token) = hub.devices.unregister(device_id, &mut token); + if let Some(mut device) = device { + // The things `Device::prepare_to_die` takes care are mostly + // unnecessary here. We know our queue is empty, so we don't + // need to wait for submissions or triage them. We know we were + // just polled, so `life_tracker.free_resources` is empty. + debug_assert!(device.lock_life(&mut _token).queue_empty()); + device.pending_writes.deactivate(); + + // Adapter is only referenced by the device and itself. + // This isn't a robust way to destroy them, we should find a better one. + if device.adapter_id.ref_count.load() == 1 { + free_adapter_id = Some(device.adapter_id.value.0); + } + + device.dispose(); } + } - device.dispose(); + // Free the adapter now that we've dropped the `Device` token. + if let Some(free_adapter_id) = free_adapter_id { + let _ = hub.adapters.unregister(free_adapter_id, &mut token); } } diff --git a/third_party/rust/wgpu-core/src/device/queue.rs b/third_party/rust/wgpu-core/src/device/queue.rs index ff3d6403215d6..b242e5b68340a 100644 --- a/third_party/rust/wgpu-core/src/device/queue.rs +++ b/third_party/rust/wgpu-core/src/device/queue.rs @@ -1,7 +1,6 @@ #[cfg(feature = "trace")] use crate::device::trace::Action; use crate::{ - align_to, command::{ extract_texture_selector, validate_linear_texture_data, validate_texture_copy_range, ClearError, CommandBuffer, CopySide, ImageCopyTexture, TransferError, @@ -415,7 +414,7 @@ impl Global { device.alignments.buffer_copy_pitch.get() as u32, format_desc.block_size as u32, ); - let stage_bytes_per_row = align_to( + let stage_bytes_per_row = hal::auxil::align_to( format_desc.block_size as u32 * width_blocks, bytes_per_row_alignment, ); @@ -609,7 +608,6 @@ impl Global { let (compute_pipe_guard, mut token) = hub.compute_pipelines.read(&mut token); let (render_pipe_guard, mut token) = hub.render_pipelines.read(&mut token); let (mut buffer_guard, mut token) = hub.buffers.write(&mut token); - // This could be made immutable. It's only mutated for the `has_work` flag. let (mut texture_guard, mut token) = hub.textures.write(&mut token); let (texture_view_guard, mut token) = hub.texture_views.read(&mut token); let (sampler_guard, mut token) = hub.samplers.read(&mut token); @@ -684,34 +682,15 @@ impl Global { *has_work = true; let ref_count = cmdbuf.trackers.textures.get_ref_count(id); //TODO: better error handling here? - { - // first, register it in the device tracker with uninitialized, - // if it wasn't used before. - let mut ts = track::TextureState::default(); - let _ = ts.change( - id, - texture.full_range.clone(), - hal::TextureUses::UNINITIALIZED, - None, - ); - let _ = trackers.textures.init( - id, - ref_count.clone(), - ts.clone(), - ); - } - { - // then, register it in the temporary tracker. - let mut ts = track::TextureState::default(); - let _ = ts.change( - id, - texture.full_range.clone(), - hal::TextureUses::empty(), - None, - ); - let _ = - used_surface_textures.init(id, ref_count.clone(), ts); - } + // register it in the temporary tracker. + let mut ts = track::TextureState::default(); + let _ = ts.change( + id, + texture.full_range.clone(), + hal::TextureUses::empty(), //present + None, + ); + let _ = used_surface_textures.init(id, ref_count.clone(), ts); } } if !texture.life_guard.use_at(submit_index) { @@ -840,6 +819,63 @@ impl Global { ref mut fence, .. } = *device; + + { + //TODO: these blocks have a few organizational issues and should be refactored + // (1) it's similar to the code we have per-command-buffer (at the begin and end) + // Maybe we an merge some? + // (2) it's doing the extra locking unconditionally + // Maybe we can only do so if any surfaces are being written to? + + let (_, mut token) = hub.buffers.read(&mut token); // skip token + let (mut texture_guard, _) = hub.textures.write(&mut token); + + for &id in pending_writes.dst_textures.iter() { + let texture = texture_guard.get_mut(id).unwrap(); + match texture.inner { + TextureInner::Native { raw: None } => { + return Err(QueueSubmitError::DestroyedTexture(id)); + } + TextureInner::Native { raw: Some(_) } => {} + TextureInner::Surface { + ref mut has_work, .. + } => { + use track::ResourceState as _; + + *has_work = true; + let ref_count = texture.life_guard.add_ref(); + //TODO: better error handling here? + // register it in the temporary tracker. + let mut ts = track::TextureState::default(); + let _ = ts.change( + id::Valid(id), + texture.full_range.clone(), + hal::TextureUses::empty(), //present + None, + ); + let _ = used_surface_textures.init(id::Valid(id), ref_count, ts); + } + } + } + + if !used_surface_textures.is_empty() { + let mut trackers = device.trackers.lock(); + let texture_barriers = trackers + .textures + .merge_replace(&used_surface_textures) + .map(|pending| { + let tex = &texture_guard[pending.id]; + pending.into_hal(tex) + }); + unsafe { + pending_writes + .command_encoder + .transition_textures(texture_barriers); + }; + used_surface_textures.clear(); + } + } + let refs = pending_writes .pre_submit() .into_iter() @@ -875,7 +911,7 @@ impl Global { // This will schedule destruction of all resources that are no longer needed // by the user but used in the command stream, among other things. - let closures = match device.maintain(hub, false, &mut token) { + let (closures, _) = match device.maintain(hub, false, &mut token) { Ok(closures) => closures, Err(WaitIdleError::Device(err)) => return Err(QueueSubmitError::Queue(err)), Err(WaitIdleError::StuckGpu) => return Err(QueueSubmitError::StuckGpu), diff --git a/third_party/rust/wgpu-core/src/hub.rs b/third_party/rust/wgpu-core/src/hub.rs index 2f78ab5faf72f..57f6a2dfe94ce 100644 --- a/third_party/rust/wgpu-core/src/hub.rs +++ b/third_party/rust/wgpu-core/src/hub.rs @@ -16,21 +16,51 @@ use wgt::Backend; use std::cell::Cell; use std::{fmt::Debug, marker::PhantomData, mem, ops}; -/// A simple structure to manage identities of objects. +/// A simple structure to allocate [`Id`] identifiers. +/// +/// Calling [`alloc`] returns a fresh, never-before-seen id. Calling [`free`] +/// marks an id as dead; it will never be returned again by `alloc`. +/// +/// Use `IdentityManager::default` to construct new instances. +/// +/// `IdentityManager` returns `Id`s whose index values are suitable for use as +/// indices into a `Storage` that holds those ids' referents: +/// +/// - Every live id has a distinct index value. Each live id's index selects a +/// distinct element in the vector. +/// +/// - `IdentityManager` prefers low index numbers. If you size your vector to +/// accommodate the indices produced here, the vector's length will reflect +/// the highwater mark of actual occupancy. +/// +/// - `IdentityManager` reuses the index values of freed ids before returning +/// ids with new index values. Freed vector entries get reused. +/// +/// [`Id`]: crate::id::Id +/// [`Backend`]: wgt::Backend; +/// [`alloc`]: IdentityManager::alloc +/// [`free`]: IdentityManager::free #[derive(Debug, Default)] pub struct IdentityManager { + /// Available index values. If empty, then `epochs.len()` is the next index + /// to allocate. free: Vec, + + /// The next or currently-live epoch value associated with each `Id` index. + /// + /// If there is a live id with index `i`, then `epochs[i]` is its epoch; any + /// id with the same index but an older epoch is dead. + /// + /// If index `i` is currently unused, `epochs[i]` is the epoch to use in its + /// next `Id`. epochs: Vec, } impl IdentityManager { - pub fn from_index(min_index: u32) -> Self { - Self { - free: (0..min_index).collect(), - epochs: vec![1; min_index as usize], - } - } - + /// Allocate a fresh, never-before-seen id with the given `backend`. + /// + /// The backend is incorporated into the id, so that ids allocated with + /// different `backend` values are always distinct. pub fn alloc(&mut self, backend: Backend) -> I { match self.free.pop() { Some(index) => I::zip(index, self.epochs[index as usize], backend), @@ -43,19 +73,34 @@ impl IdentityManager { } } + /// Free `id`. It will never be returned from `alloc` again. pub fn free(&mut self, id: I) { let (index, epoch, _backend) = id.unzip(); let pe = &mut self.epochs[index as usize]; assert_eq!(*pe, epoch); - *pe += 1; - self.free.push(index); + // If the epoch reaches EOL, the index doesn't go + // into the free list, will never be reused again. + if epoch < id::EPOCH_MASK { + *pe = epoch + 1; + self.free.push(index); + } } } +/// An entry in a `Storage::map` table. #[derive(Debug)] enum Element { + /// There are no live ids with this index. Vacant, + + /// There is one live id with this index, allocated at the given + /// epoch. Occupied(T, Epoch), + + /// Like `Occupied`, but an error occurred when creating the + /// resource. + /// + /// The given `String` is the resource's descriptor label. Error(Epoch, String), } @@ -76,6 +121,11 @@ impl StorageReport { #[derive(Clone, Debug)] pub(crate) struct InvalidId; +/// A table of `T` values indexed by the id type `I`. +/// +/// The table is represented as a vector indexed by the ids' index +/// values, so you should use an id allocator like `IdentityManager` +/// that keeps the index values dense and close to zero. #[derive(Debug)] pub struct Storage { map: Vec>, @@ -230,10 +280,10 @@ impl Storage { } /// Type system for enforcing the lock order on shared HUB structures. -/// If type A implements `Access`, that means we are allowed to proceed +/// If type A implements `Access`, that means we are allowed to proceed /// with locking resource `B` after we lock `A`. /// -/// The implenentations basically describe the edges in a directed graph +/// The implementations basically describe the edges in a directed graph /// of lock transitions. As long as it doesn't have loops, we can have /// multiple concurrent paths on this graph (from multiple threads) without /// deadlocks, i.e. there is always a path whose next resource is not locked @@ -361,7 +411,7 @@ impl IdentityHandler for Mutex { pub trait IdentityHandlerFactory { type Filter: IdentityHandler; - fn spawn(&self, min_index: Index) -> Self::Filter; + fn spawn(&self) -> Self::Filter; } #[derive(Debug)] @@ -369,8 +419,8 @@ pub struct IdentityManagerFactory; impl IdentityHandlerFactory for IdentityManagerFactory { type Filter = Mutex; - fn spawn(&self, min_index: Index) -> Self::Filter { - Mutex::new(IdentityManager::from_index(min_index)) + fn spawn(&self) -> Self::Filter { + Mutex::new(IdentityManager::default()) } } @@ -419,7 +469,7 @@ pub struct Registry> { impl> Registry { fn new(backend: Backend, factory: &F) -> Self { Self { - identity: factory.spawn(0), + identity: factory.spawn(), data: RwLock::new(Storage { map: Vec::new(), kind: T::TYPE, @@ -431,7 +481,7 @@ impl> Registry Self { Self { - identity: factory.spawn(1), + identity: factory.spawn(), data: RwLock::new(Storage { map: Vec::new(), kind, @@ -1006,10 +1056,16 @@ impl HalApi for hal::api::Dx12 { } } -/* #[cfg(dx11)] impl HalApi for hal::api::Dx11 { const VARIANT: Backend = Backend::Dx11; + fn create_instance_from_hal(name: &str, hal_instance: Self::Instance) -> Instance { + Instance { + name: name.to_owned(), + dx11: Some(hal_instance), + ..Default::default() + } + } fn hub(global: &Global) -> &Hub { &global.hubs.dx11 } @@ -1020,7 +1076,6 @@ impl HalApi for hal::api::Dx11 { surface.dx11.as_mut().unwrap() } } -*/ #[cfg(gl)] impl HalApi for hal::api::Gles { @@ -1049,3 +1104,17 @@ fn _test_send_sync(global: &Global) { fn test_internal(_: T) {} test_internal(global) } + +#[test] +fn test_epoch_end_of_life() { + use id::TypedId as _; + let mut man = IdentityManager::default(); + man.epochs.push(id::EPOCH_MASK); + man.free.push(0); + let id1 = man.alloc::(Backend::Empty); + assert_eq!(id1.unzip().0, 0); + man.free(id1); + let id2 = man.alloc::(Backend::Empty); + // confirm that the index 0 is no longer re-used + assert_eq!(id2.unzip().0, 1); +} diff --git a/third_party/rust/wgpu-core/src/id.rs b/third_party/rust/wgpu-core/src/id.rs index d102eb618346a..cbd7669e02454 100644 --- a/third_party/rust/wgpu-core/src/id.rs +++ b/third_party/rust/wgpu-core/src/id.rs @@ -1,9 +1,25 @@ use crate::{Epoch, Index}; -use std::{cmp::Ordering, fmt, marker::PhantomData, num::NonZeroU64}; +use std::{cmp::Ordering, fmt, marker::PhantomData}; use wgt::Backend; +#[cfg(feature = "id32")] +type IdType = u32; +#[cfg(not(feature = "id32"))] +type IdType = u64; +#[cfg(feature = "id32")] +type NonZeroId = std::num::NonZeroU32; +#[cfg(not(feature = "id32"))] +type NonZeroId = std::num::NonZeroU64; +#[cfg(feature = "id32")] +type ZippedIndex = u16; +#[cfg(not(feature = "id32"))] +type ZippedIndex = Index; + +const INDEX_BITS: usize = std::mem::size_of::() * 8; +const EPOCH_BITS: usize = INDEX_BITS - BACKEND_BITS; const BACKEND_BITS: usize = 3; -const EPOCH_MASK: u32 = (1 << (32 - BACKEND_BITS)) - 1; +const BACKEND_SHIFT: usize = INDEX_BITS * 2 - BACKEND_BITS; +pub const EPOCH_MASK: u32 = (1 << (EPOCH_BITS)) - 1; type Dummy = hal::api::Empty; #[repr(transparent)] @@ -21,7 +37,7 @@ type Dummy = hal::api::Empty; all(feature = "serde", not(feature = "replay")), derive(serde::Deserialize) )] -pub struct Id(NonZeroU64, PhantomData); +pub struct Id(NonZeroId, PhantomData); // This type represents Id in a more readable (and editable) way. #[allow(dead_code)] @@ -50,11 +66,11 @@ impl From for Id { impl Id { #[cfg(test)] pub(crate) fn dummy() -> Valid { - Valid(Id(NonZeroU64::new(1).unwrap(), PhantomData)) + Valid(Id(NonZeroId::new(1).unwrap(), PhantomData)) } pub fn backend(self) -> Backend { - match self.0.get() >> (64 - BACKEND_BITS) as u8 { + match self.0.get() >> (BACKEND_SHIFT) as u8 { 0 => Backend::Empty, 1 => Backend::Vulkan, 2 => Backend::Metal, @@ -114,22 +130,31 @@ impl Ord for Id { #[cfg_attr(feature = "replay", derive(serde::Deserialize))] pub(crate) struct Valid(pub I); +/// Trait carrying methods for direct `Id` access. +/// +/// Most `wgpu-core` clients should not use this trait. Unusual clients that +/// need to construct `Id` values directly, or access their components, like the +/// WGPU recording player, may use this trait to do so. pub trait TypedId { fn zip(index: Index, epoch: Epoch, backend: Backend) -> Self; fn unzip(self) -> (Index, Epoch, Backend); } +#[allow(trivial_numeric_casts)] impl TypedId for Id { fn zip(index: Index, epoch: Epoch, backend: Backend) -> Self { - assert_eq!(0, epoch >> (32 - BACKEND_BITS)); - let v = index as u64 | ((epoch as u64) << 32) | ((backend as u64) << (64 - BACKEND_BITS)); - Id(NonZeroU64::new(v).unwrap(), PhantomData) + assert_eq!(0, epoch >> EPOCH_BITS); + assert_eq!(0, (index as IdType) >> INDEX_BITS); + let v = index as IdType + | ((epoch as IdType) << INDEX_BITS) + | ((backend as IdType) << BACKEND_SHIFT); + Id(NonZeroId::new(v).unwrap(), PhantomData) } fn unzip(self) -> (Index, Epoch, Backend) { ( - self.0.get() as u32, - (self.0.get() >> 32) as u32 & EPOCH_MASK, + (self.0.get() as ZippedIndex) as Index, + (((self.0.get() >> INDEX_BITS) as ZippedIndex) & (EPOCH_MASK as ZippedIndex)) as Index, self.backend(), ) } @@ -173,6 +198,34 @@ fn test_id_backend() { Backend::Gl, ] { let id: Id<()> = Id::zip(1, 0, b); + let (_id, _epoch, backend) = id.unzip(); assert_eq!(id.backend(), b); + assert_eq!(backend, b); + } +} + +#[test] +fn test_id() { + let last_index = ((1u64 << INDEX_BITS) - 1) as Index; + let indexes = [1, last_index / 2 - 1, last_index / 2 + 1, last_index]; + let epochs = [1, EPOCH_MASK / 2 - 1, EPOCH_MASK / 2 + 1, EPOCH_MASK]; + let backends = [ + Backend::Empty, + Backend::Vulkan, + Backend::Metal, + Backend::Dx12, + Backend::Dx11, + Backend::Gl, + ]; + for &i in &indexes { + for &e in &epochs { + for &b in &backends { + let id: Id<()> = Id::zip(i, e, b); + let (index, epoch, backend) = id.unzip(); + assert_eq!(index, i); + assert_eq!(epoch, e); + assert_eq!(backend, b); + } + } } } diff --git a/third_party/rust/wgpu-core/src/init_tracker/mod.rs b/third_party/rust/wgpu-core/src/init_tracker/mod.rs index b5c6160244cd9..1111735f6bbf0 100644 --- a/third_party/rust/wgpu-core/src/init_tracker/mod.rs +++ b/third_party/rust/wgpu-core/src/init_tracker/mod.rs @@ -142,7 +142,7 @@ where .partition_point(|r| r.end <= query_range.start); self.uninitialized_ranges .get(index) - .map(|start_range| { + .and_then(|start_range| { if start_range.start < query_range.end { let start = start_range.start.max(query_range.start); match self.uninitialized_ranges.get(index + 1) { @@ -160,7 +160,6 @@ where None } }) - .flatten() } // Drains uninitialized ranges in a query range. diff --git a/third_party/rust/wgpu-core/src/instance.rs b/third_party/rust/wgpu-core/src/instance.rs index 08773aa72c6ee..d93d5d3d08571 100644 --- a/third_party/rust/wgpu-core/src/instance.rs +++ b/third_party/rust/wgpu-core/src/instance.rs @@ -28,49 +28,16 @@ pub struct FailedLimit { } fn check_limits(requested: &wgt::Limits, allowed: &wgt::Limits) -> Vec { - use std::cmp::Ordering; let mut failed = Vec::new(); - macro_rules! compare { - ($name:ident, $ordering:ident) => { - match requested.$name.cmp(&allowed.$name) { - Ordering::$ordering | Ordering::Equal => (), - _ => failed.push(FailedLimit { - name: stringify!($name), - requested: requested.$name, - allowed: allowed.$name, - }), - } - }; - } + requested.check_limits_with_fail_fn(allowed, false, |name, requested, allowed| { + failed.push(FailedLimit { + name, + requested, + allowed, + }) + }); - compare!(max_texture_dimension_1d, Less); - compare!(max_texture_dimension_2d, Less); - compare!(max_texture_dimension_3d, Less); - compare!(max_texture_array_layers, Less); - compare!(max_bind_groups, Less); - compare!(max_dynamic_uniform_buffers_per_pipeline_layout, Less); - compare!(max_dynamic_storage_buffers_per_pipeline_layout, Less); - compare!(max_sampled_textures_per_shader_stage, Less); - compare!(max_samplers_per_shader_stage, Less); - compare!(max_storage_buffers_per_shader_stage, Less); - compare!(max_storage_textures_per_shader_stage, Less); - compare!(max_uniform_buffers_per_shader_stage, Less); - compare!(max_uniform_buffer_binding_size, Less); - compare!(max_storage_buffer_binding_size, Less); - compare!(max_vertex_buffers, Less); - compare!(max_vertex_attributes, Less); - compare!(max_vertex_buffer_array_stride, Less); - compare!(max_push_constant_size, Less); - compare!(min_uniform_buffer_offset_alignment, Greater); - compare!(min_storage_buffer_offset_alignment, Greater); - compare!(max_inter_stage_shader_components, Less); - compare!(max_compute_workgroup_storage_size, Less); - compare!(max_compute_invocations_per_workgroup, Less); - compare!(max_compute_workgroup_size_x, Less); - compare!(max_compute_workgroup_size_y, Less); - compare!(max_compute_workgroup_size_z, Less); - compare!(max_compute_workgroups_per_dimension, Less); failed } @@ -197,6 +164,7 @@ impl Surface { wgt::TextureFormat::Rgba8UnormSrgb, wgt::TextureFormat::Bgra8Unorm, wgt::TextureFormat::Rgba8Unorm, + wgt::TextureFormat::Rgba16Float, ]; let suf = A::get_surface(self); @@ -514,6 +482,33 @@ impl Global { }, //acquired_texture: None, }), + #[cfg(vulkan)] + vulkan: None, + #[cfg(gl)] + gl: None, + }; + + let mut token = Token::root(); + let id = self.surfaces.prepare(id_in).assign(surface, &mut token); + id.0 + } + + #[cfg(dx12)] + pub unsafe fn instance_create_surface_from_visual( + &self, + visual: *mut std::ffi::c_void, + id_in: Input, + ) -> SurfaceId { + profiling::scope!("instance_create_surface_from_visual", "Instance"); + + let surface = Surface { + presentation: None, + #[cfg(vulkan)] + vulkan: None, + dx12: self.instance.dx12.as_ref().map(|inst| HalSurface { + raw: { inst.create_surface_from_visual(visual as _) }, + }), + dx11: None, #[cfg(gl)] gl: None, }; @@ -851,7 +846,7 @@ impl Global { .map_err(|_| InvalidAdapter) } - pub fn adapter_downlevel_properties( + pub fn adapter_downlevel_capabilities( &self, adapter_id: AdapterId, ) -> Result { diff --git a/third_party/rust/wgpu-core/src/lib.rs b/third_party/rust/wgpu-core/src/lib.rs index 565cc99ef6a5d..e3036ad0f2ba6 100644 --- a/third_party/rust/wgpu-core/src/lib.rs +++ b/third_party/rust/wgpu-core/src/lib.rs @@ -50,7 +50,11 @@ use atomic::{AtomicUsize, Ordering}; use std::{borrow::Cow, os::raw::c_char, ptr, sync::atomic}; +/// The index of a queue submission. +/// +/// These are the values stored in `Device::fence`. type SubmissionIndex = hal::FenceValue; + type Index = u32; type Epoch = u32; @@ -71,6 +75,15 @@ impl<'a> LabelHelpers<'a> for Label<'a> { } /// Reference count object that is 1:1 with each reference. +/// +/// All the clones of a given `RefCount` point to the same +/// heap-allocated atomic reference count. When the count drops to +/// zero, only the count is freed. No other automatic cleanup takes +/// place; this is just a reference count, not a smart pointer. +/// +/// `RefCount` values are created only by [`LifeGuard::new`] and by +/// `Clone`, so every `RefCount` is implicitly tied to some +/// [`LifeGuard`]. #[derive(Debug)] struct RefCount(ptr::NonNull); @@ -80,20 +93,14 @@ unsafe impl Sync for RefCount {} impl RefCount { const MAX: usize = 1 << 24; - fn load(&self) -> usize { - unsafe { self.0.as_ref() }.load(Ordering::Acquire) + /// Construct a new `RefCount`, with an initial count of 1. + fn new() -> RefCount { + let bx = Box::new(AtomicUsize::new(1)); + Self(unsafe { ptr::NonNull::new_unchecked(Box::into_raw(bx)) }) } - /// This function exists to allow `Self::rich_drop_outer` and `Drop::drop` to share the same - /// logic. To use this safely from outside of `Drop::drop`, the calling function must move - /// `Self` into a `ManuallyDrop`. - unsafe fn rich_drop_inner(&mut self) -> bool { - if self.0.as_ref().fetch_sub(1, Ordering::AcqRel) == 1 { - let _ = Box::from_raw(self.0.as_ptr()); - true - } else { - false - } + fn load(&self) -> usize { + unsafe { self.0.as_ref() }.load(Ordering::Acquire) } } @@ -108,7 +115,9 @@ impl Clone for RefCount { impl Drop for RefCount { fn drop(&mut self) { unsafe { - self.rich_drop_inner(); + if self.0.as_ref().fetch_sub(1, Ordering::AcqRel) == 1 { + drop(Box::from_raw(self.0.as_ptr())); + } } } } @@ -116,37 +125,64 @@ impl Drop for RefCount { /// Reference count object that tracks multiple references. /// Unlike `RefCount`, it's manually inc()/dec() called. #[derive(Debug)] -struct MultiRefCount(ptr::NonNull); - -unsafe impl Send for MultiRefCount {} -unsafe impl Sync for MultiRefCount {} +struct MultiRefCount(AtomicUsize); impl MultiRefCount { fn new() -> Self { - let bx = Box::new(AtomicUsize::new(1)); - let ptr = Box::into_raw(bx); - Self(unsafe { ptr::NonNull::new_unchecked(ptr) }) + Self(AtomicUsize::new(1)) } fn inc(&self) { - unsafe { self.0.as_ref() }.fetch_add(1, Ordering::AcqRel); + self.0.fetch_add(1, Ordering::AcqRel); } fn dec_and_check_empty(&self) -> bool { - unsafe { self.0.as_ref() }.fetch_sub(1, Ordering::AcqRel) == 1 - } -} - -impl Drop for MultiRefCount { - fn drop(&mut self) { - let _ = unsafe { Box::from_raw(self.0.as_ptr()) }; + self.0.fetch_sub(1, Ordering::AcqRel) == 1 } } +/// Information needed to decide when it's safe to free some wgpu-core +/// resource. +/// +/// Each type representing a `wgpu-core` resource, like [`Device`], +/// [`Buffer`], etc., contains a `LifeGuard` which indicates whether +/// it is safe to free. +/// +/// A resource may need to be retained for any of several reasons: +/// +/// - The user may hold a reference to it (via a `wgpu::Buffer`, say). +/// +/// - Other resources may depend on it (a texture view's backing +/// texture, for example). +/// +/// - It may be used by commands sent to the GPU that have not yet +/// finished execution. +/// +/// [`Device`]: device::Device +/// [`Buffer`]: resource::Buffer #[derive(Debug)] pub struct LifeGuard { + /// `RefCount` for the user's reference to this resource. + /// + /// When the user first creates a `wgpu-core` resource, this `RefCount` is + /// created along with the resource's `LifeGuard`. When the user drops the + /// resource, we swap this out for `None`. Note that the resource may + /// still be held alive by other resources. + /// + /// Any `Stored` value holds a clone of this `RefCount` along with the id + /// of a `T` resource. ref_count: Option, + + /// The index of the last queue submission in which the resource + /// was used. + /// + /// Each queue submission is fenced and assigned an index number + /// sequentially. Thus, when a queue submission completes, we know any + /// resources used in that submission and any lower-numbered submissions are + /// no longer in use by the GPU. submission_index: AtomicUsize, + + /// The `label` from the descriptor used to create the resource. #[cfg(debug_assertions)] pub(crate) label: String, } @@ -154,9 +190,8 @@ pub struct LifeGuard { impl LifeGuard { #[allow(unused_variables)] fn new(label: &str) -> Self { - let bx = Box::new(AtomicUsize::new(1)); Self { - ref_count: ptr::NonNull::new(Box::into_raw(bx)).map(RefCount), + ref_count: Some(RefCount::new()), submission_index: AtomicUsize::new(0), #[cfg(debug_assertions)] label: label.to_string(), @@ -167,7 +202,10 @@ impl LifeGuard { self.ref_count.clone().unwrap() } - /// Returns `true` if the resource is still needed by the user. + /// Record that this resource will be used by the queue submission with the + /// given index. + /// + /// Returns `true` if the resource is still held by the user. fn use_at(&self, submit_index: SubmissionIndex) -> bool { self.submission_index .store(submit_index as _, Ordering::Release); @@ -196,20 +234,54 @@ If you are running this program on native and not in a browser and wish to work Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current \ platform supports."; +/// Call a `Global` method, dispatching dynamically to the appropriate back end. +/// +/// Uses of this macro have the form: +/// +/// ```ignore +/// +/// gfx_select!(id => global.method(args...)) +/// +/// ``` +/// +/// where `id` is some [`id::Id`] resource id, `global` is a [`hub::Global`], +/// and `method` is any method on [`Global`] that takes a single generic +/// parameter that implements [`hal::Api`] (for example, +/// [`Global::device_create_buffer`]). +/// +/// The `wgpu-core` crate can support multiple back ends simultaneously (Vulkan, +/// Metal, etc.), depending on features and availability. Each [`Id`]'s value +/// indicates which back end its resource belongs to. This macro does a switch +/// on `id`'s back end, and calls the `Global` method specialized for that back +/// end. +/// +/// Internally to `wgpu-core`, most types take the back end (some type that +/// implements `hal::Api`) as a generic parameter, so their methods are compiled +/// with full knowledge of which back end they're working with. This macro +/// serves as the boundary between dynamic `Id` values provided by `wgpu-core`'s +/// users and the crate's mostly-monomorphized implementation, selecting the +/// `hal::Api` implementation appropriate to the `Id` value's back end. +/// +/// [`Global`]: hub::Global +/// [`Global::device_create_buffer`]: hub::Global::device_create_buffer +/// [`Id`]: id::Id #[macro_export] macro_rules! gfx_select { ($id:expr => $global:ident.$method:ident( $($param:expr),* )) => { // Note: For some reason the cfg aliases defined in build.rs don't succesfully apply in this // macro so we must specify their equivalents manually match $id.backend() { - #[cfg(all(not(target_arch = "wasm32"), not(target_os = "ios"), not(target_os = "macos")))] + #[cfg(any( + all(not(target_arch = "wasm32"), not(target_os = "ios"), not(target_os = "macos")), + feature = "vulkan-portability" + ))] wgt::Backend::Vulkan => $global.$method::<$crate::api::Vulkan>( $($param),* ), #[cfg(all(not(target_arch = "wasm32"), any(target_os = "ios", target_os = "macos")))] wgt::Backend::Metal => $global.$method::<$crate::api::Metal>( $($param),* ), #[cfg(all(not(target_arch = "wasm32"), windows))] wgt::Backend::Dx12 => $global.$method::<$crate::api::Dx12>( $($param),* ), - //#[cfg(all(not(target_arch = "wasm32"), windows))] - //wgt::Backend::Dx11 => $global.$method::<$crate::api::Dx11>( $($param),* ), + #[cfg(all(not(target_arch = "wasm32"), windows))] + wgt::Backend::Dx11 => $global.$method::<$crate::api::Dx11>( $($param),* ), #[cfg(any( all(unix, not(target_os = "macos"), not(target_os = "ios")), feature = "angle", @@ -252,14 +324,6 @@ pub(crate) fn get_greatest_common_divisor(mut a: u32, mut b: u32) -> u32 { } } -#[inline] -pub(crate) fn align_to(value: u32, alignment: u32) -> u32 { - match value % alignment { - 0 => value, - other => value - other + alignment, - } -} - #[test] fn test_lcd() { assert_eq!(get_lowest_common_denom(2, 2), 2); diff --git a/third_party/rust/wgpu-core/src/present.rs b/third_party/rust/wgpu-core/src/present.rs index f9a9a09bd0790..17bdf467a992a 100644 --- a/third_party/rust/wgpu-core/src/present.rs +++ b/third_party/rust/wgpu-core/src/present.rs @@ -19,9 +19,7 @@ use crate::{ hub::{Global, GlobalIdentityHandlerFactory, HalApi, Input, Token}, id::{DeviceId, SurfaceId, TextureId, Valid}, init_tracker::TextureInitTracker, - resource, - track::TextureSelector, - LifeGuard, Stored, + resource, track, LifeGuard, Stored, }; use hal::{Queue as _, Surface as _}; @@ -139,7 +137,7 @@ impl Global { unsafe { hal::Device::create_texture_view( &device.raw, - &ast.texture.borrow(), + ast.texture.borrow(), &clear_view_desc, ) } @@ -174,7 +172,7 @@ impl Global { | wgt::TextureFormatFeatureFlags::MULTISAMPLE_RESOLVE, }, initialization_status: TextureInitTracker::new(1, 1), - full_range: TextureSelector { + full_range: track::TextureSelector { layers: 0..1, levels: 0..1, }, @@ -188,7 +186,22 @@ impl Global { let ref_count = texture.life_guard.add_ref(); let id = fid.assign(texture, &mut token); - //suf.acquired_texture = Some(suf_texture); + { + use track::ResourceState as _; + // register it in the device tracker as uninitialized + let mut trackers = device.trackers.lock(); + let mut ts = track::TextureState::default(); + let _ = ts.change( + id, + track::TextureSelector { + layers: 0..1, + levels: 0..1, + }, + hal::TextureUses::UNINITIALIZED, + None, + ); + let _ = trackers.textures.init(id, ref_count.clone(), ts); + } if present.acquired_texture.is_some() { return Err(SurfaceError::AlreadyAcquired); diff --git a/third_party/rust/wgpu-core/src/resource.rs b/third_party/rust/wgpu-core/src/resource.rs index 3315162c0f482..3f12aba0d5d9e 100644 --- a/third_party/rust/wgpu-core/src/resource.rs +++ b/third_party/rust/wgpu-core/src/resource.rs @@ -299,15 +299,19 @@ pub enum CreateTextureError { EmptyUsage, #[error(transparent)] InvalidDimension(#[from] TextureDimensionError), - #[error("Depth texture kind {0:?} of format {0:?} can't be created")] - InvalidDepthKind(wgt::TextureDimension, wgt::TextureFormat), + #[error("Depth texture ({1:?}) can't be created as {0:?}")] + InvalidDepthDimension(wgt::TextureDimension, wgt::TextureFormat), + #[error("Compressed texture ({1:?}) can't be created as {0:?}")] + InvalidCompressedDimension(wgt::TextureDimension, wgt::TextureFormat), #[error( "Texture descriptor mip level count {requested} is invalid, maximum allowed is {maximum}" )] InvalidMipLevelCount { requested: u32, maximum: u32 }, #[error("Texture usages {0:?} are not allowed on a texture of type {1:?}")] - InvalidUsages(wgt::TextureUsages, wgt::TextureFormat), - #[error("Texture format {0:?} can't be used")] + InvalidFormatUsages(wgt::TextureUsages, wgt::TextureFormat), + #[error("Texture usages {0:?} are not allowed on a texture of dimensions {1:?}")] + InvalidDimensionUsages(wgt::TextureUsages, wgt::TextureDimension), + #[error("Texture format {0:?} can't be used due to missing features.")] MissingFeatures(wgt::TextureFormat, #[source] MissingFeatures), } diff --git a/third_party/rust/wgpu-core/src/track/mod.rs b/third_party/rust/wgpu-core/src/track/mod.rs index 120ce3873627b..bcf5eb4a4bf98 100644 --- a/third_party/rust/wgpu-core/src/track/mod.rs +++ b/third_party/rust/wgpu-core/src/track/mod.rs @@ -230,7 +230,17 @@ impl ResourceTracker { } } - /// Removes the resource from the tracker if we are holding the last reference. + /// Remove the resource `id`, only if `self` is holding the last reference to it. + /// + /// Return `true` if we did remove the resource; the underlying hal resource + /// is ready to be freed. + /// + /// This is generally only meaningful to apply to members of + /// [`Device::trackers`], which holds all resources allocated with that + /// [`Device`]. Other trackers should never be the final reference. + /// + /// [`Device`]: crate::device::Device + /// [`Device::trackers`]: crate::device::Device::trackers pub(crate) fn remove_abandoned(&mut self, id: Valid) -> bool { let (index, epoch, backend) = id.0.unzip(); debug_assert_eq!(backend, self.backend); @@ -285,7 +295,9 @@ impl ResourceTracker { self.map.clear(); } - /// Initialize a resource to be used. + /// Begin tracking a new resource `id` in state `state`. + /// + /// Hold `ref_count` in the tracker. /// /// Returns false if the resource is already registered. pub(crate) fn init( @@ -322,8 +334,18 @@ impl ResourceTracker { res.state.query(selector) } - /// Make sure that a resource is tracked, and return a mutable - /// reference to it. + /// Make sure that a resource is tracked, and return a mutable reference to it. + /// + /// If the resource isn't tracked, start it in the default state, and take a + /// clone of `ref_count`. + /// + /// The `self_backend` and `map` arguments should be the `backend` and `map` + /// fields of a `ResourceTracker`. Ideally this function would just take + /// `&mut self` and access those from there, but that would upset the borrow + /// checker in some callers, who want to borrow `ResourceTracker::temp` + /// alongside our return value. The approach taken here has the caller + /// borrow both `map` and `temp`, so the borrow checker can see that they + /// don't alias. fn get_or_insert<'a>( self_backend: wgt::Backend, map: &'a mut FastHashMap>, @@ -345,6 +367,7 @@ impl ResourceTracker { } } + /// Return a mutable reference to `id`'s state. fn get<'a>( self_backend: wgt::Backend, map: &'a mut FastHashMap>, @@ -357,7 +380,7 @@ impl ResourceTracker { e } - /// Extend the usage of a specified resource. + /// Extend the usage of `id`, tracking it if necessary. /// /// Returns conflicting transition as an error. pub(crate) fn change_extend( @@ -551,6 +574,11 @@ pub enum UsageConflict { } /// A set of trackers for all relevant resources. +/// +/// `Device` uses this to track all resources allocated from that device. +/// Resources like `BindGroup`, `CommandBuffer`, and so on that may own a +/// variety of other resources also use a value of this type to keep track of +/// everything they're depending on. #[derive(Debug)] pub(crate) struct TrackerSet { pub buffers: ResourceTracker, diff --git a/third_party/rust/wgpu-core/src/validation.rs b/third_party/rust/wgpu-core/src/validation.rs index 32fbe8bbc1faa..ad76f0523fc3c 100644 --- a/third_party/rust/wgpu-core/src/validation.rs +++ b/third_party/rust/wgpu-core/src/validation.rs @@ -25,7 +25,7 @@ struct Resource { name: Option, bind: naga::ResourceBinding, ty: ResourceType, - class: naga::StorageClass, + class: naga::AddressSpace, } #[derive(Clone, Copy, Debug)] @@ -181,9 +181,9 @@ pub enum BindingError { #[error("type on the shader side does not match the pipeline binding")] WrongType, #[error("storage class {binding:?} doesn't match the shader {shader:?}")] - WrongStorageClass { - binding: naga::StorageClass, - shader: naga::StorageClass, + WrongAddressSpace { + binding: naga::AddressSpace, + shader: naga::AddressSpace, }, #[error("buffer structure size {0}, added to one element of an unbound array, if it's the last field, ended up greater than the given `min_binding_size`")] WrongBufferSize(wgt::BufferSize), @@ -373,7 +373,7 @@ impl Resource { } => { let (class, global_use) = match ty { wgt::BufferBindingType::Uniform => { - (naga::StorageClass::Uniform, GlobalUse::READ) + (naga::AddressSpace::Uniform, GlobalUse::READ) } wgt::BufferBindingType::Storage { read_only } => { let mut global_use = GlobalUse::READ | GlobalUse::QUERY; @@ -381,7 +381,7 @@ impl Resource { let mut naga_access = naga::StorageAccess::LOAD; naga_access.set(naga::StorageAccess::STORE, !read_only); ( - naga::StorageClass::Storage { + naga::AddressSpace::Storage { access: naga_access, }, global_use, @@ -389,7 +389,7 @@ impl Resource { } }; if self.class != class { - return Err(BindingError::WrongStorageClass { + return Err(BindingError::WrongAddressSpace { binding: class, shader: self.class, }); @@ -540,8 +540,8 @@ impl Resource { Ok(match self.ty { ResourceType::Buffer { size } => BindingType::Buffer { ty: match self.class { - naga::StorageClass::Uniform => wgt::BufferBindingType::Uniform, - naga::StorageClass::Storage { .. } => wgt::BufferBindingType::Storage { + naga::AddressSpace::Uniform => wgt::BufferBindingType::Uniform, + naga::AddressSpace::Storage { .. } => wgt::BufferBindingType::Storage { read_only: !shader_usage.contains(GlobalUse::WRITE), }, _ => return Err(BindingError::WrongType), @@ -717,35 +717,7 @@ impl NumericType { | Tf::Etc2Rgb8A1Unorm | Tf::Etc2Rgb8A1UnormSrgb | Tf::Etc2Rgba8Unorm - | Tf::Etc2Rgba8UnormSrgb - | Tf::Astc4x4RgbaUnorm - | Tf::Astc4x4RgbaUnormSrgb - | Tf::Astc5x4RgbaUnorm - | Tf::Astc5x4RgbaUnormSrgb - | Tf::Astc5x5RgbaUnorm - | Tf::Astc5x5RgbaUnormSrgb - | Tf::Astc6x5RgbaUnorm - | Tf::Astc6x5RgbaUnormSrgb - | Tf::Astc6x6RgbaUnorm - | Tf::Astc6x6RgbaUnormSrgb - | Tf::Astc8x5RgbaUnorm - | Tf::Astc8x5RgbaUnormSrgb - | Tf::Astc8x6RgbaUnorm - | Tf::Astc8x6RgbaUnormSrgb - | Tf::Astc10x5RgbaUnorm - | Tf::Astc10x5RgbaUnormSrgb - | Tf::Astc10x6RgbaUnorm - | Tf::Astc10x6RgbaUnormSrgb - | Tf::Astc8x8RgbaUnorm - | Tf::Astc8x8RgbaUnormSrgb - | Tf::Astc10x8RgbaUnorm - | Tf::Astc10x8RgbaUnormSrgb - | Tf::Astc10x10RgbaUnorm - | Tf::Astc10x10RgbaUnormSrgb - | Tf::Astc12x10RgbaUnorm - | Tf::Astc12x10RgbaUnormSrgb - | Tf::Astc12x12RgbaUnorm - | Tf::Astc12x12RgbaUnormSrgb => (NumericDimension::Vector(Vs::Quad), Sk::Float), + | Tf::Etc2Rgba8UnormSrgb => (NumericDimension::Vector(Vs::Quad), Sk::Float), Tf::Bc4RUnorm | Tf::Bc4RSnorm | Tf::EacR11Unorm | Tf::EacR11Snorm => { (NumericDimension::Scalar, Sk::Float) } @@ -755,6 +727,10 @@ impl NumericType { Tf::Bc6hRgbUfloat | Tf::Bc6hRgbSfloat | Tf::Etc2Rgb8Unorm | Tf::Etc2Rgb8UnormSrgb => { (NumericDimension::Vector(Vs::Tri), Sk::Float) } + Tf::Astc { + block: _, + channel: _, + } => (NumericDimension::Vector(Vs::Quad), Sk::Float), }; NumericType { @@ -905,6 +881,9 @@ impl Interface { class, }, naga::TypeInner::Sampler { comparison } => ResourceType::Sampler { comparison }, + naga::TypeInner::Array { stride, .. } => ResourceType::Buffer { + size: wgt::BufferSize::new(stride as u64).unwrap(), + }, ref other => { log::error!("Unexpected resource type: {:?}", other); continue; @@ -915,7 +894,7 @@ impl Interface { name: var.name.clone(), bind, ty, - class: var.class, + class: var.space, }, Default::default(), ); diff --git a/third_party/rust/wgpu-hal/.cargo-checksum.json b/third_party/rust/wgpu-hal/.cargo-checksum.json index 43f4b8c9ed903..7b5aef6f24c08 100644 --- a/third_party/rust/wgpu-hal/.cargo-checksum.json +++ b/third_party/rust/wgpu-hal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3862315ca7f4457023d24cc734caf97344767b109b6aff70bf521842f23e057a","README.md":"78377f5876fafd77963eff7e3c2ba3a7e3ad5cf9201b09ed5612e49c2288eb18","examples/halmark/main.rs":"9985c489565558c44023c2e0939c6f23f73840d336ebc552063277a85ea5136f","examples/halmark/shader.wgsl":"d63ba820574d2809b8a5d16342fddbede5dd0ff0024b3448c947fb7da896dd8d","examples/raw-gles.rs":"e1a47d82b58eef8a74fee37f9e2d190bf33ed764818af532c31fe2ffd160d070","src/auxil/mod.rs":"80e81fb7421f29553922fe67f16859cb5a3e2e199413f10a87e58253bb4fe6f6","src/auxil/renderdoc.rs":"3a4da908ebd6230177ca55c541c8278639e83d78badb4595a941aea30dd7f80f","src/dx12/adapter.rs":"7ce0b5398973584df4a314627c9958cfd120e31533c222a7a81e9e643552c27f","src/dx12/command.rs":"f8b84a576a5f2eea82d5c001ea1a7d4552f9fc7a7d0bc496a096ac3ffee2ff14","src/dx12/conv.rs":"7dfa5fb67b11acd2ffcee400b7e737aa1b08ee1f22d93d9fffaab5f275efee44","src/dx12/descriptor.rs":"c0108edad4a7a8c77d52c6172844d4310820edb400e351c843d56aab997a5dc2","src/dx12/device.rs":"fed1f2286c153998448bf07c423f320eade15d7dbce0a1d1d719f822bebd2936","src/dx12/instance.rs":"e93de85ddf6772ca366e02b7d0b4ee4d619164fd4700df4a389515f4f4500ebc","src/dx12/mod.rs":"b11a6b29ecb9dce95ffeb0b65d69d0af0a6adb1437faf0f561c82010ca6306c9","src/dx12/view.rs":"7449d7459e39178491e76812f154ef2895f8137e944c1c821c0d441fdb173cae","src/empty.rs":"6bf65e405f63eff49b25d079af644b352b95a9c7edcf3a57be2e96a50307b66b","src/gles/adapter.rs":"854215a4a93eacb8f15bb4e905de6cf6d064b5e4773cc48f64f0acb0c1c50811","src/gles/command.rs":"557effbdf8a885fec118e926f1e322253b4e4f417d4f7efbc300f7b75580e0f5","src/gles/conv.rs":"ec87ddf4b509a394f5faaacdae2e2eb119f100585f5850e4f52ccb8687e67452","src/gles/device.rs":"6ff31ffe2f5266c73f3de787ca06da8347ae19ec178792cd215b844cc309eaf9","src/gles/egl.rs":"0d8993a0d722063042ee9fa83a4de868e91689f1ce8c8aec47e538a6c0f38553","src/gles/mod.rs":"714ce10a4929a3f0d9a32bb0bbbfbe87a3b3162a8532b2cd79f228d32b958dd1","src/gles/queue.rs":"fea36dc55becee4493cea6b554e8d7a8ffe946201eb21c563e7dc4bcacab3bcd","src/gles/shaders/clear.frag":"aac702eed9ece5482db5ba6783a678b119a5e7802b1ecf93f4975dee8acab0b3","src/gles/shaders/clear.vert":"8f636168e1da2cac48091c466a543c3b09fb4a0dd8c60c1c9bf34cc890766740","src/gles/shaders/present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"083500c0b36d079a82754895d06b993ea8ed4393690b226c85f07cbec373a730","src/lib.rs":"354670f72b69e3c6b704b9668dab681032d48ff2a650be3c07807d803582900c","src/metal/adapter.rs":"daae4f4c8097dd2fa4c915b1521457e38d9f143e468c45daba5b124f06608359","src/metal/command.rs":"233e646076d94b5d2b109f254ba129b8dcc30f683b30178a66d59bd7e2a25b78","src/metal/conv.rs":"0f8065cbe54b499476381fd93002a377d6ae756d63d5d8dacb18fe292dfa30eb","src/metal/device.rs":"b0dc77b3567b4d456118d7428a0594f0ace5c1a3bb75cee9b24a61645feae0ba","src/metal/mod.rs":"29092cc039a844611b6e6755e735ec232a947c25531fb3c185a4a9422891e6af","src/metal/surface.rs":"74f81d37f0f1362603c26fd085ad2821f82810e2b5c5f816a6c1e83c5295d47b","src/vulkan/adapter.rs":"627d67199a49ebffa8e183cb68b61ee8646418ac0f81e8634acccddccc8c0ac4","src/vulkan/command.rs":"60d1867acd0e46c34dabecea708cd776a1f435721b6673a506b5bb8aee87ff80","src/vulkan/conv.rs":"241764384cb35a7fbd453923fc0e968909689e4698e69ff61df87d2aa6cf37cb","src/vulkan/device.rs":"a88d85962e1d819b903a4b6f1b2e2822ecf770d05fa5a16673e87b77fbadc38f","src/vulkan/instance.rs":"b258b87760150feda3e1f23166fd5e6067b0af0c9ed404e0208433b3b10d42bd","src/vulkan/mod.rs":"bb4d3c01a7a75fa167f03123794f747a21e2cbe0ec93fbf473b1d40f9b2c2d42"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"0759c0c4f8f21749a407e07e46558ac571aa0a1451f4b438b2c51624a11e040f","README.md":"78377f5876fafd77963eff7e3c2ba3a7e3ad5cf9201b09ed5612e49c2288eb18","examples/halmark/main.rs":"c745317191eab3159465f79f4a693f671e2f75877dc3b7215a6a90d70e88ec7f","examples/halmark/shader.wgsl":"0a26d69464ec608984408942e8353d971de9faff8bf1d8824382c346fdf46365","examples/raw-gles.em.html":"70fbe68394a1a4522192de1dcfaf7d399f60d7bdf5de70b708f9bb0417427546","examples/raw-gles.rs":"d6db84b269b934409ef85fa31914b3f4bc7e7012e40269aad3eff5454eae2a09","src/auxil/dxgi/conv.rs":"cbdb037f2be37b3886f1449b4872a8f248390e185c3d32bf61d64aef76e2008e","src/auxil/dxgi/exception.rs":"f8d69d3d475e03c4d96d22778e5a6f322afd98fcfafb1414cd4a76239fa97a37","src/auxil/dxgi/factory.rs":"82451fcfcc1f73a570ae9e708c94efa9c125d269dfb7396de97da5b32f8a4090","src/auxil/dxgi/mod.rs":"63db737b48378d4843e2f7904f104790688029ff614bc80387cd9efe444f1e52","src/auxil/dxgi/result.rs":"20c8eb03d738062dff198feca6327addb9882ed0462be842c789eadf7dca0573","src/auxil/mod.rs":"f899555124ad6d44f5326ef935f4911702539fd933ec2ab07c6009badb3ea22c","src/auxil/renderdoc.rs":"3a4da908ebd6230177ca55c541c8278639e83d78badb4595a941aea30dd7f80f","src/dx11/adapter.rs":"dfd24df4d699772a02f8f1a9bb63e276d41ecb8ee899325d2818e01202b0845b","src/dx11/command.rs":"cdad8dcdb800acba56c931f1726ddada652af18db0f066465af643f82a034492","src/dx11/device.rs":"76ac52095c639482adc2058509cd3acafd49cebc0694fcd64f8d9f53abc823de","src/dx11/instance.rs":"3bbf2730956472cb8023bd8fbd2d53e49f93c5e4ce3d14664112a293a165d191","src/dx11/library.rs":"0da08a780eefa7ff50f2e0998117202f26e5dd3d3a433c58b585801cff9863d2","src/dx11/mod.rs":"e4f7c6100e1bec479b41f3e3af96e01d53e6597c1c3a8fcde6f14cc9eb8537f8","src/dx12/adapter.rs":"5b6f4110b558a3f5a35eca803b8253bae0f00156e9f99c486a0f20fb66a494da","src/dx12/command.rs":"f9969744663c1f01fca3892b93fc516363fa8725739d270a5f633db78f7902da","src/dx12/conv.rs":"c27336e5b576a7e05a576548fa0e6588ff77be4208f08aac0bea7e649ed1301b","src/dx12/descriptor.rs":"7145d3dc6be13fae4cf6bb8bf34a1ea1749ad87e5f429b84f3cbbea7bf63c148","src/dx12/device.rs":"05cb2a9b0a534a0fefb61d8b510521b8b1cb9fa47d7cbb34e39f336536927fec","src/dx12/instance.rs":"ccc36443cb1df8ab8ed8366cf8599ec3d75fb5fefa5f9bb0f0f0b5e6fc1c5102","src/dx12/mod.rs":"2ff1c8f52acbd86fa31838119025c20abfcdd13a4224fa396074b7857759a9a5","src/dx12/view.rs":"b7a5cb8933f30517a97b4bd767e10b4c09f686dbf493d53b9b265d2d0b16f1a6","src/empty.rs":"6bf65e405f63eff49b25d079af644b352b95a9c7edcf3a57be2e96a50307b66b","src/gles/adapter.rs":"c5b405d405c820cf7c2540125f1b3fed72983c9e4cabda1ef949b949a92c5915","src/gles/command.rs":"3bef8a822b59c7e986c2c6dd084a2c537a96de77e2b48522f86210093daad3d0","src/gles/conv.rs":"c5d6ba4afd2b3245b1a36a84e4c392c640e6170a1e81df3741bf5323c57bdc51","src/gles/device.rs":"66ebcc318f9adce0f2f646e0bf7d446fec8a770aa46c3bddea295a5fd639fe15","src/gles/egl.rs":"38dc851eede42b6be2ff02f15fef3a4a116cd1b5803974fada89ac86d42a5df4","src/gles/mod.rs":"b548dd5a1aa525e34b08922f06764a762a47265d22b10616704c49c35235242d","src/gles/queue.rs":"21543baba720fbd68aa679334c82f05ed4e138304c485cb4a9748c588cda67a6","src/gles/shaders/clear.frag":"aac702eed9ece5482db5ba6783a678b119a5e7802b1ecf93f4975dee8acab0b3","src/gles/shaders/clear.vert":"8f636168e1da2cac48091c466a543c3b09fb4a0dd8c60c1c9bf34cc890766740","src/gles/shaders/present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"083500c0b36d079a82754895d06b993ea8ed4393690b226c85f07cbec373a730","src/lib.rs":"aff587532db234498bdf8e7282bb3100e378daf547feff4ffa88ea6e0d72da0d","src/metal/adapter.rs":"3d7c105f7368a43beb49df3982a50e700d960d7a1b9dcfca05dc955d44f4af18","src/metal/command.rs":"de41fa5eaa2208abd9ff3d7daf929b17664c445cb26d43331aa84bcc7cfb67cd","src/metal/conv.rs":"517c491a87ba57f275f4a2f130ef1fc2c17528176ebc4813772f9bcd86ffd8e5","src/metal/device.rs":"839f39636c680098c3b9bec20770d2240775f0afeb0dc0111566feab92e9b93b","src/metal/mod.rs":"cb3ea8110d37b525b8718dd9e2b930fef7cc217c9cb5d021e23459b282302b6c","src/metal/surface.rs":"82836cadc751d94fb016bd590cdfec5649cbfae2f44d14599ed074dfb0a004dc","src/vulkan/adapter.rs":"30943968799a96810e25ed79f304b331cafc85598180a6a407675ebdb595c0d0","src/vulkan/command.rs":"60d1867acd0e46c34dabecea708cd776a1f435721b6673a506b5bb8aee87ff80","src/vulkan/conv.rs":"0d7b706a854ff3fdcea0e66f0d8563d9c2aa1f82b2e84692c16f4bfcc3872ed5","src/vulkan/device.rs":"ed980a4cbad2a0aa9d2b6b2b3f28b71121f6773521664baf0bb66e225bbae376","src/vulkan/instance.rs":"49bb57b65c886c14f258e8a7fc183138765310ac7efd2fe3b26115e7942aa1fe","src/vulkan/mod.rs":"bb4d3c01a7a75fa167f03123794f747a21e2cbe0ec93fbf473b1d40f9b2c2d42"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-hal/Cargo.toml b/third_party/rust/wgpu-hal/Cargo.toml index 045aded787390..25deabbc19dfd 100644 --- a/third_party/rust/wgpu-hal/Cargo.toml +++ b/third_party/rust/wgpu-hal/Cargo.toml @@ -8,6 +8,7 @@ homepage = "https://github.com/gfx-rs/wgpu" repository = "https://github.com/gfx-rs/wgpu" keywords = ["graphics"] license = "MIT OR Apache-2.0" +rust-version = "1.59" [lib] @@ -16,8 +17,10 @@ default = [] metal = ["naga/msl-out", "block", "foreign-types"] vulkan = ["naga/spv-out", "ash", "gpu-alloc", "gpu-descriptor", "libloading", "inplace_it"] gles = ["naga/glsl-out", "glow", "egl", "libloading"] +dx11 = ["naga/hlsl-out", "native", "libloading", "winapi/d3d11", "winapi/d3d11_1", "winapi/d3d11_2", "winapi/d3d11sdklayers", "winapi/dxgi1_6"] dx12 = ["naga/hlsl-out", "native", "bit-set", "range-alloc", "winapi/d3d12", "winapi/d3d12shader", "winapi/d3d12sdklayers", "winapi/dxgi1_6"] renderdoc = ["libloading", "renderdoc-sys"] +emscripten = ["gles"] [[example]] name = "halmark" @@ -44,7 +47,7 @@ block = { version = "0.1", optional = true } foreign-types = { version = "0.3", optional = true } # backend: Vulkan -ash = { version = "0.35", optional = true } +ash = { version = "0.37", optional = true } gpu-alloc = { version = "0.5", optional = true } gpu-descriptor = { version = "0.2", optional = true } inplace_it = { version ="0.3.3", optional = true } @@ -66,35 +69,41 @@ egl = { package = "khronos-egl", version = "4.1", features = ["dynamic"], option #Note: it's only unused on Apple platforms libloading = { version = "0.7", optional = true } +[target.'cfg(target_os = "emscripten")'.dependencies] +egl = { package = "khronos-egl", version = "4.1", features = ["static", "no-pkg-config"] } +#Note: it's unused by emscripten, but we keep it to have single code base in egl.rs +libloading = { version = "0.7", optional = true } + [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3", features = ["libloaderapi", "windef", "winuser"] } -native = { package = "d3d12", version = "0.4.1", features = ["libloading"], optional = true } +winapi = { version = "0.3", features = ["libloaderapi", "windef", "winuser", "dcomp"] } +# native = { package = "d3d12", version = "0.4.1", features = ["libloading"], optional = true } +native = { package = "d3d12", git = "https://github.com/gfx-rs/d3d12-rs.git", rev = "ffe5e261da0a6cb85332b82ab310abd2a7e849f6", features = ["libloading"], optional = true } [target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies] -mtl = { package = "metal", git = "https://github.com/gfx-rs/metal-rs", rev = "140c8f4" } +mtl = { package = "metal", git = "https://github.com/gfx-rs/metal-rs", rev = "1aaa903" } objc = "0.2.5" core-graphics-types = "0.1" -[target.'cfg(target_arch = "wasm32")'.dependencies] +[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies] wasm-bindgen = { version = "0.2" } web-sys = { version = "0.3", features = ["Window", "HtmlCanvasElement", "WebGl2RenderingContext"] } js-sys = { version = "0.3" } [dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "c0b7ac7" +rev = "f90e563" #version = "0.8" # DEV dependencies [dev-dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "c0b7ac7" +rev = "f90e563" #version = "0.8" features = ["wgsl-in"] [dev-dependencies] -env_logger = "0.8" +env_logger = "0.9" winit = "0.26" # for "halmark" example [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] diff --git a/third_party/rust/wgpu-hal/examples/halmark/main.rs b/third_party/rust/wgpu-hal/examples/halmark/main.rs index db999445f4420..1ed59325c15a1 100644 --- a/third_party/rust/wgpu-hal/examples/halmark/main.rs +++ b/third_party/rust/wgpu-hal/examples/halmark/main.rs @@ -69,7 +69,7 @@ struct Example { pipeline: A::RenderPipeline, bunnies: Vec, local_buffer: A::Buffer, - local_alignment: wgt::BufferAddress, + local_alignment: u32, global_buffer: A::Buffer, sampler: A::Sampler, texture: A::Texture, @@ -378,22 +378,13 @@ impl Example { buffer }; - fn align_to( - value: wgt::BufferAddress, - alignment: wgt::BufferAddress, - ) -> wgt::BufferAddress { - match value % alignment { - 0 => value, - other => value - other + alignment, - } - } - let local_alignment = align_to( - mem::size_of::() as _, - capabilities.limits.min_uniform_buffer_offset_alignment as _, + let local_alignment = hal::auxil::align_to( + mem::size_of::() as u32, + capabilities.limits.min_uniform_buffer_offset_alignment, ); let local_buffer_desc = hal::BufferDescriptor { label: Some("local"), - size: (MAX_BUNNIES as wgt::BufferAddress) * local_alignment, + size: (MAX_BUNNIES as wgt::BufferAddress) * (local_alignment as wgt::BufferAddress), usage: hal::BufferUses::MAP_WRITE | hal::BufferUses::UNIFORM, memory_flags: hal::MemoryFlags::PREFER_COHERENT, }; diff --git a/third_party/rust/wgpu-hal/examples/halmark/shader.wgsl b/third_party/rust/wgpu-hal/examples/halmark/shader.wgsl index a72128f76203e..960424bb7f1ec 100644 --- a/third_party/rust/wgpu-hal/examples/halmark/shader.wgsl +++ b/third_party/rust/wgpu-hal/examples/halmark/shader.wgsl @@ -1,28 +1,30 @@ struct Globals { - mvp: mat4x4; - size: vec2; + mvp: mat4x4, + size: vec2, }; struct Locals { - position: vec2; - velocity: vec2; - color: u32; + position: vec2, + velocity: vec2, + color: u32, }; -[[group(0), binding(0)]] +@group(0) +@binding(0) var globals: Globals; -[[group(1), binding(0)]] +@group(1) +@binding(0) var locals: Locals; struct VertexOutput { - [[builtin(position)]] position: vec4; - [[location(0)]] tex_coords: vec2; - [[location(1)]] color: vec4; + @builtin(position) position: vec4, + @location(0) tex_coords: vec2, + @location(1) color: vec4, }; -[[stage(vertex)]] -fn vs_main([[builtin(vertex_index)]] vi: u32) -> VertexOutput { +@stage(vertex) +fn vs_main(@builtin(vertex_index) vi: u32) -> VertexOutput { let tc = vec2(f32(vi & 1u), 0.5 * f32(vi & 2u)); let offset = vec2(tc.x * globals.size.x, tc.y * globals.size.y); let pos = globals.mvp * vec4(locals.position + offset, 0.0, 1.0); @@ -30,12 +32,14 @@ fn vs_main([[builtin(vertex_index)]] vi: u32) -> VertexOutput { return VertexOutput(pos, tc, color); } -[[group(0), binding(1)]] +@group(0) +@binding(1) var texture: texture_2d; -[[group(0), binding(2)]] +@group(0) +@binding(2) var sam: sampler; -[[stage(fragment)]] -fn fs_main(in: VertexOutput) -> [[location(0)]] vec4 { +@stage(fragment) +fn fs_main(in: VertexOutput) -> @location(0) vec4 { return in.color * textureSampleLevel(texture, sam, in.tex_coords, 0.0); } diff --git a/third_party/rust/wgpu-hal/examples/raw-gles.em.html b/third_party/rust/wgpu-hal/examples/raw-gles.em.html new file mode 100644 index 0000000000000..f3587e85751e1 --- /dev/null +++ b/third_party/rust/wgpu-hal/examples/raw-gles.em.html @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/third_party/rust/wgpu-hal/examples/raw-gles.rs b/third_party/rust/wgpu-hal/examples/raw-gles.rs index 23cb6df431411..34ad0214782e5 100644 --- a/third_party/rust/wgpu-hal/examples/raw-gles.rs +++ b/third_party/rust/wgpu-hal/examples/raw-gles.rs @@ -1,15 +1,17 @@ //! This example shows interop with raw GLES contexts - //! the ability to hook up wgpu-hal to an existing context and draw into it. +//! +//! Emscripten build: +//! 1. install emsdk +//! 2. build this example with cargo: +//! EMCC_CFLAGS="-g -s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry -s FULL_ES3=1" cargo build --example raw-gles --target wasm32-unknown-emscripten --features emscripten,webgl +//! 3. copy raw-gles.em.html into target directory and open it in browser: +//! cp wgpu-hal/examples/raw-gles.em.html target/wasm32-unknown-emscripten/debug/examples extern crate wgpu_hal as hal; -#[cfg(target_arch = "wasm32")] -fn main() {} - #[cfg(not(target_arch = "wasm32"))] fn main() { - use hal::{Adapter as _, CommandEncoder as _, Device as _, Queue as _}; - env_logger::init(); println!("Initializing external GL context"); @@ -32,6 +34,94 @@ fn main() { }) } .expect("GL adapter can't be initialized"); + + fill_screen(&exposed, inner_size.width, inner_size.height); + + println!("Showing the window"); + gl_context.swap_buffers().unwrap(); + + event_loop.run(move |event, _, control_flow| { + use glutin::{ + event::{Event, KeyboardInput, VirtualKeyCode, WindowEvent}, + event_loop::ControlFlow, + }; + *control_flow = ControlFlow::Wait; + + match event { + Event::LoopDestroyed => return, + Event::WindowEvent { event, .. } => match event { + WindowEvent::CloseRequested + | WindowEvent::KeyboardInput { + input: + KeyboardInput { + virtual_keycode: Some(VirtualKeyCode::Escape), + .. + }, + .. + } => *control_flow = ControlFlow::Exit, + _ => (), + }, + _ => (), + } + }); +} + +#[cfg(feature = "emscripten")] +fn main() { + env_logger::init(); + + println!("Initializing external GL context"); + let egl = egl::Instance::new(egl::Static); + let display = egl.get_display(egl::DEFAULT_DISPLAY).unwrap(); + egl.initialize(display) + .expect("unable to initialize display"); + + let attributes = [ + egl::RED_SIZE, + 8, + egl::GREEN_SIZE, + 8, + egl::BLUE_SIZE, + 8, + egl::NONE, + ]; + + let config = egl + .choose_first_config(display, &attributes) + .unwrap() + .expect("unable to choose config"); + let surface = unsafe { + let window = std::ptr::null_mut::(); + egl.create_window_surface(display, config, window, None) + } + .expect("unable to create surface"); + + let context_attributes = [egl::CONTEXT_CLIENT_VERSION, 3, egl::NONE]; + + let gl_context = egl + .create_context(display, config, None, &context_attributes) + .expect("unable to create context"); + egl.make_current(display, Some(surface), Some(surface), Some(gl_context)) + .expect("can't make context current"); + + println!("Hooking up to wgpu-hal"); + let exposed = unsafe { + ::Adapter::new_external(|name| { + egl.get_proc_address(name) + .map_or(std::ptr::null(), |p| p as *const _) + }) + } + .expect("GL adapter can't be initialized"); + + fill_screen(&exposed, 640, 400); +} + +#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))] +fn main() {} + +fn fill_screen(exposed: &hal::ExposedAdapter, width: u32, height: u32) { + use hal::{Adapter as _, CommandEncoder as _, Device as _, Queue as _}; + let mut od = unsafe { exposed .adapter @@ -68,8 +158,8 @@ fn main() { let rp_desc = hal::RenderPassDescriptor { label: None, extent: wgt::Extent3d { - width: inner_size.width, - height: inner_size.height, + width, + height, depth_or_array_layers: 1, }, sample_count: 1, @@ -92,32 +182,4 @@ fn main() { let cmd_buf = encoder.end_encoding().unwrap(); od.queue.submit(&[&cmd_buf], None).unwrap(); } - - println!("Showing the window"); - gl_context.swap_buffers().unwrap(); - - event_loop.run(move |event, _, control_flow| { - use glutin::{ - event::{Event, KeyboardInput, VirtualKeyCode, WindowEvent}, - event_loop::ControlFlow, - }; - *control_flow = ControlFlow::Wait; - - match event { - Event::LoopDestroyed => return, - Event::WindowEvent { event, .. } => match event { - WindowEvent::CloseRequested - | WindowEvent::KeyboardInput { - input: - KeyboardInput { - virtual_keycode: Some(VirtualKeyCode::Escape), - .. - }, - .. - } => *control_flow = ControlFlow::Exit, - _ => (), - }, - _ => (), - } - }); } diff --git a/third_party/rust/wgpu-hal/src/auxil/dxgi/conv.rs b/third_party/rust/wgpu-hal/src/auxil/dxgi/conv.rs new file mode 100644 index 0000000000000..dfcb95b0fc61b --- /dev/null +++ b/third_party/rust/wgpu-hal/src/auxil/dxgi/conv.rs @@ -0,0 +1,175 @@ +use winapi::shared::dxgiformat; + +pub fn map_texture_format(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { + use wgt::TextureFormat as Tf; + use winapi::shared::dxgiformat::*; + + match format { + Tf::R8Unorm => DXGI_FORMAT_R8_UNORM, + Tf::R8Snorm => DXGI_FORMAT_R8_SNORM, + Tf::R8Uint => DXGI_FORMAT_R8_UINT, + Tf::R8Sint => DXGI_FORMAT_R8_SINT, + Tf::R16Uint => DXGI_FORMAT_R16_UINT, + Tf::R16Sint => DXGI_FORMAT_R16_SINT, + Tf::R16Unorm => DXGI_FORMAT_R16_UNORM, + Tf::R16Snorm => DXGI_FORMAT_R16_SNORM, + Tf::R16Float => DXGI_FORMAT_R16_FLOAT, + Tf::Rg8Unorm => DXGI_FORMAT_R8G8_UNORM, + Tf::Rg8Snorm => DXGI_FORMAT_R8G8_SNORM, + Tf::Rg8Uint => DXGI_FORMAT_R8G8_UINT, + Tf::Rg8Sint => DXGI_FORMAT_R8G8_SINT, + Tf::Rg16Unorm => DXGI_FORMAT_R16G16_UNORM, + Tf::Rg16Snorm => DXGI_FORMAT_R16G16_SNORM, + Tf::R32Uint => DXGI_FORMAT_R32_UINT, + Tf::R32Sint => DXGI_FORMAT_R32_SINT, + Tf::R32Float => DXGI_FORMAT_R32_FLOAT, + Tf::Rg16Uint => DXGI_FORMAT_R16G16_UINT, + Tf::Rg16Sint => DXGI_FORMAT_R16G16_SINT, + Tf::Rg16Float => DXGI_FORMAT_R16G16_FLOAT, + Tf::Rgba8Unorm => DXGI_FORMAT_R8G8B8A8_UNORM, + Tf::Rgba8UnormSrgb => DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + Tf::Bgra8UnormSrgb => DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, + Tf::Rgba8Snorm => DXGI_FORMAT_R8G8B8A8_SNORM, + Tf::Bgra8Unorm => DXGI_FORMAT_B8G8R8A8_UNORM, + Tf::Rgba8Uint => DXGI_FORMAT_R8G8B8A8_UINT, + Tf::Rgba8Sint => DXGI_FORMAT_R8G8B8A8_SINT, + Tf::Rgb10a2Unorm => DXGI_FORMAT_R10G10B10A2_UNORM, + Tf::Rg11b10Float => DXGI_FORMAT_R11G11B10_FLOAT, + Tf::Rg32Uint => DXGI_FORMAT_R32G32_UINT, + Tf::Rg32Sint => DXGI_FORMAT_R32G32_SINT, + Tf::Rg32Float => DXGI_FORMAT_R32G32_FLOAT, + Tf::Rgba16Uint => DXGI_FORMAT_R16G16B16A16_UINT, + Tf::Rgba16Sint => DXGI_FORMAT_R16G16B16A16_SINT, + Tf::Rgba16Unorm => DXGI_FORMAT_R16G16B16A16_UNORM, + Tf::Rgba16Snorm => DXGI_FORMAT_R16G16B16A16_SNORM, + Tf::Rgba16Float => DXGI_FORMAT_R16G16B16A16_FLOAT, + Tf::Rgba32Uint => DXGI_FORMAT_R32G32B32A32_UINT, + Tf::Rgba32Sint => DXGI_FORMAT_R32G32B32A32_SINT, + Tf::Rgba32Float => DXGI_FORMAT_R32G32B32A32_FLOAT, + Tf::Depth32Float => DXGI_FORMAT_D32_FLOAT, + Tf::Depth24Plus => DXGI_FORMAT_D24_UNORM_S8_UINT, + Tf::Depth24PlusStencil8 => DXGI_FORMAT_D24_UNORM_S8_UINT, + Tf::Rgb9e5Ufloat => DXGI_FORMAT_R9G9B9E5_SHAREDEXP, + Tf::Bc1RgbaUnorm => DXGI_FORMAT_BC1_UNORM, + Tf::Bc1RgbaUnormSrgb => DXGI_FORMAT_BC1_UNORM_SRGB, + Tf::Bc2RgbaUnorm => DXGI_FORMAT_BC2_UNORM, + Tf::Bc2RgbaUnormSrgb => DXGI_FORMAT_BC2_UNORM_SRGB, + Tf::Bc3RgbaUnorm => DXGI_FORMAT_BC3_UNORM, + Tf::Bc3RgbaUnormSrgb => DXGI_FORMAT_BC3_UNORM_SRGB, + Tf::Bc4RUnorm => DXGI_FORMAT_BC4_UNORM, + Tf::Bc4RSnorm => DXGI_FORMAT_BC4_SNORM, + Tf::Bc5RgUnorm => DXGI_FORMAT_BC5_UNORM, + Tf::Bc5RgSnorm => DXGI_FORMAT_BC5_SNORM, + Tf::Bc6hRgbUfloat => DXGI_FORMAT_BC6H_UF16, + Tf::Bc6hRgbSfloat => DXGI_FORMAT_BC6H_SF16, + Tf::Bc7RgbaUnorm => DXGI_FORMAT_BC7_UNORM, + Tf::Bc7RgbaUnormSrgb => DXGI_FORMAT_BC7_UNORM_SRGB, + Tf::Etc2Rgb8Unorm + | Tf::Etc2Rgb8UnormSrgb + | Tf::Etc2Rgb8A1Unorm + | Tf::Etc2Rgb8A1UnormSrgb + | Tf::Etc2Rgba8Unorm + | Tf::Etc2Rgba8UnormSrgb + | Tf::EacR11Unorm + | Tf::EacR11Snorm + | Tf::EacRg11Unorm + | Tf::EacRg11Snorm + | Tf::Astc { + block: _, + channel: _, + } => unreachable!(), + } +} + +// Note: DXGI doesn't allow sRGB format on the swapchain, +// but creating RTV of swapchain buffers with sRGB works. +pub fn map_texture_format_nosrgb(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { + match format { + wgt::TextureFormat::Bgra8UnormSrgb => dxgiformat::DXGI_FORMAT_B8G8R8A8_UNORM, + wgt::TextureFormat::Rgba8UnormSrgb => dxgiformat::DXGI_FORMAT_R8G8B8A8_UNORM, + _ => map_texture_format(format), + } +} + +//Note: SRV and UAV can't use the depth formats directly +//TODO: stencil views? +pub fn map_texture_format_nodepth(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { + match format { + wgt::TextureFormat::Depth32Float => dxgiformat::DXGI_FORMAT_R32_FLOAT, + wgt::TextureFormat::Depth24Plus | wgt::TextureFormat::Depth24PlusStencil8 => { + dxgiformat::DXGI_FORMAT_R24_UNORM_X8_TYPELESS + } + _ => { + assert_eq!( + crate::FormatAspects::from(format), + crate::FormatAspects::COLOR + ); + map_texture_format(format) + } + } +} + +pub fn map_texture_format_depth_typeless(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { + match format { + wgt::TextureFormat::Depth32Float => dxgiformat::DXGI_FORMAT_R32_TYPELESS, + wgt::TextureFormat::Depth24Plus | wgt::TextureFormat::Depth24PlusStencil8 => { + dxgiformat::DXGI_FORMAT_R24G8_TYPELESS + } + _ => unreachable!(), + } +} + +pub fn map_index_format(format: wgt::IndexFormat) -> dxgiformat::DXGI_FORMAT { + match format { + wgt::IndexFormat::Uint16 => dxgiformat::DXGI_FORMAT_R16_UINT, + wgt::IndexFormat::Uint32 => dxgiformat::DXGI_FORMAT_R32_UINT, + } +} + +pub fn map_vertex_format(format: wgt::VertexFormat) -> dxgiformat::DXGI_FORMAT { + use wgt::VertexFormat as Vf; + use winapi::shared::dxgiformat::*; + + match format { + Vf::Unorm8x2 => DXGI_FORMAT_R8G8_UNORM, + Vf::Snorm8x2 => DXGI_FORMAT_R8G8_SNORM, + Vf::Uint8x2 => DXGI_FORMAT_R8G8_UINT, + Vf::Sint8x2 => DXGI_FORMAT_R8G8_SINT, + Vf::Unorm8x4 => DXGI_FORMAT_R8G8B8A8_UNORM, + Vf::Snorm8x4 => DXGI_FORMAT_R8G8B8A8_SNORM, + Vf::Uint8x4 => DXGI_FORMAT_R8G8B8A8_UINT, + Vf::Sint8x4 => DXGI_FORMAT_R8G8B8A8_SINT, + Vf::Unorm16x2 => DXGI_FORMAT_R16G16_UNORM, + Vf::Snorm16x2 => DXGI_FORMAT_R16G16_SNORM, + Vf::Uint16x2 => DXGI_FORMAT_R16G16_UINT, + Vf::Sint16x2 => DXGI_FORMAT_R16G16_SINT, + Vf::Float16x2 => DXGI_FORMAT_R16G16_FLOAT, + Vf::Unorm16x4 => DXGI_FORMAT_R16G16B16A16_UNORM, + Vf::Snorm16x4 => DXGI_FORMAT_R16G16B16A16_SNORM, + Vf::Uint16x4 => DXGI_FORMAT_R16G16B16A16_UINT, + Vf::Sint16x4 => DXGI_FORMAT_R16G16B16A16_SINT, + Vf::Float16x4 => DXGI_FORMAT_R16G16B16A16_FLOAT, + Vf::Uint32 => DXGI_FORMAT_R32_UINT, + Vf::Sint32 => DXGI_FORMAT_R32_SINT, + Vf::Float32 => DXGI_FORMAT_R32_FLOAT, + Vf::Uint32x2 => DXGI_FORMAT_R32G32_UINT, + Vf::Sint32x2 => DXGI_FORMAT_R32G32_SINT, + Vf::Float32x2 => DXGI_FORMAT_R32G32_FLOAT, + Vf::Uint32x3 => DXGI_FORMAT_R32G32B32_UINT, + Vf::Sint32x3 => DXGI_FORMAT_R32G32B32_SINT, + Vf::Float32x3 => DXGI_FORMAT_R32G32B32_FLOAT, + Vf::Uint32x4 => DXGI_FORMAT_R32G32B32A32_UINT, + Vf::Sint32x4 => DXGI_FORMAT_R32G32B32A32_SINT, + Vf::Float32x4 => DXGI_FORMAT_R32G32B32A32_FLOAT, + Vf::Float64 | Vf::Float64x2 | Vf::Float64x3 | Vf::Float64x4 => unimplemented!(), + } +} + +pub fn map_acomposite_alpha_mode(mode: crate::CompositeAlphaMode) -> native::AlphaMode { + use crate::CompositeAlphaMode as Cam; + match mode { + Cam::Opaque => native::AlphaMode::Ignore, + Cam::PreMultiplied => native::AlphaMode::Premultiplied, + Cam::PostMultiplied => native::AlphaMode::Straight, + } +} diff --git a/third_party/rust/wgpu-hal/src/auxil/dxgi/exception.rs b/third_party/rust/wgpu-hal/src/auxil/dxgi/exception.rs new file mode 100644 index 0000000000000..31d5e6933a8fe --- /dev/null +++ b/third_party/rust/wgpu-hal/src/auxil/dxgi/exception.rs @@ -0,0 +1,98 @@ +use std::{borrow::Cow, slice}; + +use parking_lot::{lock_api::RawMutex, Mutex}; +use winapi::{ + um::{errhandlingapi, winnt}, + vc::excpt, +}; + +// This is a mutex as opposed to an atomic as we need to completely +// lock everyone out until we have registered or unregistered the +// exception handler, otherwise really nasty races could happen. +// +// By routing all the registration through these functions we can guarentee +// there is either 1 or 0 exception handlers registered, not multiple. +static EXCEPTION_HANLDER_COUNT: Mutex = Mutex::const_new(parking_lot::RawMutex::INIT, 0); + +pub fn register_exception_handler() { + let mut count_guard = EXCEPTION_HANLDER_COUNT.lock(); + if *count_guard == 0 { + unsafe { + errhandlingapi::AddVectoredExceptionHandler(0, Some(output_debug_string_handler)) + }; + } + *count_guard += 1; +} + +pub fn unregister_exception_handler() { + let mut count_guard = EXCEPTION_HANLDER_COUNT.lock(); + if *count_guard == 1 { + unsafe { + errhandlingapi::RemoveVectoredExceptionHandler(output_debug_string_handler as *mut _) + }; + } + *count_guard -= 1; +} + +const MESSAGE_PREFIXES: &[(&str, log::Level)] = &[ + ("CORRUPTION", log::Level::Error), + ("ERROR", log::Level::Error), + ("WARNING", log::Level::Warn), + ("INFO", log::Level::Info), + ("MESSAGE", log::Level::Debug), +]; + +unsafe extern "system" fn output_debug_string_handler( + exception_info: *mut winnt::EXCEPTION_POINTERS, +) -> i32 { + // See https://stackoverflow.com/a/41480827 + let record = &*(*exception_info).ExceptionRecord; + if record.NumberParameters != 2 { + return excpt::EXCEPTION_CONTINUE_SEARCH; + } + let message = match record.ExceptionCode { + winnt::DBG_PRINTEXCEPTION_C => String::from_utf8_lossy(slice::from_raw_parts( + record.ExceptionInformation[1] as *const u8, + record.ExceptionInformation[0], + )), + winnt::DBG_PRINTEXCEPTION_WIDE_C => { + Cow::Owned(String::from_utf16_lossy(slice::from_raw_parts( + record.ExceptionInformation[1] as *const u16, + record.ExceptionInformation[0], + ))) + } + _ => return excpt::EXCEPTION_CONTINUE_SEARCH, + }; + + let message = match message.strip_prefix("D3D12 ") { + Some(msg) => msg + .trim_end_matches("\n\0") + .trim_end_matches("[ STATE_CREATION WARNING #0: UNKNOWN]"), + None => return excpt::EXCEPTION_CONTINUE_SEARCH, + }; + + let (message, level) = match MESSAGE_PREFIXES + .iter() + .find(|&&(prefix, _)| message.starts_with(prefix)) + { + Some(&(prefix, level)) => (&message[prefix.len() + 2..], level), + None => (message, log::Level::Debug), + }; + + if level == log::Level::Warn && message.contains("#82") { + // This is are useless spammy warnings (#820, #821): + // "The application did not pass any clear value to resource creation" + return excpt::EXCEPTION_CONTINUE_SEARCH; + } + + let _ = std::panic::catch_unwind(|| { + log::log!(level, "{}", message); + }); + + if cfg!(debug_assertions) && level == log::Level::Error { + // Set canary and continue + crate::VALIDATION_CANARY.set(); + } + + excpt::EXCEPTION_CONTINUE_EXECUTION +} diff --git a/third_party/rust/wgpu-hal/src/auxil/dxgi/factory.rs b/third_party/rust/wgpu-hal/src/auxil/dxgi/factory.rs new file mode 100644 index 0000000000000..57c94544d9f35 --- /dev/null +++ b/third_party/rust/wgpu-hal/src/auxil/dxgi/factory.rs @@ -0,0 +1,210 @@ +use winapi::{ + shared::{dxgi, dxgi1_2, dxgi1_4, dxgi1_6, winerror}, + Interface, +}; + +use super::result::HResult as _; + +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)] +pub enum DxgiFactoryType { + Factory1, + Factory2, + Factory4, + Factory6, +} + +pub fn enumerate_adapters(factory: native::DxgiFactory) -> Vec { + let mut adapters = Vec::with_capacity(8); + + for cur_index in 0.. { + if let Some(factory6) = factory.as_factory6() { + profiling::scope!("IDXGIFactory6::EnumAdapterByGpuPreference"); + // We're already at dxgi1.6, we can grab IDXGIAdapater4 directly + let mut adapter4 = native::WeakPtr::::null(); + let hr = unsafe { + factory6.EnumAdapterByGpuPreference( + cur_index, + dxgi1_6::DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, + &dxgi1_6::IDXGIAdapter4::uuidof(), + adapter4.mut_void(), + ) + }; + + if hr == winerror::DXGI_ERROR_NOT_FOUND { + break; + } + if let Err(err) = hr.into_result() { + log::error!("Failed enumerating adapters: {}", err); + break; + } + + adapters.push(native::DxgiAdapter::Adapter4(adapter4)); + continue; + } + + profiling::scope!("IDXGIFactory1::EnumAdapters1"); + let mut adapter1 = native::WeakPtr::::null(); + let hr = unsafe { factory.EnumAdapters1(cur_index, adapter1.mut_void() as *mut *mut _) }; + + if hr == winerror::DXGI_ERROR_NOT_FOUND { + break; + } + if let Err(err) = hr.into_result() { + log::error!("Failed enumerating adapters: {}", err); + break; + } + + // Do the most aggressive casts first, skipping Adpater4 as we definitely don't have dxgi1_6. + + // Adapter1 -> Adapter3 + unsafe { + match adapter1.cast::().into_result() { + Ok(adapter3) => { + adapter1.destroy(); + adapters.push(native::DxgiAdapter::Adapter3(adapter3)); + continue; + } + Err(err) => { + log::info!("Failed casting Adapter1 to Adapter3: {}", err); + } + } + } + + // Adapter1 -> Adapter2 + unsafe { + match adapter1.cast::().into_result() { + Ok(adapter2) => { + adapter1.destroy(); + adapters.push(native::DxgiAdapter::Adapter2(adapter2)); + continue; + } + Err(err) => { + log::info!("Failed casting Adapter1 to Adapter2: {}", err); + } + } + } + + adapters.push(native::DxgiAdapter::Adapter1(adapter1)); + } + + adapters +} + +/// Tries to create a IDXGIFactory6, then a IDXGIFactory4, then a IDXGIFactory2, then a IDXGIFactory1, +/// returning the one that succeeds, or if the required_factory_type fails to be +/// created. +pub fn create_factory( + required_factory_type: DxgiFactoryType, + instance_flags: crate::InstanceFlags, +) -> Result<(native::DxgiLib, native::DxgiFactory), crate::InstanceError> { + let lib_dxgi = native::DxgiLib::new().map_err(|_| crate::InstanceError)?; + + let mut factory_flags = native::FactoryCreationFlags::empty(); + + if instance_flags.contains(crate::InstanceFlags::VALIDATION) { + // The `DXGI_CREATE_FACTORY_DEBUG` flag is only allowed to be passed to + // `CreateDXGIFactory2` if the debug interface is actually available. So + // we check for whether it exists first. + match lib_dxgi.get_debug_interface1() { + Ok(pair) => match pair.into_result() { + Ok(debug_controller) => { + unsafe { debug_controller.destroy() }; + factory_flags |= native::FactoryCreationFlags::DEBUG; + } + Err(err) => { + log::warn!("Unable to enable DXGI debug interface: {}", err); + } + }, + Err(err) => { + log::warn!("Debug interface function for DXGI not found: {:?}", err); + } + } + + // Intercept `OutputDebugString` calls + super::exception::register_exception_handler(); + } + + // Try to create IDXGIFactory4 + let factory4 = match lib_dxgi.create_factory2(factory_flags) { + Ok(pair) => match pair.into_result() { + Ok(factory) => Some(factory), + // We hard error here as we _should have_ been able to make a factory4 but couldn't. + Err(err) => { + log::error!("Failed to create IDXGIFactory4: {}", err); + return Err(crate::InstanceError); + } + }, + // If we require factory4, hard error. + Err(err) if required_factory_type == DxgiFactoryType::Factory4 => { + log::error!("IDXGIFactory1 creation function not found: {:?}", err); + return Err(crate::InstanceError); + } + // If we don't print it to info as all win7 will hit this case. + Err(err) => { + log::info!("IDXGIFactory1 creation function not found: {:?}", err); + None + } + }; + + if let Some(factory4) = factory4 { + // Try to cast the IDXGIFactory4 into IDXGIFactory6 + let factory6 = unsafe { factory4.cast::().into_result() }; + match factory6 { + Ok(factory6) => { + unsafe { + factory4.destroy(); + } + return Ok((lib_dxgi, native::DxgiFactory::Factory6(factory6))); + } + // If we require factory6, hard error. + Err(err) if required_factory_type == DxgiFactoryType::Factory6 => { + log::warn!("Failed to cast IDXGIFactory4 to IDXGIFactory6: {:?}", err); + return Err(crate::InstanceError); + } + // If we don't print it to info. + Err(err) => { + log::info!("Failed to cast IDXGIFactory4 to IDXGIFactory6: {:?}", err); + return Ok((lib_dxgi, native::DxgiFactory::Factory4(factory4))); + } + } + } + + // Try to create IDXGIFactory1 + let factory1 = match lib_dxgi.create_factory1() { + Ok(pair) => match pair.into_result() { + Ok(factory) => factory, + Err(err) => { + log::error!("Failed to create IDXGIFactory1: {}", err); + return Err(crate::InstanceError); + } + }, + // We always require at least factory1, so hard error + Err(err) => { + log::error!("IDXGIFactory1 creation function not found: {:?}", err); + return Err(crate::InstanceError); + } + }; + + // Try to cast the IDXGIFactory1 into IDXGIFactory2 + let factory2 = unsafe { factory1.cast::().into_result() }; + match factory2 { + Ok(factory2) => { + unsafe { + factory1.destroy(); + } + return Ok((lib_dxgi, native::DxgiFactory::Factory2(factory2))); + } + // If we require factory2, hard error. + Err(err) if required_factory_type == DxgiFactoryType::Factory2 => { + log::warn!("Failed to cast IDXGIFactory1 to IDXGIFactory2: {:?}", err); + return Err(crate::InstanceError); + } + // If we don't print it to info. + Err(err) => { + log::info!("Failed to cast IDXGIFactory1 to IDXGIFactory2: {:?}", err); + } + } + + // We tried to create 4 and 2, but only succeeded with 1. + Ok((lib_dxgi, native::DxgiFactory::Factory1(factory1))) +} diff --git a/third_party/rust/wgpu-hal/src/auxil/dxgi/mod.rs b/third_party/rust/wgpu-hal/src/auxil/dxgi/mod.rs new file mode 100644 index 0000000000000..09a2b31bf3ffb --- /dev/null +++ b/third_party/rust/wgpu-hal/src/auxil/dxgi/mod.rs @@ -0,0 +1,4 @@ +pub mod conv; +pub mod exception; +pub mod factory; +pub mod result; diff --git a/third_party/rust/wgpu-hal/src/auxil/dxgi/result.rs b/third_party/rust/wgpu-hal/src/auxil/dxgi/result.rs new file mode 100644 index 0000000000000..db013d2dec400 --- /dev/null +++ b/third_party/rust/wgpu-hal/src/auxil/dxgi/result.rs @@ -0,0 +1,42 @@ +use std::borrow::Cow; + +use winapi::shared::winerror; + +pub(crate) trait HResult { + fn into_result(self) -> Result>; + fn into_device_result(self, description: &str) -> Result; +} +impl HResult<()> for i32 { + fn into_result(self) -> Result<(), Cow<'static, str>> { + if self >= 0 { + return Ok(()); + } + let description = match self { + winerror::E_UNEXPECTED => "unexpected", + winerror::E_NOTIMPL => "not implemented", + winerror::E_OUTOFMEMORY => "out of memory", + winerror::E_INVALIDARG => "invalid argument", + _ => return Err(Cow::Owned(format!("0x{:X}", self as u32))), + }; + Err(Cow::Borrowed(description)) + } + fn into_device_result(self, description: &str) -> Result<(), crate::DeviceError> { + self.into_result().map_err(|err| { + log::error!("{} failed: {}", description, err); + if self == winerror::E_OUTOFMEMORY { + crate::DeviceError::OutOfMemory + } else { + crate::DeviceError::Lost + } + }) + } +} + +impl HResult for (T, i32) { + fn into_result(self) -> Result> { + self.1.into_result().map(|()| self.0) + } + fn into_device_result(self, description: &str) -> Result { + self.1.into_device_result(description).map(|()| self.0) + } +} diff --git a/third_party/rust/wgpu-hal/src/auxil/mod.rs b/third_party/rust/wgpu-hal/src/auxil/mod.rs index a157e80565019..f92fa2863e98e 100644 --- a/third_party/rust/wgpu-hal/src/auxil/mod.rs +++ b/third_party/rust/wgpu-hal/src/auxil/mod.rs @@ -1,3 +1,6 @@ +#[cfg(any(feature = "dx11", feature = "dx12"))] +pub(super) mod dxgi; + #[cfg(feature = "renderdoc")] pub(super) mod renderdoc; @@ -29,6 +32,17 @@ pub fn map_naga_stage(stage: naga::ShaderStage) -> wgt::ShaderStages { } } +pub fn align_to(value: u32, alignment: u32) -> u32 { + if alignment.is_power_of_two() { + (value + alignment - 1) & !(alignment - 1) + } else { + match value % alignment { + 0 => value, + other => value - other + alignment, + } + } +} + impl crate::CopyExtent { pub fn min(&self, other: &Self) -> Self { Self { diff --git a/third_party/rust/wgpu-hal/src/dx11/adapter.rs b/third_party/rust/wgpu-hal/src/dx11/adapter.rs new file mode 100644 index 0000000000000..2e4d3b6214950 --- /dev/null +++ b/third_party/rust/wgpu-hal/src/dx11/adapter.rs @@ -0,0 +1,274 @@ +use std::num::NonZeroU64; + +use winapi::um::{d3d11, d3dcommon}; + +impl crate::Adapter for super::Adapter { + unsafe fn open( + &self, + features: wgt::Features, + limits: &wgt::Limits, + ) -> Result, crate::DeviceError> { + todo!() + } + + unsafe fn texture_format_capabilities( + &self, + format: wgt::TextureFormat, + ) -> crate::TextureFormatCapabilities { + todo!() + } + + unsafe fn surface_capabilities( + &self, + surface: &super::Surface, + ) -> Option { + todo!() + } +} + +impl super::Adapter { + pub(super) fn expose( + instance: &super::library::D3D11Lib, + adapter: native::DxgiAdapter, + ) -> Option> { + use d3dcommon::{ + D3D_FEATURE_LEVEL_10_0 as FL10_0, D3D_FEATURE_LEVEL_10_1 as FL10_1, + D3D_FEATURE_LEVEL_11_0 as FL11_0, D3D_FEATURE_LEVEL_11_1 as FL11_1, + D3D_FEATURE_LEVEL_9_1 as FL9_1, D3D_FEATURE_LEVEL_9_2 as FL9_2, + D3D_FEATURE_LEVEL_9_3 as FL9_3, + }; + + let (device, feature_level) = instance.create_device(adapter)?; + + // + // Query Features from d3d11 + // + + let d3d9_features = unsafe { + device.check_feature_support::( + d3d11::D3D11_FEATURE_D3D9_OPTIONS1, + ) + }; + + let d3d10_features = unsafe { + device.check_feature_support::( + d3d11::D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, + ) + }; + + let d3d11_features = unsafe { + device.check_feature_support::( + d3d11::D3D11_FEATURE_D3D11_OPTIONS, + ) + }; + + let d3d11_features1 = unsafe { + device.check_feature_support::( + d3d11::D3D11_FEATURE_D3D11_OPTIONS1, + ) + }; + + let d3d11_features2 = unsafe { + device.check_feature_support::( + d3d11::D3D11_FEATURE_D3D11_OPTIONS2, + ) + }; + + let d3d11_features3 = unsafe { + device.check_feature_support::( + d3d11::D3D11_FEATURE_D3D11_OPTIONS3, + ) + }; + + // + // Fill out features and downlevel features + // + // TODO(cwfitzgerald): Needed downlevel features: 3D dispatch + + let mut features = wgt::Features::DEPTH_CLIP_CONTROL + | wgt::Features::PUSH_CONSTANTS + | wgt::Features::POLYGON_MODE_LINE + | wgt::Features::CLEAR_TEXTURE + | wgt::Features::TEXTURE_FORMAT_16BIT_NORM + | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO; + let mut downlevel = + wgt::DownlevelFlags::BASE_VERTEX | wgt::DownlevelFlags::READ_ONLY_DEPTH_STENCIL; + + // Features from queries + downlevel.set( + wgt::DownlevelFlags::NON_POWER_OF_TWO_MIPMAPPED_TEXTURES, + d3d9_features.FullNonPow2TextureSupported == 1, + ); + downlevel.set( + wgt::DownlevelFlags::COMPUTE_SHADERS, + d3d10_features.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x == 1, + ); + + // Features from feature level + if feature_level >= FL9_2 { + downlevel |= wgt::DownlevelFlags::INDEPENDENT_BLEND; + // formally FL9_1 supports aniso 2, but we don't support that level of distinction + downlevel |= wgt::DownlevelFlags::ANISOTROPIC_FILTERING; + } + + if feature_level >= FL9_3 { + downlevel |= wgt::DownlevelFlags::COMPARISON_SAMPLERS; + } + + if feature_level >= FL10_0 { + downlevel |= wgt::DownlevelFlags::INDEPENDENT_BLEND; + downlevel |= wgt::DownlevelFlags::FRAGMENT_STORAGE; + downlevel |= wgt::DownlevelFlags::FRAGMENT_WRITABLE_STORAGE; + features |= wgt::Features::DEPTH_CLIP_CONTROL; + features |= wgt::Features::TIMESTAMP_QUERY; + features |= wgt::Features::PIPELINE_STATISTICS_QUERY; + } + + if feature_level >= FL10_1 { + downlevel |= wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES; + } + + if feature_level >= FL11_0 { + downlevel |= wgt::DownlevelFlags::INDIRECT_EXECUTION; + features |= wgt::Features::TEXTURE_COMPRESSION_BC; + } + + if feature_level >= FL11_1 { + downlevel |= wgt::DownlevelFlags::VERTEX_STORAGE; + } + + // + // Fill out limits and alignments + // + + let max_texture_dimension_2d = match feature_level { + FL9_1 | FL9_2 => 2048, + FL9_3 => 4096, + FL10_0 | FL10_1 => 8192, + _ => d3d11::D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION, + }; + + let max_texture_dimension_3d = match feature_level { + FL9_1..=FL9_3 => 256, + _ => d3d11::D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, + }; + let max_vertex_buffers = match feature_level { + FL9_1..=FL9_3 => 16, + _ => 32, + }; + let max_compute_workgroup_storage_size = match feature_level { + FL9_1..=FL9_3 => 0, + FL10_0 | FL10_1 => 4096 * 4, // This doesn't have an equiv SM4 constant :\ + _ => d3d11::D3D11_CS_TGSM_REGISTER_COUNT * 4, + }; + let max_workgroup_size_xy = match feature_level { + FL9_1..=FL9_3 => 0, + FL10_0 | FL10_1 => d3d11::D3D11_CS_4_X_THREAD_GROUP_MAX_X, + _ => d3d11::D3D11_CS_THREAD_GROUP_MAX_X, + }; + let max_workgroup_size_z = match feature_level { + FL9_1..=FL9_3 => 0, + FL10_0 | FL10_1 => 1, + _ => d3d11::D3D11_CS_THREAD_GROUP_MAX_Z, + }; + // let max_workgroup_count_z = match feature_level { + // FL9_1..=FL9_3 => 0, + // FL10_0 | FL10_1 => 1, + // _ => d3d11::D3D11_CS_THREAD_GROUP_MAX_Z, + // }; + + let max_sampled_textures = d3d11::D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT; + let max_samplers = d3d11::D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT; + let max_constant_buffers = d3d11::D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1; + let max_uavs = if device.as_device1().is_some() { + d3d11::D3D11_1_UAV_SLOT_COUNT + } else { + d3d11::D3D11_PS_CS_UAV_REGISTER_COUNT + }; + let max_output_registers = d3d11::D3D11_VS_OUTPUT_REGISTER_COMPONENTS; + let max_compute_invocations_per_workgroup = + d3d11::D3D11_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP; + let max_compute_workgroups_per_dimension = + d3d11::D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION; + + let limits = wgt::Limits { + max_texture_dimension_1d: max_texture_dimension_2d, + max_texture_dimension_2d: max_texture_dimension_2d, + max_texture_dimension_3d: max_texture_dimension_3d, + max_texture_array_layers: max_texture_dimension_3d, + max_bind_groups: u32::MAX, + max_dynamic_uniform_buffers_per_pipeline_layout: max_constant_buffers, + max_dynamic_storage_buffers_per_pipeline_layout: 0, + max_sampled_textures_per_shader_stage: max_sampled_textures, + max_samplers_per_shader_stage: max_samplers, + max_storage_buffers_per_shader_stage: max_uavs, + max_storage_textures_per_shader_stage: max_uavs, + max_uniform_buffers_per_shader_stage: max_constant_buffers, + max_uniform_buffer_binding_size: 1 << 16, + max_storage_buffer_binding_size: u32::MAX, + max_vertex_buffers: max_vertex_buffers, + max_vertex_attributes: max_vertex_buffers, + max_vertex_buffer_array_stride: u32::MAX, + max_push_constant_size: 1 << 16, + min_uniform_buffer_offset_alignment: 256, + min_storage_buffer_offset_alignment: 1, + max_inter_stage_shader_components: max_output_registers, + max_compute_workgroup_storage_size, + max_compute_invocations_per_workgroup, + max_compute_workgroup_size_x: max_workgroup_size_xy, + max_compute_workgroup_size_y: max_workgroup_size_xy, + max_compute_workgroup_size_z: max_workgroup_size_z, + max_compute_workgroups_per_dimension, + }; + + // + // Other capabilities + // + + let shader_model = match feature_level { + FL9_1..=FL9_3 => wgt::ShaderModel::Sm2, + FL10_0 | FL10_1 => wgt::ShaderModel::Sm4, + _ => wgt::ShaderModel::Sm5, + }; + + let device_info = wgt::AdapterInfo { + name: String::new(), + vendor: 0, + device: 0, + device_type: match d3d11_features2.UnifiedMemoryArchitecture { + 0 => wgt::DeviceType::DiscreteGpu, + 1 => wgt::DeviceType::IntegratedGpu, + _ => unreachable!(), + }, + backend: wgt::Backend::Dx11, + }; + + // + // Build up the structs + // + + let api_adapter = super::Adapter { device }; + + let alignments = crate::Alignments { + buffer_copy_offset: NonZeroU64::new(1).unwrap(), // todo + buffer_copy_pitch: NonZeroU64::new(1).unwrap(), // todo + }; + + let capabilities = crate::Capabilities { + limits, + alignments, + downlevel: wgt::DownlevelCapabilities { + flags: downlevel, + limits: wgt::DownlevelLimits {}, + shader_model, + }, + }; + + Some(crate::ExposedAdapter { + adapter: api_adapter, + info: device_info, + features, + capabilities, + }) + } +} diff --git a/third_party/rust/wgpu-hal/src/dx11/command.rs b/third_party/rust/wgpu-hal/src/dx11/command.rs new file mode 100644 index 0000000000000..1c73f3c325683 --- /dev/null +++ b/third_party/rust/wgpu-hal/src/dx11/command.rs @@ -0,0 +1,268 @@ +impl crate::CommandEncoder for super::CommandEncoder { + unsafe fn begin_encoding(&mut self, label: crate::Label) -> Result<(), crate::DeviceError> { + todo!() + } + + unsafe fn discard_encoding(&mut self) { + todo!() + } + + unsafe fn end_encoding(&mut self) -> Result { + todo!() + } + + unsafe fn reset_all(&mut self, command_buffers: I) + where + I: Iterator, + { + todo!() + } + + unsafe fn transition_buffers<'a, T>(&mut self, barriers: T) + where + T: Iterator>, + { + todo!() + } + + unsafe fn transition_textures<'a, T>(&mut self, barriers: T) + where + T: Iterator>, + { + todo!() + } + + unsafe fn clear_buffer(&mut self, buffer: &super::Buffer, range: crate::MemoryRange) { + todo!() + } + + unsafe fn copy_buffer_to_buffer( + &mut self, + src: &super::Buffer, + dst: &super::Buffer, + regions: T, + ) where + T: Iterator, + { + todo!() + } + + unsafe fn copy_texture_to_texture( + &mut self, + src: &super::Texture, + src_usage: crate::TextureUses, + dst: &super::Texture, + regions: T, + ) where + T: Iterator, + { + todo!() + } + + unsafe fn copy_buffer_to_texture( + &mut self, + src: &super::Buffer, + dst: &super::Texture, + regions: T, + ) where + T: Iterator, + { + todo!() + } + + unsafe fn copy_texture_to_buffer( + &mut self, + src: &super::Texture, + src_usage: crate::TextureUses, + dst: &super::Buffer, + regions: T, + ) where + T: Iterator, + { + todo!() + } + + unsafe fn set_bind_group( + &mut self, + layout: &super::PipelineLayout, + index: u32, + group: &super::BindGroup, + dynamic_offsets: &[wgt::DynamicOffset], + ) { + todo!() + } + + unsafe fn set_push_constants( + &mut self, + layout: &super::PipelineLayout, + stages: wgt::ShaderStages, + offset: u32, + data: &[u32], + ) { + todo!() + } + + unsafe fn insert_debug_marker(&mut self, label: &str) { + todo!() + } + + unsafe fn begin_debug_marker(&mut self, group_label: &str) { + todo!() + } + + unsafe fn end_debug_marker(&mut self) { + todo!() + } + + unsafe fn begin_query(&mut self, set: &super::QuerySet, index: u32) { + todo!() + } + + unsafe fn end_query(&mut self, set: &super::QuerySet, index: u32) { + todo!() + } + + unsafe fn write_timestamp(&mut self, set: &super::QuerySet, index: u32) { + todo!() + } + + unsafe fn reset_queries(&mut self, set: &super::QuerySet, range: std::ops::Range) { + todo!() + } + + unsafe fn copy_query_results( + &mut self, + set: &super::QuerySet, + range: std::ops::Range, + buffer: &super::Buffer, + offset: wgt::BufferAddress, + stride: wgt::BufferSize, + ) { + todo!() + } + + unsafe fn begin_render_pass(&mut self, desc: &crate::RenderPassDescriptor) { + todo!() + } + + unsafe fn end_render_pass(&mut self) { + todo!() + } + + unsafe fn set_render_pipeline(&mut self, pipeline: &super::RenderPipeline) { + todo!() + } + + unsafe fn set_index_buffer<'a>( + &mut self, + binding: crate::BufferBinding<'a, super::Api>, + format: wgt::IndexFormat, + ) { + todo!() + } + + unsafe fn set_vertex_buffer<'a>( + &mut self, + index: u32, + binding: crate::BufferBinding<'a, super::Api>, + ) { + todo!() + } + + unsafe fn set_viewport(&mut self, rect: &crate::Rect, depth_range: std::ops::Range) { + todo!() + } + + unsafe fn set_scissor_rect(&mut self, rect: &crate::Rect) { + todo!() + } + + unsafe fn set_stencil_reference(&mut self, value: u32) { + todo!() + } + + unsafe fn set_blend_constants(&mut self, color: &[f32; 4]) { + todo!() + } + + unsafe fn draw( + &mut self, + start_vertex: u32, + vertex_count: u32, + start_instance: u32, + instance_count: u32, + ) { + todo!() + } + + unsafe fn draw_indexed( + &mut self, + start_index: u32, + index_count: u32, + base_vertex: i32, + start_instance: u32, + instance_count: u32, + ) { + todo!() + } + + unsafe fn draw_indirect( + &mut self, + buffer: &super::Buffer, + offset: wgt::BufferAddress, + draw_count: u32, + ) { + todo!() + } + + unsafe fn draw_indexed_indirect( + &mut self, + buffer: &super::Buffer, + offset: wgt::BufferAddress, + draw_count: u32, + ) { + todo!() + } + + unsafe fn draw_indirect_count( + &mut self, + buffer: &super::Buffer, + offset: wgt::BufferAddress, + count_buffer: &super::Buffer, + count_offset: wgt::BufferAddress, + max_count: u32, + ) { + todo!() + } + + unsafe fn draw_indexed_indirect_count( + &mut self, + buffer: &super::Buffer, + offset: wgt::BufferAddress, + count_buffer: &super::Buffer, + count_offset: wgt::BufferAddress, + max_count: u32, + ) { + todo!() + } + + unsafe fn begin_compute_pass(&mut self, desc: &crate::ComputePassDescriptor) { + todo!() + } + + unsafe fn end_compute_pass(&mut self) { + todo!() + } + + unsafe fn set_compute_pipeline(&mut self, pipeline: &super::ComputePipeline) { + todo!() + } + + unsafe fn dispatch(&mut self, count: [u32; 3]) { + todo!() + } + + unsafe fn dispatch_indirect(&mut self, buffer: &super::Buffer, offset: wgt::BufferAddress) { + todo!() + } +} diff --git a/third_party/rust/wgpu-hal/src/dx11/device.rs b/third_party/rust/wgpu-hal/src/dx11/device.rs new file mode 100644 index 0000000000000..7b095ba1df334 --- /dev/null +++ b/third_party/rust/wgpu-hal/src/dx11/device.rs @@ -0,0 +1,240 @@ +use std::{ffi::c_void, mem}; + +use winapi::um::d3d11; + +use crate::auxil::dxgi::result::HResult; + +impl crate::Device for super::Device { + unsafe fn exit(self, queue: super::Queue) { + todo!() + } + + unsafe fn create_buffer( + &self, + desc: &crate::BufferDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_buffer(&self, buffer: super::Buffer) { + todo!() + } + + unsafe fn map_buffer( + &self, + buffer: &super::Buffer, + range: crate::MemoryRange, + ) -> Result { + todo!() + } + + unsafe fn unmap_buffer(&self, buffer: &super::Buffer) -> Result<(), crate::DeviceError> { + todo!() + } + + unsafe fn flush_mapped_ranges(&self, buffer: &super::Buffer, ranges: I) + where + I: Iterator, + { + todo!() + } + + unsafe fn invalidate_mapped_ranges(&self, buffer: &super::Buffer, ranges: I) + where + I: Iterator, + { + todo!() + } + + unsafe fn create_texture( + &self, + desc: &crate::TextureDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_texture(&self, texture: super::Texture) { + todo!() + } + + unsafe fn create_texture_view( + &self, + texture: &super::Texture, + desc: &crate::TextureViewDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_texture_view(&self, view: super::TextureView) { + todo!() + } + + unsafe fn create_sampler( + &self, + desc: &crate::SamplerDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_sampler(&self, sampler: super::Sampler) { + todo!() + } + + unsafe fn create_command_encoder( + &self, + desc: &crate::CommandEncoderDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_command_encoder(&self, pool: super::CommandEncoder) { + todo!() + } + + unsafe fn create_bind_group_layout( + &self, + desc: &crate::BindGroupLayoutDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_bind_group_layout(&self, bg_layout: super::BindGroupLayout) { + todo!() + } + + unsafe fn create_pipeline_layout( + &self, + desc: &crate::PipelineLayoutDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_pipeline_layout(&self, pipeline_layout: super::PipelineLayout) { + todo!() + } + + unsafe fn create_bind_group( + &self, + desc: &crate::BindGroupDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_bind_group(&self, group: super::BindGroup) { + todo!() + } + + unsafe fn create_shader_module( + &self, + desc: &crate::ShaderModuleDescriptor, + shader: crate::ShaderInput, + ) -> Result { + todo!() + } + + unsafe fn destroy_shader_module(&self, module: super::ShaderModule) { + todo!() + } + + unsafe fn create_render_pipeline( + &self, + desc: &crate::RenderPipelineDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_render_pipeline(&self, pipeline: super::RenderPipeline) { + todo!() + } + + unsafe fn create_compute_pipeline( + &self, + desc: &crate::ComputePipelineDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_compute_pipeline(&self, pipeline: super::ComputePipeline) { + todo!() + } + + unsafe fn create_query_set( + &self, + desc: &wgt::QuerySetDescriptor, + ) -> Result { + todo!() + } + + unsafe fn destroy_query_set(&self, set: super::QuerySet) { + todo!() + } + + unsafe fn create_fence(&self) -> Result { + todo!() + } + + unsafe fn destroy_fence(&self, fence: super::Fence) { + todo!() + } + + unsafe fn get_fence_value( + &self, + fence: &super::Fence, + ) -> Result { + todo!() + } + + unsafe fn wait( + &self, + fence: &super::Fence, + value: crate::FenceValue, + timeout_ms: u32, + ) -> Result { + todo!() + } + + unsafe fn start_capture(&self) -> bool { + todo!() + } + + unsafe fn stop_capture(&self) { + todo!() + } +} + +impl crate::Queue for super::Queue { + unsafe fn submit( + &mut self, + command_buffers: &[&super::CommandBuffer], + signal_fence: Option<(&mut super::Fence, crate::FenceValue)>, + ) -> Result<(), crate::DeviceError> { + todo!() + } + + unsafe fn present( + &mut self, + surface: &mut super::Surface, + texture: super::SurfaceTexture, + ) -> Result<(), crate::SurfaceError> { + todo!() + } + + unsafe fn get_timestamp_period(&self) -> f32 { + todo!() + } +} + +impl super::D3D11Device { + #[allow(trivial_casts)] // come on + pub unsafe fn check_feature_support(&self, feature: d3d11::D3D11_FEATURE) -> T { + let mut value = mem::zeroed::(); + let ret = self.CheckFeatureSupport( + feature, + &mut value as *mut T as *mut c_void, + mem::size_of::() as u32, + ); + assert_eq!(ret.into_result(), Ok(())); + + value + } +} diff --git a/third_party/rust/wgpu-hal/src/dx11/instance.rs b/third_party/rust/wgpu-hal/src/dx11/instance.rs new file mode 100644 index 0000000000000..ac0fdbe597e24 --- /dev/null +++ b/third_party/rust/wgpu-hal/src/dx11/instance.rs @@ -0,0 +1,47 @@ +use crate::auxil; + +impl crate::Instance for super::Instance { + unsafe fn init(desc: &crate::InstanceDescriptor) -> Result { + let enable_dx11 = match std::env::var("WGPU_UNSTABLE_DX11_BACKEND") { + Ok(string) => string == "1" || string == "true", + Err(_) => false, + }; + + if !enable_dx11 { + return Err(crate::InstanceError); + } + + let lib_d3d11 = super::library::D3D11Lib::new().ok_or(crate::InstanceError)?; + + let (lib_dxgi, factory) = auxil::dxgi::factory::create_factory( + auxil::dxgi::factory::DxgiFactoryType::Factory1, + desc.flags, + )?; + + Ok(super::Instance { + lib_d3d11, + lib_dxgi, + factory, + }) + } + + unsafe fn create_surface( + &self, + rwh: &impl raw_window_handle::HasRawWindowHandle, + ) -> Result { + todo!() + } + + unsafe fn destroy_surface(&self, surface: super::Surface) { + todo!() + } + + unsafe fn enumerate_adapters(&self) -> Vec> { + let adapters = auxil::dxgi::factory::enumerate_adapters(self.factory); + + adapters + .into_iter() + .filter_map(|adapter| super::Adapter::expose(&self.lib_d3d11, adapter)) + .collect() + } +} diff --git a/third_party/rust/wgpu-hal/src/dx11/library.rs b/third_party/rust/wgpu-hal/src/dx11/library.rs new file mode 100644 index 0000000000000..1b2defe4f83ae --- /dev/null +++ b/third_party/rust/wgpu-hal/src/dx11/library.rs @@ -0,0 +1,144 @@ +use std::ptr; + +use winapi::{ + shared::{ + dxgi, + minwindef::{HMODULE, UINT}, + winerror, + }, + um::{d3d11, d3d11_1, d3d11_2, d3dcommon}, +}; + +use crate::auxil::dxgi::result::HResult; + +type D3D11CreateDeviceFun = unsafe extern "system" fn( + *mut dxgi::IDXGIAdapter, + d3dcommon::D3D_DRIVER_TYPE, + HMODULE, + UINT, + *const d3dcommon::D3D_FEATURE_LEVEL, + UINT, + UINT, + *mut *mut d3d11::ID3D11Device, + *mut d3dcommon::D3D_FEATURE_LEVEL, + *mut *mut d3d11::ID3D11DeviceContext, +) -> native::HRESULT; + +pub(super) struct D3D11Lib { + // We use the os specific symbol to drop the lifetime parameter. + // + // SAFETY: we must ensure this outlives the Library. + d3d11_create_device: libloading::os::windows::Symbol, + + lib: libloading::Library, +} +impl D3D11Lib { + pub fn new() -> Option { + unsafe { + let lib = libloading::Library::new("d3d11.dll").ok()?; + + let d3d11_create_device = lib + .get::(b"D3D11CreateDevice") + .ok()? + .into_raw(); + + Some(Self { + lib, + d3d11_create_device, + }) + } + } + + pub fn create_device( + &self, + adapter: native::DxgiAdapter, + ) -> Option<(super::D3D11Device, d3dcommon::D3D_FEATURE_LEVEL)> { + let feature_levels = [ + d3dcommon::D3D_FEATURE_LEVEL_11_1, + d3dcommon::D3D_FEATURE_LEVEL_11_0, + d3dcommon::D3D_FEATURE_LEVEL_10_1, + d3dcommon::D3D_FEATURE_LEVEL_10_0, + d3dcommon::D3D_FEATURE_LEVEL_9_3, + d3dcommon::D3D_FEATURE_LEVEL_9_2, + d3dcommon::D3D_FEATURE_LEVEL_9_1, + ]; + + let mut device = native::WeakPtr::::null(); + let mut feature_level: d3dcommon::D3D_FEATURE_LEVEL = 0; + + // We need to try this twice. If the first time fails due to E_INVALIDARG + // we are running on a machine without a D3D11.1 runtime, and need to + // retry without the feature level 11_1 feature level. + // + // Why they thought this was a good API, who knows. + + let mut hr = unsafe { + (self.d3d11_create_device)( + adapter.as_mut_ptr() as *mut _, + d3dcommon::D3D_DRIVER_TYPE_UNKNOWN, + ptr::null_mut(), // software implementation DLL??? + 0, // flags + feature_levels.as_ptr(), + feature_levels.len() as u32, + d3d11::D3D11_SDK_VERSION, + device.mut_self(), + &mut feature_level, + ptr::null_mut(), // device context + ) + }; + + // Try again without FL11_1 + if hr == winerror::E_INVALIDARG { + hr = unsafe { + (self.d3d11_create_device)( + adapter.as_mut_ptr() as *mut _, + d3dcommon::D3D_DRIVER_TYPE_UNKNOWN, + ptr::null_mut(), // software implementation DLL??? + 0, // flags + feature_levels[1..].as_ptr(), + feature_levels[1..].len() as u32, + d3d11::D3D11_SDK_VERSION, + device.mut_self(), + &mut feature_level, + ptr::null_mut(), // device context + ) + }; + } + + // Any errors here are real and we should complain about + if let Err(err) = hr.into_result() { + log::error!("Failed to make a D3D11 device: {}", err); + return None; + } + + // We always try to upcast in highest -> lowest order + + // Device -> Device2 + unsafe { + match device.cast::().into_result() { + Ok(device2) => { + device.destroy(); + return Some((super::D3D11Device::Device2(device2), feature_level)); + } + Err(hr) => { + log::info!("Failed to cast device to ID3D11Device2: {}", hr) + } + } + } + + // Device -> Device1 + unsafe { + match device.cast::().into_result() { + Ok(device1) => { + device.destroy(); + return Some((super::D3D11Device::Device1(device1), feature_level)); + } + Err(hr) => { + log::info!("Failed to cast device to ID3D11Device1: {}", hr) + } + } + } + + Some((super::D3D11Device::Device(device), feature_level)) + } +} diff --git a/third_party/rust/wgpu-hal/src/dx11/mod.rs b/third_party/rust/wgpu-hal/src/dx11/mod.rs new file mode 100644 index 0000000000000..ff9c49e0b3e4b --- /dev/null +++ b/third_party/rust/wgpu-hal/src/dx11/mod.rs @@ -0,0 +1,135 @@ +#![allow(dead_code)] +#![allow(unused_variables)] + +use winapi::um::{d3d11, d3d11_1, d3d11_2}; + +mod adapter; +mod command; +mod device; +mod instance; +mod library; + +#[derive(Clone)] +pub struct Api; + +impl crate::Api for Api { + type Instance = Instance; + type Surface = Surface; + type Adapter = Adapter; + type Device = Device; + + type Queue = Queue; + type CommandEncoder = CommandEncoder; + type CommandBuffer = CommandBuffer; + + type Buffer = Buffer; + type Texture = Texture; + type SurfaceTexture = SurfaceTexture; + type TextureView = TextureView; + type Sampler = Sampler; + type QuerySet = QuerySet; + type Fence = Fence; + + type BindGroupLayout = BindGroupLayout; + type BindGroup = BindGroup; + type PipelineLayout = PipelineLayout; + type ShaderModule = ShaderModule; + type RenderPipeline = RenderPipeline; + type ComputePipeline = ComputePipeline; +} + +pub struct Instance { + lib_d3d11: library::D3D11Lib, + lib_dxgi: native::DxgiLib, + factory: native::DxgiFactory, +} + +unsafe impl Send for Instance {} +unsafe impl Sync for Instance {} + +pub struct Surface {} + +pub struct Adapter { + device: D3D11Device, +} + +unsafe impl Send for Adapter {} +unsafe impl Sync for Adapter {} + +native::weak_com_inheritance_chain! { + #[derive(Debug, Copy, Clone, PartialEq)] + enum D3D11Device { + Device(d3d11::ID3D11Device), from_device, as_device, device; + Device1(d3d11_1::ID3D11Device1), from_device1, as_device1, unwrap_device1; + Device2(d3d11_2::ID3D11Device2), from_device2, as_device2, unwrap_device2; + } +} + +pub struct Device {} + +unsafe impl Send for Device {} +unsafe impl Sync for Device {} + +pub struct Queue {} + +pub struct CommandEncoder {} + +pub struct CommandBuffer {} + +#[derive(Debug)] +pub struct Buffer {} +#[derive(Debug)] +pub struct Texture {} +#[derive(Debug)] +pub struct SurfaceTexture {} + +impl std::borrow::Borrow for SurfaceTexture { + fn borrow(&self) -> &Texture { + todo!() + } +} + +#[derive(Debug)] +pub struct TextureView {} +#[derive(Debug)] +pub struct Sampler {} +#[derive(Debug)] +pub struct QuerySet {} +#[derive(Debug)] +pub struct Fence {} +#[derive(Debug)] + +pub struct BindGroupLayout {} +#[derive(Debug)] +pub struct BindGroup {} +#[derive(Debug)] +pub struct PipelineLayout {} +#[derive(Debug)] +pub struct ShaderModule {} +pub struct RenderPipeline {} +pub struct ComputePipeline {} + +impl crate::Surface for Surface { + unsafe fn configure( + &mut self, + device: &Device, + config: &crate::SurfaceConfiguration, + ) -> Result<(), crate::SurfaceError> { + todo!() + } + + unsafe fn unconfigure(&mut self, device: &Device) { + todo!() + } + + unsafe fn acquire_texture( + &mut self, + timeout_ms: u32, + ) -> Result>, crate::SurfaceError> { + todo!() + } + + unsafe fn discard_texture(&mut self, texture: SurfaceTexture) { + todo!() + } +} diff --git a/third_party/rust/wgpu-hal/src/dx12/adapter.rs b/third_party/rust/wgpu-hal/src/dx12/adapter.rs index 8f3ebbf152537..88959bdb4758f 100644 --- a/third_party/rust/wgpu-hal/src/dx12/adapter.rs +++ b/third_party/rust/wgpu-hal/src/dx12/adapter.rs @@ -1,4 +1,7 @@ -use super::{conv, HResult as _}; +use crate::{ + auxil::{self, dxgi::result::HResult as _}, + dx12::SurfaceTarget, +}; use std::{mem, sync::Arc, thread}; use winapi::{ shared::{dxgi, dxgi1_2, dxgi1_5, minwindef, windef, winerror}, @@ -40,14 +43,14 @@ impl super::Adapter { #[allow(trivial_casts)] pub(super) fn expose( - adapter: native::WeakPtr, + adapter: native::DxgiAdapter, library: &Arc, instance_flags: crate::InstanceFlags, ) -> Option> { // Create the device so that we can get the capabilities. let device = { profiling::scope!("ID3D12Device::create_device"); - match library.create_device(adapter, native::FeatureLevel::L11_0) { + match library.create_device(*adapter, native::FeatureLevel::L11_0) { Ok(pair) => match pair.into_result() { Ok(device) => device, Err(err) => { @@ -68,7 +71,7 @@ impl super::Adapter { // Acquire the device information. let mut desc: dxgi1_2::DXGI_ADAPTER_DESC2 = unsafe { mem::zeroed() }; unsafe { - adapter.GetDesc2(&mut desc); + adapter.unwrap_adapter2().GetDesc2(&mut desc); } let device_name = { @@ -180,6 +183,7 @@ impl super::Adapter { | wgt::Features::MULTI_DRAW_INDIRECT | wgt::Features::MULTI_DRAW_INDIRECT_COUNT | wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER + | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO | wgt::Features::POLYGON_MODE_LINE | wgt::Features::POLYGON_MODE_POINT | wgt::Features::VERTEX_WRITABLE_STORAGE @@ -316,7 +320,7 @@ impl crate::Adapter for super::Adapter { ) -> crate::TextureFormatCapabilities { use crate::TextureFormatCapabilities as Tfc; - let raw_format = conv::map_texture_format(format); + let raw_format = auxil::dxgi::conv::map_texture_format(format); let mut data = d3d12::D3D12_FEATURE_DATA_FORMAT_SUPPORT { Format: raw_format, Support1: mem::zeroed(), @@ -388,26 +392,27 @@ impl crate::Adapter for super::Adapter { surface: &super::Surface, ) -> Option { let current_extent = { - let mut rect: windef::RECT = mem::zeroed(); - if winuser::GetClientRect(surface.wnd_handle, &mut rect) != 0 { - Some(wgt::Extent3d { - width: (rect.right - rect.left) as u32, - height: (rect.bottom - rect.top) as u32, - depth_or_array_layers: 1, - }) - } else { - log::warn!("Unable to get the window client rect"); - None + match surface.target { + SurfaceTarget::WndHandle(wnd_handle) => { + let mut rect: windef::RECT = mem::zeroed(); + if winuser::GetClientRect(wnd_handle, &mut rect) != 0 { + Some(wgt::Extent3d { + width: (rect.right - rect.left) as u32, + height: (rect.bottom - rect.top) as u32, + depth_or_array_layers: 1, + }) + } else { + log::warn!("Unable to get the window client rect"); + None + } + } + SurfaceTarget::Visual(_) => None, } }; let mut present_modes = vec![wgt::PresentMode::Fifo]; #[allow(trivial_casts)] - if let Ok(factory5) = surface - .factory - .cast::() - .into_result() - { + if let Some(factory5) = surface.factory.as_factory5() { let mut allow_tearing: minwindef::BOOL = minwindef::FALSE; let hr = factory5.CheckFeatureSupport( dxgi1_5::DXGI_FEATURE_PRESENT_ALLOW_TEARING, @@ -415,7 +420,6 @@ impl crate::Adapter for super::Adapter { mem::size_of::() as _, ); - factory5.destroy(); match hr.into_result() { Err(err) => log::warn!("Unable to check for tearing support: {}", err), Ok(()) => present_modes.push(wgt::PresentMode::Immediate), diff --git a/third_party/rust/wgpu-hal/src/dx12/command.rs b/third_party/rust/wgpu-hal/src/dx12/command.rs index 48f72377b07b7..95546d213abb8 100644 --- a/third_party/rust/wgpu-hal/src/dx12/command.rs +++ b/third_party/rust/wgpu-hal/src/dx12/command.rs @@ -1,4 +1,6 @@ -use super::{conv, HResult as _}; +use crate::auxil::{self, dxgi::result::HResult as _}; + +use super::conv; use std::{mem, ops::Range, ptr}; use winapi::um::d3d12; @@ -13,6 +15,40 @@ fn make_box(origin: &wgt::Origin3d, size: &crate::CopyExtent) -> d3d12::D3D12_BO } } +impl crate::BufferTextureCopy { + fn to_subresource_footprint( + &self, + format: wgt::TextureFormat, + ) -> d3d12::D3D12_PLACED_SUBRESOURCE_FOOTPRINT { + let desc = format.describe(); + d3d12::D3D12_PLACED_SUBRESOURCE_FOOTPRINT { + Offset: self.buffer_layout.offset, + Footprint: d3d12::D3D12_SUBRESOURCE_FOOTPRINT { + Format: auxil::dxgi::conv::map_texture_format(format), + Width: self.size.width, + Height: self + .buffer_layout + .rows_per_image + .map_or(self.size.height, |count| { + count.get() * desc.block_dimensions.1 as u32 + }), + Depth: self.size.depth, + RowPitch: { + let actual = match self.buffer_layout.bytes_per_row { + Some(count) => count.get(), + // this may happen for single-line updates + None => { + (self.size.width / desc.block_dimensions.0 as u32) + * desc.block_size as u32 + } + }; + crate::auxil::align_to(actual, d3d12::D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) + }, + }, + } + } +} + impl super::Temp { fn prepare_marker(&mut self, marker: &str) -> (&[u16], u32) { self.marker.clear(); @@ -458,28 +494,10 @@ impl crate::CommandEncoder for super::CommandEncoder { Type: d3d12::D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, u: mem::zeroed(), }; - let raw_format = conv::map_texture_format(dst.format); - - let block_size = dst.format.describe().block_dimensions.0 as u32; for r in regions { let src_box = make_box(&wgt::Origin3d::ZERO, &r.size); - *src_location.u.PlacedFootprint_mut() = d3d12::D3D12_PLACED_SUBRESOURCE_FOOTPRINT { - Offset: r.buffer_layout.offset, - Footprint: d3d12::D3D12_SUBRESOURCE_FOOTPRINT { - Format: raw_format, - Width: r.size.width, - Height: r - .buffer_layout - .rows_per_image - .map_or(r.size.height, |count| count.get() * block_size), - Depth: r.size.depth, - RowPitch: r.buffer_layout.bytes_per_row.map_or(0, |count| { - count.get().max(d3d12::D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) - }), - }, - }; + *src_location.u.PlacedFootprint_mut() = r.to_subresource_footprint(dst.format); *dst_location.u.SubresourceIndex_mut() = dst.calc_subresource_for_copy(&r.texture_base); - list.CopyTextureRegion( &dst_location, r.texture_base.origin.x, @@ -511,26 +529,10 @@ impl crate::CommandEncoder for super::CommandEncoder { Type: d3d12::D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, u: mem::zeroed(), }; - let raw_format = conv::map_texture_format(src.format); - - let block_size = src.format.describe().block_dimensions.0 as u32; for r in regions { let src_box = make_box(&r.texture_base.origin, &r.size); *src_location.u.SubresourceIndex_mut() = src.calc_subresource_for_copy(&r.texture_base); - *dst_location.u.PlacedFootprint_mut() = d3d12::D3D12_PLACED_SUBRESOURCE_FOOTPRINT { - Offset: r.buffer_layout.offset, - Footprint: d3d12::D3D12_SUBRESOURCE_FOOTPRINT { - Format: raw_format, - Width: r.size.width, - Height: r - .buffer_layout - .rows_per_image - .map_or(r.size.height, |count| count.get() * block_size), - Depth: r.size.depth, - RowPitch: r.buffer_layout.bytes_per_row.map_or(0, |count| count.get()), - }, - }; - + *dst_location.u.PlacedFootprint_mut() = r.to_subresource_footprint(src.format); list.CopyTextureRegion(&dst_location, 0, 0, 0, &src_location, &src_box); } } @@ -834,7 +836,7 @@ impl crate::CommandEncoder for super::CommandEncoder { self.list.unwrap().set_index_buffer( binding.resolve_address(), binding.resolve_size() as u32, - conv::map_index_format(format), + auxil::dxgi::conv::map_index_format(format), ); } unsafe fn set_vertex_buffer<'a>( diff --git a/third_party/rust/wgpu-hal/src/dx12/conv.rs b/third_party/rust/wgpu-hal/src/dx12/conv.rs index 3763d31671850..6ea0339afb626 100644 --- a/third_party/rust/wgpu-hal/src/dx12/conv.rs +++ b/third_party/rust/wgpu-hal/src/dx12/conv.rs @@ -1,206 +1,5 @@ use std::iter; -use winapi::{ - shared::{dxgi1_2, dxgiformat}, - um::{d3d12, d3dcommon}, -}; - -pub(super) fn map_texture_format(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { - use wgt::TextureFormat as Tf; - use winapi::shared::dxgiformat::*; - - match format { - Tf::R8Unorm => DXGI_FORMAT_R8_UNORM, - Tf::R8Snorm => DXGI_FORMAT_R8_SNORM, - Tf::R8Uint => DXGI_FORMAT_R8_UINT, - Tf::R8Sint => DXGI_FORMAT_R8_SINT, - Tf::R16Uint => DXGI_FORMAT_R16_UINT, - Tf::R16Sint => DXGI_FORMAT_R16_SINT, - Tf::R16Unorm => DXGI_FORMAT_R16_UNORM, - Tf::R16Snorm => DXGI_FORMAT_R16_SNORM, - Tf::R16Float => DXGI_FORMAT_R16_FLOAT, - Tf::Rg8Unorm => DXGI_FORMAT_R8G8_UNORM, - Tf::Rg8Snorm => DXGI_FORMAT_R8G8_SNORM, - Tf::Rg8Uint => DXGI_FORMAT_R8G8_UINT, - Tf::Rg8Sint => DXGI_FORMAT_R8G8_SINT, - Tf::Rg16Unorm => DXGI_FORMAT_R16G16_UNORM, - Tf::Rg16Snorm => DXGI_FORMAT_R16G16_SNORM, - Tf::R32Uint => DXGI_FORMAT_R32_UINT, - Tf::R32Sint => DXGI_FORMAT_R32_SINT, - Tf::R32Float => DXGI_FORMAT_R32_FLOAT, - Tf::Rg16Uint => DXGI_FORMAT_R16G16_UINT, - Tf::Rg16Sint => DXGI_FORMAT_R16G16_SINT, - Tf::Rg16Float => DXGI_FORMAT_R16G16_FLOAT, - Tf::Rgba8Unorm => DXGI_FORMAT_R8G8B8A8_UNORM, - Tf::Rgba8UnormSrgb => DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, - Tf::Bgra8UnormSrgb => DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, - Tf::Rgba8Snorm => DXGI_FORMAT_R8G8B8A8_SNORM, - Tf::Bgra8Unorm => DXGI_FORMAT_B8G8R8A8_UNORM, - Tf::Rgba8Uint => DXGI_FORMAT_R8G8B8A8_UINT, - Tf::Rgba8Sint => DXGI_FORMAT_R8G8B8A8_SINT, - Tf::Rgb10a2Unorm => DXGI_FORMAT_R10G10B10A2_UNORM, - Tf::Rg11b10Float => DXGI_FORMAT_R11G11B10_FLOAT, - Tf::Rg32Uint => DXGI_FORMAT_R32G32_UINT, - Tf::Rg32Sint => DXGI_FORMAT_R32G32_SINT, - Tf::Rg32Float => DXGI_FORMAT_R32G32_FLOAT, - Tf::Rgba16Uint => DXGI_FORMAT_R16G16B16A16_UINT, - Tf::Rgba16Sint => DXGI_FORMAT_R16G16B16A16_SINT, - Tf::Rgba16Unorm => DXGI_FORMAT_R16G16B16A16_UNORM, - Tf::Rgba16Snorm => DXGI_FORMAT_R16G16B16A16_SNORM, - Tf::Rgba16Float => DXGI_FORMAT_R16G16B16A16_FLOAT, - Tf::Rgba32Uint => DXGI_FORMAT_R32G32B32A32_UINT, - Tf::Rgba32Sint => DXGI_FORMAT_R32G32B32A32_SINT, - Tf::Rgba32Float => DXGI_FORMAT_R32G32B32A32_FLOAT, - Tf::Depth32Float => DXGI_FORMAT_D32_FLOAT, - Tf::Depth24Plus => DXGI_FORMAT_D24_UNORM_S8_UINT, - Tf::Depth24PlusStencil8 => DXGI_FORMAT_D24_UNORM_S8_UINT, - Tf::Rgb9e5Ufloat => DXGI_FORMAT_R9G9B9E5_SHAREDEXP, - Tf::Bc1RgbaUnorm => DXGI_FORMAT_BC1_UNORM, - Tf::Bc1RgbaUnormSrgb => DXGI_FORMAT_BC1_UNORM_SRGB, - Tf::Bc2RgbaUnorm => DXGI_FORMAT_BC2_UNORM, - Tf::Bc2RgbaUnormSrgb => DXGI_FORMAT_BC2_UNORM_SRGB, - Tf::Bc3RgbaUnorm => DXGI_FORMAT_BC3_UNORM, - Tf::Bc3RgbaUnormSrgb => DXGI_FORMAT_BC3_UNORM_SRGB, - Tf::Bc4RUnorm => DXGI_FORMAT_BC4_UNORM, - Tf::Bc4RSnorm => DXGI_FORMAT_BC4_SNORM, - Tf::Bc5RgUnorm => DXGI_FORMAT_BC5_UNORM, - Tf::Bc5RgSnorm => DXGI_FORMAT_BC5_SNORM, - Tf::Bc6hRgbUfloat => DXGI_FORMAT_BC6H_UF16, - Tf::Bc6hRgbSfloat => DXGI_FORMAT_BC6H_SF16, - Tf::Bc7RgbaUnorm => DXGI_FORMAT_BC7_UNORM, - Tf::Bc7RgbaUnormSrgb => DXGI_FORMAT_BC7_UNORM_SRGB, - Tf::Etc2Rgb8Unorm - | Tf::Etc2Rgb8UnormSrgb - | Tf::Etc2Rgb8A1Unorm - | Tf::Etc2Rgb8A1UnormSrgb - | Tf::Etc2Rgba8Unorm - | Tf::Etc2Rgba8UnormSrgb - | Tf::EacR11Unorm - | Tf::EacR11Snorm - | Tf::EacRg11Unorm - | Tf::EacRg11Snorm - | Tf::Astc4x4RgbaUnorm - | Tf::Astc4x4RgbaUnormSrgb - | Tf::Astc5x4RgbaUnorm - | Tf::Astc5x4RgbaUnormSrgb - | Tf::Astc5x5RgbaUnorm - | Tf::Astc5x5RgbaUnormSrgb - | Tf::Astc6x5RgbaUnorm - | Tf::Astc6x5RgbaUnormSrgb - | Tf::Astc6x6RgbaUnorm - | Tf::Astc6x6RgbaUnormSrgb - | Tf::Astc8x5RgbaUnorm - | Tf::Astc8x5RgbaUnormSrgb - | Tf::Astc8x6RgbaUnorm - | Tf::Astc8x6RgbaUnormSrgb - | Tf::Astc10x5RgbaUnorm - | Tf::Astc10x5RgbaUnormSrgb - | Tf::Astc10x6RgbaUnorm - | Tf::Astc10x6RgbaUnormSrgb - | Tf::Astc8x8RgbaUnorm - | Tf::Astc8x8RgbaUnormSrgb - | Tf::Astc10x8RgbaUnorm - | Tf::Astc10x8RgbaUnormSrgb - | Tf::Astc10x10RgbaUnorm - | Tf::Astc10x10RgbaUnormSrgb - | Tf::Astc12x10RgbaUnorm - | Tf::Astc12x10RgbaUnormSrgb - | Tf::Astc12x12RgbaUnorm - | Tf::Astc12x12RgbaUnormSrgb => unreachable!(), - } -} - -//Note: DXGI doesn't allow sRGB format on the swapchain, -// but creating RTV of swapchain buffers with sRGB works. -pub fn map_texture_format_nosrgb(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { - match format { - wgt::TextureFormat::Bgra8UnormSrgb => dxgiformat::DXGI_FORMAT_B8G8R8A8_UNORM, - wgt::TextureFormat::Rgba8UnormSrgb => dxgiformat::DXGI_FORMAT_R8G8B8A8_UNORM, - _ => map_texture_format(format), - } -} - -//Note: SRV and UAV can't use the depth formats directly -//TODO: stencil views? -pub fn map_texture_format_nodepth(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { - match format { - wgt::TextureFormat::Depth32Float => dxgiformat::DXGI_FORMAT_R32_FLOAT, - wgt::TextureFormat::Depth24Plus | wgt::TextureFormat::Depth24PlusStencil8 => { - dxgiformat::DXGI_FORMAT_R24_UNORM_X8_TYPELESS - } - _ => { - assert_eq!( - crate::FormatAspects::from(format), - crate::FormatAspects::COLOR - ); - map_texture_format(format) - } - } -} - -pub fn map_texture_format_depth_typeless(format: wgt::TextureFormat) -> dxgiformat::DXGI_FORMAT { - match format { - wgt::TextureFormat::Depth32Float => dxgiformat::DXGI_FORMAT_R32_TYPELESS, - wgt::TextureFormat::Depth24Plus | wgt::TextureFormat::Depth24PlusStencil8 => { - dxgiformat::DXGI_FORMAT_R24G8_TYPELESS - } - _ => unreachable!(), - } -} - -pub fn map_index_format(format: wgt::IndexFormat) -> dxgiformat::DXGI_FORMAT { - match format { - wgt::IndexFormat::Uint16 => dxgiformat::DXGI_FORMAT_R16_UINT, - wgt::IndexFormat::Uint32 => dxgiformat::DXGI_FORMAT_R32_UINT, - } -} - -pub fn map_vertex_format(format: wgt::VertexFormat) -> dxgiformat::DXGI_FORMAT { - use wgt::VertexFormat as Vf; - use winapi::shared::dxgiformat::*; - - match format { - Vf::Unorm8x2 => DXGI_FORMAT_R8G8_UNORM, - Vf::Snorm8x2 => DXGI_FORMAT_R8G8_SNORM, - Vf::Uint8x2 => DXGI_FORMAT_R8G8_UINT, - Vf::Sint8x2 => DXGI_FORMAT_R8G8_SINT, - Vf::Unorm8x4 => DXGI_FORMAT_R8G8B8A8_UNORM, - Vf::Snorm8x4 => DXGI_FORMAT_R8G8B8A8_SNORM, - Vf::Uint8x4 => DXGI_FORMAT_R8G8B8A8_UINT, - Vf::Sint8x4 => DXGI_FORMAT_R8G8B8A8_SINT, - Vf::Unorm16x2 => DXGI_FORMAT_R16G16_UNORM, - Vf::Snorm16x2 => DXGI_FORMAT_R16G16_SNORM, - Vf::Uint16x2 => DXGI_FORMAT_R16G16_UINT, - Vf::Sint16x2 => DXGI_FORMAT_R16G16_SINT, - Vf::Float16x2 => DXGI_FORMAT_R16G16_FLOAT, - Vf::Unorm16x4 => DXGI_FORMAT_R16G16B16A16_UNORM, - Vf::Snorm16x4 => DXGI_FORMAT_R16G16B16A16_SNORM, - Vf::Uint16x4 => DXGI_FORMAT_R16G16B16A16_UINT, - Vf::Sint16x4 => DXGI_FORMAT_R16G16B16A16_SINT, - Vf::Float16x4 => DXGI_FORMAT_R16G16B16A16_FLOAT, - Vf::Uint32 => DXGI_FORMAT_R32_UINT, - Vf::Sint32 => DXGI_FORMAT_R32_SINT, - Vf::Float32 => DXGI_FORMAT_R32_FLOAT, - Vf::Uint32x2 => DXGI_FORMAT_R32G32_UINT, - Vf::Sint32x2 => DXGI_FORMAT_R32G32_SINT, - Vf::Float32x2 => DXGI_FORMAT_R32G32_FLOAT, - Vf::Uint32x3 => DXGI_FORMAT_R32G32B32_UINT, - Vf::Sint32x3 => DXGI_FORMAT_R32G32B32_SINT, - Vf::Float32x3 => DXGI_FORMAT_R32G32B32_FLOAT, - Vf::Uint32x4 => DXGI_FORMAT_R32G32B32A32_UINT, - Vf::Sint32x4 => DXGI_FORMAT_R32G32B32A32_SINT, - Vf::Float32x4 => DXGI_FORMAT_R32G32B32A32_FLOAT, - Vf::Float64 | Vf::Float64x2 | Vf::Float64x3 | Vf::Float64x4 => unimplemented!(), - } -} - -pub fn map_acomposite_alpha_mode(mode: crate::CompositeAlphaMode) -> dxgi1_2::DXGI_ALPHA_MODE { - use crate::CompositeAlphaMode as Cam; - match mode { - Cam::Opaque => dxgi1_2::DXGI_ALPHA_MODE_IGNORE, - Cam::PreMultiplied => dxgi1_2::DXGI_ALPHA_MODE_PREMULTIPLIED, - Cam::PostMultiplied => dxgi1_2::DXGI_ALPHA_MODE_STRAIGHT, - } -} +use winapi::um::{d3d12, d3dcommon}; pub fn map_buffer_usage_to_resource_flags(usage: crate::BufferUses) -> d3d12::D3D12_RESOURCE_FLAGS { let mut flags = 0; @@ -276,7 +75,7 @@ pub fn map_comparison(func: wgt::CompareFunction) -> d3d12::D3D12_COMPARISON_FUN pub fn map_border_color(border_color: Option) -> [f32; 4] { use wgt::SamplerBorderColor as Sbc; match border_color { - Some(Sbc::TransparentBlack) | None => [0.0; 4], + Some(Sbc::TransparentBlack) | Some(Sbc::Zero) | None => [0.0; 4], Some(Sbc::OpaqueBlack) => [0.0, 0.0, 0.0, 1.0], Some(Sbc::OpaqueWhite) => [1.0; 4], } diff --git a/third_party/rust/wgpu-hal/src/dx12/descriptor.rs b/third_party/rust/wgpu-hal/src/dx12/descriptor.rs index 0a8bac414425c..67c8eca4fee4a 100644 --- a/third_party/rust/wgpu-hal/src/dx12/descriptor.rs +++ b/third_party/rust/wgpu-hal/src/dx12/descriptor.rs @@ -1,4 +1,4 @@ -use super::HResult as _; +use crate::auxil::dxgi::result::HResult as _; use bit_set::BitSet; use parking_lot::Mutex; use range_alloc::RangeAllocator; diff --git a/third_party/rust/wgpu-hal/src/dx12/device.rs b/third_party/rust/wgpu-hal/src/dx12/device.rs index 5294a16275a59..778bd2e51a479 100644 --- a/third_party/rust/wgpu-hal/src/dx12/device.rs +++ b/third_party/rust/wgpu-hal/src/dx12/device.rs @@ -1,6 +1,9 @@ -use crate::FormatAspects; +use crate::{ + auxil::{self, dxgi::result::HResult as _}, + FormatAspects, +}; -use super::{conv, descriptor, view, HResult as _}; +use super::{conv, descriptor, view}; use parking_lot::Mutex; use std::{ffi, mem, num::NonZeroU32, ptr, slice, sync::Arc}; use winapi::{ @@ -432,13 +435,13 @@ impl crate::Device for super::Device { | crate::TextureUses::STORAGE_READ | crate::TextureUses::STORAGE_WRITE, ) { - conv::map_texture_format(desc.format) + auxil::dxgi::conv::map_texture_format(desc.format) } else { // This branch is needed if it's a depth texture, and it's ever needed to be viewed as SRV or UAV, // because then we'd create a non-depth format view of it. // Note: we can skip this branch if // `D3D12_FEATURE_D3D12_OPTIONS3::CastingFullyTypedFormatSupported` - conv::map_texture_format_depth_typeless(desc.format) + auxil::dxgi::conv::map_texture_format_depth_typeless(desc.format) }, SampleDesc: dxgitype::DXGI_SAMPLE_DESC { Count: desc.sample_count, @@ -620,6 +623,8 @@ impl crate::Device for super::Device { .anisotropy_clamp .map_or(0, |_| d3d12::D3D12_FILTER_ANISOTROPIC); + let border_color = conv::map_border_color(desc.border_color); + self.raw.create_sampler( handle.raw, filter, @@ -631,7 +636,7 @@ impl crate::Device for super::Device { 0.0, desc.anisotropy_clamp.map_or(0, |aniso| aniso.get() as u32), conv::map_comparison(desc.compare.unwrap_or(wgt::CompareFunction::Always)), - conv::map_border_color(desc.border_color), + border_color, desc.lod_clamp.clone().unwrap_or(0.0..16.0), ); @@ -1247,7 +1252,7 @@ impl crate::Device for super::Device { input_element_descs.push(d3d12::D3D12_INPUT_ELEMENT_DESC { SemanticName: NAGA_LOCATION_SEMANTIC.as_ptr() as *const _, SemanticIndex: attribute.shader_location, - Format: conv::map_vertex_format(attribute.format), + Format: auxil::dxgi::conv::map_vertex_format(attribute.format), InputSlot: i as u32, AlignedByteOffset: attribute.offset as u32, InputSlotClass: slot_class, @@ -1259,7 +1264,7 @@ impl crate::Device for super::Device { let mut rtv_formats = [dxgiformat::DXGI_FORMAT_UNKNOWN; d3d12::D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT as usize]; for (rtv_format, ct) in rtv_formats.iter_mut().zip(desc.color_targets) { - *rtv_format = conv::map_texture_format(ct.format); + *rtv_format = auxil::dxgi::conv::map_texture_format(ct.format); } let bias = desc @@ -1348,7 +1353,7 @@ impl crate::Device for super::Device { .depth_stencil .as_ref() .map_or(dxgiformat::DXGI_FORMAT_UNKNOWN, |ds| { - conv::map_texture_format(ds.format) + auxil::dxgi::conv::map_texture_format(ds.format) }), SampleDesc: dxgitype::DXGI_SAMPLE_DESC { Count: desc.multisample.count, diff --git a/third_party/rust/wgpu-hal/src/dx12/instance.rs b/third_party/rust/wgpu-hal/src/dx12/instance.rs index c00fce84ce10f..6129d53a7177e 100644 --- a/third_party/rust/wgpu-hal/src/dx12/instance.rs +++ b/third_party/rust/wgpu-hal/src/dx12/instance.rs @@ -1,79 +1,11 @@ -use super::HResult as _; -use std::{borrow::Cow, slice, sync::Arc}; -use winapi::{ - shared::{dxgi, dxgi1_2, dxgi1_6, winerror}, - um::{errhandlingapi, winnt}, - vc::excpt, - Interface, -}; - -const MESSAGE_PREFIXES: &[(&str, log::Level)] = &[ - ("CORRUPTION", log::Level::Error), - ("ERROR", log::Level::Error), - ("WARNING", log::Level::Warn), - ("INFO", log::Level::Info), - ("MESSAGE", log::Level::Debug), -]; - -unsafe extern "system" fn output_debug_string_handler( - exception_info: *mut winnt::EXCEPTION_POINTERS, -) -> i32 { - // See https://stackoverflow.com/a/41480827 - let record = &*(*exception_info).ExceptionRecord; - if record.NumberParameters != 2 { - return excpt::EXCEPTION_CONTINUE_SEARCH; - } - let message = match record.ExceptionCode { - winnt::DBG_PRINTEXCEPTION_C => String::from_utf8_lossy(slice::from_raw_parts( - record.ExceptionInformation[1] as *const u8, - record.ExceptionInformation[0], - )), - winnt::DBG_PRINTEXCEPTION_WIDE_C => { - Cow::Owned(String::from_utf16_lossy(slice::from_raw_parts( - record.ExceptionInformation[1] as *const u16, - record.ExceptionInformation[0], - ))) - } - _ => return excpt::EXCEPTION_CONTINUE_SEARCH, - }; - - let message = match message.strip_prefix("D3D12 ") { - Some(msg) => msg - .trim_end_matches("\n\0") - .trim_end_matches("[ STATE_CREATION WARNING #0: UNKNOWN]"), - None => return excpt::EXCEPTION_CONTINUE_SEARCH, - }; - - let (message, level) = match MESSAGE_PREFIXES - .iter() - .find(|&&(prefix, _)| message.starts_with(prefix)) - { - Some(&(prefix, level)) => (&message[prefix.len() + 2..], level), - None => (message, log::Level::Debug), - }; - - if level == log::Level::Warn && message.contains("#82") { - // This is are useless spammy warnings (#820, #821): - // "The application did not pass any clear value to resource creation" - return excpt::EXCEPTION_CONTINUE_SEARCH; - } - - log::log!(level, "{}", message); - - if cfg!(debug_assertions) && level == log::Level::Error { - // Panicking behind FFI is UB, so we just exit. - std::process::exit(1); - } - - excpt::EXCEPTION_CONTINUE_EXECUTION -} +use super::SurfaceTarget; +use crate::auxil::{self, dxgi::result::HResult as _}; +use std::sync::Arc; impl Drop for super::Instance { fn drop(&mut self) { - unsafe { - self.factory.destroy(); - errhandlingapi::RemoveVectoredExceptionHandler(output_debug_string_handler as *mut _); - } + unsafe { self.factory.destroy() }; + crate::auxil::dxgi::exception::unregister_exception_handler(); } } @@ -81,9 +13,6 @@ impl crate::Instance for super::Instance { unsafe fn init(desc: &crate::InstanceDescriptor) -> Result { let lib_main = native::D3D12Lib::new().map_err(|_| crate::InstanceError)?; - let lib_dxgi = native::DxgiLib::new().map_err(|_| crate::InstanceError)?; - let mut factory_flags = native::FactoryCreationFlags::empty(); - if desc.flags.contains(crate::InstanceFlags::VALIDATION) { // Enable debug layer match lib_main.get_debug_interface() { @@ -100,45 +29,16 @@ impl crate::Instance for super::Instance { log::warn!("Debug interface function for D3D12 not found: {:?}", err); } } - - // The `DXGI_CREATE_FACTORY_DEBUG` flag is only allowed to be passed to - // `CreateDXGIFactory2` if the debug interface is actually available. So - // we check for whether it exists first. - match lib_dxgi.get_debug_interface1() { - Ok(pair) => match pair.into_result() { - Ok(debug_controller) => { - debug_controller.destroy(); - factory_flags |= native::FactoryCreationFlags::DEBUG; - } - Err(err) => { - log::warn!("Unable to enable DXGI debug interface: {}", err); - } - }, - Err(err) => { - log::warn!("Debug interface function for DXGI not found: {:?}", err); - } - } - - // Intercept `OutputDebugString` calls - errhandlingapi::AddVectoredExceptionHandler(0, Some(output_debug_string_handler)); } - // Create DXGI factory - let factory = match lib_dxgi.create_factory2(factory_flags) { - Ok(pair) => match pair.into_result() { - Ok(factory) => factory, - Err(err) => { - log::warn!("Failed to create DXGI factory: {}", err); - return Err(crate::InstanceError); - } - }, - Err(err) => { - log::warn!("Factory creation function for DXGI not found: {:?}", err); - return Err(crate::InstanceError); - } - }; + // Create DXGIFactory4 + let (lib_dxgi, factory) = auxil::dxgi::factory::create_factory( + auxil::dxgi::factory::DxgiFactoryType::Factory4, + desc.flags, + )?; Ok(Self { + // The call to create_factory will only succeed if we get a factory4, so this is safe. factory, library: Arc::new(lib_main), _lib_dxgi: lib_dxgi, @@ -153,7 +53,7 @@ impl crate::Instance for super::Instance { match has_handle.raw_window_handle() { raw_window_handle::RawWindowHandle::Win32(handle) => Ok(super::Surface { factory: self.factory, - wnd_handle: handle.hwnd as *mut _, + target: SurfaceTarget::WndHandle(handle.hwnd as *mut _), swap_chain: None, }), _ => Err(crate::InstanceError), @@ -164,74 +64,11 @@ impl crate::Instance for super::Instance { } unsafe fn enumerate_adapters(&self) -> Vec> { - // Try to use high performance order by default (returns None on Windows < 1803) - let factory6 = match self.factory.cast::().into_result() { - Ok(f6) => { - // It's okay to decrement the refcount here because we - // have another reference to the factory already owned by `self`. - f6.destroy(); - Some(f6) - } - Err(err) => { - log::info!("Failed to cast DXGI to 1.6: {}", err); - None - } - }; - - // Enumerate adapters - let mut adapters = Vec::new(); - for cur_index in 0.. { - let raw = match factory6 { - Some(factory) => { - profiling::scope!("IDXGIFactory6::EnumAdapterByGpuPreference"); - let mut adapter2 = native::WeakPtr::::null(); - let hr = factory.EnumAdapterByGpuPreference( - cur_index, - dxgi1_6::DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, - &dxgi1_2::IDXGIAdapter2::uuidof(), - adapter2.mut_void(), - ); - - if hr == winerror::DXGI_ERROR_NOT_FOUND { - break; - } - if let Err(err) = hr.into_result() { - log::error!("Failed enumerating adapters: {}", err); - break; - } - - adapter2 - } - None => { - profiling::scope!("IDXGIFactory1::EnumAdapters1"); - let mut adapter1 = native::WeakPtr::::null(); - let hr = self - .factory - .EnumAdapters1(cur_index, adapter1.mut_void() as *mut *mut _); + let adapters = auxil::dxgi::factory::enumerate_adapters(self.factory); - if hr == winerror::DXGI_ERROR_NOT_FOUND { - break; - } - if let Err(err) = hr.into_result() { - log::error!("Failed enumerating adapters: {}", err); - break; - } - - match adapter1.cast::().into_result() { - Ok(adapter2) => { - adapter1.destroy(); - adapter2 - } - Err(err) => { - log::error!("Failed casting to Adapter2: {}", err); - break; - } - } - } - }; - - adapters.extend(super::Adapter::expose(raw, &self.library, self.flags)); - } adapters + .into_iter() + .filter_map(|raw| super::Adapter::expose(raw, &self.library, self.flags)) + .collect() } } diff --git a/third_party/rust/wgpu-hal/src/dx12/mod.rs b/third_party/rust/wgpu-hal/src/dx12/mod.rs index b4dd295059022..ffef5a3ada3e3 100644 --- a/third_party/rust/wgpu-hal/src/dx12/mod.rs +++ b/third_party/rust/wgpu-hal/src/dx12/mod.rs @@ -41,12 +41,14 @@ mod device; mod instance; mod view; +use crate::auxil::{self, dxgi::result::HResult as _}; + use arrayvec::ArrayVec; use parking_lot::Mutex; -use std::{borrow::Cow, ffi, mem, num::NonZeroU32, ptr, sync::Arc}; +use std::{ffi, mem, num::NonZeroU32, sync::Arc}; use winapi::{ - shared::{dxgi, dxgi1_2, dxgi1_4, dxgitype, windef, winerror}, - um::{d3d12, synchapi, winbase, winnt}, + shared::{dxgi, dxgi1_4, dxgitype, windef, winerror}, + um::{d3d12, dcomp, synchapi, winbase, winnt}, Interface as _, }; @@ -79,56 +81,30 @@ impl crate::Api for Api { type ComputePipeline = ComputePipeline; } -trait HResult { - fn into_result(self) -> Result>; - fn into_device_result(self, description: &str) -> Result; -} -impl HResult<()> for i32 { - fn into_result(self) -> Result<(), Cow<'static, str>> { - if self >= 0 { - return Ok(()); - } - let description = match self { - winerror::E_UNEXPECTED => "unexpected", - winerror::E_NOTIMPL => "not implemented", - winerror::E_OUTOFMEMORY => "out of memory", - winerror::E_INVALIDARG => "invalid argument", - _ => return Err(Cow::Owned(format!("0x{:X}", self as u32))), - }; - Err(Cow::Borrowed(description)) - } - fn into_device_result(self, description: &str) -> Result<(), crate::DeviceError> { - self.into_result().map_err(|err| { - log::error!("{} failed: {}", description, err); - if self == winerror::E_OUTOFMEMORY { - crate::DeviceError::OutOfMemory - } else { - crate::DeviceError::Lost - } - }) - } -} - -impl HResult for (T, i32) { - fn into_result(self) -> Result> { - self.1.into_result().map(|()| self.0) - } - fn into_device_result(self, description: &str) -> Result { - self.1.into_device_result(description).map(|()| self.0) - } -} - // Limited by D3D12's root signature size of 64. Each element takes 1 or 2 entries. const MAX_ROOT_ELEMENTS: usize = 64; const ZERO_BUFFER_SIZE: wgt::BufferAddress = 256 << 10; pub struct Instance { - factory: native::Factory4, + factory: native::DxgiFactory, library: Arc, _lib_dxgi: native::DxgiLib, flags: crate::InstanceFlags, } +impl Instance { + pub unsafe fn create_surface_from_visual( + &self, + visual: *mut dcomp::IDCompositionVisual, + ) -> Surface { + Surface { + factory: self.factory, + target: SurfaceTarget::Visual(native::WeakPtr::from_raw(visual)), + swap_chain: None, + } + } +} + unsafe impl Send for Instance {} unsafe impl Sync for Instance {} @@ -144,9 +120,14 @@ struct SwapChain { size: wgt::Extent3d, } +enum SurfaceTarget { + WndHandle(windef::HWND), + Visual(native::WeakPtr), +} + pub struct Surface { - factory: native::WeakPtr, - wnd_handle: windef::HWND, + factory: native::DxgiFactory, + target: SurfaceTarget, swap_chain: Option, } @@ -179,7 +160,7 @@ struct Workarounds { } pub struct Adapter { - raw: native::WeakPtr, + raw: native::DxgiAdapter, device: native::Device, library: Arc, private_caps: PrivateCapabilities, @@ -574,7 +555,7 @@ impl crate::Surface for Surface { _ => {} } - let non_srgb_format = conv::map_texture_format_nosrgb(config.format); + let non_srgb_format = auxil::dxgi::conv::map_texture_format_nosrgb(config.format); let swap_chain = match self.swap_chain.take() { //Note: this path doesn't properly re-initialize all of the things @@ -597,40 +578,68 @@ impl crate::Surface for Surface { raw } None => { - let mut swap_chain1 = native::WeakPtr::::null(); - - let raw_desc = dxgi1_2::DXGI_SWAP_CHAIN_DESC1 { - AlphaMode: conv::map_acomposite_alpha_mode(config.composite_alpha_mode), - BufferCount: config.swap_chain_size, - Width: config.extent.width, - Height: config.extent.height, - Format: non_srgb_format, - Flags: flags, - BufferUsage: dxgitype::DXGI_USAGE_RENDER_TARGET_OUTPUT, - SampleDesc: dxgitype::DXGI_SAMPLE_DESC { - Count: 1, - Quality: 0, + let desc = native::SwapchainDesc { + alpha_mode: auxil::dxgi::conv::map_acomposite_alpha_mode( + config.composite_alpha_mode, + ), + width: config.extent.width, + height: config.extent.height, + format: non_srgb_format, + stereo: false, + sample: native::SampleDesc { + count: 1, + quality: 0, }, - Scaling: dxgi1_2::DXGI_SCALING_STRETCH, - Stereo: 0, - SwapEffect: dxgi::DXGI_SWAP_EFFECT_FLIP_DISCARD, + buffer_usage: dxgitype::DXGI_USAGE_RENDER_TARGET_OUTPUT, + buffer_count: config.swap_chain_size, + scaling: native::Scaling::Stretch, + swap_effect: native::SwapEffect::FlipDiscard, + flags, + }; + let swap_chain1 = match self.target { + SurfaceTarget::Visual(_) => { + profiling::scope!("IDXGIFactory4::CreateSwapChainForComposition"); + self.factory + .unwrap_factory2() + .create_swapchain_for_composition( + device.present_queue.as_mut_ptr() as *mut _, + &desc, + ) + .into_result() + } + SurfaceTarget::WndHandle(hwnd) => { + profiling::scope!("IDXGIFactory4::CreateSwapChainForHwnd"); + self.factory + .as_factory2() + .unwrap() + .create_swapchain_for_hwnd( + device.present_queue.as_mut_ptr() as *mut _, + hwnd, + &desc, + ) + .into_result() + } }; - let hr = { - profiling::scope!("IDXGIFactory4::CreateSwapChainForHwnd"); - self.factory.CreateSwapChainForHwnd( - device.present_queue.as_mut_ptr() as *mut _, - self.wnd_handle, - &raw_desc, - ptr::null(), - ptr::null_mut(), - swap_chain1.mut_void() as *mut *mut _, - ) + let swap_chain1 = match swap_chain1 { + Ok(s) => s, + Err(err) => { + log::error!("SwapChain creation error: {}", err); + return Err(crate::SurfaceError::Other("swap chain creation")); + } }; - if let Err(err) = hr.into_result() { - log::error!("SwapChain creation error: {}", err); - return Err(crate::SurfaceError::Other("swap chain creation")); + match self.target { + SurfaceTarget::WndHandle(_) => {} + SurfaceTarget::Visual(visual) => { + if let Err(err) = visual.SetContent(swap_chain1.as_unknown()).into_result() + { + log::error!("Unable to SetContent: {}", err); + return Err(crate::SurfaceError::Other( + "IDCompositionVisual::SetContent", + )); + } + } } match swap_chain1.cast::().into_result() { @@ -646,13 +655,18 @@ impl crate::Surface for Surface { } }; - // Disable automatic Alt+Enter handling by DXGI. - const DXGI_MWA_NO_WINDOW_CHANGES: u32 = 1; - const DXGI_MWA_NO_ALT_ENTER: u32 = 2; - self.factory.MakeWindowAssociation( - self.wnd_handle, - DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER, - ); + match self.target { + SurfaceTarget::WndHandle(wnd_handle) => { + // Disable automatic Alt+Enter handling by DXGI. + const DXGI_MWA_NO_WINDOW_CHANGES: u32 = 1; + const DXGI_MWA_NO_ALT_ENTER: u32 = 2; + self.factory.MakeWindowAssociation( + wnd_handle, + DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER, + ); + } + SurfaceTarget::Visual(_) => {} + } swap_chain.SetMaximumFrameLatency(config.swap_chain_size); let waitable = swap_chain.GetFrameLatencyWaitableObject(); diff --git a/third_party/rust/wgpu-hal/src/dx12/view.rs b/third_party/rust/wgpu-hal/src/dx12/view.rs index 52b3e2f77fc47..81e187aaf1597 100644 --- a/third_party/rust/wgpu-hal/src/dx12/view.rs +++ b/third_party/rust/wgpu-hal/src/dx12/view.rs @@ -1,4 +1,4 @@ -use super::conv; +use crate::auxil; use std::mem; use winapi::um::d3d12; @@ -19,8 +19,8 @@ impl crate::TextureViewDescriptor<'_> { pub(super) fn to_internal(&self, texture: &super::Texture) -> ViewDescriptor { ViewDescriptor { dimension: self.dimension, - format: conv::map_texture_format(self.format), - format_nodepth: conv::map_texture_format_nodepth(self.format), + format: auxil::dxgi::conv::map_texture_format(self.format), + format_nodepth: auxil::dxgi::conv::map_texture_format_nodepth(self.format), multisampled: texture.sample_count > 1, mip_level_base: self.range.base_mip_level, mip_level_count: match self.range.mip_level_count { diff --git a/third_party/rust/wgpu-hal/src/gles/adapter.rs b/third_party/rust/wgpu-hal/src/gles/adapter.rs index e4bb5b60c941a..61dcd56b918a2 100644 --- a/third_party/rust/wgpu-hal/src/gles/adapter.rs +++ b/third_party/rust/wgpu-hal/src/gles/adapter.rs @@ -1,5 +1,6 @@ use glow::HasContext; use std::sync::Arc; +use wgt::AstcChannel; // https://webgl2fundamentals.org/webgl/lessons/webgl-data-textures.html @@ -118,6 +119,7 @@ impl super::Adapter { "mali", "intel", "v3d", + "apple m1", ]; let strings_that_imply_cpu = ["mesa offscreen", "swiftshader", "llvmpipe"]; @@ -259,7 +261,6 @@ impl super::Adapter { }; let mut downlevel_flags = wgt::DownlevelFlags::empty() - | wgt::DownlevelFlags::DEVICE_LOCAL_IMAGE_COPIES | wgt::DownlevelFlags::NON_POWER_OF_TWO_MIPMAPPED_TEXTURES | wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES | wgt::DownlevelFlags::COMPARISON_SAMPLERS; @@ -273,7 +274,7 @@ impl super::Adapter { // as we emulate the `start_instance`. But we can't deal with negatives... downlevel_flags.set(wgt::DownlevelFlags::BASE_VERTEX, ver >= (3, 2)); downlevel_flags.set( - wgt::DownlevelFlags::INDEPENDENT_BLENDING, + wgt::DownlevelFlags::INDEPENDENT_BLEND, ver >= (3, 2) || extensions.contains("GL_EXT_draw_buffers_indexed"), ); downlevel_flags.set( @@ -286,9 +287,10 @@ impl super::Adapter { let mut features = wgt::Features::empty() | wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES - | wgt::Features::CLEAR_TEXTURE; + | wgt::Features::CLEAR_TEXTURE + | wgt::Features::PUSH_CONSTANTS; features.set( - wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER, + wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO, extensions.contains("GL_EXT_texture_border_clamp"), ); features.set( @@ -300,13 +302,31 @@ impl super::Adapter { downlevel_flags.contains(wgt::DownlevelFlags::VERTEX_STORAGE) && vertex_shader_storage_textures != 0, ); + let gles_bcn_exts = [ + "GL_EXT_texture_compression_s3tc_srgb", + "GL_EXT_texture_compression_rgtc", + "GL_EXT_texture_compression_bptc", + ]; + let webgl_bcn_exts = [ + "WEBGL_compressed_texture_s3tc", + "WEBGL_compressed_texture_s3tc_srgb", + "EXT_texture_compression_rgtc", + "EXT_texture_compression_bptc", + ]; + let bcn_exts = if cfg!(target_arch = "wasm32") { + &webgl_bcn_exts[..] + } else { + &gles_bcn_exts[..] + }; + features.set( + wgt::Features::TEXTURE_COMPRESSION_BC, + bcn_exts.iter().all(|&ext| extensions.contains(ext)), + ); features.set( wgt::Features::TEXTURE_COMPRESSION_ETC2, // This is a part of GLES-3 but not WebGL2 core !cfg!(target_arch = "wasm32") || extensions.contains("WEBGL_compressed_texture_etc"), ); - //Note: `wgt::Features::TEXTURE_COMPRESSION_BC` can't be fully supported, but there are - // "WEBGL_compressed_texture_s3tc" and "WEBGL_compressed_texture_s3tc_srgb" which could partially cover it features.set( wgt::Features::TEXTURE_COMPRESSION_ASTC_LDR, extensions.contains("GL_KHR_texture_compression_astc_ldr") @@ -339,6 +359,10 @@ impl super::Adapter { super::PrivateCapabilities::CAN_DISABLE_DRAW_BUFFER, !cfg!(target_arch = "wasm32"), ); + private_caps.set( + super::PrivateCapabilities::GET_BUFFER_SUB_DATA, + cfg!(target_arch = "wasm32"), + ); let max_texture_size = gl.get_parameter_i32(glow::MAX_TEXTURE_SIZE) as u32; let max_texture_3d_size = gl.get_parameter_i32(glow::MAX_3D_TEXTURE_SIZE) as u32; @@ -399,7 +423,7 @@ impl super::Adapter { } else { !0 }, - max_push_constant_size: 0, + max_push_constant_size: super::MAX_PUSH_CONSTANTS as u32 * 4, min_uniform_buffer_offset_alignment, min_storage_buffer_offset_alignment, max_inter_stage_shader_components: gl.get_parameter_i32(glow::MAX_VARYING_COMPONENTS) @@ -470,6 +494,7 @@ impl super::Adapter { private_caps, workarounds, shading_language_version, + max_texture_size, }), }, info: Self::make_info(vendor, renderer), @@ -577,35 +602,59 @@ impl crate::Adapter for super::Adapter { use crate::TextureFormatCapabilities as Tfc; use wgt::TextureFormat as Tf; - // The storage types are sprinkled based on section - // "TEXTURE IMAGE LOADS AND STORES" of GLES-3.2 spec. - let unfiltered_color = - Tfc::SAMPLED | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE | Tfc::MULTISAMPLE_RESOLVE; - let filtered_color = unfiltered_color | Tfc::SAMPLED_LINEAR | Tfc::COLOR_ATTACHMENT_BLEND; + // Base types are pulled from the table in the OpenGLES 3.0 spec in section 3.8. + // + // The storage types are based on table 8.26, in section + // "TEXTURE IMAGE LOADS AND STORES" of OpenGLES-3.2 spec. + let empty = Tfc::empty(); + let unfilterable = Tfc::SAMPLED; + let depth = Tfc::SAMPLED | Tfc::DEPTH_STENCIL_ATTACHMENT; + let filterable = unfilterable | Tfc::SAMPLED_LINEAR; + let renderable = + unfilterable | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE | Tfc::MULTISAMPLE_RESOLVE; + let filterable_renderable = filterable | renderable | Tfc::COLOR_ATTACHMENT_BLEND; + let storage = Tfc::STORAGE | Tfc::STORAGE_READ_WRITE; match format { - Tf::R8Unorm | Tf::R8Snorm => filtered_color, - Tf::R8Uint | Tf::R8Sint | Tf::R16Uint | Tf::R16Sint => unfiltered_color, - Tf::R16Float | Tf::Rg8Unorm | Tf::Rg8Snorm => filtered_color, - Tf::Rg8Uint | Tf::Rg8Sint | Tf::R32Uint | Tf::R32Sint => { - unfiltered_color | Tfc::STORAGE - } - Tf::R16Unorm | Tf::Rg16Unorm | Tf::Rgba16Unorm => filtered_color, - Tf::R16Snorm | Tf::Rg16Snorm | Tf::Rgba16Snorm => filtered_color, - Tf::R32Float => unfiltered_color, - Tf::Rg16Uint | Tf::Rg16Sint => unfiltered_color, - Tf::Rg16Float | Tf::Rgba8Unorm | Tf::Rgba8UnormSrgb => filtered_color | Tfc::STORAGE, - Tf::Bgra8UnormSrgb | Tf::Rgba8Snorm | Tf::Bgra8Unorm => filtered_color, - Tf::Rgba8Uint | Tf::Rgba8Sint => unfiltered_color | Tfc::STORAGE, - Tf::Rgb10a2Unorm | Tf::Rg11b10Float => filtered_color, - Tf::Rg32Uint | Tf::Rg32Sint => unfiltered_color, - Tf::Rg32Float => unfiltered_color | Tfc::STORAGE, - Tf::Rgba16Uint | Tf::Rgba16Sint => unfiltered_color | Tfc::STORAGE, - Tf::Rgba16Float => filtered_color | Tfc::STORAGE, - Tf::Rgba32Uint | Tf::Rgba32Sint => unfiltered_color | Tfc::STORAGE, - Tf::Rgba32Float => unfiltered_color | Tfc::STORAGE, - Tf::Depth32Float => Tfc::SAMPLED | Tfc::DEPTH_STENCIL_ATTACHMENT, - Tf::Depth24Plus => Tfc::SAMPLED | Tfc::DEPTH_STENCIL_ATTACHMENT, - Tf::Depth24PlusStencil8 => Tfc::SAMPLED | Tfc::DEPTH_STENCIL_ATTACHMENT, + Tf::R8Unorm => filterable_renderable, + Tf::R8Snorm => filterable, + Tf::R8Uint => renderable, + Tf::R8Sint => renderable, + Tf::R16Uint => renderable, + Tf::R16Sint => renderable, + Tf::R16Unorm => empty, + Tf::R16Snorm => empty, + Tf::R16Float => filterable, + Tf::Rg8Unorm => filterable_renderable, + Tf::Rg8Snorm => filterable, + Tf::Rg8Uint => renderable, + Tf::Rg8Sint => renderable, + Tf::R32Uint => renderable | storage, + Tf::R32Sint => renderable | storage, + Tf::R32Float => unfilterable | storage, + Tf::Rg16Uint => renderable, + Tf::Rg16Sint => renderable, + Tf::Rg16Unorm => empty, + Tf::Rg16Snorm => empty, + Tf::Rg16Float => filterable, + Tf::Rgba8Unorm | Tf::Rgba8UnormSrgb => filterable_renderable | storage, + Tf::Bgra8Unorm | Tf::Bgra8UnormSrgb => filterable_renderable, + Tf::Rgba8Snorm => filterable, + Tf::Rgba8Uint => renderable | storage, + Tf::Rgba8Sint => renderable | storage, + Tf::Rgb10a2Unorm => filterable_renderable, + Tf::Rg11b10Float => filterable, + Tf::Rg32Uint => renderable, + Tf::Rg32Sint => renderable, + Tf::Rg32Float => unfilterable, + Tf::Rgba16Uint => renderable | storage, + Tf::Rgba16Sint => renderable | storage, + Tf::Rgba16Unorm => empty, + Tf::Rgba16Snorm => empty, + Tf::Rgba16Float => filterable | storage, + Tf::Rgba32Uint => renderable | storage, + Tf::Rgba32Sint => renderable | storage, + Tf::Rgba32Float => unfilterable | storage, + Tf::Depth32Float | Tf::Depth24Plus | Tf::Depth24PlusStencil8 => depth, Tf::Rgb9e5Ufloat | Tf::Bc1RgbaUnorm | Tf::Bc1RgbaUnormSrgb @@ -631,34 +680,14 @@ impl crate::Adapter for super::Adapter { | Tf::EacR11Snorm | Tf::EacRg11Unorm | Tf::EacRg11Snorm - | Tf::Astc4x4RgbaUnorm - | Tf::Astc4x4RgbaUnormSrgb - | Tf::Astc5x4RgbaUnorm - | Tf::Astc5x4RgbaUnormSrgb - | Tf::Astc5x5RgbaUnorm - | Tf::Astc5x5RgbaUnormSrgb - | Tf::Astc6x5RgbaUnorm - | Tf::Astc6x5RgbaUnormSrgb - | Tf::Astc6x6RgbaUnorm - | Tf::Astc6x6RgbaUnormSrgb - | Tf::Astc8x5RgbaUnorm - | Tf::Astc8x5RgbaUnormSrgb - | Tf::Astc8x6RgbaUnorm - | Tf::Astc8x6RgbaUnormSrgb - | Tf::Astc10x5RgbaUnorm - | Tf::Astc10x5RgbaUnormSrgb - | Tf::Astc10x6RgbaUnorm - | Tf::Astc10x6RgbaUnormSrgb - | Tf::Astc8x8RgbaUnorm - | Tf::Astc8x8RgbaUnormSrgb - | Tf::Astc10x8RgbaUnorm - | Tf::Astc10x8RgbaUnormSrgb - | Tf::Astc10x10RgbaUnorm - | Tf::Astc10x10RgbaUnormSrgb - | Tf::Astc12x10RgbaUnorm - | Tf::Astc12x10RgbaUnormSrgb - | Tf::Astc12x12RgbaUnorm - | Tf::Astc12x12RgbaUnormSrgb => Tfc::SAMPLED | Tfc::SAMPLED_LINEAR, + | Tf::Astc { + block: _, + channel: AstcChannel::Unorm | AstcChannel::UnormSrgb, + } => filterable, + Tf::Astc { + block: _, + channel: AstcChannel::Hdr, + } => empty, } } @@ -690,8 +719,8 @@ impl crate::Adapter for super::Adapter { height: 4, depth_or_array_layers: 1, }..=wgt::Extent3d { - width: 4096, - height: 4096, + width: self.shared.max_texture_size, + height: self.shared.max_texture_size, depth_or_array_layers: 1, }, usage: crate::TextureUses::COLOR_TARGET, @@ -702,6 +731,32 @@ impl crate::Adapter for super::Adapter { } } +impl super::AdapterShared { + pub(super) unsafe fn get_buffer_sub_data( + &self, + gl: &glow::Context, + target: u32, + offset: i32, + dst_data: &mut [u8], + ) { + if self + .private_caps + .contains(super::PrivateCapabilities::GET_BUFFER_SUB_DATA) + { + gl.get_buffer_sub_data(target, offset, dst_data); + } else { + log::error!("Fake map"); + let length = dst_data.len(); + let buffer_mapping = + gl.map_buffer_range(target, offset, length as _, glow::MAP_READ_BIT); + + std::ptr::copy_nonoverlapping(buffer_mapping, dst_data.as_mut_ptr(), length); + + gl.unmap_buffer(target); + } + } +} + // SAFE: WASM doesn't have threads #[cfg(target_arch = "wasm32")] unsafe impl Sync for super::Adapter {} diff --git a/third_party/rust/wgpu-hal/src/gles/command.rs b/third_party/rust/wgpu-hal/src/gles/command.rs index a2e80e0f6c8a5..e316844b66cb3 100644 --- a/third_party/rust/wgpu-hal/src/gles/command.rs +++ b/third_party/rust/wgpu-hal/src/gles/command.rs @@ -28,6 +28,8 @@ pub(super) struct State { has_pass_label: bool, instance_vbuf_mask: usize, dirty_vbuf_mask: usize, + active_first_instance: u32, + push_offset_to_uniform: ArrayVec, } impl super::CommandBuffer { @@ -43,6 +45,21 @@ impl super::CommandBuffer { self.data_bytes.extend(marker.as_bytes()); start..self.data_bytes.len() as u32 } + + fn add_push_constant_data(&mut self, data: &[u32]) -> Range { + let data_raw = unsafe { + std::slice::from_raw_parts( + data.as_ptr() as *const _, + data.len() * mem::size_of::(), + ) + }; + let start = self.data_bytes.len(); + assert!(start < u32::MAX as usize); + self.data_bytes.extend_from_slice(data_raw); + let end = self.data_bytes.len(); + assert!(end < u32::MAX as usize); + (start as u32)..(end as u32) + } } impl super::CommandEncoder { @@ -75,34 +92,44 @@ impl super::CommandEncoder { .private_caps .contains(super::PrivateCapabilities::VERTEX_BUFFER_LAYOUT) { - for (index, &(ref vb_desc, ref vb)) in self.state.vertex_buffers.iter().enumerate() { + for (index, pair) in self.state.vertex_buffers.iter().enumerate() { if self.state.dirty_vbuf_mask & (1 << index) == 0 { continue; } - let vb = vb.as_ref().unwrap(); - let instance_offset = match vb_desc.step { + let (buffer_desc, vb) = match *pair { + // Not all dirty bindings are necessarily filled. Some may be unused. + (_, None) => continue, + (ref vb_desc, Some(ref vb)) => (vb_desc.clone(), vb), + }; + let instance_offset = match buffer_desc.step { wgt::VertexStepMode::Vertex => 0, - wgt::VertexStepMode::Instance => first_instance * vb_desc.stride, + wgt::VertexStepMode::Instance => first_instance * buffer_desc.stride, }; + self.cmd_buffer.commands.push(C::SetVertexBuffer { index: index as u32, buffer: super::BufferBinding { raw: vb.raw, offset: vb.offset + instance_offset as wgt::BufferAddress, }, - buffer_desc: vb_desc.clone(), + buffer_desc, }); + self.state.dirty_vbuf_mask ^= 1 << index; } } else { + let mut vbuf_mask = 0; for attribute in self.state.vertex_attributes.iter() { if self.state.dirty_vbuf_mask & (1 << attribute.buffer_index) == 0 { continue; } - let (buffer_desc, buffer) = - self.state.vertex_buffers[attribute.buffer_index as usize].clone(); + let (buffer_desc, vb) = + match self.state.vertex_buffers[attribute.buffer_index as usize] { + // Not all dirty bindings are necessarily filled. Some may be unused. + (_, None) => continue, + (ref vb_desc, Some(ref vb)) => (vb_desc.clone(), vb), + }; let mut attribute_desc = attribute.clone(); - let vb = buffer.unwrap(); attribute_desc.offset += vb.offset as u32; if buffer_desc.step == wgt::VertexStepMode::Instance { attribute_desc.offset += buffer_desc.stride * first_instance; @@ -113,7 +140,9 @@ impl super::CommandEncoder { buffer_desc, attribute_desc, }); + vbuf_mask |= 1 << attribute.buffer_index; } + self.state.dirty_vbuf_mask ^= vbuf_mask; } } @@ -135,21 +164,23 @@ impl super::CommandEncoder { } fn prepare_draw(&mut self, first_instance: u32) { - if first_instance != 0 { + if first_instance != self.state.active_first_instance { + // rebind all per-instance buffers on first-instance change self.state.dirty_vbuf_mask |= self.state.instance_vbuf_mask; + self.state.active_first_instance = first_instance; } if self.state.dirty_vbuf_mask != 0 { self.rebind_vertex_data(first_instance); - let vertex_rate_mask = self.state.dirty_vbuf_mask & !self.state.instance_vbuf_mask; - self.state.dirty_vbuf_mask ^= vertex_rate_mask; } } fn set_pipeline_inner(&mut self, inner: &super::PipelineInner) { self.cmd_buffer.commands.push(C::SetProgram(inner.program)); - //TODO: push constants - let _ = &inner.uniforms; + self.state.push_offset_to_uniform.clear(); + self.state + .push_offset_to_uniform + .extend(inner.uniforms.iter().cloned()); // rebind textures, if needed let mut dirty_textures = 0u32; @@ -521,6 +552,7 @@ impl crate::CommandEncoder for super::CommandEncoder { } self.state.instance_vbuf_mask = 0; self.state.dirty_vbuf_mask = 0; + self.state.active_first_instance = 0; self.state.color_targets.clear(); self.state.vertex_attributes.clear(); self.state.primitive = super::PrimitiveState::default(); @@ -603,10 +635,25 @@ impl crate::CommandEncoder for super::CommandEncoder { &mut self, _layout: &super::PipelineLayout, _stages: wgt::ShaderStages, - _offset: u32, - _data: &[u32], + start_offset: u32, + data: &[u32], ) { - unimplemented!() + let range = self.cmd_buffer.add_push_constant_data(data); + + let end = start_offset + data.len() as u32 * 4; + let mut offset = start_offset; + while offset < end { + let uniform = self.state.push_offset_to_uniform[offset as usize / 4].clone(); + let size = uniform.size; + if uniform.location.is_none() { + panic!("No uniform for push constant"); + } + self.cmd_buffer.commands.push(C::SetPushConstants { + uniform, + offset: range.start + offset, + }); + offset += size; + } } unsafe fn insert_debug_marker(&mut self, label: &str) { diff --git a/third_party/rust/wgpu-hal/src/gles/conv.rs b/third_party/rust/wgpu-hal/src/gles/conv.rs index 09c269143acc1..d7a9268c287dd 100644 --- a/third_party/rust/wgpu-hal/src/gles/conv.rs +++ b/third_party/rust/wgpu-hal/src/gles/conv.rs @@ -4,10 +4,11 @@ impl super::AdapterShared { texture_format: wgt::TextureFormat, ) -> super::TextureFormatDesc { use wgt::TextureFormat as Tf; + use wgt::{AstcBlock, AstcChannel}; let (internal, external, data_type) = match texture_format { Tf::R8Unorm => (glow::R8, glow::RED, glow::UNSIGNED_BYTE), - Tf::R8Snorm => (glow::R8, glow::RED, glow::BYTE), + Tf::R8Snorm => (glow::R8_SNORM, glow::RED, glow::BYTE), Tf::R8Uint => (glow::R8UI, glow::RED_INTEGER, glow::UNSIGNED_BYTE), Tf::R8Sint => (glow::R8I, glow::RED_INTEGER, glow::BYTE), Tf::R16Uint => (glow::R16UI, glow::RED_INTEGER, glow::UNSIGNED_SHORT), @@ -16,7 +17,7 @@ impl super::AdapterShared { Tf::R16Snorm => (glow::R16_SNORM, glow::RED, glow::SHORT), Tf::R16Float => (glow::R16F, glow::RED, glow::HALF_FLOAT), Tf::Rg8Unorm => (glow::RG8, glow::RG, glow::UNSIGNED_BYTE), - Tf::Rg8Snorm => (glow::RG8, glow::RG, glow::BYTE), + Tf::Rg8Snorm => (glow::RG8_SNORM, glow::RG, glow::BYTE), Tf::Rg8Uint => (glow::RG8UI, glow::RG_INTEGER, glow::UNSIGNED_BYTE), Tf::Rg8Sint => (glow::RG8I, glow::RG_INTEGER, glow::BYTE), Tf::R32Uint => (glow::R32UI, glow::RED_INTEGER, glow::UNSIGNED_INT), @@ -29,9 +30,9 @@ impl super::AdapterShared { Tf::Rg16Float => (glow::RG16F, glow::RG, glow::HALF_FLOAT), Tf::Rgba8Unorm => (glow::RGBA8, glow::RGBA, glow::UNSIGNED_BYTE), Tf::Rgba8UnormSrgb => (glow::SRGB8_ALPHA8, glow::RGBA, glow::UNSIGNED_BYTE), - Tf::Bgra8UnormSrgb => (glow::SRGB8_ALPHA8, glow::RGBA, glow::UNSIGNED_BYTE), //TODO? - Tf::Rgba8Snorm => (glow::RGBA8, glow::RGBA, glow::BYTE), - Tf::Bgra8Unorm => (glow::RGBA8, glow::BGRA, glow::UNSIGNED_BYTE), + Tf::Bgra8UnormSrgb => (glow::SRGB8_ALPHA8, glow::BGRA, glow::UNSIGNED_BYTE), //TODO? + Tf::Rgba8Snorm => (glow::RGBA8_SNORM, glow::RGBA, glow::BYTE), + Tf::Bgra8Unorm => (glow::RGBA8, glow::BGRA, glow::UNSIGNED_BYTE), //TODO? Tf::Rgba8Uint => (glow::RGBA8UI, glow::RGBA_INTEGER, glow::UNSIGNED_BYTE), Tf::Rgba8Sint => (glow::RGBA8I, glow::RGBA_INTEGER, glow::BYTE), Tf::Rgb10a2Unorm => ( @@ -73,14 +74,14 @@ impl super::AdapterShared { Tf::Bc2RgbaUnormSrgb => (glow::COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, glow::RGBA, 0), Tf::Bc3RgbaUnorm => (glow::COMPRESSED_RGBA_S3TC_DXT5_EXT, glow::RGBA, 0), Tf::Bc3RgbaUnormSrgb => (glow::COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, glow::RGBA, 0), - Tf::Bc4RUnorm - | Tf::Bc4RSnorm - | Tf::Bc5RgUnorm - | Tf::Bc5RgSnorm - | Tf::Bc6hRgbUfloat - | Tf::Bc6hRgbSfloat - | Tf::Bc7RgbaUnorm - | Tf::Bc7RgbaUnormSrgb => unimplemented!(), + Tf::Bc4RUnorm => (glow::COMPRESSED_RED_RGTC1, glow::RED, 0), + Tf::Bc4RSnorm => (glow::COMPRESSED_SIGNED_RED_RGTC1, glow::RED, 0), + Tf::Bc5RgUnorm => (glow::COMPRESSED_RG_RGTC2, glow::RG, 0), + Tf::Bc5RgSnorm => (glow::COMPRESSED_SIGNED_RG_RGTC2, glow::RG, 0), + Tf::Bc6hRgbUfloat => (glow::COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT, glow::RGB, 0), + Tf::Bc6hRgbSfloat => (glow::COMPRESSED_RGB_BPTC_SIGNED_FLOAT, glow::RGB, 0), + Tf::Bc7RgbaUnorm => (glow::COMPRESSED_RGBA_BPTC_UNORM, glow::RGBA, 0), + Tf::Bc7RgbaUnormSrgb => (glow::COMPRESSED_SRGB_ALPHA_BPTC_UNORM, glow::RGBA, 0), Tf::Etc2Rgb8Unorm => (glow::COMPRESSED_RGB8_ETC2, glow::RGB, 0), Tf::Etc2Rgb8UnormSrgb => (glow::COMPRESSED_SRGB8_ETC2, glow::RGB, 0), Tf::Etc2Rgb8A1Unorm => ( @@ -104,46 +105,53 @@ impl super::AdapterShared { Tf::EacR11Snorm => (glow::COMPRESSED_SIGNED_R11_EAC, glow::RED, 0), Tf::EacRg11Unorm => (glow::COMPRESSED_RG11_EAC, glow::RG, 0), Tf::EacRg11Snorm => (glow::COMPRESSED_SIGNED_RG11_EAC, glow::RG, 0), - Tf::Astc4x4RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_4x4_KHR, glow::RGBA, 0), - Tf::Astc4x4RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, glow::RGBA, 0), - Tf::Astc5x4RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_5x4_KHR, glow::RGBA, 0), - Tf::Astc5x4RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, glow::RGBA, 0), - Tf::Astc5x5RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_5x5_KHR, glow::RGBA, 0), - Tf::Astc5x5RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, glow::RGBA, 0), - Tf::Astc6x5RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_6x5_KHR, glow::RGBA, 0), - Tf::Astc6x5RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, glow::RGBA, 0), - Tf::Astc6x6RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_6x6_KHR, glow::RGBA, 0), - Tf::Astc6x6RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, glow::RGBA, 0), - Tf::Astc8x5RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_8x5_KHR, glow::RGBA, 0), - Tf::Astc8x5RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, glow::RGBA, 0), - Tf::Astc8x6RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_8x6_KHR, glow::RGBA, 0), - Tf::Astc8x6RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, glow::RGBA, 0), - Tf::Astc8x8RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_8x8_KHR, glow::RGBA, 0), - Tf::Astc8x8RgbaUnormSrgb => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, glow::RGBA, 0), - Tf::Astc10x5RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_10x5_KHR, glow::RGBA, 0), - Tf::Astc10x5RgbaUnormSrgb => { - (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, glow::RGBA, 0) - } - Tf::Astc10x6RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_10x6_KHR, glow::RGBA, 0), - Tf::Astc10x6RgbaUnormSrgb => { - (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, glow::RGBA, 0) - } - Tf::Astc10x8RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_10x8_KHR, glow::RGBA, 0), - Tf::Astc10x8RgbaUnormSrgb => { - (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, glow::RGBA, 0) - } - Tf::Astc10x10RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_10x10_KHR, glow::RGBA, 0), - Tf::Astc10x10RgbaUnormSrgb => { - (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, glow::RGBA, 0) - } - Tf::Astc12x10RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_12x10_KHR, glow::RGBA, 0), - Tf::Astc12x10RgbaUnormSrgb => { - (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, glow::RGBA, 0) - } - Tf::Astc12x12RgbaUnorm => (glow::COMPRESSED_RGBA_ASTC_12x12_KHR, glow::RGBA, 0), - Tf::Astc12x12RgbaUnormSrgb => { - (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, glow::RGBA, 0) - } + Tf::Astc { block, channel } => match channel { + AstcChannel::Unorm => match block { + AstcBlock::B4x4 => (glow::COMPRESSED_RGBA_ASTC_4x4_KHR, glow::RGBA, 0), + AstcBlock::B5x4 => (glow::COMPRESSED_RGBA_ASTC_5x4_KHR, glow::RGBA, 0), + AstcBlock::B5x5 => (glow::COMPRESSED_RGBA_ASTC_5x5_KHR, glow::RGBA, 0), + AstcBlock::B6x5 => (glow::COMPRESSED_RGBA_ASTC_6x5_KHR, glow::RGBA, 0), + AstcBlock::B6x6 => (glow::COMPRESSED_RGBA_ASTC_6x6_KHR, glow::RGBA, 0), + AstcBlock::B8x5 => (glow::COMPRESSED_RGBA_ASTC_8x5_KHR, glow::RGBA, 0), + AstcBlock::B8x6 => (glow::COMPRESSED_RGBA_ASTC_8x6_KHR, glow::RGBA, 0), + AstcBlock::B8x8 => (glow::COMPRESSED_RGBA_ASTC_8x8_KHR, glow::RGBA, 0), + AstcBlock::B10x5 => (glow::COMPRESSED_RGBA_ASTC_10x5_KHR, glow::RGBA, 0), + AstcBlock::B10x6 => (glow::COMPRESSED_RGBA_ASTC_10x6_KHR, glow::RGBA, 0), + AstcBlock::B10x8 => (glow::COMPRESSED_RGBA_ASTC_10x8_KHR, glow::RGBA, 0), + AstcBlock::B10x10 => (glow::COMPRESSED_RGBA_ASTC_10x10_KHR, glow::RGBA, 0), + AstcBlock::B12x10 => (glow::COMPRESSED_RGBA_ASTC_12x10_KHR, glow::RGBA, 0), + AstcBlock::B12x12 => (glow::COMPRESSED_RGBA_ASTC_12x12_KHR, glow::RGBA, 0), + }, + AstcChannel::UnormSrgb => match block { + AstcBlock::B4x4 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, glow::RGBA, 0), + AstcBlock::B5x4 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, glow::RGBA, 0), + AstcBlock::B5x5 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, glow::RGBA, 0), + AstcBlock::B6x5 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, glow::RGBA, 0), + AstcBlock::B6x6 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, glow::RGBA, 0), + AstcBlock::B8x5 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, glow::RGBA, 0), + AstcBlock::B8x6 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, glow::RGBA, 0), + AstcBlock::B8x8 => (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, glow::RGBA, 0), + AstcBlock::B10x5 => { + (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, glow::RGBA, 0) + } + AstcBlock::B10x6 => { + (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, glow::RGBA, 0) + } + AstcBlock::B10x8 => { + (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, glow::RGBA, 0) + } + AstcBlock::B10x10 => { + (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, glow::RGBA, 0) + } + AstcBlock::B12x10 => { + (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, glow::RGBA, 0) + } + AstcBlock::B12x12 => { + (glow::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, glow::RGBA, 0) + } + }, + AstcChannel::Hdr => unimplemented!(), + }, }; super::TextureFormatDesc { @@ -375,3 +383,59 @@ pub(super) fn map_storage_access(access: wgt::StorageTextureAccess) -> u32 { wgt::StorageTextureAccess::ReadWrite => glow::READ_WRITE, } } + +pub(super) fn is_sampler(glsl_uniform_type: u32) -> bool { + match glsl_uniform_type { + glow::INT_SAMPLER_1D + | glow::INT_SAMPLER_1D_ARRAY + | glow::INT_SAMPLER_2D + | glow::INT_SAMPLER_2D_ARRAY + | glow::INT_SAMPLER_2D_MULTISAMPLE + | glow::INT_SAMPLER_2D_MULTISAMPLE_ARRAY + | glow::INT_SAMPLER_2D_RECT + | glow::INT_SAMPLER_3D + | glow::INT_SAMPLER_CUBE + | glow::INT_SAMPLER_CUBE_MAP_ARRAY + | glow::UNSIGNED_INT_SAMPLER_1D + | glow::UNSIGNED_INT_SAMPLER_1D_ARRAY + | glow::UNSIGNED_INT_SAMPLER_2D + | glow::UNSIGNED_INT_SAMPLER_2D_ARRAY + | glow::UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE + | glow::UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY + | glow::UNSIGNED_INT_SAMPLER_2D_RECT + | glow::UNSIGNED_INT_SAMPLER_3D + | glow::UNSIGNED_INT_SAMPLER_CUBE + | glow::UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY + | glow::SAMPLER_1D + | glow::SAMPLER_1D_SHADOW + | glow::SAMPLER_1D_ARRAY + | glow::SAMPLER_1D_ARRAY_SHADOW + | glow::SAMPLER_2D + | glow::SAMPLER_2D_SHADOW + | glow::SAMPLER_2D_ARRAY + | glow::SAMPLER_2D_ARRAY_SHADOW + | glow::SAMPLER_2D_MULTISAMPLE + | glow::SAMPLER_2D_MULTISAMPLE_ARRAY + | glow::SAMPLER_2D_RECT + | glow::SAMPLER_2D_RECT_SHADOW + | glow::SAMPLER_3D + | glow::SAMPLER_CUBE + | glow::SAMPLER_CUBE_MAP_ARRAY + | glow::SAMPLER_CUBE_MAP_ARRAY_SHADOW + | glow::SAMPLER_CUBE_SHADOW => true, + _ => false, + } +} + +pub(super) fn uniform_byte_size(glsl_uniform_type: u32) -> u32 { + match glsl_uniform_type { + glow::FLOAT | glow::INT => 4, + glow::FLOAT_VEC2 | glow::INT_VEC2 => 8, + glow::FLOAT_VEC3 | glow::INT_VEC3 => 12, + glow::FLOAT_VEC4 | glow::INT_VEC4 => 16, + glow::FLOAT_MAT2 => 16, + glow::FLOAT_MAT3 => 36, + glow::FLOAT_MAT4 => 64, + _ => panic!("Unsupported uniform datatype!"), + } +} diff --git a/third_party/rust/wgpu-hal/src/gles/device.rs b/third_party/rust/wgpu-hal/src/gles/device.rs index a85301fa2c0cf..29a6155f1498f 100644 --- a/third_party/rust/wgpu-hal/src/gles/device.rs +++ b/third_party/rust/wgpu-hal/src/gles/device.rs @@ -33,9 +33,9 @@ impl CompilationContext<'_> { if ep_info[handle].is_empty() { continue; } - let register = match var.class { - naga::StorageClass::Uniform => super::BindingRegister::UniformBuffers, - naga::StorageClass::Storage { .. } => super::BindingRegister::StorageBuffers, + let register = match var.space { + naga::AddressSpace::Uniform => super::BindingRegister::UniformBuffers, + naga::AddressSpace::Storage { .. } => super::BindingRegister::StorageBuffers, _ => continue, }; @@ -272,30 +272,35 @@ impl super::Device { } } - let uniforms = { - let count = gl.get_active_uniforms(program); - let mut offset = 0; - let mut uniforms = Vec::new(); - - for uniform in 0..count { - let glow::ActiveUniform { size, utype, name } = - gl.get_active_uniform(program, uniform).unwrap(); - - if let Some(location) = gl.get_uniform_location(program, &name) { - // Sampler2D won't show up in UniformLocation and the only other uniforms - // should be push constants - uniforms.push(super::UniformDesc { - location, - offset, - utype, - }); + let mut uniforms: [super::UniformDesc; super::MAX_PUSH_CONSTANTS] = Default::default(); + let count = gl.get_active_uniforms(program); + let mut offset = 0; - offset += size as u32; - } + for uniform in 0..count { + let glow::ActiveUniform { utype, name, .. } = + gl.get_active_uniform(program, uniform).unwrap(); + + if conv::is_sampler(utype) { + continue; } - uniforms.into_boxed_slice() - }; + if let Some(location) = gl.get_uniform_location(program, &name) { + if uniforms[offset / 4].location.is_some() { + panic!("Offset already occupied") + } + + // `size` will always be 1 so we need to guess the real size from the type + let uniform_size = conv::uniform_byte_size(utype); + + uniforms[offset / 4] = super::UniformDesc { + location: Some(location), + size: uniform_size, + utype, + }; + + offset += uniform_size as usize; + } + } Ok(super::PipelineInner { program, @@ -452,7 +457,7 @@ impl crate::Device for super::Device { let ptr = if let Some(ref map_read_allocation) = buffer.data { let mut guard = map_read_allocation.lock().unwrap(); let slice = guard.as_mut_slice(); - gl.get_buffer_sub_data(buffer.target, 0, slice); + self.shared.get_buffer_sub_data(gl, buffer.target, 0, slice); slice.as_mut_ptr() } else { gl.map_buffer_range( @@ -473,11 +478,7 @@ impl crate::Device for super::Device { } unsafe fn unmap_buffer(&self, buffer: &super::Buffer) -> Result<(), crate::DeviceError> { if let Some(raw) = buffer.raw { - if !self - .shared - .workarounds - .contains(super::Workarounds::EMULATE_BUFFER_MAP) - { + if buffer.data.is_none() { let gl = &self.shared.context.lock(); gl.bind_buffer(buffer.target, Some(raw)); gl.unmap_buffer(buffer.target); @@ -721,7 +722,9 @@ impl crate::Device for super::Device { if let Some(border_color) = desc.border_color { let border = match border_color { - wgt::SamplerBorderColor::TransparentBlack => [0.0; 4], + wgt::SamplerBorderColor::TransparentBlack | wgt::SamplerBorderColor::Zero => { + [0.0; 4] + } wgt::SamplerBorderColor::OpaqueBlack => [0.0, 0.0, 0.0, 1.0], wgt::SamplerBorderColor::OpaqueWhite => [1.0; 4], }; diff --git a/third_party/rust/wgpu-hal/src/gles/egl.rs b/third_party/rust/wgpu-hal/src/gles/egl.rs index ea49dfb3e6b03..9539fe211e908 100644 --- a/third_party/rust/wgpu-hal/src/gles/egl.rs +++ b/third_party/rust/wgpu-hal/src/gles/egl.rs @@ -15,6 +15,7 @@ const EGL_PLATFORM_X11_KHR: u32 = 0x31D5; const EGL_PLATFORM_ANGLE_ANGLE: u32 = 0x3202; const EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE: u32 = 0x348F; const EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED: u32 = 0x3451; +const EGL_PLATFORM_SURFACELESS_MESA: u32 = 0x31DD; const EGL_GL_COLORSPACE_KHR: u32 = 0x309D; const EGL_GL_COLORSPACE_SRGB_KHR: u32 = 0x3089; @@ -26,6 +27,12 @@ type WlDisplayConnectFun = type WlDisplayDisconnectFun = unsafe extern "system" fn(display: *const raw::c_void); +#[cfg(not(feature = "emscripten"))] +type EglInstance = egl::DynamicInstance; + +#[cfg(feature = "emscripten")] +type EglInstance = egl::Instance; + type WlEglWindowCreateFun = unsafe extern "system" fn( surface: *const raw::c_void, width: raw::c_int, @@ -154,7 +161,7 @@ enum SrgbFrameBufferKind { /// Choose GLES framebuffer configuration. fn choose_config( - egl: &egl::DynamicInstance, + egl: &EglInstance, display: egl::Display, srgb_kind: SrgbFrameBufferKind, ) -> Result<(egl::Config, bool), crate::InstanceError> { @@ -162,11 +169,19 @@ fn choose_config( let tiers = [ ( "off-screen", - &[egl::RENDERABLE_TYPE, egl::OPENGL_ES2_BIT][..], + &[ + egl::SURFACE_TYPE, + egl::PBUFFER_BIT, + egl::RENDERABLE_TYPE, + egl::OPENGL_ES2_BIT, + ][..], ), - ("presentation", &[egl::SURFACE_TYPE, egl::WINDOW_BIT]), + ("presentation", &[egl::SURFACE_TYPE, egl::WINDOW_BIT][..]), #[cfg(not(target_os = "android"))] - ("native-render", &[egl::NATIVE_RENDERABLE, egl::TRUE as _]), + ( + "native-render", + &[egl::NATIVE_RENDERABLE, egl::TRUE as _][..], + ), ]; let mut attributes = Vec::with_capacity(9); @@ -247,23 +262,26 @@ fn gl_debug_message_callback(source: u32, gltype: u32, id: u32, severity: u32, m _ => unreachable!(), }; - log::log!( - log_severity, - "GLES: [{}/{}] ID {} : {}", - source_str, - type_str, - id, - message - ); + let _ = std::panic::catch_unwind(|| { + log::log!( + log_severity, + "GLES: [{}/{}] ID {} : {}", + source_str, + type_str, + id, + message + ); + }); if cfg!(debug_assertions) && log_severity == log::Level::Error { - std::process::exit(1); + // Set canary and continue + crate::VALIDATION_CANARY.set(); } } #[derive(Clone, Debug)] struct EglContext { - instance: Arc>, + instance: Arc, display: egl::Display, raw: egl::Context, pbuffer: Option, @@ -307,7 +325,7 @@ impl AdapterContext { } struct EglContextLock<'a> { - instance: &'a Arc>, + instance: &'a Arc, display: egl::Display, } @@ -385,6 +403,7 @@ struct Inner { version: (i32, i32), supports_native_window: bool, config: egl::Config, + #[cfg_attr(feature = "emscripten", allow(dead_code))] wl_display: Option<*mut raw::c_void>, /// Method by which the framebuffer should support srgb srgb_kind: SrgbFrameBufferKind, @@ -393,7 +412,7 @@ struct Inner { impl Inner { fn create( flags: crate::InstanceFlags, - egl: Arc>, + egl: Arc, display: egl::Display, ) -> Result { let version = egl.initialize(display).map_err(|_| crate::InstanceError)?; @@ -494,19 +513,21 @@ impl Inner { // Testing if context can be binded without surface // and creating dummy pbuffer surface if not. - let pbuffer = - if version >= (1, 5) || display_extensions.contains("EGL_KHR_surfaceless_context") { - log::info!("\tEGL context: +surfaceless"); - None - } else { - let attributes = [egl::WIDTH, 1, egl::HEIGHT, 1, egl::NONE]; - egl.create_pbuffer_surface(display, config, &attributes) - .map(Some) - .map_err(|e| { - log::warn!("Error in create_pbuffer_surface: {:?}", e); - crate::InstanceError - })? - }; + let pbuffer = if version >= (1, 5) + || display_extensions.contains("EGL_KHR_surfaceless_context") + || cfg!(feature = "emscripten") + { + log::info!("\tEGL context: +surfaceless"); + None + } else { + let attributes = [egl::WIDTH, 1, egl::HEIGHT, 1, egl::NONE]; + egl.create_pbuffer_surface(display, config, &attributes) + .map(Some) + .map_err(|e| { + log::warn!("Error in create_pbuffer_surface: {:?}", e); + crate::InstanceError + })? + }; Ok(Self { egl: EglContext { @@ -564,6 +585,10 @@ unsafe impl Sync for Instance {} impl crate::Instance for Instance { unsafe fn init(desc: &crate::InstanceDescriptor) -> Result { + #[cfg(feature = "emscripten")] + let egl_result: Result = Ok(egl::Instance::new(egl::Static)); + + #[cfg(not(feature = "emscripten"))] let egl_result = if cfg!(windows) { egl::DynamicInstance::::load_required_from_filename("libEGL.dll") } else if cfg!(any(target_os = "macos", target_os = "ios")) { @@ -606,8 +631,14 @@ impl crate::Instance for Instance { None }; + #[cfg(not(feature = "emscripten"))] + let egl1_5 = egl.upcast::(); + + #[cfg(feature = "emscripten")] + let egl1_5: Option<&Arc> = Some(&egl); + let (display, wsi_library, wsi_kind) = if let (Some(library), Some(egl)) = - (wayland_library, egl.upcast::()) + (wayland_library, egl1_5) { log::info!("Using Wayland platform"); let display_attributes = [egl::ATTRIB_NONE]; @@ -619,18 +650,14 @@ impl crate::Instance for Instance { ) .unwrap(); (display, Some(Arc::new(library)), WindowKind::Wayland) - } else if let (Some((display, library)), Some(egl)) = - (x11_display_library, egl.upcast::()) - { + } else if let (Some((display, library)), Some(egl)) = (x11_display_library, egl1_5) { log::info!("Using X11 platform"); let display_attributes = [egl::ATTRIB_NONE]; let display = egl .get_platform_display(EGL_PLATFORM_X11_KHR, display.as_ptr(), &display_attributes) .unwrap(); (display, Some(Arc::new(library)), WindowKind::X11) - } else if let (Some((display, library)), Some(egl)) = - (angle_x11_display_library, egl.upcast::()) - { + } else if let (Some((display, library)), Some(egl)) = (angle_x11_display_library, egl1_5) { log::info!("Using Angle platform with X11"); let display_attributes = [ EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE as egl::Attrib, @@ -651,8 +678,19 @@ impl crate::Instance for Instance { ) .unwrap(); (display, Some(Arc::new(library)), WindowKind::AngleX11) + } else if client_ext_str.contains("EGL_MESA_platform_surfaceless") { + log::info!("No windowing system present. Using surfaceless platform"); + let egl = egl1_5.expect("Failed to get EGL 1.5 for surfaceless"); + let display = egl + .get_platform_display( + EGL_PLATFORM_SURFACELESS_MESA, + std::ptr::null_mut(), + &[egl::ATTRIB_NONE], + ) + .unwrap(); + (display, None, WindowKind::Unknown) } else { - log::info!("Using default platform"); + log::info!("EGL_MESA_platform_surfaceless not available. Using default platform"); let display = egl.get_display(egl::DEFAULT_DISPLAY).unwrap(); (display, None, WindowKind::Unknown) }; @@ -698,7 +736,7 @@ impl crate::Instance for Instance { let raw_window_handle = has_handle.raw_window_handle(); - #[cfg_attr(target_os = "android", allow(unused_mut))] + #[cfg_attr(any(target_os = "android", feature = "emscripten"), allow(unused_mut))] let mut inner = self.inner.lock(); match raw_window_handle { @@ -721,6 +759,7 @@ impl crate::Instance for Instance { return Err(crate::InstanceError); } } + #[cfg(not(feature = "emscripten"))] Rwh::Wayland(handle) => { /* Wayland displays are not sharable between surfaces so if the * surface we receive from this handle is from a different @@ -757,6 +796,8 @@ impl crate::Instance for Instance { drop(old_inner); } } + #[cfg(feature = "emscripten")] + Rwh::Web(_) => {} other => { log::error!("Unsupported window: {:?}", other); return Err(crate::InstanceError); @@ -975,8 +1016,22 @@ impl crate::Surface for Surface { wl_window = Some(window); window } + #[cfg(feature = "emscripten")] + (WindowKind::Unknown, Rwh::Web(handle)) => handle.id as *mut std::ffi::c_void, (WindowKind::Unknown, Rwh::Win32(handle)) => handle.hwnd, - (WindowKind::Unknown, Rwh::AppKit(handle)) => handle.ns_view, + (WindowKind::Unknown, Rwh::AppKit(handle)) => { + #[cfg(not(target_os = "macos"))] + let window_ptr = handle.ns_view; + #[cfg(target_os = "macos")] + let window_ptr = { + use objc::{msg_send, runtime::Object, sel, sel_impl}; + // ns_view always have a layer and don't need to verify that it exists. + let layer: *mut Object = + msg_send![handle.ns_view as *mut Object, layer]; + layer as *mut ffi::c_void + }; + window_ptr + } _ => { log::warn!( "Initialized platform {:?} doesn't work with window {:?}", @@ -992,7 +1047,7 @@ impl crate::Surface for Surface { // We don't want any of the buffering done by the driver, because we // manage a swapchain on our side. // Some drivers just fail on surface creation seeing `EGL_SINGLE_BUFFER`. - if cfg!(target_os = "android") + if cfg!(any(target_os = "android", target_os = "macos")) || cfg!(windows) || self.wsi.kind == WindowKind::AngleX11 { @@ -1014,8 +1069,14 @@ impl crate::Surface for Surface { } attributes.push(egl::ATTRIB_NONE as i32); + #[cfg(not(feature = "emscripten"))] + let egl1_5 = self.egl.instance.upcast::(); + + #[cfg(feature = "emscripten")] + let egl1_5: Option<&Arc> = Some(&self.egl.instance); + // Careful, we can still be in 1.4 version even if `upcast` succeeds - let raw_result = match self.egl.instance.upcast::() { + let raw_result = match egl1_5 { Some(egl) if self.wsi.kind != WindowKind::Unknown => { let attributes_usize = attributes .into_iter() diff --git a/third_party/rust/wgpu-hal/src/gles/mod.rs b/third_party/rust/wgpu-hal/src/gles/mod.rs index d5e1980b212f2..eb62f70d22f14 100644 --- a/third_party/rust/wgpu-hal/src/gles/mod.rs +++ b/third_party/rust/wgpu-hal/src/gles/mod.rs @@ -56,9 +56,10 @@ To address this, we invalidate the vertex buffers based on: */ -#[cfg(not(target_arch = "wasm32"))] +///cbindgen:ignore +#[cfg(any(not(target_arch = "wasm32"), feature = "emscripten"))] mod egl; -#[cfg(target_arch = "wasm32")] +#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))] mod web; mod adapter; @@ -67,10 +68,10 @@ mod conv; mod device; mod queue; -#[cfg(not(target_arch = "wasm32"))] +#[cfg(any(not(target_arch = "wasm32"), feature = "emscripten"))] use self::egl::{AdapterContext, Instance, Surface}; -#[cfg(target_arch = "wasm32")] +#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))] use self::web::{AdapterContext, Instance, Surface}; use arrayvec::ArrayVec; @@ -88,6 +89,7 @@ const MAX_TEXTURE_SLOTS: usize = 16; const MAX_SAMPLERS: usize = 16; const MAX_VERTEX_ATTRIBUTES: usize = 16; const ZERO_BUFFER_SIZE: usize = 256 << 10; +const MAX_PUSH_CONSTANTS: usize = 16; impl crate::Api for Api { type Instance = Instance; @@ -134,6 +136,8 @@ bitflags::bitflags! { const INDEX_BUFFER_ROLE_CHANGE = 1 << 5; /// Indicates that the device supports disabling draw buffers const CAN_DISABLE_DRAW_BUFFER = 1 << 6; + /// Supports `glGetBufferSubData` + const GET_BUFFER_SUB_DATA = 1 << 7; } } @@ -179,6 +183,7 @@ struct AdapterShared { private_caps: PrivateCapabilities, workarounds: Workarounds, shading_language_version: naga::back::glsl::Version, + max_texture_size: u32, } pub struct Adapter { @@ -392,14 +397,19 @@ struct VertexBufferDesc { stride: u32, } -#[allow(unused)] -#[derive(Clone)] +#[derive(Clone, Debug, Default)] struct UniformDesc { - location: glow::UniformLocation, - offset: u32, + location: Option, + size: u32, utype: u32, } +// Safe: WASM doesn't have threads +#[cfg(target_arch = "wasm32")] +unsafe impl Sync for UniformDesc {} +#[cfg(target_arch = "wasm32")] +unsafe impl Send for UniformDesc {} + /// For each texture in the pipeline layout, store the index of the only /// sampler (in this layout) that the texture is used with. type SamplerBindMap = [Option; MAX_TEXTURE_SLOTS]; @@ -407,7 +417,7 @@ type SamplerBindMap = [Option; MAX_TEXTURE_SLOTS]; struct PipelineInner { program: glow::Program, sampler_map: SamplerBindMap, - uniforms: Box<[UniformDesc]>, + uniforms: [UniformDesc; MAX_PUSH_CONSTANTS], } #[derive(Clone, Debug)] @@ -716,6 +726,11 @@ enum Command { InsertDebugMarker(Range), PushDebugGroup(Range), PopDebugGroup, + SetPushConstants { + uniform: UniformDesc, + /// Offset from the start of the `data_bytes` + offset: u32, + }, } #[derive(Default)] diff --git a/third_party/rust/wgpu-hal/src/gles/queue.rs b/third_party/rust/wgpu-hal/src/gles/queue.rs index 5dee453eae27c..31c837cdbbca5 100644 --- a/third_party/rust/wgpu-hal/src/gles/queue.rs +++ b/third_party/rust/wgpu-hal/src/gles/queue.rs @@ -59,7 +59,7 @@ impl super::Queue { } } - unsafe fn reset_state(&self, gl: &glow::Context) { + unsafe fn reset_state(&mut self, gl: &glow::Context) { gl.use_program(None); gl.bind_framebuffer(glow::FRAMEBUFFER, None); gl.disable(glow::DEPTH_TEST); @@ -71,6 +71,9 @@ impl super::Queue { if self.features.contains(wgt::Features::DEPTH_CLIP_CONTROL) { gl.disable(glow::DEPTH_CLAMP); } + + gl.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, None); + self.current_index_buffer = None; } unsafe fn set_attachment( @@ -271,7 +274,12 @@ impl super::Queue { [copy.dst_offset as usize..copy.dst_offset as usize + size]; gl.bind_buffer(copy_src_target, Some(src)); - gl.get_buffer_sub_data(copy_src_target, copy.src_offset as i32, dst_data); + self.shared.get_buffer_sub_data( + gl, + copy_src_target, + copy.src_offset as i32, + dst_data, + ); } (None, Some(dst)) => { let data = src.data.as_ref().unwrap().lock().unwrap(); @@ -449,9 +457,24 @@ impl super::Queue { _ => unreachable!(), } } else { - let bytes_per_image = - copy.buffer_layout.rows_per_image.map_or(1, |rpi| rpi.get()) - * copy.buffer_layout.bytes_per_row.map_or(1, |bpr| bpr.get()); + let bytes_per_row = copy + .buffer_layout + .bytes_per_row + .map_or(copy.size.width * format_info.block_size as u32, |bpr| { + bpr.get() + }); + let block_height = format_info.block_dimensions.1 as u32; + let minimum_rows_per_image = (copy.size.height + block_height - 1) + / format_info.block_dimensions.1 as u32; + let rows_per_image = copy + .buffer_layout + .rows_per_image + .map_or(minimum_rows_per_image, |rpi| rpi.get()); + + let bytes_per_image = bytes_per_row * rows_per_image; + let minimum_bytes_per_image = bytes_per_row * minimum_rows_per_image; + let bytes_in_upload = + (bytes_per_image * (copy.size.depth - 1)) + minimum_bytes_per_image; let offset = copy.buffer_layout.offset as u32; let buffer_data; @@ -460,18 +483,35 @@ impl super::Queue { gl.bind_buffer(glow::PIXEL_UNPACK_BUFFER, Some(buffer)); unbind_unpack_buffer = true; glow::CompressedPixelUnpackData::BufferRange( - offset..offset + bytes_per_image, + offset..offset + bytes_in_upload, ) } None => { buffer_data = src.data.as_ref().unwrap().lock().unwrap(); let src_data = &buffer_data.as_slice() - [(offset as usize)..(offset + bytes_per_image) as usize]; + [(offset as usize)..(offset + bytes_in_upload) as usize]; glow::CompressedPixelUnpackData::Slice(src_data) } }; + log::error!( + "bytes_per_row: {}, \ + minimum_rows_per_image: {}, \ + rows_per_image: {}, \ + bytes_per_image: {}, \ + minimum_bytes_per_image: {}, \ + bytes_in_upload: {}\ + ", + bytes_per_row, + minimum_rows_per_image, + rows_per_image, + bytes_per_image, + minimum_bytes_per_image, + bytes_in_upload + ); match dst_target { - glow::TEXTURE_3D | glow::TEXTURE_2D_ARRAY => { + glow::TEXTURE_3D + | glow::TEXTURE_CUBE_MAP_ARRAY + | glow::TEXTURE_2D_ARRAY => { gl.compressed_tex_sub_image_3d( dst_target, copy.texture_base.mip_level as i32, @@ -509,21 +549,6 @@ impl super::Queue { unpack_data, ); } - glow::TEXTURE_CUBE_MAP_ARRAY => { - //Note: not sure if this is correct! - gl.compressed_tex_sub_image_3d( - dst_target, - copy.texture_base.mip_level as i32, - copy.texture_base.origin.x as i32, - copy.texture_base.origin.y as i32, - copy.texture_base.origin.z as i32, - copy.size.width as i32, - copy.size.height as i32, - copy.size.depth as i32, - format_desc.internal, - unpack_data, - ); - } _ => unreachable!(), } } @@ -1064,6 +1089,70 @@ impl super::Queue { #[cfg(not(target_arch = "wasm32"))] gl.pop_debug_group(); } + C::SetPushConstants { + ref uniform, + offset, + } => { + fn get_data(data: &[u8], offset: u32) -> &[T] { + let raw = &data[(offset as usize)..]; + unsafe { + slice::from_raw_parts( + raw.as_ptr() as *const _, + raw.len() / mem::size_of::(), + ) + } + } + + let location = uniform.location.as_ref(); + + match uniform.utype { + glow::FLOAT => { + let data = get_data::(data_bytes, offset)[0]; + gl.uniform_1_f32(location, data); + } + glow::FLOAT_VEC2 => { + let data = get_data::<[f32; 2]>(data_bytes, offset)[0]; + gl.uniform_2_f32_slice(location, &data); + } + glow::FLOAT_VEC3 => { + let data = get_data::<[f32; 3]>(data_bytes, offset)[0]; + gl.uniform_3_f32_slice(location, &data); + } + glow::FLOAT_VEC4 => { + let data = get_data::<[f32; 4]>(data_bytes, offset)[0]; + gl.uniform_4_f32_slice(location, &data); + } + glow::INT => { + let data = get_data::(data_bytes, offset)[0]; + gl.uniform_1_i32(location, data); + } + glow::INT_VEC2 => { + let data = get_data::<[i32; 2]>(data_bytes, offset)[0]; + gl.uniform_2_i32_slice(location, &data); + } + glow::INT_VEC3 => { + let data = get_data::<[i32; 3]>(data_bytes, offset)[0]; + gl.uniform_3_i32_slice(location, &data); + } + glow::INT_VEC4 => { + let data = get_data::<[i32; 4]>(data_bytes, offset)[0]; + gl.uniform_4_i32_slice(location, &data); + } + glow::FLOAT_MAT2 => { + let data = get_data::<[f32; 4]>(data_bytes, offset)[0]; + gl.uniform_matrix_2_f32_slice(location, false, &data); + } + glow::FLOAT_MAT3 => { + let data = get_data::<[f32; 9]>(data_bytes, offset)[0]; + gl.uniform_matrix_3_f32_slice(location, false, &data); + } + glow::FLOAT_MAT4 => { + let data = get_data::<[f32; 16]>(data_bytes, offset)[0]; + gl.uniform_matrix_4_f32_slice(location, false, &data); + } + _ => panic!("Unsupported uniform datatype!"), + } + } } } } @@ -1109,10 +1198,10 @@ impl crate::Queue for super::Queue { surface: &mut super::Surface, texture: super::Texture, ) -> Result<(), crate::SurfaceError> { - #[cfg(not(target_arch = "wasm32"))] + #[cfg(any(not(target_arch = "wasm32"), feature = "emscripten"))] let gl = &self.shared.context.get_without_egl_lock(); - #[cfg(target_arch = "wasm32")] + #[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))] let gl = &self.shared.context.glow_context; surface.present(texture, gl) diff --git a/third_party/rust/wgpu-hal/src/lib.rs b/third_party/rust/wgpu-hal/src/lib.rs index feb7bf77734d9..891381e50aa72 100644 --- a/third_party/rust/wgpu-hal/src/lib.rs +++ b/third_party/rust/wgpu-hal/src/lib.rs @@ -52,6 +52,8 @@ compile_error!("Metal API enabled on non-Apple OS. If your project is not using #[cfg(all(feature = "dx12", not(windows)))] compile_error!("DX12 API enabled on non-Windows OS. If your project is not using resolver=\"2\" in Cargo.toml, it should."); +#[cfg(all(feature = "dx11", windows))] +mod dx11; #[cfg(all(feature = "dx12", windows))] mod dx12; mod empty; @@ -64,6 +66,8 @@ mod vulkan; pub mod auxil; pub mod api { + #[cfg(feature = "dx11")] + pub use super::dx11::Api as Dx11; #[cfg(feature = "dx12")] pub use super::dx12::Api as Dx12; pub use super::empty::Api as Empty; @@ -84,6 +88,7 @@ use std::{ num::{NonZeroU32, NonZeroU8}, ops::{Range, RangeInclusive}, ptr::NonNull, + sync::atomic::AtomicBool, }; use bitflags::bitflags; @@ -1148,6 +1153,39 @@ pub struct ComputePassDescriptor<'a> { pub label: Label<'a>, } +/// Stores if any API validation error has occurred in this process +/// since it was last reset. +/// +/// This is used for internal wgpu testing only and _must not_ be used +/// as a way to check for errors. +/// +/// This works as a static because `cargo nextest` runs all of our +/// tests in separate processes, so each test gets its own canary. +/// +/// This prevents the issue of one validation error terminating the +/// entire process. +pub static VALIDATION_CANARY: ValidationCanary = ValidationCanary { + inner: AtomicBool::new(false), +}; + +/// Flag for internal testing. +pub struct ValidationCanary { + inner: AtomicBool, +} + +impl ValidationCanary { + #[allow(dead_code)] // in some configurations this function is dead + fn set(&self) { + self.inner.store(true, std::sync::atomic::Ordering::SeqCst); + } + + /// Returns true if any API validation error has occurred in this process + /// since the last call to this function. + pub fn get_and_reset(&self) -> bool { + self.inner.swap(false, std::sync::atomic::Ordering::SeqCst) + } +} + #[test] fn test_default_limits() { let limits = wgt::Limits::default(); diff --git a/third_party/rust/wgpu-hal/src/metal/adapter.rs b/third_party/rust/wgpu-hal/src/metal/adapter.rs index cf0e0f718dbf7..82cd2242368f2 100644 --- a/third_party/rust/wgpu-hal/src/metal/adapter.rs +++ b/third_party/rust/wgpu-hal/src/metal/adapter.rs @@ -1,6 +1,7 @@ -use mtl::{MTLFeatureSet, MTLGPUFamily, MTLLanguageVersion}; +use mtl::{MTLFeatureSet, MTLGPUFamily, MTLLanguageVersion, MTLReadWriteTextureTier}; use objc::{class, msg_send, sel, sel_impl}; use parking_lot::Mutex; +use wgt::{AstcBlock, AstcChannel}; use std::{sync::Arc, thread}; @@ -75,37 +76,48 @@ impl crate::Adapter for super::Adapter { } else { Tfc::empty() }; + let is_not_apple1x = super::PrivateCapabilities::supports_any( + self.shared.device.lock().as_ref(), + &[ + MTLFeatureSet::iOS_GPUFamily2_v1, + MTLFeatureSet::macOS_GPUFamily1_v1, + MTLFeatureSet::tvOS_GPUFamily1_v1, + ], + ); + + // Metal defined pixel format capabilities + let all_caps = Tfc::SAMPLED_LINEAR + | Tfc::STORAGE + | Tfc::COLOR_ATTACHMENT + | Tfc::COLOR_ATTACHMENT_BLEND + | Tfc::MULTISAMPLE + | Tfc::MULTISAMPLE_RESOLVE; let extra = match format { - Tf::R8Unorm => { - read_write_tier2_if - | Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE + Tf::R8Unorm | Tf::R16Float | Tf::Rgba8Unorm | Tf::Rgba16Float => { + read_write_tier2_if | all_caps } - Tf::R8Snorm => { - Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE + Tf::R8Snorm | Tf::Rg8Snorm | Tf::Rgba8Snorm => { + let mut flags = all_caps; + flags.set(Tfc::MULTISAMPLE_RESOLVE, is_not_apple1x); + flags } - Tf::R8Uint | Tf::R8Sint | Tf::R16Uint | Tf::R16Sint => { + Tf::R8Uint + | Tf::R8Sint + | Tf::R16Uint + | Tf::R16Sint + | Tf::Rgba8Uint + | Tf::Rgba8Sint + | Tf::Rgba16Uint + | Tf::Rgba16Sint => { read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE } - Tf::R16Float => { - read_write_tier2_if - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE - } - Tf::R16Unorm | Tf::R16Snorm => { + Tf::R16Unorm + | Tf::R16Snorm + | Tf::Rg16Unorm + | Tf::Rg16Snorm + | Tf::Rgba16Unorm + | Tf::Rgba16Snorm => { Tfc::SAMPLED_LINEAR | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT @@ -113,177 +125,89 @@ impl crate::Adapter for super::Adapter { | Tfc::MULTISAMPLE | msaa_resolve_desktop_if } - Tf::Rg8Unorm | Tf::Rg8Snorm => { - Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE - } - Tf::Rg8Uint | Tf::Rg8Sint => Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE, + Tf::Rg8Unorm | Tf::Rg16Float | Tf::Bgra8Unorm => all_caps, + Tf::Rg8Uint | Tf::Rg8Sint => Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE, Tf::R32Uint | Tf::R32Sint => { - let storage = if pc.format_r32_all { - read_write_tier1_if | Tfc::STORAGE - } else { - Tfc::empty() - }; - Tfc::COLOR_ATTACHMENT | storage | msaa_desktop_if + read_write_tier1_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | msaa_desktop_if } Tf::R32Float => { - let flags = Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | msaa_resolve_desktop_if; - let extra = if pc.format_r32float_all { - read_write_tier1_if | Tfc::STORAGE | Tfc::SAMPLED_LINEAR - } else if pc.format_r32float_no_filter { - Tfc::SAMPLED_LINEAR + let flags = if pc.format_r32float_all { + all_caps } else { - Tfc::empty() + Tfc::STORAGE + | Tfc::COLOR_ATTACHMENT + | Tfc::COLOR_ATTACHMENT_BLEND + | Tfc::MULTISAMPLE }; - flags | extra - } - Tf::Rg16Uint | Tf::Rg16Sint => { - read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE - } - Tf::Rg16Unorm | Tf::Rg16Snorm => { - Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | msaa_resolve_desktop_if - } - Tf::Rg16Float => { - read_write_tier2_if - | Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE - } - Tf::Rgba8Unorm => { - read_write_tier2_if - | Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE + read_write_tier1_if | flags } + Tf::Rg16Uint | Tf::Rg16Sint => Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE, Tf::Rgba8UnormSrgb | Tf::Bgra8UnormSrgb => { - let mut flags = Tfc::SAMPLED_LINEAR - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE; + let mut flags = all_caps; flags.set(Tfc::STORAGE, pc.format_rgba8_srgb_all); flags } - Tf::Rgba8Snorm | Tf::Bgra8Unorm => { - Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE - } - Tf::Rgba8Uint | Tf::Rgba8Sint => { - read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE - } Tf::Rgb10a2Unorm => { - let mut flags = Tfc::SAMPLED_LINEAR - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE; + let mut flags = all_caps; flags.set(Tfc::STORAGE, pc.format_rgb10a2_unorm_all); flags } Tf::Rg11b10Float => { - let mut flags = Tfc::SAMPLED_LINEAR - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE; + let mut flags = all_caps; flags.set(Tfc::STORAGE, pc.format_rg11b10_all); flags } Tf::Rg32Uint | Tf::Rg32Sint => Tfc::COLOR_ATTACHMENT | Tfc::STORAGE | msaa_apple7x_if, Tf::Rg32Float => { - let mut flags = - Tfc::COLOR_ATTACHMENT | Tfc::COLOR_ATTACHMENT_BLEND | msaa_apple7x_if; if pc.format_rg32float_all { - flags |= Tfc::STORAGE | Tfc::SAMPLED_LINEAR; - } else if pc.format_rg32float_color_blend { - flags |= Tfc::SAMPLED_LINEAR; + all_caps + } else { + Tfc::STORAGE + | Tfc::COLOR_ATTACHMENT + | Tfc::COLOR_ATTACHMENT_BLEND + | msaa_apple7x_if } - flags - } - Tf::Rgba16Uint | Tf::Rgba16Sint => { - read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | Tfc::MULTISAMPLE - } - Tf::Rgba16Unorm | Tf::Rgba16Snorm => { - Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | msaa_resolve_desktop_if - } - Tf::Rgba16Float => { - read_write_tier2_if - | Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT - | Tfc::COLOR_ATTACHMENT_BLEND - | Tfc::MULTISAMPLE - | Tfc::MULTISAMPLE_RESOLVE } Tf::Rgba32Uint | Tf::Rgba32Sint => { - let storage = if pc.format_rgba32int_color_write { - read_write_tier2_if | Tfc::STORAGE - } else { - Tfc::empty() - }; - storage | Tfc::COLOR_ATTACHMENT | msaa_desktop_if + read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT | msaa_desktop_if } Tf::Rgba32Float => { - let extra = if pc.format_rgba32float_all { - read_write_tier2_if - | Tfc::SAMPLED_LINEAR - | Tfc::STORAGE - | Tfc::COLOR_ATTACHMENT_BLEND - } else if pc.format_rgba32float_color_write { - read_write_tier2_if | Tfc::STORAGE - } else { - Tfc::empty() + let mut flags = read_write_tier2_if | Tfc::STORAGE | Tfc::COLOR_ATTACHMENT; + if pc.format_rgba32float_all { + flags |= all_caps + } else if pc.msaa_apple7 { + flags |= Tfc::MULTISAMPLE }; - extra | Tfc::COLOR_ATTACHMENT | msaa_apple7x_if | msaa_resolve_desktop_if + flags } Tf::Depth32Float => { - let linear = if pc.format_depth32float_filter { - Tfc::SAMPLED_LINEAR + let mut flats = + Tfc::DEPTH_STENCIL_ATTACHMENT | Tfc::MULTISAMPLE | msaa_resolve_apple3x_if; + if pc.format_depth32float_filter { + flats |= Tfc::SAMPLED_LINEAR + } + flats + } + Tf::Depth24Plus => Tfc::empty(), + Tf::Depth24PlusStencil8 => { + if pc.msaa_desktop { + Tfc::DEPTH_STENCIL_ATTACHMENT | Tfc::SAMPLED_LINEAR | Tfc::MULTISAMPLE } else { Tfc::empty() - }; - linear | Tfc::DEPTH_STENCIL_ATTACHMENT | Tfc::MULTISAMPLE | msaa_resolve_apple3x_if - } - Tf::Depth24Plus | Tf::Depth24PlusStencil8 => { - Tfc::DEPTH_STENCIL_ATTACHMENT - | Tfc::SAMPLED_LINEAR - | Tfc::MULTISAMPLE - | msaa_resolve_apple3x_if + } } Tf::Rgb9e5Ufloat => { - let msaa = if msaa_desktop_if.is_empty() { - Tfc::MULTISAMPLE | Tfc::MULTISAMPLE_RESOLVE + if pc.msaa_apple3 { + all_caps + } else if pc.msaa_desktop { + Tfc::SAMPLED_LINEAR } else { - Tfc::empty() - }; - Tfc::SAMPLED_LINEAR | msaa + Tfc::STORAGE + | Tfc::COLOR_ATTACHMENT + | Tfc::COLOR_ATTACHMENT_BLEND + | Tfc::MULTISAMPLE + | Tfc::MULTISAMPLE_RESOLVE + } } Tf::Bc1RgbaUnorm | Tf::Bc1RgbaUnormSrgb @@ -321,35 +245,11 @@ impl crate::Adapter for super::Adapter { Tfc::empty() } } - Tf::Astc4x4RgbaUnorm - | Tf::Astc4x4RgbaUnormSrgb - | Tf::Astc5x4RgbaUnorm - | Tf::Astc5x4RgbaUnormSrgb - | Tf::Astc5x5RgbaUnorm - | Tf::Astc5x5RgbaUnormSrgb - | Tf::Astc6x5RgbaUnorm - | Tf::Astc6x5RgbaUnormSrgb - | Tf::Astc6x6RgbaUnorm - | Tf::Astc6x6RgbaUnormSrgb - | Tf::Astc8x5RgbaUnorm - | Tf::Astc8x5RgbaUnormSrgb - | Tf::Astc8x6RgbaUnorm - | Tf::Astc8x6RgbaUnormSrgb - | Tf::Astc10x5RgbaUnorm - | Tf::Astc10x5RgbaUnormSrgb - | Tf::Astc10x6RgbaUnorm - | Tf::Astc10x6RgbaUnormSrgb - | Tf::Astc8x8RgbaUnorm - | Tf::Astc8x8RgbaUnormSrgb - | Tf::Astc10x8RgbaUnorm - | Tf::Astc10x8RgbaUnormSrgb - | Tf::Astc10x10RgbaUnorm - | Tf::Astc10x10RgbaUnormSrgb - | Tf::Astc12x10RgbaUnorm - | Tf::Astc12x10RgbaUnormSrgb - | Tf::Astc12x12RgbaUnorm - | Tf::Astc12x12RgbaUnormSrgb => { - if pc.format_astc { + Tf::Astc { + block: _, + channel: _, + } => { + if pc.format_astc || pc.format_astc_hdr { Tfc::SAMPLED_LINEAR } else { Tfc::empty() @@ -403,172 +303,106 @@ impl crate::Adapter for super::Adapter { height: 4, depth_or_array_layers: 1, }..=wgt::Extent3d { - width: 4096, - height: 4096, + width: pc.max_texture_size as u32, + height: pc.max_texture_size as u32, depth_or_array_layers: 1, }, - usage: crate::TextureUses::COLOR_TARGET, //TODO: expose more + usage: crate::TextureUses::COLOR_TARGET | crate::TextureUses::COPY_DST, //TODO: expose more }) } } const RESOURCE_HEAP_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily1_v3, - MTLFeatureSet::iOS_GPUFamily2_v3, - MTLFeatureSet::iOS_GPUFamily3_v2, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v2, - MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v3, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const ARGUMENT_BUFFER_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily1_v4, - MTLFeatureSet::iOS_GPUFamily2_v4, - MTLFeatureSet::iOS_GPUFamily3_v3, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v3, MTLFeatureSet::macOS_GPUFamily1_v3, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const MUTABLE_COMPARISON_SAMPLER_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; -const SAMPLER_CLAMP_TO_BORDER_SUPPORT: &[MTLFeatureSet] = &[ - MTLFeatureSet::macOS_GPUFamily1_v2, - MTLFeatureSet::macOS_GPUFamily2_v1, -]; +const SAMPLER_CLAMP_TO_BORDER_SUPPORT: &[MTLFeatureSet] = &[MTLFeatureSet::macOS_GPUFamily1_v2]; const ASTC_PIXEL_FORMAT_FEATURES: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily2_v1, - MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v1, - MTLFeatureSet::tvOS_GPUFamily2_v1, ]; const ANY8_UNORM_SRGB_ALL: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily2_v3, - MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v2, - MTLFeatureSet::tvOS_GPUFamily2_v1, ]; const ANY8_SNORM_RESOLVE: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily2_v1, - MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v1, - MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const RGBA8_SRGB: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily2_v3, - MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v2, - MTLFeatureSet::tvOS_GPUFamily2_v1, ]; const RGB10A2UNORM_ALL: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const RGB10A2UINT_COLOR_WRITE: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const RG11B10FLOAT_ALL: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const RGB9E5FLOAT_ALL: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily2_v1, ]; const BGR10A2_ALL: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily1_v4, - MTLFeatureSet::iOS_GPUFamily2_v4, - MTLFeatureSet::iOS_GPUFamily3_v3, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v3, - MTLFeatureSet::tvOS_GPUFamily2_v1, - MTLFeatureSet::macOS_GPUFamily1_v3, MTLFeatureSet::macOS_GPUFamily2_v1, ]; const BASE_INSTANCE_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const BASE_VERTEX_INSTANCE_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const TEXTURE_CUBE_ARRAY_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v2, - MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const DUAL_SOURCE_BLEND_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily1_v4, - MTLFeatureSet::iOS_GPUFamily2_v4, - MTLFeatureSet::iOS_GPUFamily3_v3, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v3, - MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v2, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const LAYERED_RENDERING_SUPPORT: &[MTLFeatureSet] = &[ @@ -579,28 +413,19 @@ const LAYERED_RENDERING_SUPPORT: &[MTLFeatureSet] = &[ const FUNCTION_SPECIALIZATION_SUPPORT: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily1_v3, - MTLFeatureSet::iOS_GPUFamily2_v3, - MTLFeatureSet::iOS_GPUFamily3_v2, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v2, MTLFeatureSet::macOS_GPUFamily1_v2, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; const DEPTH_CLIP_MODE: &[MTLFeatureSet] = &[ MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v3, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ]; -impl super::PrivateCapabilities { - fn version_at_least(major: u32, minor: u32, needed_major: u32, needed_minor: u32) -> bool { - major > needed_major || (major == needed_major && minor >= needed_minor) - } +const OS_NOT_SUPPORT: (usize, usize) = (10000, 0); +impl super::PrivateCapabilities { fn supports_any(raw: &mtl::DeviceRef, features_sets: &[MTLFeatureSet]) -> bool { features_sets .iter() @@ -616,22 +441,30 @@ impl super::PrivateCapabilities { major: usize, minor: usize, patch: usize, + is_mac: bool, } - let version: NSOperatingSystemVersion = unsafe { + impl NSOperatingSystemVersion { + fn at_least(&self, mac_version: (usize, usize), ios_version: (usize, usize)) -> bool { + if self.is_mac { + self.major > mac_version.0 + || (self.major == mac_version.0 && self.minor >= mac_version.1) + } else { + self.major > ios_version.0 + || (self.major == ios_version.0 && self.minor >= ios_version.1) + } + } + } + + let mut version: NSOperatingSystemVersion = unsafe { let process_info: *mut objc::runtime::Object = msg_send![class!(NSProcessInfo), processInfo]; msg_send![process_info, operatingSystemVersion] }; - let major = version.major as u32; - let minor = version.minor as u32; let os_is_mac = device.supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v1); - let family_check = if os_is_mac { - Self::version_at_least(major, minor, 10, 15) - } else { - Self::version_at_least(major, minor, 13, 0) - }; + version.is_mac = os_is_mac; + let family_check = version.at_least((10, 15), (13, 0)); let mut sample_count_mask: u8 = 1 | 4; // 1 and 4 samples are supported on all devices if device.supports_texture_sample_count(2) { @@ -641,50 +474,46 @@ impl super::PrivateCapabilities { sample_count_mask |= 8; } + let rw_texture_tier = if version.at_least((10, 13), (11, 0)) { + device.read_write_texture_support() + } else if version.at_least((10, 12), OS_NOT_SUPPORT) { + if Self::supports_any(device, &[MTLFeatureSet::macOS_ReadWriteTextureTier2]) { + MTLReadWriteTextureTier::Tier2 + } else { + MTLReadWriteTextureTier::Tier1 + } + } else { + MTLReadWriteTextureTier::TierNone + }; + Self { family_check, - msl_version: if os_is_mac { - if Self::version_at_least(major, minor, 10, 15) { - MTLLanguageVersion::V2_2 - } else if Self::version_at_least(major, minor, 10, 14) { - MTLLanguageVersion::V2_1 - } else if Self::version_at_least(major, minor, 10, 13) { - MTLLanguageVersion::V2_0 - } else if Self::version_at_least(major, minor, 10, 12) { - MTLLanguageVersion::V1_2 - } else if Self::version_at_least(major, minor, 10, 11) { - MTLLanguageVersion::V1_1 - } else { - MTLLanguageVersion::V1_0 - } - } else if Self::version_at_least(major, minor, 13, 0) { + msl_version: if version.at_least((12, 0), (15, 0)) { + MTLLanguageVersion::V2_4 + } else if version.at_least((11, 0), (14, 0)) { + MTLLanguageVersion::V2_3 + } else if version.at_least((10, 15), (13, 0)) { MTLLanguageVersion::V2_2 - } else if Self::version_at_least(major, minor, 12, 0) { + } else if version.at_least((10, 14), (12, 0)) { MTLLanguageVersion::V2_1 - } else if Self::version_at_least(major, minor, 11, 0) { + } else if version.at_least((10, 13), (11, 0)) { MTLLanguageVersion::V2_0 - } else if Self::version_at_least(major, minor, 10, 0) { + } else if version.at_least((10, 12), (10, 0)) { MTLLanguageVersion::V1_2 - } else if Self::version_at_least(major, minor, 9, 0) { + } else if version.at_least((10, 11), (9, 0)) { MTLLanguageVersion::V1_1 } else { MTLLanguageVersion::V1_0 }, // macOS 10.11 doesn't support read-write resources - fragment_rw_storage: !os_is_mac || Self::version_at_least(major, minor, 10, 12), - read_write_texture_tier: if os_is_mac { - if Self::version_at_least(major, minor, 10, 13) { - device.read_write_texture_support() - } else { - mtl::MTLReadWriteTextureTier::TierNone - } - } else if Self::version_at_least(major, minor, 11, 0) { - device.read_write_texture_support() + fragment_rw_storage: version.at_least((10, 12), (8, 0)), + read_write_texture_tier: rw_texture_tier, + msaa_desktop: os_is_mac, + msaa_apple3: if family_check { + device.supports_family(MTLGPUFamily::Apple3) } else { - mtl::MTLReadWriteTextureTier::TierNone + device.supports_feature_set(MTLFeatureSet::iOS_GPUFamily3_v4) }, - msaa_desktop: os_is_mac, - msaa_apple3: family_check && device.supports_family(MTLGPUFamily::Apple3), msaa_apple7: family_check && device.supports_family(MTLGPUFamily::Apple7), resource_heaps: Self::supports_any(device, RESOURCE_HEAP_SUPPORT), argument_buffers: Self::supports_any(device, ARGUMENT_BUFFER_SUPPORT), @@ -696,8 +525,7 @@ impl super::PrivateCapabilities { sampler_clamp_to_border: Self::supports_any(device, SAMPLER_CLAMP_TO_BORDER_SUPPORT), sampler_lod_average: { // TODO: Clarify minimum macOS version with Apple (43707452) - let need_version = if os_is_mac { (10, 13) } else { (9, 0) }; - Self::version_at_least(major, minor, need_version.0, need_version.1) + version.at_least((10, 13), (9, 0)) }, base_instance: Self::supports_any(device, BASE_INSTANCE_SUPPORT), base_vertex_instance_drawing: Self::supports_any(device, BASE_VERTEX_INSTANCE_SUPPORT), @@ -714,41 +542,27 @@ impl super::PrivateCapabilities { format_min_srgb_channels: if os_is_mac { 4 } else { 1 }, format_b5: !os_is_mac, format_bc: os_is_mac, - format_eac_etc: !os_is_mac, - format_astc: Self::supports_any(device, ASTC_PIXEL_FORMAT_FEATURES), + format_eac_etc: !os_is_mac + // M1 in macOS supports EAC/ETC2 + || (family_check && device.supports_family(MTLGPUFamily::Apple7)), + // A8(Apple2) and later always support ASTC pixel formats + format_astc: (family_check && device.supports_family(MTLGPUFamily::Apple2)) + || Self::supports_any(device, ASTC_PIXEL_FORMAT_FEATURES), + // A13(Apple6) M1(Apple7) and later always support HDR ASTC pixel formats + format_astc_hdr: family_check && device.supports_family(MTLGPUFamily::Apple6), format_any8_unorm_srgb_all: Self::supports_any(device, ANY8_UNORM_SRGB_ALL), format_any8_unorm_srgb_no_write: !Self::supports_any(device, ANY8_UNORM_SRGB_ALL) && !os_is_mac, format_any8_snorm_all: Self::supports_any(device, ANY8_SNORM_RESOLVE), format_r16_norm_all: os_is_mac, - format_r32_all: !Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), - format_r32_no_write: Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), - format_r32float_no_write_no_filter: Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ) && !os_is_mac, - format_r32float_no_filter: !Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ) && !os_is_mac, + // No devices support r32's all capabilities + format_r32_all: false, + // All devices support r32's write capability + format_r32_no_write: false, + // iOS support r32float's write capability, macOS support r32float's all capabilities + format_r32float_no_write_no_filter: false, + // Only iOS doesn't support r32float's filter capability + format_r32float_no_filter: !os_is_mac, format_r32float_all: os_is_mac, format_rgba8_srgb_all: Self::supports_any(device, RGBA8_SRGB), format_rgba8_srgb_no_write: !Self::supports_any(device, RGBA8_SRGB), @@ -761,81 +575,59 @@ impl super::PrivateCapabilities { format_rgb9e5_all: Self::supports_any(device, RGB9E5FLOAT_ALL), format_rgb9e5_no_write: !Self::supports_any(device, RGB9E5FLOAT_ALL) && !os_is_mac, format_rgb9e5_filter_only: os_is_mac, - format_rg32_color: Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), - format_rg32_color_write: !Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), + format_rg32_color: true, + format_rg32_color_write: true, + // Only macOS support rg32float's all capabilities format_rg32float_all: os_is_mac, - format_rg32float_color_blend: Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), - format_rg32float_no_filter: !os_is_mac - && !Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), - format_rgba32int_color: Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), - format_rgba32int_color_write: !Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ), - format_rgba32float_color: Self::supports_any( + // All devices support rg32float's color + blend capabilities + format_rg32float_color_blend: true, + // Only iOS doesn't support rg32float's filter + format_rg32float_no_filter: !os_is_mac, + format_rgba32int_color: true, + // All devices support rgba32uint and rgba32sint's color + write capabilities + format_rgba32int_color_write: true, + format_rgba32float_color: true, + // All devices support rgba32float's color + write capabilities + format_rgba32float_color_write: true, + // Only macOS support rgba32float's all capabilities + format_rgba32float_all: os_is_mac, + format_depth16unorm: Self::supports_any( device, &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, + MTLFeatureSet::iOS_GPUFamily3_v3, + MTLFeatureSet::macOS_GPUFamily1_v2, ], ), - format_rgba32float_color_write: !Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v1, - MTLFeatureSet::iOS_GPUFamily2_v1, - ], - ) && !os_is_mac, - format_rgba32float_all: os_is_mac, - format_depth16unorm: device.supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v2), - format_depth32float_filter: device - .supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v1), - format_depth32float_none: !device - .supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v1), + format_depth32float_filter: os_is_mac, + format_depth32float_none: !os_is_mac, format_bgr10a2_all: Self::supports_any(device, BGR10A2_ALL), - format_bgr10a2_no_write: !device - .supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v3), + format_bgr10a2_no_write: !Self::supports_any(device, BGR10A2_ALL), max_buffers_per_stage: 31, - max_textures_per_stage: if os_is_mac { 128 } else { 31 }, - max_samplers_per_stage: 16, + max_textures_per_stage: if os_is_mac { + 128 // On macOS, minimun value is 128 + } else if device.supports_feature_set(MTLFeatureSet::iOS_GPUFamily4_v1) { + 96 + } else { + 31 + }, + max_samplers_per_stage: if (family_check + && device.supports_family(MTLGPUFamily::Apple6)) + || (os_is_mac && rw_texture_tier == MTLReadWriteTextureTier::Tier2) + { + 1024 + } else { + 16 + }, buffer_alignment: if os_is_mac { 256 } else { 64 }, - max_buffer_size: if device.supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v2) { - 1 << 30 // 1GB on macOS 1.2 and up + max_buffer_size: if version.at_least((10, 14), (12, 0)) { + // maxBufferLength available on macOS 10.14+ and iOS 12.0+ + let buffer_size: mtl::NSInteger = + unsafe { msg_send![device.as_ref(), maxBufferLength] }; + buffer_size as _ + } else if os_is_mac { + 1 << 30 // 1GB on macOS 10.11 and up } else { - 1 << 28 // 256MB otherwise + 1 << 28 // 256MB on iOS 8.0+ }, max_texture_size: if Self::supports_any( device, @@ -846,45 +638,33 @@ impl super::PrivateCapabilities { ], ) { 16384 - } else if Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily1_v2, - MTLFeatureSet::iOS_GPUFamily2_v2, - MTLFeatureSet::tvOS_GPUFamily1_v1, - ], - ) { - 8192 } else { - 4096 + 8192 }, max_texture_3d_size: 2048, max_texture_layers: 2048, - max_fragment_input_components: if os_is_mac { 128 } else { 60 }, + max_fragment_input_components: if os_is_mac + || device.supports_feature_set(MTLFeatureSet::iOS_GPUFamily4_v1) + { + 124 + } else { + 60 + }, max_color_render_targets: if Self::supports_any( device, &[ MTLFeatureSet::iOS_GPUFamily2_v1, - MTLFeatureSet::iOS_GPUFamily3_v1, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v1, - MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ], ) { 8 } else { 4 }, - max_varying_components: if Self::supports_any( - device, - &[ - MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, - ], - ) { + max_varying_components: if device + .supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v1) + { 128 } else { 60 @@ -893,29 +673,22 @@ impl super::PrivateCapabilities { device, &[ MTLFeatureSet::iOS_GPUFamily4_v2, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::macOS_GPUFamily1_v1, - MTLFeatureSet::macOS_GPUFamily2_v1, ], ) { 1024 } else { 512 }, - max_total_threadgroup_memory: if Self::supports_any( - device, - &[ - MTLFeatureSet::iOS_GPUFamily4_v2, - MTLFeatureSet::iOS_GPUFamily5_v1, - ], - ) { + max_total_threadgroup_memory: if device + .supports_feature_set(MTLFeatureSet::iOS_GPUFamily4_v2) + { 64 << 10 } else if Self::supports_any( device, &[ MTLFeatureSet::iOS_GPUFamily4_v1, MTLFeatureSet::macOS_GPUFamily1_v2, - MTLFeatureSet::macOS_GPUFamily2_v1, ], ) { 32 << 10 @@ -927,58 +700,47 @@ impl super::PrivateCapabilities { device, &[ MTLFeatureSet::macOS_GPUFamily1_v2, - MTLFeatureSet::macOS_GPUFamily2_v1, MTLFeatureSet::iOS_GPUFamily1_v3, - MTLFeatureSet::iOS_GPUFamily2_v3, - MTLFeatureSet::iOS_GPUFamily3_v2, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily1_v2, - MTLFeatureSet::tvOS_GPUFamily2_v1, ], ), supports_binary_archives: family_check && (device.supports_family(MTLGPUFamily::Apple3) || device.supports_family(MTLGPUFamily::Mac1)), - supports_capture_manager: if os_is_mac { - Self::version_at_least(major, minor, 10, 13) - } else { - Self::version_at_least(major, minor, 11, 0) - }, - can_set_maximum_drawables_count: os_is_mac - || Self::version_at_least(major, minor, 11, 2), - can_set_display_sync: os_is_mac && Self::version_at_least(major, minor, 10, 13), - can_set_next_drawable_timeout: if os_is_mac { - Self::version_at_least(major, minor, 10, 13) - } else { - Self::version_at_least(major, minor, 11, 0) - }, + supports_capture_manager: version.at_least((10, 13), (11, 0)), + can_set_maximum_drawables_count: version.at_least((10, 14), (11, 2)), + can_set_display_sync: version.at_least((10, 13), OS_NOT_SUPPORT), + can_set_next_drawable_timeout: version.at_least((10, 13), (11, 0)), supports_arrays_of_textures: Self::supports_any( device, &[ MTLFeatureSet::iOS_GPUFamily3_v2, - MTLFeatureSet::iOS_GPUFamily4_v1, - MTLFeatureSet::iOS_GPUFamily5_v1, MTLFeatureSet::tvOS_GPUFamily2_v1, MTLFeatureSet::macOS_GPUFamily1_v3, - MTLFeatureSet::macOS_GPUFamily2_v1, ], ), supports_arrays_of_textures_write: family_check && (device.supports_family(MTLGPUFamily::Apple6) || device.supports_family(MTLGPUFamily::Mac1) - || device.supports_family(MTLGPUFamily::Mac2) - || device.supports_family(MTLGPUFamily::MacCatalyst1) - || device.supports_family(MTLGPUFamily::MacCatalyst2)), - supports_mutability: if os_is_mac { - Self::version_at_least(major, minor, 10, 13) + || device.supports_family(MTLGPUFamily::MacCatalyst1)), + supports_mutability: version.at_least((10, 13), (11, 0)), + //Depth clipping is supported on all macOS GPU families and iOS family 4 and later + supports_depth_clip_control: os_is_mac + || device.supports_feature_set(MTLFeatureSet::iOS_GPUFamily4_v1), + supports_preserve_invariance: version.at_least((11, 0), (13, 0)), + has_unified_memory: if version.at_least((10, 15), (13, 0)) { + Some(device.has_unified_memory()) } else { - Self::version_at_least(major, minor, 11, 0) + None }, - //Depth clipping is supported on all macOS GPU families and iOS family 4 and later - supports_depth_clip_control: device - .supports_feature_set(MTLFeatureSet::iOS_GPUFamily4_v1) - || os_is_mac, + } + } + + pub fn device_type(&self) -> wgt::DeviceType { + if self.has_unified_memory.unwrap_or(self.low_power) { + wgt::DeviceType::IntegratedGpu + } else { + wgt::DeviceType::DiscreteGpu } } @@ -986,7 +748,6 @@ impl super::PrivateCapabilities { use wgt::Features as F; let mut features = F::empty() - | F::TEXTURE_COMPRESSION_BC | F::INDIRECT_FIRST_INSTANCE | F::MAPPABLE_PRIMARY_BUFFERS | F::VERTEX_WRITABLE_STORAGE @@ -996,6 +757,11 @@ impl super::PrivateCapabilities { | F::CLEAR_TEXTURE | F::TEXTURE_FORMAT_16BIT_NORM; + features.set(F::TEXTURE_COMPRESSION_ASTC_LDR, self.format_astc); + features.set(F::TEXTURE_COMPRESSION_ASTC_HDR, self.format_astc_hdr); + features.set(F::TEXTURE_COMPRESSION_BC, self.format_bc); + features.set(F::TEXTURE_COMPRESSION_ETC2, self.format_eac_etc); + features.set(F::DEPTH_CLIP_CONTROL, self.supports_depth_clip_control); features.set( @@ -1013,10 +779,12 @@ impl super::PrivateCapabilities { { features.insert(F::STORAGE_RESOURCE_BINDING_ARRAY); } + features.set( F::ADDRESS_MODE_CLAMP_TO_BORDER, self.sampler_clamp_to_border, ); + features.set(F::ADDRESS_MODE_CLAMP_TO_ZERO, true); features } @@ -1085,7 +853,6 @@ impl super::PrivateCapabilities { pub fn map_format(&self, format: wgt::TextureFormat) -> mtl::MTLPixelFormat { use mtl::MTLPixelFormat::*; use wgt::TextureFormat as Tf; - match format { Tf::R8Unorm => R8Unorm, Tf::R8Snorm => R8Snorm, @@ -1168,34 +935,56 @@ impl super::PrivateCapabilities { Tf::EacR11Snorm => EAC_R11Snorm, Tf::EacRg11Unorm => EAC_RG11Unorm, Tf::EacRg11Snorm => EAC_RG11Snorm, - Tf::Astc4x4RgbaUnorm => ASTC_4x4_LDR, - Tf::Astc4x4RgbaUnormSrgb => ASTC_4x4_sRGB, - Tf::Astc5x4RgbaUnorm => ASTC_5x4_LDR, - Tf::Astc5x4RgbaUnormSrgb => ASTC_5x4_sRGB, - Tf::Astc5x5RgbaUnorm => ASTC_5x5_LDR, - Tf::Astc5x5RgbaUnormSrgb => ASTC_5x5_sRGB, - Tf::Astc6x5RgbaUnorm => ASTC_6x5_LDR, - Tf::Astc6x5RgbaUnormSrgb => ASTC_6x5_sRGB, - Tf::Astc6x6RgbaUnorm => ASTC_6x6_LDR, - Tf::Astc6x6RgbaUnormSrgb => ASTC_6x6_sRGB, - Tf::Astc8x5RgbaUnorm => ASTC_8x5_LDR, - Tf::Astc8x5RgbaUnormSrgb => ASTC_8x5_sRGB, - Tf::Astc8x6RgbaUnorm => ASTC_8x6_LDR, - Tf::Astc8x6RgbaUnormSrgb => ASTC_8x6_sRGB, - Tf::Astc10x5RgbaUnorm => ASTC_8x8_LDR, - Tf::Astc10x5RgbaUnormSrgb => ASTC_8x8_sRGB, - Tf::Astc10x6RgbaUnorm => ASTC_10x5_LDR, - Tf::Astc10x6RgbaUnormSrgb => ASTC_10x5_sRGB, - Tf::Astc8x8RgbaUnorm => ASTC_10x6_LDR, - Tf::Astc8x8RgbaUnormSrgb => ASTC_10x6_sRGB, - Tf::Astc10x8RgbaUnorm => ASTC_10x8_LDR, - Tf::Astc10x8RgbaUnormSrgb => ASTC_10x8_sRGB, - Tf::Astc10x10RgbaUnorm => ASTC_10x10_LDR, - Tf::Astc10x10RgbaUnormSrgb => ASTC_10x10_sRGB, - Tf::Astc12x10RgbaUnorm => ASTC_12x10_LDR, - Tf::Astc12x10RgbaUnormSrgb => ASTC_12x10_sRGB, - Tf::Astc12x12RgbaUnorm => ASTC_12x12_LDR, - Tf::Astc12x12RgbaUnormSrgb => ASTC_12x12_sRGB, + Tf::Astc { block, channel } => match channel { + AstcChannel::Unorm => match block { + AstcBlock::B4x4 => ASTC_4x4_LDR, + AstcBlock::B5x4 => ASTC_5x4_LDR, + AstcBlock::B5x5 => ASTC_5x5_LDR, + AstcBlock::B6x5 => ASTC_6x5_LDR, + AstcBlock::B6x6 => ASTC_6x6_LDR, + AstcBlock::B8x5 => ASTC_8x5_LDR, + AstcBlock::B8x6 => ASTC_8x6_LDR, + AstcBlock::B8x8 => ASTC_8x8_LDR, + AstcBlock::B10x5 => ASTC_10x5_LDR, + AstcBlock::B10x6 => ASTC_10x6_LDR, + AstcBlock::B10x8 => ASTC_10x8_LDR, + AstcBlock::B10x10 => ASTC_10x10_LDR, + AstcBlock::B12x10 => ASTC_12x10_LDR, + AstcBlock::B12x12 => ASTC_12x12_LDR, + }, + AstcChannel::UnormSrgb => match block { + AstcBlock::B4x4 => ASTC_4x4_sRGB, + AstcBlock::B5x4 => ASTC_5x4_sRGB, + AstcBlock::B5x5 => ASTC_5x5_sRGB, + AstcBlock::B6x5 => ASTC_6x5_sRGB, + AstcBlock::B6x6 => ASTC_6x6_sRGB, + AstcBlock::B8x5 => ASTC_8x5_sRGB, + AstcBlock::B8x6 => ASTC_8x6_sRGB, + AstcBlock::B8x8 => ASTC_8x8_sRGB, + AstcBlock::B10x5 => ASTC_10x5_sRGB, + AstcBlock::B10x6 => ASTC_10x6_sRGB, + AstcBlock::B10x8 => ASTC_10x8_sRGB, + AstcBlock::B10x10 => ASTC_10x10_sRGB, + AstcBlock::B12x10 => ASTC_12x10_sRGB, + AstcBlock::B12x12 => ASTC_12x12_sRGB, + }, + AstcChannel::Hdr => match block { + AstcBlock::B4x4 => ASTC_4x4_HDR, + AstcBlock::B5x4 => ASTC_5x4_HDR, + AstcBlock::B5x5 => ASTC_5x5_HDR, + AstcBlock::B6x5 => ASTC_6x5_HDR, + AstcBlock::B6x6 => ASTC_6x6_HDR, + AstcBlock::B8x5 => ASTC_8x5_HDR, + AstcBlock::B8x6 => ASTC_8x6_HDR, + AstcBlock::B8x8 => ASTC_8x8_HDR, + AstcBlock::B10x5 => ASTC_10x5_HDR, + AstcBlock::B10x6 => ASTC_10x6_HDR, + AstcBlock::B10x8 => ASTC_10x8_HDR, + AstcBlock::B10x10 => ASTC_10x10_HDR, + AstcBlock::B12x10 => ASTC_12x10_HDR, + AstcBlock::B12x12 => ASTC_12x12_HDR, + }, + }, } } } diff --git a/third_party/rust/wgpu-hal/src/metal/command.rs b/third_party/rust/wgpu-hal/src/metal/command.rs index e7a0642b89adf..77f3cbfb1b131 100644 --- a/third_party/rust/wgpu-hal/src/metal/command.rs +++ b/third_party/rust/wgpu-hal/src/metal/command.rs @@ -39,13 +39,15 @@ impl super::CommandEncoder { } } - fn enter_any(&mut self) -> &mtl::CommandEncoderRef { + fn enter_any(&mut self) -> Option<&mtl::CommandEncoderRef> { if let Some(ref encoder) = self.state.render { - encoder + Some(encoder) } else if let Some(ref encoder) = self.state.compute { - encoder + Some(encoder) + } else if let Some(ref encoder) = self.state.blit { + Some(encoder) } else { - self.enter_blit() + None } } @@ -627,13 +629,23 @@ impl crate::CommandEncoder for super::CommandEncoder { } unsafe fn insert_debug_marker(&mut self, label: &str) { - self.enter_any().insert_debug_signpost(label); + if let Some(encoder) = self.enter_any() { + encoder.insert_debug_signpost(label); + } } unsafe fn begin_debug_marker(&mut self, group_label: &str) { - self.enter_any().push_debug_group(group_label); + if let Some(encoder) = self.enter_any() { + encoder.push_debug_group(group_label); + } else if let Some(ref buf) = self.raw_cmd_buf { + buf.push_debug_group(group_label); + } } unsafe fn end_debug_marker(&mut self) { - self.enter_any().pop_debug_group(); + if let Some(encoder) = self.enter_any() { + encoder.pop_debug_group(); + } else if let Some(ref buf) = self.raw_cmd_buf { + buf.pop_debug_group(); + } } unsafe fn set_render_pipeline(&mut self, pipeline: &super::RenderPipeline) { diff --git a/third_party/rust/wgpu-hal/src/metal/conv.rs b/third_party/rust/wgpu-hal/src/metal/conv.rs index 8cc7dc67c9d48..f275a74ec98ca 100644 --- a/third_party/rust/wgpu-hal/src/metal/conv.rs +++ b/third_party/rust/wgpu-hal/src/metal/conv.rs @@ -73,6 +73,7 @@ pub fn map_border_color(border_color: wgt::SamplerBorderColor) -> mtl::MTLSample wgt::SamplerBorderColor::TransparentBlack => TransparentBlack, wgt::SamplerBorderColor::OpaqueBlack => OpaqueBlack, wgt::SamplerBorderColor::OpaqueWhite => OpaqueWhite, + wgt::SamplerBorderColor::Zero => unreachable!(), } } diff --git a/third_party/rust/wgpu-hal/src/metal/device.rs b/third_party/rust/wgpu-hal/src/metal/device.rs index 84a2caf362cbe..b560bd0670e19 100644 --- a/third_party/rust/wgpu-hal/src/metal/device.rs +++ b/third_party/rust/wgpu-hal/src/metal/device.rs @@ -76,6 +76,10 @@ impl super::Device { let options = mtl::CompileOptions::new(); options.set_language_version(self.shared.private_caps.msl_version); + if self.shared.private_caps.supports_preserve_invariance { + options.set_preserve_invariance(true); + } + let library = self .shared .device @@ -112,43 +116,46 @@ impl super::Device { let mut sized_bindings = Vec::new(); let mut immutable_buffer_mask = 0; for (var_handle, var) in module.global_variables.iter() { - if var.class == naga::StorageClass::WorkGroup { - let size = module.types[var.ty].inner.span(&module.constants); - wg_memory_sizes.push(size); - } - - if let naga::TypeInner::Struct { ref members, .. } = module.types[var.ty].inner { - let br = match var.binding { - Some(ref br) => br.clone(), - None => continue, - }; - - if !ep_info[var_handle].is_empty() { - let storage_access_store = match var.class { - naga::StorageClass::Storage { access } => { + match var.space { + naga::AddressSpace::WorkGroup => { + if !ep_info[var_handle].is_empty() { + let size = module.types[var.ty].inner.size(&module.constants); + wg_memory_sizes.push(size); + } + } + naga::AddressSpace::Uniform | naga::AddressSpace::Storage { .. } => { + let br = match var.binding { + Some(ref br) => br.clone(), + None => continue, + }; + let storage_access_store = match var.space { + naga::AddressSpace::Storage { access } => { access.contains(naga::StorageAccess::STORE) } _ => false, }; + // check for an immutable buffer - if !storage_access_store { + if !ep_info[var_handle].is_empty() && !storage_access_store { let psm = &layout.naga_options.per_stage_map[naga_stage]; let slot = psm.resources[&br].buffer.unwrap(); immutable_buffer_mask |= 1 << slot; } - } - // check for the unsized buffer - if let Some(member) = members.last() { + let mut dynamic_array_container_ty = var.ty; + if let naga::TypeInner::Struct { ref members, .. } = module.types[var.ty].inner + { + dynamic_array_container_ty = members.last().unwrap().ty; + } if let naga::TypeInner::Array { size: naga::ArraySize::Dynamic, .. - } = module.types[member.ty].inner + } = module.types[dynamic_array_container_ty].inner { - // Note: unwraps are fine, since the MSL is already generated sized_bindings.push(br); } } + _ => {} } } @@ -388,15 +395,15 @@ impl crate::Device for super::Device { wgt::FilterMode::Linear => mtl::MTLSamplerMipFilter::Linear, }); - if let Some(aniso) = desc.anisotropy_clamp { - descriptor.set_max_anisotropy(aniso.get() as _); - } - let [s, t, r] = desc.address_modes; descriptor.set_address_mode_s(conv::map_address_mode(s)); descriptor.set_address_mode_t(conv::map_address_mode(t)); descriptor.set_address_mode_r(conv::map_address_mode(r)); + if let Some(aniso) = desc.anisotropy_clamp { + descriptor.set_max_anisotropy(aniso.get() as _); + } + if let Some(ref range) = desc.lod_clamp { descriptor.set_lod_min_clamp(range.start); descriptor.set_lod_max_clamp(range.end); @@ -409,8 +416,23 @@ impl crate::Device for super::Device { if let Some(fun) = desc.compare { descriptor.set_compare_function(conv::map_compare_function(fun)); } + if let Some(border_color) = desc.border_color { - descriptor.set_border_color(conv::map_border_color(border_color)); + if let wgt::SamplerBorderColor::Zero = border_color { + if s == wgt::AddressMode::ClampToBorder { + descriptor.set_address_mode_s(mtl::MTLSamplerAddressMode::ClampToZero); + } + + if t == wgt::AddressMode::ClampToBorder { + descriptor.set_address_mode_t(mtl::MTLSamplerAddressMode::ClampToZero); + } + + if r == wgt::AddressMode::ClampToBorder { + descriptor.set_address_mode_r(mtl::MTLSamplerAddressMode::ClampToZero); + } + } else { + descriptor.set_border_color(conv::map_border_color(border_color)); + } } if let Some(label) = desc.label { @@ -622,6 +644,7 @@ impl crate::Device for super::Device { mtl::MTLLanguageVersion::V2_1 => (2, 1), mtl::MTLLanguageVersion::V2_2 => (2, 2), mtl::MTLLanguageVersion::V2_3 => (2, 3), + mtl::MTLLanguageVersion::V2_4 => (2, 4), }, inline_samplers: Default::default(), spirv_cross_compatibility: false, diff --git a/third_party/rust/wgpu-hal/src/metal/mod.rs b/third_party/rust/wgpu-hal/src/metal/mod.rs index fab99d19b8e28..84c1e20929b00 100644 --- a/third_party/rust/wgpu-hal/src/metal/mod.rs +++ b/third_party/rust/wgpu-hal/src/metal/mod.rs @@ -87,12 +87,12 @@ impl crate::Instance for Instance { #[cfg(target_os = "ios")] raw_window_handle::RawWindowHandle::UiKit(handle) => { let _ = &self.managed_metal_layer_delegate; - Ok(Surface::from_uiview(handle.ui_view)) + Ok(Surface::from_view(handle.ui_view, None)) } #[cfg(target_os = "macos")] - raw_window_handle::RawWindowHandle::AppKit(handle) => Ok(Surface::from_nsview( + raw_window_handle::RawWindowHandle::AppKit(handle) => Ok(Surface::from_view( handle.ns_view, - &self.managed_metal_layer_delegate, + Some(&self.managed_metal_layer_delegate), )), _ => Err(crate::InstanceError), } @@ -114,11 +114,7 @@ impl crate::Instance for Instance { name, vendor: 0, device: 0, - device_type: if shared.private_caps.low_power { - wgt::DeviceType::IntegratedGpu - } else { - wgt::DeviceType::DiscreteGpu - }, + device_type: shared.private_caps.device_type(), backend: wgt::Backend::Metal, }, features: shared.private_caps.features(), @@ -170,6 +166,7 @@ struct PrivateCapabilities { format_bc: bool, format_eac_etc: bool, format_astc: bool, + format_astc_hdr: bool, format_any8_unorm_srgb_all: bool, format_any8_unorm_srgb_no_write: bool, format_any8_snorm_all: bool, @@ -229,6 +226,8 @@ struct PrivateCapabilities { supports_arrays_of_textures_write: bool, supports_mutability: bool, supports_depth_clip_control: bool, + supports_preserve_invariance: bool, + has_unified_memory: Option, } #[derive(Clone, Debug)] diff --git a/third_party/rust/wgpu-hal/src/metal/surface.rs b/third_party/rust/wgpu-hal/src/metal/surface.rs index 823b37ca2ad4f..124cf910f33ed 100644 --- a/third_party/rust/wgpu-hal/src/metal/surface.rs +++ b/third_party/rust/wgpu-hal/src/metal/surface.rs @@ -74,10 +74,12 @@ impl super::Surface { } } - #[cfg(target_os = "ios")] #[allow(clippy::transmute_ptr_to_ref)] - pub unsafe fn from_uiview(uiview: *mut c_void) -> Self { - let view = uiview as *mut Object; + pub unsafe fn from_view( + view: *mut c_void, + delegate: Option<&HalManagedMetalLayerDelegate>, + ) -> Self { + let view = view as *mut Object; if view.is_null() { panic!("window does not have a valid contentView"); } @@ -85,77 +87,41 @@ impl super::Surface { let main_layer: *mut Object = msg_send![view, layer]; let class = class!(CAMetalLayer); let is_valid_layer: BOOL = msg_send![main_layer, isKindOfClass: class]; + let render_layer = if is_valid_layer == YES { mem::transmute::<_, &mtl::MetalLayerRef>(main_layer).to_owned() } else { - // If the main layer is not a CAMetalLayer, we create a CAMetalLayer sublayer and use it instead. - // Unlike on macOS, we cannot replace the main view as UIView does not allow it (when NSView does). + // If the main layer is not a CAMetalLayer, we create a CAMetalLayer and use it. let new_layer: mtl::MetalLayer = msg_send![class, new]; - let bounds: CGRect = msg_send![main_layer, bounds]; - let () = msg_send![new_layer.as_ref(), setFrame: bounds]; - let () = msg_send![main_layer, addSublayer: new_layer.as_ref()]; - new_layer - }; - - let window: *mut Object = msg_send![view, window]; - if !window.is_null() { - let screen: *mut Object = msg_send![window, screen]; - assert!(!screen.is_null(), "window is not attached to a screen"); - - let scale_factor: CGFloat = msg_send![screen, nativeScale]; - let () = msg_send![view, setContentScaleFactor: scale_factor]; - } - - let _: *mut c_void = msg_send![view, retain]; - Self::new(NonNull::new(view), render_layer) - } - - #[cfg(target_os = "macos")] - #[allow(clippy::transmute_ptr_to_ref)] - pub unsafe fn from_nsview( - nsview: *mut c_void, - delegate: &HalManagedMetalLayerDelegate, - ) -> Self { - let view = nsview as *mut Object; - if view.is_null() { - panic!("window does not have a valid contentView"); - } - - let class = class!(CAMetalLayer); - // Deprecated! Clients should use `create_surface_from_layer` instead. - let is_actually_layer: BOOL = msg_send![view, isKindOfClass: class]; - if is_actually_layer == YES { - return Self::from_layer(mem::transmute(view)); - } - - let existing: *mut Object = msg_send![view, layer]; - let use_current = if existing.is_null() { - false - } else { - let result: BOOL = msg_send![existing, isKindOfClass: class]; - result == YES - }; - - let render_layer: mtl::MetalLayer = if use_current { - mem::transmute::<_, &mtl::MetalLayerRef>(existing).to_owned() - } else { - let layer: mtl::MetalLayer = msg_send![class, new]; - let () = msg_send![view, setLayer: layer.as_ref()]; - let () = msg_send![view, setWantsLayer: YES]; - let bounds: CGRect = msg_send![view, bounds]; - let () = msg_send![layer.as_ref(), setBounds: bounds]; - - let window: *mut Object = msg_send![view, window]; - if !window.is_null() { - let scale_factor: CGFloat = msg_send![window, backingScaleFactor]; - let () = msg_send![layer, setContentsScale: scale_factor]; + let frame: CGRect = msg_send![main_layer, bounds]; + let () = msg_send![new_layer.as_ref(), setFrame: frame]; + #[cfg(target_os = "ios")] + { + // Unlike NSView, UIView does not allow to replace main layer. + let () = msg_send![main_layer, addSublayer: new_layer.as_ref()]; + // On iOS, "from_view" may be called before the application initialization is complete, + // `msg_send![view, window]` and `msg_send![window, screen]` will get null. + let screen: *mut Object = msg_send![class!(UIScreen), mainScreen]; + let scale_factor: CGFloat = msg_send![screen, nativeScale]; + let () = msg_send![view, setContentScaleFactor: scale_factor]; + }; + #[cfg(target_os = "macos")] + { + let () = msg_send![view, setLayer: new_layer.as_ref()]; + let () = msg_send![view, setWantsLayer: YES]; + let () = msg_send![new_layer.as_ref(), setContentsGravity: kCAGravityTopLeft]; + let window: *mut Object = msg_send![view, window]; + if !window.is_null() { + let scale_factor: CGFloat = msg_send![window, backingScaleFactor]; + let () = msg_send![new_layer, setContentsScale: scale_factor]; + } + }; + if let Some(delegate) = delegate { + let () = msg_send![new_layer, setDelegate: delegate.0]; } - let () = msg_send![layer, setDelegate: delegate.0]; - layer + new_layer }; - let () = msg_send![render_layer, setContentsGravity: kCAGravityTopLeft]; - let _: *mut c_void = msg_send![view, retain]; Self::new(NonNull::new(view), render_layer) } @@ -168,30 +134,12 @@ impl super::Surface { } pub(super) fn dimensions(&self) -> wgt::Extent3d { - let (size, scale): (CGSize, CGFloat) = match self.view { - Some(view) if !cfg!(target_os = "macos") => unsafe { - let bounds: CGRect = msg_send![view.as_ptr(), bounds]; - let window: Option> = msg_send![view.as_ptr(), window]; - let screen = window.and_then(|window| -> Option> { - msg_send![window.as_ptr(), screen] - }); - match screen { - Some(screen) => { - let screen_space: *mut Object = msg_send![screen.as_ptr(), coordinateSpace]; - let rect: CGRect = msg_send![view.as_ptr(), convertRect:bounds toCoordinateSpace:screen_space]; - let scale_factor: CGFloat = msg_send![screen.as_ptr(), nativeScale]; - (rect.size, scale_factor) - } - None => (bounds.size, 1.0), - } - }, - _ => unsafe { - let render_layer_borrow = self.render_layer.lock(); - let render_layer = render_layer_borrow.as_ref(); - let bounds: CGRect = msg_send![render_layer, bounds]; - let contents_scale: CGFloat = msg_send![render_layer, contentsScale]; - (bounds.size, contents_scale) - }, + let (size, scale): (CGSize, CGFloat) = unsafe { + let render_layer_borrow = self.render_layer.lock(); + let render_layer = render_layer_borrow.as_ref(); + let bounds: CGRect = msg_send![render_layer, bounds]; + let contents_scale: CGFloat = msg_send![render_layer, contentsScale]; + (bounds.size, contents_scale) }; wgt::Extent3d { @@ -242,10 +190,15 @@ impl crate::Surface for super::Surface { render_layer.set_pixel_format(self.raw_swapchain_format); render_layer.set_framebuffer_only(framebuffer_only); render_layer.set_presents_with_transaction(self.present_with_transaction); + // opt-in to Metal EDR + // EDR potentially more power used in display and more bandwidth, memory footprint. + let wants_edr = self.raw_swapchain_format == mtl::MTLPixelFormat::RGBA16Float; + if wants_edr != render_layer.wants_extended_dynamic_range_content() { + render_layer.set_wants_extended_dynamic_range_content(wants_edr); + } // this gets ignored on iOS for certain OS/device combinations (iphone5s iOS 10.3) - let () = msg_send![*render_layer, setMaximumDrawableCount: config.swap_chain_size as u64]; - + render_layer.set_maximum_drawable_count(config.swap_chain_size as _); render_layer.set_drawable_size(drawable_size); if caps.can_set_next_drawable_timeout { let () = msg_send![*render_layer, setAllowsNextDrawableTimeout:false]; diff --git a/third_party/rust/wgpu-hal/src/vulkan/adapter.rs b/third_party/rust/wgpu-hal/src/vulkan/adapter.rs index e084d09afa394..20065e3a7f983 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/adapter.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/adapter.rs @@ -25,6 +25,7 @@ pub struct PhysicalDeviceFeatures { robustness2: Option, depth_clip_enable: Option, multiview: Option, + astc_hdr: Option, } // This is safe because the structs have `p_next: *mut c_void`, which we null out/never read. @@ -59,6 +60,9 @@ impl PhysicalDeviceFeatures { if let Some(ref mut feature) = self.depth_clip_enable { info = info.push_next(feature); } + if let Some(ref mut feature) = self.astc_hdr { + info = info.push_next(feature); + } info } @@ -99,8 +103,10 @@ impl PhysicalDeviceFeatures { // Features is a bitfield so we need to map everything manually core: vk::PhysicalDeviceFeatures::builder() .robust_buffer_access(private_caps.robust_buffer_access) - .independent_blend(true) - .sample_rate_shading(true) + .independent_blend(downlevel_flags.contains(wgt::DownlevelFlags::INDEPENDENT_BLEND)) + .sample_rate_shading( + downlevel_flags.contains(wgt::DownlevelFlags::MULTISAMPLED_SHADING), + ) .image_cube_array( downlevel_flags.contains(wgt::DownlevelFlags::CUBE_ARRAY_TEXTURES), ) @@ -318,6 +324,15 @@ impl PhysicalDeviceFeatures { } else { None }, + astc_hdr: if enabled_extensions.contains(&vk::ExtTextureCompressionAstcHdrFn::name()) { + Some( + vk::PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT::builder() + .texture_compression_astc_hdr(true) + .build(), + ) + } else { + None + }, } } @@ -329,6 +344,7 @@ impl PhysicalDeviceFeatures { | F::MAPPABLE_PRIMARY_BUFFERS | F::PUSH_CONSTANTS | F::ADDRESS_MODE_CLAMP_TO_BORDER + | F::ADDRESS_MODE_CLAMP_TO_ZERO | F::TIMESTAMP_QUERY | F::PIPELINE_STATISTICS_QUERY | F::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES @@ -341,6 +357,8 @@ impl PhysicalDeviceFeatures { Df::FRAGMENT_WRITABLE_STORAGE, self.core.fragment_stores_and_atomics != 0, ); + dl_flags.set(Df::MULTISAMPLED_SHADING, self.core.sample_rate_shading != 0); + dl_flags.set(Df::INDEPENDENT_BLEND, self.core.independent_blend != 0); features.set( F::INDIRECT_FIRST_INSTANCE, @@ -519,6 +537,13 @@ impl PhysicalDeviceFeatures { is_format_16bit_norm_supported(caps), ); + if let Some(ref astc_hdr) = self.astc_hdr { + features.set( + F::TEXTURE_COMPRESSION_ASTC_HDR, + astc_hdr.texture_compression_astc_hdr != 0, + ); + } + (features, dl_flags) } @@ -626,6 +651,13 @@ impl PhysicalDeviceCapabilities { extensions.push(vk::ExtDepthClipEnableFn::name()); } + #[cfg(any(target_os = "macos", target_os = "ios"))] + extensions.push(vk::KhrPortabilitySubsetFn::name()); + + if requested_features.contains(wgt::Features::TEXTURE_COMPRESSION_ASTC_HDR) { + extensions.push(vk::ExtTextureCompressionAstcHdrFn::name()) + } + extensions } @@ -858,6 +890,12 @@ impl super::InstanceShared { .insert(vk::PhysicalDeviceDepthClipEnableFeaturesEXT::default()); builder = builder.push_next(next); } + if capabilities.supports_extension(vk::ExtTextureCompressionAstcHdrFn::name()) { + let next = features + .astc_hdr + .insert(vk::PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT::default()); + builder = builder.push_next(next); + } let mut features2 = builder.build(); unsafe { @@ -928,16 +966,9 @@ impl super::Instance { ); return None; } - if phd_features.core.sample_rate_shading == 0 { - log::warn!( - "sample_rate_shading feature is not supported, hiding adapter: {}", - info.name - ); - return None; - } if !phd_capabilities.supports_extension(vk::AmdNegativeViewportHeightFn::name()) && !phd_capabilities.supports_extension(vk::KhrMaintenance1Fn::name()) - && phd_capabilities.properties.api_version < vk::API_VERSION_1_2 + && phd_capabilities.properties.api_version < vk::API_VERSION_1_1 { log::warn!( "viewport Y-flip is not supported, hiding adapter: {}", @@ -1401,7 +1432,6 @@ impl crate::Adapter for super::Adapter { if !self.private_caps.can_present { return None; } - let queue_family_index = 0; //TODO { profiling::scope!("vkGetPhysicalDeviceSurfaceSupportKHR"); @@ -1497,6 +1527,7 @@ impl crate::Adapter for super::Adapter { wgt::TextureFormat::Rgba8UnormSrgb, wgt::TextureFormat::Bgra8Unorm, wgt::TextureFormat::Bgra8UnormSrgb, + wgt::TextureFormat::Rgba16Float, ]; let formats = supported_formats .iter() @@ -1508,7 +1539,6 @@ impl crate::Adapter for super::Adapter { .any(|sf| sf.format == vk_format || sf.format == vk::Format::UNDEFINED) }) .collect(); - Some(crate::SurfaceCapabilities { formats, swap_chain_sizes: caps.min_image_count..=max_image_count, diff --git a/third_party/rust/wgpu-hal/src/vulkan/conv.rs b/third_party/rust/wgpu-hal/src/vulkan/conv.rs index 9d91ea054ccb0..727502aed8097 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/conv.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/conv.rs @@ -5,6 +5,7 @@ impl super::PrivateCapabilities { pub fn map_texture_format(&self, format: wgt::TextureFormat) -> vk::Format { use ash::vk::Format as F; use wgt::TextureFormat as Tf; + use wgt::{AstcBlock, AstcChannel}; match format { Tf::R8Unorm => F::R8_UNORM, Tf::R8Snorm => F::R8_SNORM, @@ -87,34 +88,56 @@ impl super::PrivateCapabilities { Tf::EacR11Snorm => F::EAC_R11_SNORM_BLOCK, Tf::EacRg11Unorm => F::EAC_R11G11_UNORM_BLOCK, Tf::EacRg11Snorm => F::EAC_R11G11_SNORM_BLOCK, - Tf::Astc4x4RgbaUnorm => F::ASTC_4X4_UNORM_BLOCK, - Tf::Astc4x4RgbaUnormSrgb => F::ASTC_4X4_SRGB_BLOCK, - Tf::Astc5x4RgbaUnorm => F::ASTC_5X4_UNORM_BLOCK, - Tf::Astc5x4RgbaUnormSrgb => F::ASTC_5X4_SRGB_BLOCK, - Tf::Astc5x5RgbaUnorm => F::ASTC_5X5_UNORM_BLOCK, - Tf::Astc5x5RgbaUnormSrgb => F::ASTC_5X5_SRGB_BLOCK, - Tf::Astc6x5RgbaUnorm => F::ASTC_6X5_UNORM_BLOCK, - Tf::Astc6x5RgbaUnormSrgb => F::ASTC_6X5_SRGB_BLOCK, - Tf::Astc6x6RgbaUnorm => F::ASTC_6X6_UNORM_BLOCK, - Tf::Astc6x6RgbaUnormSrgb => F::ASTC_6X6_SRGB_BLOCK, - Tf::Astc8x5RgbaUnorm => F::ASTC_8X5_UNORM_BLOCK, - Tf::Astc8x5RgbaUnormSrgb => F::ASTC_8X5_SRGB_BLOCK, - Tf::Astc8x6RgbaUnorm => F::ASTC_8X6_UNORM_BLOCK, - Tf::Astc8x6RgbaUnormSrgb => F::ASTC_8X6_SRGB_BLOCK, - Tf::Astc10x5RgbaUnorm => F::ASTC_8X8_UNORM_BLOCK, - Tf::Astc10x5RgbaUnormSrgb => F::ASTC_8X8_SRGB_BLOCK, - Tf::Astc10x6RgbaUnorm => F::ASTC_10X5_UNORM_BLOCK, - Tf::Astc10x6RgbaUnormSrgb => F::ASTC_10X5_SRGB_BLOCK, - Tf::Astc8x8RgbaUnorm => F::ASTC_10X6_UNORM_BLOCK, - Tf::Astc8x8RgbaUnormSrgb => F::ASTC_10X6_SRGB_BLOCK, - Tf::Astc10x8RgbaUnorm => F::ASTC_10X8_UNORM_BLOCK, - Tf::Astc10x8RgbaUnormSrgb => F::ASTC_10X8_SRGB_BLOCK, - Tf::Astc10x10RgbaUnorm => F::ASTC_10X10_UNORM_BLOCK, - Tf::Astc10x10RgbaUnormSrgb => F::ASTC_10X10_SRGB_BLOCK, - Tf::Astc12x10RgbaUnorm => F::ASTC_12X10_UNORM_BLOCK, - Tf::Astc12x10RgbaUnormSrgb => F::ASTC_12X10_SRGB_BLOCK, - Tf::Astc12x12RgbaUnorm => F::ASTC_12X12_UNORM_BLOCK, - Tf::Astc12x12RgbaUnormSrgb => F::ASTC_12X12_SRGB_BLOCK, + Tf::Astc { block, channel } => match channel { + AstcChannel::Unorm => match block { + AstcBlock::B4x4 => F::ASTC_4X4_UNORM_BLOCK, + AstcBlock::B5x4 => F::ASTC_5X4_UNORM_BLOCK, + AstcBlock::B5x5 => F::ASTC_5X5_UNORM_BLOCK, + AstcBlock::B6x5 => F::ASTC_6X5_UNORM_BLOCK, + AstcBlock::B6x6 => F::ASTC_6X6_UNORM_BLOCK, + AstcBlock::B8x5 => F::ASTC_8X5_UNORM_BLOCK, + AstcBlock::B8x6 => F::ASTC_8X6_UNORM_BLOCK, + AstcBlock::B8x8 => F::ASTC_8X8_UNORM_BLOCK, + AstcBlock::B10x5 => F::ASTC_10X5_UNORM_BLOCK, + AstcBlock::B10x6 => F::ASTC_10X6_UNORM_BLOCK, + AstcBlock::B10x8 => F::ASTC_10X8_UNORM_BLOCK, + AstcBlock::B10x10 => F::ASTC_10X10_UNORM_BLOCK, + AstcBlock::B12x10 => F::ASTC_12X10_UNORM_BLOCK, + AstcBlock::B12x12 => F::ASTC_12X12_UNORM_BLOCK, + }, + AstcChannel::UnormSrgb => match block { + AstcBlock::B4x4 => F::ASTC_4X4_SRGB_BLOCK, + AstcBlock::B5x4 => F::ASTC_5X4_SRGB_BLOCK, + AstcBlock::B5x5 => F::ASTC_5X5_SRGB_BLOCK, + AstcBlock::B6x5 => F::ASTC_6X5_SRGB_BLOCK, + AstcBlock::B6x6 => F::ASTC_6X6_SRGB_BLOCK, + AstcBlock::B8x5 => F::ASTC_8X5_SRGB_BLOCK, + AstcBlock::B8x6 => F::ASTC_8X6_SRGB_BLOCK, + AstcBlock::B8x8 => F::ASTC_8X8_SRGB_BLOCK, + AstcBlock::B10x5 => F::ASTC_10X5_SRGB_BLOCK, + AstcBlock::B10x6 => F::ASTC_10X6_SRGB_BLOCK, + AstcBlock::B10x8 => F::ASTC_10X8_SRGB_BLOCK, + AstcBlock::B10x10 => F::ASTC_10X10_SRGB_BLOCK, + AstcBlock::B12x10 => F::ASTC_12X10_SRGB_BLOCK, + AstcBlock::B12x12 => F::ASTC_12X12_SRGB_BLOCK, + }, + AstcChannel::Hdr => match block { + AstcBlock::B4x4 => F::ASTC_4X4_SFLOAT_BLOCK_EXT, + AstcBlock::B5x4 => F::ASTC_5X4_SFLOAT_BLOCK_EXT, + AstcBlock::B5x5 => F::ASTC_5X5_SFLOAT_BLOCK_EXT, + AstcBlock::B6x5 => F::ASTC_6X5_SFLOAT_BLOCK_EXT, + AstcBlock::B6x6 => F::ASTC_6X6_SFLOAT_BLOCK_EXT, + AstcBlock::B8x5 => F::ASTC_8X5_SFLOAT_BLOCK_EXT, + AstcBlock::B8x6 => F::ASTC_8X6_SFLOAT_BLOCK_EXT, + AstcBlock::B8x8 => F::ASTC_8X8_SFLOAT_BLOCK_EXT, + AstcBlock::B10x5 => F::ASTC_10X5_SFLOAT_BLOCK_EXT, + AstcBlock::B10x6 => F::ASTC_10X6_SFLOAT_BLOCK_EXT, + AstcBlock::B10x8 => F::ASTC_10X8_SFLOAT_BLOCK_EXT, + AstcBlock::B10x10 => F::ASTC_10X10_SFLOAT_BLOCK_EXT, + AstcBlock::B12x10 => F::ASTC_12X10_SFLOAT_BLOCK_EXT, + AstcBlock::B12x12 => F::ASTC_12X12_SFLOAT_BLOCK_EXT, + }, + }, } } } @@ -589,13 +612,15 @@ pub fn map_address_mode(mode: wgt::AddressMode) -> vk::SamplerAddressMode { wgt::AddressMode::Repeat => vk::SamplerAddressMode::REPEAT, wgt::AddressMode::MirrorRepeat => vk::SamplerAddressMode::MIRRORED_REPEAT, wgt::AddressMode::ClampToBorder => vk::SamplerAddressMode::CLAMP_TO_BORDER, - //wgt::AddressMode::MirrorClamp => vk::SamplerAddressMode::MIRROR_CLAMP_TO_EDGE, + // wgt::AddressMode::MirrorClamp => vk::SamplerAddressMode::MIRROR_CLAMP_TO_EDGE, } } pub fn map_border_color(border_color: wgt::SamplerBorderColor) -> vk::BorderColor { match border_color { - wgt::SamplerBorderColor::TransparentBlack => vk::BorderColor::FLOAT_TRANSPARENT_BLACK, + wgt::SamplerBorderColor::TransparentBlack | wgt::SamplerBorderColor::Zero => { + vk::BorderColor::FLOAT_TRANSPARENT_BLACK + } wgt::SamplerBorderColor::OpaqueBlack => vk::BorderColor::FLOAT_OPAQUE_BLACK, wgt::SamplerBorderColor::OpaqueWhite => vk::BorderColor::FLOAT_OPAQUE_WHITE, } diff --git a/third_party/rust/wgpu-hal/src/vulkan/device.rs b/third_party/rust/wgpu-hal/src/vulkan/device.rs index 56354ef690cbe..55dcd82f9de85 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/device.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/device.rs @@ -517,12 +517,19 @@ impl super::Device { None => vk::SwapchainKHR::null(), }; + let color_space = if config.format == wgt::TextureFormat::Rgba16Float { + // Enable wide color gamut mode + // Vulkan swapchain for Android only supports DISPLAY_P3_NONLINEAR_EXT and EXTENDED_SRGB_LINEAR_EXT + vk::ColorSpaceKHR::EXTENDED_SRGB_LINEAR_EXT + } else { + vk::ColorSpaceKHR::SRGB_NONLINEAR + }; let info = vk::SwapchainCreateInfoKHR::builder() .flags(vk::SwapchainCreateFlagsKHR::empty()) .surface(surface.raw) .min_image_count(config.swap_chain_size) .image_format(self.shared.private_caps.map_texture_format(config.format)) - .image_color_space(vk::ColorSpaceKHR::SRGB_NONLINEAR) + .image_color_space(color_space) .image_extent(vk::Extent2D { width: config.extent.width, height: config.extent.height, @@ -974,6 +981,7 @@ impl crate::Device for super::Device { .max_anisotropy(aniso.get() as f32); } } + if let Some(color) = desc.border_color { vk_info = vk_info.border_color(conv::map_border_color(color)); } diff --git a/third_party/rust/wgpu-hal/src/vulkan/instance.rs b/third_party/rust/wgpu-hal/src/vulkan/instance.rs index 71e0fc7e38554..6dff2fd485dd4 100644 --- a/third_party/rust/wgpu-hal/src/vulkan/instance.rs +++ b/third_party/rust/wgpu-hal/src/vulkan/instance.rs @@ -44,14 +44,16 @@ unsafe extern "system" fn debug_utils_messenger_callback( CStr::from_ptr(cd.p_message).to_string_lossy() }; - log::log!( - level, - "{:?} [{} (0x{:x})]\n\t{}", - message_type, - message_id_name, - cd.message_id_number, - message, - ); + let _ = std::panic::catch_unwind(|| { + log::log!( + level, + "{:?} [{} (0x{:x})]\n\t{}", + message_type, + message_id_name, + cd.message_id_number, + message, + ); + }); if cd.queue_label_count != 0 { let labels = slice::from_raw_parts(cd.p_queue_labels, cd.queue_label_count as usize); @@ -64,7 +66,10 @@ unsafe extern "system" fn debug_utils_messenger_callback( .map(|lbl| CStr::from_ptr(lbl).to_string_lossy()) }) .collect::>(); - log::log!(level, "\tqueues: {}", names.join(", ")); + + let _ = std::panic::catch_unwind(|| { + log::log!(level, "\tqueues: {}", names.join(", ")); + }); } if cd.cmd_buf_label_count != 0 { @@ -78,7 +83,10 @@ unsafe extern "system" fn debug_utils_messenger_callback( .map(|lbl| CStr::from_ptr(lbl).to_string_lossy()) }) .collect::>(); - log::log!(level, "\tcommand buffers: {}", names.join(", ")); + + let _ = std::panic::catch_unwind(|| { + log::log!(level, "\tcommand buffers: {}", names.join(", ")); + }); } if cd.object_count != 0 { @@ -99,7 +107,14 @@ unsafe extern "system" fn debug_utils_messenger_callback( ) }) .collect::>(); - log::log!(level, "\tobjects: {}", names.join(", ")); + let _ = std::panic::catch_unwind(|| { + log::log!(level, "\tobjects: {}", names.join(", ")); + }); + } + + if cfg!(debug_assertions) && level == log::Level::Error { + // Set canary and continue + crate::VALIDATION_CANARY.set(); } vk::FALSE @@ -123,7 +138,7 @@ impl super::Instance { flags: crate::InstanceFlags, ) -> Result, crate::InstanceError> { let instance_extensions = entry - .enumerate_instance_extension_properties() + .enumerate_instance_extension_properties(None) .map_err(|e| { log::info!("enumerate_instance_extension_properties: {:?}", e); crate::InstanceError @@ -159,6 +174,9 @@ impl super::Instance { extensions.push(vk::KhrGetPhysicalDeviceProperties2Fn::name()); + // Provid wide color gamut + extensions.push(vk::ExtSwapchainColorspaceFn::name()); + // Only keep available extensions. extensions.retain(|&ext| { if instance_extensions @@ -365,7 +383,7 @@ impl super::Instance { } #[cfg(any(target_os = "macos", target_os = "ios"))] - fn create_surface_from_ns_view(&self, view: *mut c_void) -> super::Surface { + fn create_surface_from_view(&self, view: *mut c_void) -> super::Surface { use core_graphics_types::{base::CGFloat, geometry::CGRect}; use objc::{ class, msg_send, @@ -378,27 +396,33 @@ impl super::Instance { let existing: *mut Object = msg_send![view, layer]; let class = class!(CAMetalLayer); - let use_current = if existing.is_null() { - false - } else { - let result: BOOL = msg_send![existing, isKindOfClass: class]; - result == YES - }; - - if use_current { + let use_current: BOOL = msg_send![existing, isKindOfClass: class]; + if use_current == YES { existing } else { - let layer: *mut Object = msg_send![class, new]; - let () = msg_send![view, setLayer: layer]; - let bounds: CGRect = msg_send![view, bounds]; - let () = msg_send![layer, setBounds: bounds]; - - let window: *mut Object = msg_send![view, window]; - if !window.is_null() { - let scale_factor: CGFloat = msg_send![window, backingScaleFactor]; - let () = msg_send![layer, setContentsScale: scale_factor]; - } - layer + let new_layer: *mut Object = msg_send![class, new]; + let frame: CGRect = msg_send![existing, bounds]; + let () = msg_send![new_layer, setFrame: frame]; + + let scale_factor: CGFloat = if cfg!(target_os = "ios") { + let () = msg_send![existing, addSublayer: new_layer]; + // On iOS, `create_surface_from_view` may be called before the application initialization is complete, + // `msg_send![view, window]` and `msg_send![window, screen]` will get null. + let screen: *mut Object = msg_send![class!(UIScreen), mainScreen]; + msg_send![screen, nativeScale] + } else { + let () = msg_send![view, setLayer: new_layer]; + let () = msg_send![view, setWantsLayer: YES]; + let window: *mut Object = msg_send![view, window]; + if !window.is_null() { + msg_send![window, backingScaleFactor] + } else { + 1.0 + } + }; + let () = msg_send![new_layer, setContentsScale: scale_factor]; + + new_layer } }; @@ -583,13 +607,13 @@ impl crate::Instance for super::Instance { RawWindowHandle::AppKit(handle) if self.extensions.contains(&ext::MetalSurface::name()) => { - Ok(self.create_surface_from_ns_view(handle.ns_view)) + Ok(self.create_surface_from_view(handle.ns_view)) } #[cfg(target_os = "ios")] RawWindowHandle::UiKit(handle) if self.extensions.contains(&ext::MetalSurface::name()) => { - Ok(self.create_surface_from_ns_view(handle.ui_view)) + Ok(self.create_surface_from_view(handle.ui_view)) } _ => Err(crate::InstanceError), } diff --git a/third_party/rust/wgpu-types/.cargo-checksum.json b/third_party/rust/wgpu-types/.cargo-checksum.json index 452283e74d4d5..c8b6b76989fbf 100644 --- a/third_party/rust/wgpu-types/.cargo-checksum.json +++ b/third_party/rust/wgpu-types/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"742abe387ad0a6b054a3e525040ff1e64f16072ae7cd305db0616beaa844e389","src/lib.rs":"d6f763ad1a62d23b0d733f3943012a59b313a8e96973774ba84a25f322e6df3e"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"742abe387ad0a6b054a3e525040ff1e64f16072ae7cd305db0616beaa844e389","src/lib.rs":"29aa1037479aff28823ea669792625a5f7febe06bd75987382c9984f1a2482a8"},"package":null} \ No newline at end of file diff --git a/third_party/rust/wgpu-types/src/lib.rs b/third_party/rust/wgpu-types/src/lib.rs index e2a15ca44049d..7642dd2b5724e 100644 --- a/third_party/rust/wgpu-types/src/lib.rs +++ b/third_party/rust/wgpu-types/src/lib.rs @@ -204,7 +204,7 @@ bitflags::bitflags! { /// write out a timestamp. /// /// They must be resolved using [`CommandEncoder::resolve_query_sets`] into a buffer, - /// then the result must be multiplied by the timestamp period [`Device::get_timestamp_period`] + /// then the result must be multiplied by the timestamp period [`Queue::get_timestamp_period`] /// to get the timestamp in nanoseconds. Multiple timestamps can then be diffed to get the /// time for operations between them to finish. /// @@ -394,7 +394,8 @@ bitflags::bitflags! { /// /// This is a native only feature. const PUSH_CONSTANTS = 1 << 26; - /// Allows the use of [`AddressMode::ClampToBorder`]. + /// Allows the use of [`AddressMode::ClampToBorder`] with a border color + /// other than [`SamplerBorderColor::Zero`]. /// /// Supported platforms: /// - DX12 @@ -415,7 +416,7 @@ bitflags::bitflags! { /// - Metal /// /// This is a native only feature. - const POLYGON_MODE_LINE= 1 << 28; + const POLYGON_MODE_LINE = 1 << 28; /// Allows the user to set [`PolygonMode::Point`] in [`PrimitiveState::polygon_mode`] /// /// This allows only drawing the vertices of polygons/triangles instead of filled @@ -551,6 +552,23 @@ bitflags::bitflags! { /// /// This is a native only feature. const TEXTURE_FORMAT_16BIT_NORM = 1 << 41; + /// Allows the use of [`AddressMode::ClampToBorder`] with a border color + /// of [`SamplerBorderColor::Zero`]. + /// + /// Supported platforms: + /// - DX12 + /// - Vulkan + /// - Metal + /// - DX11 + /// - OpenGL + /// + /// This is a native only feature. + const ADDRESS_MODE_CLAMP_TO_ZERO = 1 << 42; + /// Supported Platforms: + /// - Metal + /// + /// This is a native-only feature. + const TEXTURE_COMPRESSION_ASTC_HDR = 1 << 43; } } @@ -599,7 +617,7 @@ impl Features { /// /// See also: #[repr(C)] -#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] #[cfg_attr(feature = "trace", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] @@ -802,6 +820,76 @@ impl Limits { ..self } } + + /// Compares every limits within self is within the limits given in `allowed`. + /// + /// If you need detailed information on failures, look at [`Limits::check_limits_with_fail_fn`]. + pub fn check_limits(&self, allowed: &Self) -> bool { + let mut within = true; + self.check_limits_with_fail_fn(allowed, true, |_, _, _| within = false); + within + } + + /// Compares every limits within self is within the limits given in `allowed`. + /// For an easy to use binary choice, use [`Limits::check_limits`]. + /// + /// If a value is not within the allowed limit, this function calls the `fail_fn` + /// with the: + /// - limit name + /// - self's limit + /// - allowed's limit. + /// + /// If fatal is true, a single failure bails out the comparison after a single failure. + pub fn check_limits_with_fail_fn( + &self, + allowed: &Self, + fatal: bool, + mut fail_fn: impl FnMut(&'static str, u32, u32), + ) { + use std::cmp::Ordering; + + macro_rules! compare { + ($name:ident, $ordering:ident) => { + match self.$name.cmp(&allowed.$name) { + Ordering::$ordering | Ordering::Equal => (), + _ => { + fail_fn(stringify!($name), self.$name, allowed.$name); + if fatal { + return; + } + } + } + }; + } + + compare!(max_texture_dimension_1d, Less); + compare!(max_texture_dimension_2d, Less); + compare!(max_texture_dimension_3d, Less); + compare!(max_texture_array_layers, Less); + compare!(max_bind_groups, Less); + compare!(max_dynamic_uniform_buffers_per_pipeline_layout, Less); + compare!(max_dynamic_storage_buffers_per_pipeline_layout, Less); + compare!(max_sampled_textures_per_shader_stage, Less); + compare!(max_samplers_per_shader_stage, Less); + compare!(max_storage_buffers_per_shader_stage, Less); + compare!(max_storage_textures_per_shader_stage, Less); + compare!(max_uniform_buffers_per_shader_stage, Less); + compare!(max_uniform_buffer_binding_size, Less); + compare!(max_storage_buffer_binding_size, Less); + compare!(max_vertex_buffers, Less); + compare!(max_vertex_attributes, Less); + compare!(max_vertex_buffer_array_stride, Less); + compare!(max_push_constant_size, Less); + compare!(min_uniform_buffer_offset_alignment, Greater); + compare!(min_storage_buffer_offset_alignment, Greater); + compare!(max_inter_stage_shader_components, Less); + compare!(max_compute_workgroup_storage_size, Less); + compare!(max_compute_invocations_per_workgroup, Less); + compare!(max_compute_workgroup_size_x, Less); + compare!(max_compute_workgroup_size_y, Less); + compare!(max_compute_workgroup_size_z, Less); + compare!(max_compute_workgroups_per_dimension, Less); + } } /// Represents the sets of additional limits on an adapter, @@ -863,39 +951,50 @@ bitflags::bitflags! { /// [`DownlevelCapabilities::is_webgpu_compliant()`] function. pub struct DownlevelFlags: u32 { /// The device supports compiling and using compute shaders. + /// + /// DX11 on FL10 level hardware, WebGL2, and GLES3.0 devices do not support compute. const COMPUTE_SHADERS = 1 << 0; /// Supports binding storage buffers and textures to fragment shaders. const FRAGMENT_WRITABLE_STORAGE = 1 << 1; /// Supports indirect drawing and dispatching. + /// + /// DX11 on FL10 level hardware, WebGL2, and GLES 3.0 devices do not support indirect. const INDIRECT_EXECUTION = 1 << 2; /// Supports non-zero `base_vertex` parameter to indexed draw calls. const BASE_VERTEX = 1 << 3; /// Supports reading from a depth/stencil buffer while using as a read-only depth/stencil /// attachment. + /// + /// The WebGL2 and GLES backends do not support RODS. const READ_ONLY_DEPTH_STENCIL = 1 << 4; - /// Supports: - /// - copy_image_to_image - /// - copy_buffer_to_image and copy_image_to_buffer with a buffer without a MAP_* usage - const DEVICE_LOCAL_IMAGE_COPIES = 1 << 5; /// Supports textures with mipmaps which have a non power of two size. - const NON_POWER_OF_TWO_MIPMAPPED_TEXTURES = 1 << 6; + const NON_POWER_OF_TWO_MIPMAPPED_TEXTURES = 1 << 5; /// Supports textures that are cube arrays. - const CUBE_ARRAY_TEXTURES = 1 << 7; + const CUBE_ARRAY_TEXTURES = 1 << 6; /// Supports comparison samplers. - const COMPARISON_SAMPLERS = 1 << 8; - /// Supports different blending modes per color target. - const INDEPENDENT_BLENDING = 1 << 9; + const COMPARISON_SAMPLERS = 1 << 7; + /// Supports different blend operations per color attachment. + const INDEPENDENT_BLEND = 1 << 8; /// Supports storage buffers in vertex shaders. - const VERTEX_STORAGE = 1 << 10; - + const VERTEX_STORAGE = 1 << 9; /// Supports samplers with anisotropic filtering. Note this isn't actually required by /// WebGPU, the implementation is allowed to completely ignore aniso clamp. This flag is /// here for native backends so they can comunicate to the user of aniso is enabled. - const ANISOTROPIC_FILTERING = 1 << 11; + /// + /// All backends and all devices support anisotropic filtering. + const ANISOTROPIC_FILTERING = 1 << 10; /// Supports storage buffers in fragment shaders. - const FRAGMENT_STORAGE = 1 << 12; + const FRAGMENT_STORAGE = 1 << 11; + + /// Supports sample-rate shading. + const MULTISAMPLED_SHADING = 1 << 12; + + /// Supports copies between depth textures and buffers. + /// + /// GLES/WebGL don't support this. + const DEPTH_TEXTURE_AND_BUFFER_COPIES = 1 << 13; } } @@ -1467,6 +1566,60 @@ impl TextureFormatInfo { } } +/// ASTC block dimensions +#[repr(C)] +#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] +pub enum AstcBlock { + /// 4x4 block compressed texture. 16 bytes per block (8 bit/px). + B4x4, + /// 5x4 block compressed texture. 16 bytes per block (6.4 bit/px). + B5x4, + /// 5x5 block compressed texture. 16 bytes per block (5.12 bit/px). + B5x5, + /// 6x5 block compressed texture. 16 bytes per block (4.27 bit/px). + B6x5, + /// 6x6 block compressed texture. 16 bytes per block (3.56 bit/px). + B6x6, + /// 8x5 block compressed texture. 16 bytes per block (3.2 bit/px). + B8x5, + /// 8x6 block compressed texture. 16 bytes per block (2.67 bit/px). + B8x6, + /// 8x8 block compressed texture. 16 bytes per block (2 bit/px). + B8x8, + /// 10x5 block compressed texture. 16 bytes per block (2.56 bit/px). + B10x5, + /// 10x6 block compressed texture. 16 bytes per block (2.13 bit/px). + B10x6, + /// 10x8 block compressed texture. 16 bytes per block (1.6 bit/px). + B10x8, + /// 10x10 block compressed texture. 16 bytes per block (1.28 bit/px). + B10x10, + /// 12x10 block compressed texture. 16 bytes per block (1.07 bit/px). + B12x10, + /// 12x12 block compressed texture. 16 bytes per block (0.89 bit/px). + B12x12, +} + +/// ASTC RGBA channel +#[repr(C)] +#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] +pub enum AstcChannel { + /// 8 bit integer RGBA, [0, 255] converted to/from linear-color float [0, 1] in shader. + /// + /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this channel. + Unorm, + /// 8 bit integer RGBA, Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. + /// + /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this channel. + UnormSrgb, + /// floating-point RGBA, linear-color float can be outside of the [0, 1] range. + /// + /// [`Features::TEXTURE_COMPRESSION_ASTC_HDR`] must be enabled to use this channel. + Hdr, +} + /// Underlying texture data format. /// /// If there is a conversion in the format (such as srgb -> linear), The conversion listed is for @@ -1809,174 +1962,15 @@ pub enum TextureFormat { /// [`Features::TEXTURE_COMPRESSION_ETC2`] must be enabled to use this texture format. #[cfg_attr(feature = "serde", serde(rename = "eac-rg11snorm"))] EacRg11Snorm, - /// 4x4 block compressed texture. 16 bytes per block (8 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-4x4-unorm"))] - Astc4x4RgbaUnorm, - /// 4x4 block compressed texture. 16 bytes per block (8 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-4x4-unorm-srgb"))] - Astc4x4RgbaUnormSrgb, - /// 5x4 block compressed texture. 16 bytes per block (6.4 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-5x4-unorm"))] - Astc5x4RgbaUnorm, - /// 5x4 block compressed texture. 16 bytes per block (6.4 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-5x4-unorm-srgb"))] - Astc5x4RgbaUnormSrgb, - /// 5x5 block compressed texture. 16 bytes per block (5.12 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-5x5-unorm"))] - Astc5x5RgbaUnorm, - /// 5x5 block compressed texture. 16 bytes per block (5.12 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-5x5-unorm-srgb"))] - Astc5x5RgbaUnormSrgb, - /// 6x5 block compressed texture. 16 bytes per block (4.27 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-6x5-unorm"))] - Astc6x5RgbaUnorm, - /// 6x5 block compressed texture. 16 bytes per block (4.27 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-6x5-unorm-srgb"))] - Astc6x5RgbaUnormSrgb, - /// 6x6 block compressed texture. 16 bytes per block (3.56 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-6x6-unorm"))] - Astc6x6RgbaUnorm, - /// 6x6 block compressed texture. 16 bytes per block (3.56 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-6x6-unorm-srgb"))] - Astc6x6RgbaUnormSrgb, - /// 8x5 block compressed texture. 16 bytes per block (3.2 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-8x5-unorm"))] - Astc8x5RgbaUnorm, - /// 8x5 block compressed texture. 16 bytes per block (3.2 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-8x5-unorm-srgb"))] - Astc8x5RgbaUnormSrgb, - /// 8x6 block compressed texture. 16 bytes per block (2.67 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-8x6-unorm"))] - Astc8x6RgbaUnorm, - /// 8x6 block compressed texture. 16 bytes per block (2.67 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-8x6-unorm-srgb"))] - Astc8x6RgbaUnormSrgb, - /// 10x5 block compressed texture. 16 bytes per block (2.56 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x5-unorm"))] - Astc10x5RgbaUnorm, - /// 10x5 block compressed texture. 16 bytes per block (2.56 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x5-unorm-srgb"))] - Astc10x5RgbaUnormSrgb, - /// 10x6 block compressed texture. 16 bytes per block (2.13 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x6-unorm"))] - Astc10x6RgbaUnorm, - /// 10x6 block compressed texture. 16 bytes per block (2.13 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x6-unorm-srgb"))] - Astc10x6RgbaUnormSrgb, - /// 8x8 block compressed texture. 16 bytes per block (2 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. + /// block compressed texture. 16 bytes per block. /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-8x8-unorm"))] - Astc8x8RgbaUnorm, - /// 8x8 block compressed texture. 16 bytes per block (2 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-8x8-unorm-srgb"))] - Astc8x8RgbaUnormSrgb, - /// 10x8 block compressed texture. 16 bytes per block (1.6 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x8-unorm"))] - Astc10x8RgbaUnorm, - /// 10x8 block compressed texture. 16 bytes per block (1.6 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x8-unorm-srgb"))] - Astc10x8RgbaUnormSrgb, - /// 10x10 block compressed texture. 16 bytes per block (1.28 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x10-unorm"))] - Astc10x10RgbaUnorm, - /// 10x10 block compressed texture. 16 bytes per block (1.28 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-10x10-unorm-srgb"))] - Astc10x10RgbaUnormSrgb, - /// 12x10 block compressed texture. 16 bytes per block (1.07 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-12x10-unorm"))] - Astc12x10RgbaUnorm, - /// 12x10 block compressed texture. 16 bytes per block (1.07 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-12x10-unorm-srgb"))] - Astc12x10RgbaUnormSrgb, - /// 12x12 block compressed texture. 16 bytes per block (0.89 bit/px). Complex pallet. 8 bit integer RGBA. - /// [0, 255] converted to/from float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-12x12-unorm"))] - Astc12x12RgbaUnorm, - /// 12x12 block compressed texture. 16 bytes per block (0.89 bit/px). Complex pallet. 8 bit integer RGBA. - /// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader. - /// - /// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format. - #[cfg_attr(feature = "serde", serde(rename = "astc-12x12-unorm-srgb"))] - Astc12x12RgbaUnormSrgb, + /// Features [`TEXTURE_COMPRESSION_ASTC_LDR`] or [`TEXTURE_COMPRESSION_ASTC_HDR`] must be enabled to use this texture format. + Astc { + /// compressed block dimensions + block: AstcBlock, + /// + channel: AstcChannel, + }, } impl TextureFormat { @@ -1987,6 +1981,7 @@ impl TextureFormat { let bc = Features::TEXTURE_COMPRESSION_BC; let etc2 = Features::TEXTURE_COMPRESSION_ETC2; let astc_ldr = Features::TEXTURE_COMPRESSION_ASTC_LDR; + let astc_hdr = Features::TEXTURE_COMPRESSION_ASTC_HDR; let norm16bit = Features::TEXTURE_FORMAT_16BIT_NORM; // Sample Types @@ -2017,6 +2012,7 @@ impl TextureFormat { let all_flags = TextureUsages::all(); // See for reference + #[rustfmt::skip] // lets make a nice table let ( required_features, sample_type, @@ -2028,209 +2024,121 @@ impl TextureFormat { components, ) = match self { // Normal 8 bit textures - Self::R8Unorm => ( - native, - float, - linear, - msaa_resolve, - (1, 1), - 1, - attachment, - 1, - ), - Self::R8Snorm => (native, float, linear, msaa, (1, 1), 1, basic, 1), - Self::R8Uint => (native, uint, linear, msaa, (1, 1), 1, attachment, 1), - Self::R8Sint => (native, sint, linear, msaa, (1, 1), 1, attachment, 1), + Self::R8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 1, attachment, 1), + Self::R8Snorm => ( native, float, linear, msaa, (1, 1), 1, basic, 1), + Self::R8Uint => ( native, uint, linear, msaa, (1, 1), 1, attachment, 1), + Self::R8Sint => ( native, sint, linear, msaa, (1, 1), 1, attachment, 1), // Normal 16 bit textures - Self::R16Uint => (native, uint, linear, msaa, (1, 1), 2, attachment, 1), - Self::R16Sint => (native, sint, linear, msaa, (1, 1), 2, attachment, 1), - Self::R16Float => ( - native, - float, - linear, - msaa_resolve, - (1, 1), - 2, - attachment, - 1, - ), - Self::Rg8Unorm => ( - native, - float, - linear, - msaa_resolve, - (1, 1), - 2, - attachment, - 2, - ), - Self::Rg8Snorm => (native, float, linear, msaa, (1, 1), 2, attachment, 2), - Self::Rg8Uint => (native, uint, linear, msaa, (1, 1), 2, attachment, 2), - Self::Rg8Sint => (native, sint, linear, msaa, (1, 1), 2, basic, 2), + Self::R16Uint => ( native, uint, linear, msaa, (1, 1), 2, attachment, 1), + Self::R16Sint => ( native, sint, linear, msaa, (1, 1), 2, attachment, 1), + Self::R16Float => ( native, float, linear, msaa_resolve, (1, 1), 2, attachment, 1), + Self::Rg8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 2, attachment, 2), + Self::Rg8Snorm => ( native, float, linear, msaa, (1, 1), 2, attachment, 2), + Self::Rg8Uint => ( native, uint, linear, msaa, (1, 1), 2, attachment, 2), + Self::Rg8Sint => ( native, sint, linear, msaa, (1, 1), 2, basic, 2), // Normal 32 bit textures - Self::R32Uint => (native, uint, linear, noaa, (1, 1), 4, all_flags, 1), - Self::R32Sint => (native, sint, linear, noaa, (1, 1), 4, all_flags, 1), - Self::R32Float => (native, nearest, linear, msaa, (1, 1), 4, all_flags, 1), - Self::Rg16Uint => (native, uint, linear, msaa, (1, 1), 4, attachment, 2), - Self::Rg16Sint => (native, sint, linear, msaa, (1, 1), 4, attachment, 2), - Self::Rg16Float => ( - native, - float, - linear, - msaa_resolve, - (1, 1), - 4, - attachment, - 2, - ), - Self::Rgba8Unorm => (native, float, linear, msaa_resolve, (1, 1), 4, all_flags, 4), - Self::Rgba8UnormSrgb => ( - native, - float, - corrected, - msaa_resolve, - (1, 1), - 4, - attachment, - 4, - ), - Self::Rgba8Snorm => (native, float, linear, msaa, (1, 1), 4, storage, 4), - Self::Rgba8Uint => (native, uint, linear, msaa, (1, 1), 4, all_flags, 4), - Self::Rgba8Sint => (native, sint, linear, msaa, (1, 1), 4, all_flags, 4), - Self::Bgra8Unorm => ( - native, - float, - linear, - msaa_resolve, - (1, 1), - 4, - attachment, - 4, - ), - Self::Bgra8UnormSrgb => ( - native, - float, - corrected, - msaa_resolve, - (1, 1), - 4, - attachment, - 4, - ), + Self::R32Uint => ( native, uint, linear, noaa, (1, 1), 4, all_flags, 1), + Self::R32Sint => ( native, sint, linear, noaa, (1, 1), 4, all_flags, 1), + Self::R32Float => ( native, nearest, linear, msaa, (1, 1), 4, all_flags, 1), + Self::Rg16Uint => ( native, uint, linear, msaa, (1, 1), 4, attachment, 2), + Self::Rg16Sint => ( native, sint, linear, msaa, (1, 1), 4, attachment, 2), + Self::Rg16Float => ( native, float, linear, msaa_resolve, (1, 1), 4, attachment, 2), + Self::Rgba8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 4, all_flags, 4), + Self::Rgba8UnormSrgb => ( native, float, corrected, msaa_resolve, (1, 1), 4, attachment, 4), + Self::Rgba8Snorm => ( native, float, linear, msaa, (1, 1), 4, storage, 4), + Self::Rgba8Uint => ( native, uint, linear, msaa, (1, 1), 4, all_flags, 4), + Self::Rgba8Sint => ( native, sint, linear, msaa, (1, 1), 4, all_flags, 4), + Self::Bgra8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 4, attachment, 4), + Self::Bgra8UnormSrgb => ( native, float, corrected, msaa_resolve, (1, 1), 4, attachment, 4), // Packed 32 bit textures - Self::Rgb10a2Unorm => ( - native, - float, - linear, - msaa_resolve, - (1, 1), - 4, - attachment, - 4, - ), - Self::Rg11b10Float => (native, float, linear, msaa, (1, 1), 4, basic, 3), - - // Packed 32 bit textures - Self::Rg32Uint => (native, uint, linear, noaa, (1, 1), 8, all_flags, 2), - Self::Rg32Sint => (native, sint, linear, noaa, (1, 1), 8, all_flags, 2), - Self::Rg32Float => (native, nearest, linear, noaa, (1, 1), 8, all_flags, 2), - Self::Rgba16Uint => (native, uint, linear, msaa, (1, 1), 8, all_flags, 4), - Self::Rgba16Sint => (native, sint, linear, msaa, (1, 1), 8, all_flags, 4), - Self::Rgba16Float => (native, float, linear, msaa_resolve, (1, 1), 8, all_flags, 4), - - // Packed 32 bit textures - Self::Rgba32Uint => (native, uint, linear, noaa, (1, 1), 16, all_flags, 4), - Self::Rgba32Sint => (native, sint, linear, noaa, (1, 1), 16, all_flags, 4), - Self::Rgba32Float => (native, nearest, linear, noaa, (1, 1), 16, all_flags, 4), + Self::Rgb10a2Unorm => ( native, float, linear, msaa_resolve, (1, 1), 4, attachment, 4), + Self::Rg11b10Float => ( native, float, linear, msaa, (1, 1), 4, basic, 3), + + // Packed 32 bit textures + Self::Rg32Uint => ( native, uint, linear, noaa, (1, 1), 8, all_flags, 2), + Self::Rg32Sint => ( native, sint, linear, noaa, (1, 1), 8, all_flags, 2), + Self::Rg32Float => ( native, nearest, linear, noaa, (1, 1), 8, all_flags, 2), + Self::Rgba16Uint => ( native, uint, linear, msaa, (1, 1), 8, all_flags, 4), + Self::Rgba16Sint => ( native, sint, linear, msaa, (1, 1), 8, all_flags, 4), + Self::Rgba16Float => ( native, float, linear, msaa_resolve, (1, 1), 8, all_flags, 4), + + // Packed 32 bit textures + Self::Rgba32Uint => ( native, uint, linear, noaa, (1, 1), 16, all_flags, 4), + Self::Rgba32Sint => ( native, sint, linear, noaa, (1, 1), 16, all_flags, 4), + Self::Rgba32Float => ( native, nearest, linear, noaa, (1, 1), 16, all_flags, 4), // Depth-stencil textures - Self::Depth32Float => (native, depth, linear, msaa, (1, 1), 4, attachment, 1), - Self::Depth24Plus => (native, depth, linear, msaa, (1, 1), 4, attachment, 1), - Self::Depth24PlusStencil8 => (native, depth, linear, msaa, (1, 1), 4, attachment, 2), + Self::Depth32Float => ( native, depth, linear, msaa, (1, 1), 4, attachment, 1), + Self::Depth24Plus => ( native, depth, linear, msaa, (1, 1), 4, attachment, 1), + Self::Depth24PlusStencil8 => ( native, depth, linear, msaa, (1, 1), 4, attachment, 2), - // Packed uncompressed - Self::Rgb9e5Ufloat => (native, float, linear, noaa, (1, 1), 4, basic, 3), + // Packed uncompressed + Self::Rgb9e5Ufloat => ( native, float, linear, noaa, (1, 1), 4, basic, 3), + + // Optional normalized 16-bit-per-channel formats + Self::R16Unorm => (norm16bit, float, linear, msaa, (1, 1), 2, storage, 1), + Self::R16Snorm => (norm16bit, float, linear, msaa, (1, 1), 2, storage, 1), + Self::Rg16Unorm => (norm16bit, float, linear, msaa, (1, 1), 4, storage, 2), + Self::Rg16Snorm => (norm16bit, float, linear, msaa, (1, 1), 4, storage, 2), + Self::Rgba16Unorm => (norm16bit, float, linear, msaa, (1, 1), 8, storage, 4), + Self::Rgba16Snorm => (norm16bit, float, linear, msaa, (1, 1), 8, storage, 4), // BCn compressed textures - Self::Bc1RgbaUnorm => (bc, float, linear, noaa, (4, 4), 8, basic, 4), - Self::Bc1RgbaUnormSrgb => (bc, float, corrected, noaa, (4, 4), 8, basic, 4), - Self::Bc2RgbaUnorm => (bc, float, linear, noaa, (4, 4), 16, basic, 4), - Self::Bc2RgbaUnormSrgb => (bc, float, corrected, noaa, (4, 4), 16, basic, 4), - Self::Bc3RgbaUnorm => (bc, float, linear, noaa, (4, 4), 16, basic, 4), - Self::Bc3RgbaUnormSrgb => (bc, float, corrected, noaa, (4, 4), 16, basic, 4), - Self::Bc4RUnorm => (bc, float, linear, noaa, (4, 4), 8, basic, 1), - Self::Bc4RSnorm => (bc, float, linear, noaa, (4, 4), 8, basic, 1), - Self::Bc5RgUnorm => (bc, float, linear, noaa, (4, 4), 16, basic, 2), - Self::Bc5RgSnorm => (bc, float, linear, noaa, (4, 4), 16, basic, 2), - Self::Bc6hRgbUfloat => (bc, float, linear, noaa, (4, 4), 16, basic, 3), - Self::Bc6hRgbSfloat => (bc, float, linear, noaa, (4, 4), 16, basic, 3), - Self::Bc7RgbaUnorm => (bc, float, linear, noaa, (4, 4), 16, basic, 4), - Self::Bc7RgbaUnormSrgb => (bc, float, corrected, noaa, (4, 4), 16, basic, 4), + Self::Bc1RgbaUnorm => ( bc, float, linear, noaa, (4, 4), 8, basic, 4), + Self::Bc1RgbaUnormSrgb => ( bc, float, corrected, noaa, (4, 4), 8, basic, 4), + Self::Bc2RgbaUnorm => ( bc, float, linear, noaa, (4, 4), 16, basic, 4), + Self::Bc2RgbaUnormSrgb => ( bc, float, corrected, noaa, (4, 4), 16, basic, 4), + Self::Bc3RgbaUnorm => ( bc, float, linear, noaa, (4, 4), 16, basic, 4), + Self::Bc3RgbaUnormSrgb => ( bc, float, corrected, noaa, (4, 4), 16, basic, 4), + Self::Bc4RUnorm => ( bc, float, linear, noaa, (4, 4), 8, basic, 1), + Self::Bc4RSnorm => ( bc, float, linear, noaa, (4, 4), 8, basic, 1), + Self::Bc5RgUnorm => ( bc, float, linear, noaa, (4, 4), 16, basic, 2), + Self::Bc5RgSnorm => ( bc, float, linear, noaa, (4, 4), 16, basic, 2), + Self::Bc6hRgbUfloat => ( bc, float, linear, noaa, (4, 4), 16, basic, 3), + Self::Bc6hRgbSfloat => ( bc, float, linear, noaa, (4, 4), 16, basic, 3), + Self::Bc7RgbaUnorm => ( bc, float, linear, noaa, (4, 4), 16, basic, 4), + Self::Bc7RgbaUnormSrgb => ( bc, float, corrected, noaa, (4, 4), 16, basic, 4), // ETC compressed textures - Self::Etc2Rgb8Unorm => (etc2, float, linear, noaa, (4, 4), 8, basic, 3), - Self::Etc2Rgb8UnormSrgb => (etc2, float, corrected, noaa, (4, 4), 8, basic, 3), - Self::Etc2Rgb8A1Unorm => (etc2, float, linear, noaa, (4, 4), 8, basic, 4), - Self::Etc2Rgb8A1UnormSrgb => (etc2, float, corrected, noaa, (4, 4), 8, basic, 4), - Self::Etc2Rgba8Unorm => (etc2, float, linear, noaa, (4, 4), 16, basic, 4), - Self::Etc2Rgba8UnormSrgb => (etc2, float, corrected, noaa, (4, 4), 16, basic, 4), - Self::EacR11Unorm => (etc2, float, linear, noaa, (4, 4), 8, basic, 1), - Self::EacR11Snorm => (etc2, float, linear, noaa, (4, 4), 8, basic, 1), - Self::EacRg11Unorm => (etc2, float, linear, noaa, (4, 4), 16, basic, 2), - Self::EacRg11Snorm => (etc2, float, linear, noaa, (4, 4), 16, basic, 2), + Self::Etc2Rgb8Unorm => ( etc2, float, linear, noaa, (4, 4), 8, basic, 3), + Self::Etc2Rgb8UnormSrgb => ( etc2, float, corrected, noaa, (4, 4), 8, basic, 3), + Self::Etc2Rgb8A1Unorm => ( etc2, float, linear, noaa, (4, 4), 8, basic, 4), + Self::Etc2Rgb8A1UnormSrgb => ( etc2, float, corrected, noaa, (4, 4), 8, basic, 4), + Self::Etc2Rgba8Unorm => ( etc2, float, linear, noaa, (4, 4), 16, basic, 4), + Self::Etc2Rgba8UnormSrgb => ( etc2, float, corrected, noaa, (4, 4), 16, basic, 4), + Self::EacR11Unorm => ( etc2, float, linear, noaa, (4, 4), 8, basic, 1), + Self::EacR11Snorm => ( etc2, float, linear, noaa, (4, 4), 8, basic, 1), + Self::EacRg11Unorm => ( etc2, float, linear, noaa, (4, 4), 16, basic, 2), + Self::EacRg11Snorm => ( etc2, float, linear, noaa, (4, 4), 16, basic, 2), // ASTC compressed textures - Self::Astc4x4RgbaUnorm => (astc_ldr, float, linear, noaa, (4, 4), 16, basic, 4), - Self::Astc4x4RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (4, 4), 16, basic, 4), - Self::Astc5x4RgbaUnorm => (astc_ldr, float, linear, noaa, (5, 4), 16, basic, 4), - Self::Astc5x4RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (5, 4), 16, basic, 4), - Self::Astc5x5RgbaUnorm => (astc_ldr, float, linear, noaa, (5, 5), 16, basic, 4), - Self::Astc5x5RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (5, 5), 16, basic, 4), - Self::Astc6x5RgbaUnorm => (astc_ldr, float, linear, noaa, (6, 5), 16, basic, 4), - Self::Astc6x5RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (6, 5), 16, basic, 4), - Self::Astc6x6RgbaUnorm => (astc_ldr, float, linear, noaa, (6, 6), 16, basic, 4), - Self::Astc6x6RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (6, 6), 16, basic, 4), - Self::Astc8x5RgbaUnorm => (astc_ldr, float, linear, noaa, (8, 5), 16, basic, 4), - Self::Astc8x5RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (8, 5), 16, basic, 4), - Self::Astc8x6RgbaUnorm => (astc_ldr, float, linear, noaa, (8, 6), 16, basic, 4), - Self::Astc8x6RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (8, 6), 16, basic, 4), - Self::Astc10x5RgbaUnorm => (astc_ldr, float, linear, noaa, (10, 5), 16, basic, 4), - Self::Astc10x5RgbaUnormSrgb => { - (astc_ldr, float, corrected, noaa, (10, 5), 16, basic, 4) - } - Self::Astc10x6RgbaUnorm => (astc_ldr, float, linear, noaa, (10, 6), 16, basic, 4), - Self::Astc10x6RgbaUnormSrgb => { - (astc_ldr, float, corrected, noaa, (10, 6), 16, basic, 4) - } - Self::Astc8x8RgbaUnorm => (astc_ldr, float, linear, noaa, (8, 8), 16, basic, 4), - Self::Astc8x8RgbaUnormSrgb => (astc_ldr, float, corrected, noaa, (8, 8), 16, basic, 4), - Self::Astc10x8RgbaUnorm => (astc_ldr, float, linear, noaa, (10, 8), 16, basic, 4), - Self::Astc10x8RgbaUnormSrgb => { - (astc_ldr, float, corrected, noaa, (10, 8), 16, basic, 4) + Self::Astc { block, channel } => { + let (feature, color_space) = match channel { + AstcChannel::Hdr => (astc_hdr, linear), + AstcChannel::Unorm => (astc_ldr, linear), + AstcChannel::UnormSrgb => (astc_ldr, corrected), + }; + let dimensions = match block { + AstcBlock::B4x4 => (4, 4), + AstcBlock::B5x4 => (5, 4), + AstcBlock::B5x5 => (5, 5), + AstcBlock::B6x5 => (6, 5), + AstcBlock::B6x6 => (6, 6), + AstcBlock::B8x5 => (8, 5), + AstcBlock::B8x6 => (8, 6), + AstcBlock::B8x8 => (8, 8), + AstcBlock::B10x5 => (10, 5), + AstcBlock::B10x6 => (10, 6), + AstcBlock::B10x8 => (10, 8), + AstcBlock::B10x10 => (10, 10), + AstcBlock::B12x10 => (12, 10), + AstcBlock::B12x12 => (12, 12), + }; + (feature, float, color_space, noaa, dimensions, 16, basic, 4) } - Self::Astc10x10RgbaUnorm => (astc_ldr, float, linear, noaa, (10, 10), 16, basic, 4), - Self::Astc10x10RgbaUnormSrgb => { - (astc_ldr, float, corrected, noaa, (10, 10), 16, basic, 4) - } - Self::Astc12x10RgbaUnorm => (astc_ldr, float, linear, noaa, (12, 10), 16, basic, 4), - Self::Astc12x10RgbaUnormSrgb => { - (astc_ldr, float, corrected, noaa, (12, 10), 16, basic, 4) - } - Self::Astc12x12RgbaUnorm => (astc_ldr, float, linear, noaa, (12, 12), 16, basic, 4), - Self::Astc12x12RgbaUnormSrgb => { - (astc_ldr, float, corrected, noaa, (12, 12), 16, basic, 4) - } - - // Optional normalized 16-bit-per-channel formats - Self::R16Unorm => (norm16bit, float, linear, msaa, (1, 1), 2, storage, 1), - Self::R16Snorm => (norm16bit, float, linear, msaa, (1, 1), 2, storage, 1), - Self::Rg16Unorm => (norm16bit, float, linear, msaa, (1, 1), 4, storage, 2), - Self::Rg16Snorm => (norm16bit, float, linear, msaa, (1, 1), 4, storage, 2), - Self::Rgba16Unorm => (norm16bit, float, linear, msaa, (1, 1), 8, storage, 4), - Self::Rgba16Snorm => (norm16bit, float, linear, msaa, (1, 1), 8, storage, 4), }; let mut flags = msaa_flags; @@ -3040,7 +2948,10 @@ fn test_physical_size() { depth_or_array_layers: 1 } ); - let format = TextureFormat::Astc8x5RgbaUnorm; // 8x5 blocks + let format = TextureFormat::Astc { + block: AstcBlock::B8x5, + channel: AstcChannel::Unorm, + }; // 8x5 blocks assert_eq!( Extent3d { width: 7, @@ -3727,6 +3638,13 @@ pub enum SamplerBorderColor { OpaqueBlack, /// [1, 1, 1, 1] OpaqueWhite, + + /// On the Metal backend, this is equivalent to `TransparentBlack` for + /// textures that have an alpha component, and equivalent to `OpaqueBlack` + /// for textures that do not have an alpha component. On other backends, + /// this is equivalent to `TransparentBlack`. Requires + /// [`Features::ADDRESS_MODE_CLAMP_TO_ZERO`]. Not supported on the web. + Zero, } /// Describes how to create a QuerySet. @@ -3771,7 +3689,7 @@ pub enum QueryType { /// Query returns a 64-bit number indicating the GPU-timestamp /// where all previous commands have finished executing. /// - /// Must be multiplied by [`Device::get_timestamp_period`] to get + /// Must be multiplied by [`Queue::get_timestamp_period`] to get /// the value in nanoseconds. Absolute values have no meaning, /// but timestamps can be subtracted to get the time it takes /// for a string of operations to complete.