TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The rise of wgpu

274 pointsby jobstijlabout 6 years ago

10 comments

flohofwoeabout 6 years ago
Worth looking at the hello-triangle examples for the C- and Rust-APIs:<p>C99 Hello Triangle:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gfx-rs&#x2F;wgpu&#x2F;blob&#x2F;master&#x2F;examples&#x2F;hello_triangle_c&#x2F;main.c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gfx-rs&#x2F;wgpu&#x2F;blob&#x2F;master&#x2F;examples&#x2F;hello_tr...</a><p>Rust Hello Triangle:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gfx-rs&#x2F;wgpu&#x2F;blob&#x2F;master&#x2F;examples&#x2F;hello_triangle_rust&#x2F;main.rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gfx-rs&#x2F;wgpu&#x2F;blob&#x2F;master&#x2F;examples&#x2F;hello_tr...</a><p>Both look very neat and tidy IMHO.<p>The C99 version could also use nested designated initialization right in the function call, this would make it look very similar to the Rust version, e.g.:<p><pre><code> WGPUBlendStateId blend_state_0 = wgpu_device_create_blend_state( device, &amp;(WGPUBlendDescriptor) { .blend_enabled = false, .write_mask = WGPUColorWriteFlags_ALL, .color = { .src_factor = WGPUBlendFactor_One, .dst_factor = WGPUBlendFactor_Zero, .operation = WGPUBlendOperation_Add, }, .alpha = { .src_factor = WGPUBlendFactor_One, .dst_factor = WGPUBlendFactor_Zero, .operation = WGPUBlendOperation_Add, } }); </code></pre> But of course that&#x27;s a matter of taste :)
评论 #19327255 未加载
评论 #19327799 未加载
评论 #19334206 未加载
mikepurvisabout 6 years ago
How practical would it be to produce a 2D UI using a framework built on these kinds of APIs? I&#x27;m wondering if there&#x27;s a future down the road for multi-platform desktop apps with the convenience of Electron-like development and distribution, but where the native clients are able to be much thinner than a whole browser.
评论 #19328496 未加载
评论 #19328948 未加载
评论 #19328188 未加载
评论 #19328031 未加载
评论 #19328929 未加载
评论 #19328167 未加载
评论 #19332625 未加载
评论 #19328726 未加载
评论 #19330668 未加载
评论 #19330846 未加载
评论 #19328038 未加载
kodablahabout 6 years ago
&gt; The code runs on a variety of platforms [...] eventually the Web (when the browsers gain support for the API, which is also in our scope of work).<p>Have the big three confirmed intent to support WebGPU?<p>Also, what is the state of WebGL backend support for gfx-rs? I&#x27;m watching [0] eagerly. That would be a great practical step towards gfx-rs in browsers today.<p>0 - <a href="https:&#x2F;&#x2F;github.com&#x2F;gfx-rs&#x2F;gfx&#x2F;pull&#x2F;2554" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gfx-rs&#x2F;gfx&#x2F;pull&#x2F;2554</a>
评论 #19328064 未加载
评论 #19329061 未加载
评论 #19328056 未加载
_-___________-_about 6 years ago
&quot;We don’t even rely on Rust syntax and features for safety, since it’s handled at the lower level [...]&quot;<p>This part makes me nervous. Isn&#x27;t it basically saying &quot;we wrote perfectly safe C and made a Rust wrapper for it&quot;?
评论 #19328396 未加载
sharpneliabout 6 years ago
Even webgpu makes performance portability hard and keeps the user manually setting barriers etc. We could use a modern but yet higher level api.<p>Shameless plug: We have a graph based approach which automates all intermediate resource allocations and scheduling. I am hoping we can opensource it or something similar as it separates definitions of the algorithms nicely from how they are scheduled in the end (async compute on amd and so forth are all automatic). We also have backend implementations for all the major modern apis.
评论 #19330345 未加载
评论 #19330616 未加载
评论 #19333857 未加载
xtfabout 6 years ago
WebGPU. That&#x27;s an awful name. Given WebGL is taken and already in version 2. But WebGPU sounds like a virtual GPU for GameStreaming. Even GLWeb would be nicer.
评论 #19327605 未加载
评论 #19327622 未加载
评论 #19330026 未加载
评论 #19328140 未加载
dmanabout 6 years ago
The important question is - are the graphics and platform vendors onboard? Does webgpu sit directly on top of graphics drivers or is this just a MoltenVK&#x2F;Angle style abstraction layer that abstracts away OpenGL &#x2F; Vulkan &#x2F; Metal? Has someone done the hard work of getting Apple onboard for using this outside the browser (ie as a Metal replacement).
评论 #19329312 未加载
评论 #19329086 未加载
Jasper_about 6 years ago
If this is WebGPU, where&#x27;s the WHLSL and questionably bad faith arguments for days on incompatible binding models from Apple?
评论 #19329581 未加载
ttfleeabout 6 years ago
I would double down on WebGPU given it was based upon Apple Metal API. BTW, canvas was a web clone of Core Graphics, more or less.
评论 #19328021 未加载
gardaaniabout 6 years ago
<i>&gt; With wgpu-rs we can finally deprecate the old gfx and have a solid recommendation for people getting started with graphics in Rust.</i><p>Does this mean that gfx-rs (the low level API) is deprecated and no longer maintained?
评论 #19328958 未加载