Skip to content

Commit d414044

Browse files
Deploying to master from @ gfx-rs/wgpu@9d14871 🚀
1 parent 20fcc8e commit d414044

File tree

8 files changed

+55
-11
lines changed

8 files changed

+55
-11
lines changed

doc/search-index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/src/wgpu_hal/vulkan/drm.rs.html

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,37 @@
149149
<a href="#148" id="148">148</a>
150150
<a href="#149" id="149">149</a>
151151
<a href="#150" id="150">150</a>
152-
<a href="#151" id="151">151</a></pre></div><pre class="rust"><code><span class="attr">#![cfg(all(unix, not(target_vendor = <span class="string">"apple"</span>), not(target_family = <span class="string">"wasm"</span>)))]
152+
<a href="#151" id="151">151</a>
153+
<a href="#152" id="152">152</a>
154+
<a href="#153" id="153">153</a>
155+
<a href="#154" id="154">154</a>
156+
<a href="#155" id="155">155</a>
157+
<a href="#156" id="156">156</a>
158+
<a href="#157" id="157">157</a>
159+
<a href="#158" id="158">158</a>
160+
<a href="#159" id="159">159</a>
161+
<a href="#160" id="160">160</a>
162+
<a href="#161" id="161">161</a>
163+
<a href="#162" id="162">162</a>
164+
<a href="#163" id="163">163</a>
165+
<a href="#164" id="164">164</a>
166+
<a href="#165" id="165">165</a>
167+
<a href="#166" id="166">166</a></pre></div><pre class="rust"><code><span class="attr">#![cfg(all(unix, not(target_vendor = <span class="string">"apple"</span>), not(target_family = <span class="string">"wasm"</span>)))]
153168

154169
</span><span class="kw">use </span>alloc::{string::ToString, vec::Vec};
155170
<span class="kw">use </span>core::mem::MaybeUninit;
156171

157172
<span class="kw">use </span>ash::{ext, khr, vk};
158173

174+
<span class="macro">macro_rules!</span> to_u64 {
175+
(<span class="macro-nonterminal">$expr</span>:expr) =&gt; {{
176+
<span class="attr">#[allow(trivial_numeric_casts)]
177+
</span><span class="kw">let </span>expr = <span class="macro-nonterminal">$expr </span><span class="kw">as </span>u64;
178+
<span class="macro">assert!</span>(size_of_val(<span class="kw-2">&amp;</span>expr) &lt;= size_of::&lt;u64&gt;());
179+
expr
180+
}};
181+
}
182+
159183
<span class="kw">impl </span><span class="kw">super</span>::Instance {
160184
<span class="doccomment">/// Creates a new surface from the given drm configuration.
161185
///
@@ -228,12 +252,18 @@
228252
<span class="kw">let </span>render_devid =
229253
libc::makedev(drm_props.render_major <span class="kw">as _</span>, drm_props.render_minor <span class="kw">as _</span>);
230254

231-
<span class="comment">// Various platforms use different widths between `dev_t` and `c_int`, so just
232-
// force-convert to `u64` to keep things portable.
255+
<span class="comment">// On most platforms, both `*_devid`s and `st_rdev` are `dev_t`s (which is generally
256+
// observed to be an unsigned integral type no greater than 64 bits). However, on some
257+
// platforms, there divergences from this pattern:
258+
//
259+
// - `armv7-linux-androideabi`: `dev_t` is `c_ulong`, and `*_devid`s are `dev_t`, but
260+
// `st_rdev` is `c_ulonglong`. So, we can't just do a `==` comparison.
261+
// - OpenBSD has `dev_t` on both sides, but is `i32` (N.B., unsigned). Therefore, we
262+
// can't just use `u64::from`.
233263
</span><span class="attr">#[allow(clippy::useless_conversion)]
234264
</span><span class="kw">if </span>[primary_devid, render_devid]
235-
.map(u64::from)
236-
.contains(<span class="kw-2">&amp;</span>drm_stat.st_rdev)
265+
.map(|devid| <span class="macro">to_u64!</span>(devid))
266+
.contains(<span class="kw-2">&amp;</span><span class="macro">to_u64!</span>(drm_stat.st_rdev))
237267
{
238268
physical_device = <span class="prelude-val">Some</span>(device)
239269
}

doc/wgpu_hal/all.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

doc/wgpu_hal/vulkan/drm/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `drm` mod in crate `wgpu_hal`."><title>wgpu_hal::vulkan::drm - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="wgpu_hal" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../wgpu_hal/index.html">wgpu_<wbr>hal</a><span class="version">25.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="../index.html">In wgpu_<wbr>hal::<wbr>vulkan</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">wgpu_hal</a>::<wbr><a href="../index.html">vulkan</a></span><h1>Module <span>drm</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/wgpu_hal/vulkan/drm.rs.html#1-151">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>Unix and non-Apple and non-<code>target_family="wasm"</code> and <code>vulkan</code></strong> only.</div></span></section></div></main></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `drm` mod in crate `wgpu_hal`."><title>wgpu_hal::vulkan::drm - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="wgpu_hal" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../wgpu_hal/index.html">wgpu_<wbr>hal</a><span class="version">25.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module drm</a></h2><h3><a href="#macros">Module Items</a></h3><ul class="block"><li><a href="#macros" title="Macros">Macros</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In wgpu_<wbr>hal::<wbr>vulkan</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">wgpu_hal</a>::<wbr><a href="../index.html">vulkan</a></span><h1>Module <span>drm</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/wgpu_hal/vulkan/drm.rs.html#1-166">Source</a> </span></div><span class="item-info"><div class="stab portability">Available on <strong>Unix and non-Apple and non-<code>target_family="wasm"</code> and <code>vulkan</code></strong> only.</div></span><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="macro" href="macro.to_u64.html" title="macro wgpu_hal::vulkan::drm::to_u64">to_u64</a><span title="Restricted Visibility">&nbsp;🔒</span> </div></li></ul></section></div></main></body></html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta http-equiv="refresh" content="0;URL=macro.to_u64.html">
5+
<title>Redirection</title>
6+
</head>
7+
<body>
8+
<p>Redirecting to <a href="macro.to_u64.html">macro.to_u64.html</a>...</p>
9+
<script>location.replace("macro.to_u64.html" + location.search + location.hash);</script>
10+
</body>
11+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `to_u64` macro in crate `wgpu_hal`."><title>to_u64 in wgpu_hal::vulkan::drm - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="wgpu_hal" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../wgpu_hal/index.html">wgpu_<wbr>hal</a><span class="version">25.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>hal::<wbr>vulkan::<wbr>drm</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">wgpu_hal</a>::<wbr><a href="../index.html">vulkan</a>::<wbr><a href="index.html">drm</a></span><h1>Macro <span class="macro">to_u64</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/wgpu_hal/vulkan/drm.rs.html#8-15">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! to_u64 {
2+
($expr:expr) =&gt; { ... };
3+
}</code></pre><span class="item-info"><div class="stab portability">Available on <strong>Unix and non-Apple and non-<code>target_family="wasm"</code> and <code>vulkan</code></strong> only.</div></span></section></div></main></body></html>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
window.SIDEBAR_ITEMS = {};
1+
window.SIDEBAR_ITEMS = {"macro":["to_u64"]};

0 commit comments

Comments
 (0)