Skip to content

Commit 6766bce

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@da0b68d 🚀
1 parent b553365 commit 6766bce

File tree

12 files changed

+30
-24
lines changed

12 files changed

+30
-24
lines changed

doc/src/wgpu_examples/ray_scene/mod.rs.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,9 @@
567567
<a href="#566" id="566">566</a>
568568
<a href="#567" id="567">567</a>
569569
<a href="#568" id="568">568</a>
570-
<a href="#569" id="569">569</a></pre></div><pre class="rust"><code><span class="kw">use </span>bytemuck::{Pod, Zeroable};
570+
<a href="#569" id="569">569</a>
571+
<a href="#570" id="570">570</a>
572+
<a href="#571" id="571">571</a></pre></div><pre class="rust"><code><span class="kw">use </span>bytemuck::{Pod, Zeroable};
571573
<span class="kw">use </span>glam::{Mat4, Quat, Vec3};
572574
<span class="kw">use </span>std::f32::consts::PI;
573575
<span class="kw">use </span>std::ops::IndexMut;
@@ -670,7 +672,7 @@
670672
<span class="kw">let </span>start_vertex_index = scene.vertices.len();
671673
<span class="kw">let </span>start_geometry_index = scene.geometries.len();
672674

673-
<span class="kw">let </span><span class="kw-2">mut </span>mapping = std::collections::HashMap::&lt;(usize, usize, usize), usize&gt;::new();
675+
<span class="kw">let </span><span class="kw-2">mut </span>mapping = std::collections::HashMap::&lt;(usize, <span class="prelude-ty">Option</span>&lt;usize&gt;, usize), usize&gt;::new();
674676

675677
<span class="kw">let </span><span class="kw-2">mut </span>next_index = <span class="number">0</span>;
676678

