>vulkan for websites?
nop, its basically a graphics API. just like vulkan and metal. it has a spec.
difference is there is no implementation for it at driver level (not yet at least) like we have for vulkan, opengl, metal, dx, etc
so the implementations that exist today are run on top of vulkan/metal/dx.
the major ones are: google dawn and rust wgpu
the fact that is has "web" in the name was a awful decision, you can use it as a native library. browsers (chrome using dawn and firefox using wgpu) just support it because they have the implementation built in, so you can use it as "vulkan for websites"
not the same anon, but it's the same reason why electron/tauri makes more sense for developers than maintaining 5 native codebases between desktop and mobile + 1 web version
So far so good. It really needs tutorials that don't just build toy examples. There's a lot of concepts to wrap your head around and little guidance on best practices for how to use them and why. Also ecosystem is immature. Nevertheless, having fun building my game on it now that it's all slowly making sense.
my only problem with it is that the spec requires wglsl support by default. Can someone actually explain to me why they couldn't have gone with SPIRV or something like that? I do remember seing a github PR where a guy was complaining a ton about WGLSL and how bad it was (though I feel it was a schizo post).
I did use WebGPU (through wgpu) and it wasn't that bad honestly (other than the fact that I had to compile GLSL manually through shaderc and not through the shitty naga interface).
Yep! Sad thing is that most (if not all) rust engines / render engines that use WGPU tend to stick to it as well. In my custom engine I decided to use GLSL just cause I didn't like how WGSL looked and felt compared to GLSL. I guess they all have their ups and downs.
https://github.com/gpuweb/gpuweb/issues/566
Yep that was the post! To be fair I kind of understand where they're coming from when they keep saying that WGSL is pretty bad.
Oh really? There's already support for that in WGPU I didn't know it was meant to be supported in the spec. That would definitely help if I could compile everything to SPIRV instead lol.
After reading the article on Mozilla, I got to say that it is not bad. I suppose that it helped having experience with Vulkan, because WebGPU is low level (as low as you can get on the browser).
Can you access it directly from WASM or you need to interface only through JS? That would really suck.
Also WGSL is a retarded idea
You'd still need Javascript to set up the canvas but it can be pretty seamless since Rust has wasm-bindgen to do that for you.
You can even use webgl2 as a backend for WebGPU so you don't need to mess with the browser's settings to get webgpu to work.
https://sotrh.github.io/learn-wgpu/beginner/tutorial1-window
I sure miss the good old days of ActiveX in IE.
They even allowed you to set a web page as the desktop's wallpaper because lol who cares about security.
WebGPUsisters, is there a way to measure how long a pass takes on the GPU without using a debugger? Wanna compare different pipeline ideas to see which is faster.
I don’t know shit about the web and I was able to make a real-time Dashboard for some industrial process that was orders of magnitude faster than whatever the fuck the team of web guys was doing. The real, compiled program is of course faster and doesn’t require a very recent version of chrome, but the ability to hack together a quick tool with a imgui interface and have it just werk on the boomer´s Windows machine, the baseddev’s Mac, the autist’s Linux set-up and the normie’s browser is just neat.
i know right, next get crypto mining
Awesome bro. Are you y2k compliant yet too?
Does it work yet. Last time I tried it it just didn't work.
No idea what it exactly is, probably something like vulkan for websites?
If so, can I like apply custom shaders to the entire document/ canvas ?
>vulkan for websites?
nop, its basically a graphics API. just like vulkan and metal. it has a spec.
difference is there is no implementation for it at driver level (not yet at least) like we have for vulkan, opengl, metal, dx, etc
so the implementations that exist today are run on top of vulkan/metal/dx.
the major ones are: google dawn and rust wgpu
the fact that is has "web" in the name was a awful decision, you can use it as a native library. browsers (chrome using dawn and firefox using wgpu) just support it because they have the implementation built in, so you can use it as "vulkan for websites"
yeah its a graphics api standarized for web browsers
good explanation anon, now what's better about this as compared to just using Vulkan or DX
not the same anon, but it's the same reason why electron/tauri makes more sense for developers than maintaining 5 native codebases between desktop and mobile + 1 web version
It's higher level idiot
It's higher level, you can't use Vulkan in the browser. You could implement WGPU using Vulkan to give you an idea of the difference between the two.
WGPU is just getting translated to DX12 / VK / Metal, any bugs would be in one of those apis
And even then the spec has a bunch of error checking shenanigans that a compliant implementation must conform to to reduce exploits afaik.
Can't wait for that shit getting used for zero day exploits in the pajeetware drivers amd, intel and nvidia are shipping.
>connection lost
>computer crashes
not available on chromium linux = might as well not exist
It’s like metal in the browser omfg
why would i want this over webgl THOUGH
So far so good. It really needs tutorials that don't just build toy examples. There's a lot of concepts to wrap your head around and little guidance on best practices for how to use them and why. Also ecosystem is immature. Nevertheless, having fun building my game on it now that it's all slowly making sense.
*Krashes*
Wake me up when it has dedicated drivers instead of vulkan/metal wrappers
Literally mainframe or server gpu but worse on every possible way
it's got literally nothing to do with either of those, pls try again
>This site is suspended
it expires after 1 hour but for some reason is back now, try again
my only problem with it is that the spec requires wglsl support by default. Can someone actually explain to me why they couldn't have gone with SPIRV or something like that? I do remember seing a github PR where a guy was complaining a ton about WGLSL and how bad it was (though I feel it was a schizo post).
I did use WebGPU (through wgpu) and it wasn't that bad honestly (other than the fact that I had to compile GLSL manually through shaderc and not through the shitty naga interface).
I just looked into it and they really made WGSL instead using SPIRV like Vulkan! Yet another way to write a shader program... Great!
Yep! Sad thing is that most (if not all) rust engines / render engines that use WGPU tend to stick to it as well. In my custom engine I decided to use GLSL just cause I didn't like how WGSL looked and felt compared to GLSL. I guess they all have their ups and downs.
Yep that was the post! To be fair I kind of understand where they're coming from when they keep saying that WGSL is pretty bad.
https://github.com/gpuweb/gpuweb/issues/566
Hahaha who made this and taught they made a good job?
>closed due to language [WONT FIX]
This is why you can't expect R*st retards to ever make anything good
They just added a normal for loop.
https://google.github.io/tour-of-wgsl/control-flow/for-statements/
I think I read somewhere that most browsers were planning on supporting SPIR-V through an extension.
Oh really? There's already support for that in WGPU I didn't know it was meant to be supported in the spec. That would definitely help if I could compile everything to SPIRV instead lol.
After reading the article on Mozilla, I got to say that it is not bad. I suppose that it helped having experience with Vulkan, because WebGPU is low level (as low as you can get on the browser).
Can you access it directly from WASM or you need to interface only through JS? That would really suck.
Also WGSL is a retarded idea
You'd still need Javascript to set up the canvas but it can be pretty seamless since Rust has wasm-bindgen to do that for you.
You can even use webgl2 as a backend for WebGPU so you don't need to mess with the browser's settings to get webgpu to work.
https://sotrh.github.io/learn-wgpu/beginner/tutorial1-window
Not for your freedom.
>finally cross-platform graphics API
Yes if you use it outside a browser
https://pastebin.com/x6f4puzf
for (let x = 0; x < textureSize; x += 32) {
for (let y = 0; y < textureSize; y += 16) {
const brickColor = {
r: baseColor.r + (Math.random() * 0.1 - 0.05),
g: baseColor.g + (Math.random() * 0.1 - 0.05),
b: baseColor.b + (Math.random() * 0.1 - 0.05)
};
context.fillStyle = `rgb(${Math.floor(brickColor.r * 255)}, ${Math.floor(brickColor.g * 255)}, ${Math.floor(brickColor.b * 255)})`;
context.fillRect(x, y, 32, 16);
}
}
let me guess, you """"need"""" more than a few lines of code to create a texture?
>babylonjs
This barely has anything to do with WebGPU except that one line where you initialize the engine.
james webbgpu
yes.......... james web teelsecoep
>pref("browser.webgpu.enabled", false)
the modern web is the largest remote execution exploit known to man
I sure miss the good old days of ActiveX in IE.
They even allowed you to set a web page as the desktop's wallpaper because lol who cares about security.
wtf, what kind of use case requires implementing something like that?
WebGPUsisters, is there a way to measure how long a pass takes on the GPU without using a debugger? Wanna compare different pipeline ideas to see which is faster.
Performance.now() ?
https://omar-shehata.medium.com/how-to-use-webgpu-timestamp-query-9bf81fb5344a
Thank you kind anon
Through several layer of abstraction, I got wgpu-native to work on my Ivy Bridge Intel HD integrated GPU.
I don’t know shit about the web and I was able to make a real-time Dashboard for some industrial process that was orders of magnitude faster than whatever the fuck the team of web guys was doing. The real, compiled program is of course faster and doesn’t require a very recent version of chrome, but the ability to hack together a quick tool with a imgui interface and have it just werk on the boomer´s Windows machine, the baseddev’s Mac, the autist’s Linux set-up and the normie’s browser is just neat.