mirror of https://github.com/sotrh/learn-wgpu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
21 KiB
HTML
30 lines
21 KiB
HTML
4 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="en-US">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
<title>News | Learn Wgpu</title>
|
||
|
<meta name="description" content="">
|
||
|
<meta name="generator" content="VuePress 1.4.0">
|
||
|
|
||
|
<meta property="article:modified_time" content="2020-11-24T06:29:52.000Z"><meta property="og:site_name" content="Learn Wgpu"><meta property="og:title" content="News"><meta property="og:type" content="website"><meta property="og:url" content="/news/"><meta name="twitter:title" content="News"><meta name="twitter:url" content="/news/"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:label1" content="Written by"><meta name="twitter:data2" content="Benjamin R Hansen"><meta name="twitter:creator" content="https://twitter.com/sotrh760">
|
||
|
<link rel="preload" href="/learn-wgpu/assets/css/0.styles.7acc6ef6.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.10252059.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/2.6a9f728b.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/17.1d99e854.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/9.ecb6e79c.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/10.de8cadfb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.53581734.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.8c46a0c8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.4723ba5d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/14.90ed5917.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.3056a06c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.0af06f1e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.9923f29d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.dab68ffd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.70e640cc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.1dba0934.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.2132e362.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.1a88f225.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.585372be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.022f80fd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.8484ba66.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.8b0a41bf.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.b9bf1b57.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5c3f77ba.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.df177b88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.dc887be9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.89cbdecc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.c2eff02b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.086069e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.65364b9b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.1fd4cc1c.js">
|
||
|
<link rel="stylesheet" href="/learn-wgpu/assets/css/0.styles.7acc6ef6.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="inner"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/learn-wgpu/" class="home-link router-link-active"><!----> <span class="site-name">Learn Wgpu</span></a> <div class="links"><!----> <div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div></div></div></header> <div class="sidebar-mask"></div> <div class="docs-layout"><aside class="sidebar"><!----> <ul class="sidebar-links"><li><a href="/learn-wgpu/" class="sidebar-link">Introduction</a></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Beginner</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/learn-wgpu/beginner/tutorial1-window/" class="sidebar-link">Dependencies and the window</a></li><li><a href="/learn-wgpu/beginner/tutorial2-swapchain/" class="sidebar-link">The Swapchain</a></li><li><a href="/learn-wgpu/beginner/tutorial3-pipeline/" class="sidebar-link">The Pipeline</a></li><li><a href="/learn-wgpu/beginner/tutorial4-buffer/" class="sidebar-link">Buffers and Indices</a></li><li><a href="/learn-wgpu/beginner/tutorial5-textures/" class="sidebar-link">Textures and bind groups</a></li><li><a href="/learn-wgpu/beginner/tutorial6-uniforms/" class="sidebar-link">Uniform buffers and a 3d camera</a></li><li><a href="/learn-wgpu/beginner/tutorial7-instancing/" class="sidebar-link">Instancing</a></li><li><a href="/learn-wgpu/beginner/tutorial8-depth/" class="sidebar-link">The Depth Buffer</a></li><li><a href="/learn-wgpu/beginner/tutorial9-models/" class="sidebar-link">Model Loading</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Intermediate</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/learn-wgpu/intermediate/tutorial10-lighting/" class="sidebar-link">Working with Lights</a></li><li><a href="/learn-wgpu/intermediate/tutorial11-normals/" class="sidebar-link">Normal Mapping</a></li><li><a href="/learn-wgpu/intermediate/tutorial12-camera/" class="sidebar-link">A Better Camera</a></li><li><a href="/learn-wgpu/intermediate/tutorial13-threading/" class="sidebar-link">Multi-threading with Wgpu and Rayon</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Showcase</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/learn-wgpu/news/" class="active sidebar-link">News</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#november-2020-cleanup-content-freeze-and-patreon" class="sidebar-link">November 2020 Cleanup, Content Freeze, and Patreon</a></li><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#_0-6" class="sidebar-link">0.6</a></li><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#added-pong-showcase" class="sidebar-link">Added Pong Showcase</a></li><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#normal-mapping" class="sidebar-link">Normal mapping</a></li><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#_0-5" class="sidebar-link">0.5!</a></li><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#reworked-lighting-tutorial" class="sidebar-link">Reworked lighting tutorial</a></li><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#added-gif-showcase" class="sidebar-link">Added GIF showcase</a></li><li class="sidebar-sub-header"><a href="/learn-wgpu/news/#updated-texture-tutorials" class="sidebar-link">Updated texture
|
||
|
<span class="token keyword">let</span> adapter <span class="token operator">=</span> <span class="token namespace">wgpu<span class="token punctuation">::</span></span><span class="token class-name">Adapter</span><span class="token punctuation">::</span><span class="token function">request</span><span class="token punctuation">(</span><span class="token operator">&</span><span class="token namespace">wgpu<span class="token punctuation">::</span></span><span class="token class-name">RequestAdapterOptions</span> <span class="token punctuation">{</span>
|
||
|
<span class="token punctuation">..</span><span class="token class-name">Default</span><span class="token punctuation">::</span><span class="token function">default</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||
|
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">unwrap</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// needs to be unwrapped</span>
|
||
|
</code></pre></div><ol start="2"><li>The <code>request_device</code> method now returns a <code>(Device, Queue)</code> tuple. This means that you can borrow the <code>Queue</code> mutably while using the <code>Device</code> immutably. Because of this change, submitting <code>CommandBuffer</code>s to the queue uses the <code>submit</code> method on the <code>Queue</code> directly.</li></ol> <div class="language-rust extra-class"><pre class="language-rust"><code><span class="token keyword">self</span><span class="token punctuation">.</span>queue<span class="token punctuation">.</span><span class="token function">submit</span><span class="token punctuation">(</span><span class="token operator">&</span><span class="token punctuation">[</span>
|
||
|
encoder<span class="token punctuation">.</span><span class="token function">finish</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||
|
<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
|
</code></pre></div><ol start="3"><li>The <code>create</code> method on <code>Surface</code> takes in any struct that implements the <code>HasRawWindow</code> trait, instead of a <code>RawWindowHandle</code>. This means that the <code>raw-window-handle = "0.3"</code> line in <code>Cargo.toml</code> is no longer needed.</li></ol> <p>I don't know if this is a change from 0.4, but you use <code>wgpu = "0.4"</code> line in dependencies instead of the <code>[dependencies.wgpu]</code> as wgpu will determine the best back end for you.</p> <h2 id="new-recent-articles"><a href="#new-recent-articles" class="header-anchor">#</a> New/Recent Articles</h2> <div><ul><li><a href="/beginner/tutorial4-buffer/">Buffers and Indices</a></li><li><a href="/beginner/tutorial5-textures/">Textures and bind groups</a></li><li><a href="/beginner/tutorial3-pipeline/">The Pipeline</a></li><li><a href="/beginner/tutorial2-swapchain/">The Swapchain</a></li><li><a href="/beginner/tutorial1-window/">Dependencies and the window</a></li></ul></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/23/2020, 11:29:52 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||
|
←
|
||
|
<a href="/learn-wgpu/showcase/imgui-demo/" class="prev">
|
||
|
Basic Imgui Demo
|
||
|
</a></span> <!----></p></div> </main></div></div><div class="global-ui"><!----></div></div>
|
||
|
<script src="/learn-wgpu/assets/js/app.10252059.js" defer></script><script src="/learn-wgpu/assets/js/2.6a9f728b.js" defer></script><script src="/learn-wgpu/assets/js/17.1d99e854.js" defer></script><script src="/learn-wgpu/assets/js/9.ecb6e79c.js" defer></script>
|
||
|
</body>
|
||
|
</html>
|