@@ -681,7 +683,9 @@
681683
<span class="kw">for </span>end_index <span class="kw">in </span><span class="number">2</span>..poly.<span class="number">0</span>.len() {
682684
<span class="kw">for </span><span class="kw-2">&amp;</span>index <span class="kw">in </span><span class="kw-2">&amp;</span>[<span class="number">0</span>, end_index - <span class="number">1</span>, end_index] {
683685
<span class="kw">let </span>obj::IndexTuple(position_id, texture_id, normal_id) = poly.<span class="number">0</span>[index];
684-
<span class="kw">let </span>texture_id = texture_id.expect(<span class="string">"uvs required"</span>);
686+
<span class="kw">let </span>uv = texture_id
687+
.map(|texture_id| data.texture[texture_id])
688+
.unwrap_or_default();
685689
<span class="kw">let </span>normal_id = normal_id.expect(<span class="string">"normals required"</span>);
686690

687691
<span class="kw">let </span>index = <span class="kw-2">*</span>mapping
@@ -692,7 +696,7 @@
692696

693697
scene.vertices.push(Vertex {
694698
pos: data.position[position_id],
695-
uv: data.texture[texture_id],
699+
uv,
696700
normal: data.normal[normal_id],
697701
..Default::default()
698702
})
@@ -865,7 +869,7 @@
865869
<span class="kw">fn </span>load_scene(device: <span class="kw-2">&amp;</span>wgpu::Device, queue: <span class="kw-2">&amp;</span>wgpu::Queue) -&gt; SceneComponents {
866870
<span class="kw">let </span><span class="kw-2">mut </span>scene = RawSceneComponents::default();
867871

868-
load_model(<span class="kw-2">&amp;mut </span>scene, <span class="string">"/skybox/models/teslacyberv3.0.obj"</span>);
872+
load_model(<span class="kw-2">&amp;mut </span>scene, <span class="string">"/skybox/models/rustacean-3d.obj"</span>);
869873
load_model(<span class="kw-2">&amp;mut </span>scene, <span class="string">"/ray_scene/cube.obj"</span>);
870874

871875
upload_scene_components(device, queue, <span class="kw-2">&amp;</span>scene)

doc/src/wgpu_examples/skybox/mod.rs.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@
523523
<a href="#522" id="522">522</a>
524524
<a href="#523" id="523">523</a>
525525
<a href="#524" id="524">524</a>
526-
<a href="#525" id="525">525</a></pre></div><pre class="rust"><code><span class="kw">use </span>bytemuck::{Pod, Zeroable};
526+
<a href="#525" id="525">525</a>
527+
<a href="#526" id="526">526</a></pre></div><pre class="rust"><code><span class="kw">use </span>bytemuck::{Pod, Zeroable};
527528
<span class="kw">use </span>std::f32::consts;
528529
<span class="kw">use </span>wgpu::{util::DeviceExt, AstcBlock, AstcChannel};
529530

@@ -629,7 +630,7 @@
629630
) -&gt; <span class="self">Self </span>{
630631
<span class="kw">let </span><span class="kw-2">mut </span>entities = Vec::new();
631632
{
632-
<span class="kw">let </span>source = <span class="macro">include_bytes!</span>(<span class="string">"models/teslacyberv3.0.obj"</span>);
633+
<span class="kw">let </span>source = <span class="macro">include_bytes!</span>(<span class="string">"models/rustacean-3d.obj"</span>);
633634
<span class="kw">let </span>data = obj::ObjData::load_buf(<span class="kw-2">&amp;</span>source[..]).unwrap();
634635
<span class="kw">let </span><span class="kw-2">mut </span>vertices = Vec::new();
635636
<span class="kw">for </span>object <span class="kw">in </span>data.objects {
@@ -640,9 +641,10 @@
640641
<span class="kw">for </span><span class="kw-2">&amp;</span>index <span class="kw">in </span><span class="kw-2">&amp;</span>[<span class="number">0</span>, end_index - <span class="number">1</span>, end_index] {
641642
<span class="kw">let </span>obj::IndexTuple(position_id, _texture_id, normal_id) =
642643
poly.<span class="number">0</span>[index];
644+
<span class="kw">let </span>[x, y, z] = data.position[position_id];
643645
vertices.push(Vertex {
644-
pos: data.position[position_id],
645-
normal: data.normal[normal_id.unwrap()],
646+
pos: [y, z, x], <span class="comment">// model is rotated to face down, so need to rotate it
647+
</span>normal: data.normal[normal_id.unwrap()],
646648
})
647649
}
648650
}

doc/wgpu_examples/framework/trait.Example.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
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 `load_model` fn in crate `wgpu_examples`."><title>load_model in wgpu_examples::ray_scene - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0 (4d91de4e4 2025-02-17)" data-channel="1.85.0" data-search-js="search-75f5ac3e.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 fn"><!--[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_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>ray_<wbr>scene</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_examples</a>::<wbr><a href="index.html">ray_scene</a></span><h1>Function <span class="fn">load_model</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_examples/ray_scene/mod.rs.html#93-168">Source</a> </span></div><pre class="rust item-decl"><code>fn load_model(scene: &amp;mut <a class="struct" href="struct.RawSceneComponents.html" title="struct wgpu_examples::ray_scene::RawSceneComponents">RawSceneComponents</a>, path: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.85.0/std/primitive.str.html">str</a>)</code></pre></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 `load_model` fn in crate `wgpu_examples`."><title>load_model in wgpu_examples::ray_scene - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0 (4d91de4e4 2025-02-17)" data-channel="1.85.0" data-search-js="search-75f5ac3e.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 fn"><!--[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_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>ray_<wbr>scene</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_examples</a>::<wbr><a href="index.html">ray_scene</a></span><h1>Function <span class="fn">load_model</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_examples/ray_scene/mod.rs.html#93-170">Source</a> </span></div><pre class="rust item-decl"><code>fn load_model(scene: &amp;mut <a class="struct" href="struct.RawSceneComponents.html" title="struct wgpu_examples::ray_scene::RawSceneComponents">RawSceneComponents</a>, path: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.85.0/std/primitive.str.html">str</a>)</code></pre></section></div></main></body></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 `load_scene` fn in crate `wgpu_examples`."><title>load_scene in wgpu_examples::ray_scene - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0 (4d91de4e4 2025-02-17)" data-channel="1.85.0" data-search-js="search-75f5ac3e.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 fn"><!--[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_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>ray_<wbr>scene</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_examples</a>::<wbr><a href="index.html">ray_scene</a></span><h1>Function <span class="fn">load_scene</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_examples/ray_scene/mod.rs.html#296-303">Source</a> </span></div><pre class="rust item-decl"><code>fn load_scene(device: &amp;Device, queue: &amp;Queue) -&gt; <a class="struct" href="struct.SceneComponents.html" title="struct wgpu_examples::ray_scene::SceneComponents">SceneComponents</a></code></pre></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 `load_scene` fn in crate `wgpu_examples`."><title>load_scene in wgpu_examples::ray_scene - 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-46132b98.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0 (4d91de4e4 2025-02-17)" data-channel="1.85.0" data-search-js="search-75f5ac3e.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 fn"><!--[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_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>ray_<wbr>scene</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_examples</a>::<wbr><a href="index.html">ray_scene</a></span><h1>Function <span class="fn">load_scene</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_examples/ray_scene/mod.rs.html#298-305">Source</a> </span></div><pre class="rust item-decl"><code>fn load_scene(device: &amp;Device, queue: &amp;Queue) -&gt; <a class="struct" href="struct.SceneComponents.html" title="struct wgpu_examples::ray_scene::SceneComponents">SceneComponents</a></code></pre></section></div></main></body></html>

0 commit comments

Comments
 (0)