# I have an important question about webgpu

**URL:** <https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896>\
**Category:** Questions\
**Tags:** webgpu\
**Created:** [December 27, 2022, 12:41am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896 "2022-12-27T00:41:17Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [December 27, 2022, 12:41am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/1 "2022-12-27T00:41:18Z")

</div>

1. What Graphics API does Babylon.js use when using Webgpu?

2. What Graphics API do you usually use?

3. Is there a function to choose options…? ( Graphics API select function)

4. Three.js also supports Webgpu  
Is there a difference in WebGPU driving between Three.js and Babylon.js?  
What would be the difference if there was a difference?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 27, 2022, 10:12am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/2 "2022-12-27T10:12:35Z")

</div>

For general explanations about WebGPU, I would refer to: [WebGPU - Chrome Developers](https://developer.chrome.com/en/docs/web-platform/webgpu/), [WebGPU Explainer (gpuweb.github.io)](https://gpuweb.github.io/gpuweb/explainer/) and [mikbry/awesome-webgpu: 🕶 Curated list of awesome things around WebGPU ecosystem. (github.com)](https://github.com/mikbry/awesome-webgpu). In short, WebGPU is _itself a graphics API_ that can communicate with the underlying system GPU in an uniform way. WebGPU doesn’t care about which Graphics API the underlying system uses, it just sends commands to the GPU and expects it to execute:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/8/d81610b6b444094423b5435733c132719fd5b3e6.png)

You can read more about the WebGPU suport in Babylon here: [WebGPU Support | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/setup/support/webGPU)

Both Three and Babylon use the same WebGPU API.

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [December 28, 2022, 1:01am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/3 "2022-12-28T01:01:02Z")

</div>

In the webGL environment,  
Is there any option to select and use the Graphics API?

It is said that the functionality was improved through Vulkan, but does the functional improvement work the same way when using DirectX and Metal?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 28, 2022, 10:17am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/4 "2022-12-28T10:17:40Z")

</div>

Yes, WebGPU is an API on top of Vulkan/DirectX/Metal, so depending on your computer and your settings, one of these backends will be used by the browser.

You can choose which backend the browser is using (at least in Chrome and Edge) in `chrome://flags`:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/9/795514c2267d05ae651a0c8a2ccb88888c1f6e2d.png)

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [December 29, 2022, 12:12am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/5 "2022-12-29T00:12:43Z")

</div>

Wow, thank you so much It’s the answer I’ve been looking for!

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [December 29, 2022, 7:43am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/6 "2022-12-29T07:43:43Z")

</div>

Can’t I use Vulkan? You can use it in browser, but if you use WebGPU and Vulkan together, you will get an error

When using Directx  
Do I use Vulkan by detour?

Can I have or implement a demo using Vulkan, Babylon.js in my web environment?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 29, 2022, 10:56am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/7 "2022-12-29T10:56:59Z")

</div>

It’s up to the browser to support a graphics API or not, depending on your hardware. Though it’s strange it does not work with Vulkan if the option is available… What is the error message you get?

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [January 2, 2023, 12:45am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/8 "2023-01-02T00:45:41Z")

</div>

Test Result  
Chrome canary Vulkan X Webgpu O  
Edge canary Vulkna X Webgpu O  
Chrome Vulkan O Webgpu X  
Edge Vulkan O Webgpu X  
Firefox Nightly Webgpu X  
Opera Webgpu X  
Naver Whale beta Webgpu X

My enviroment  
NVIDIA GeForce RTX 3060  
Intel(R) Core™ i7-12700KF  
x64  
Windows 10 Pro

I want to test Babylon.js My project using Vulkan in my entire web environment!  
WebGL DirectX, OpenGL Babylon.js VS WebGPU Bulkan Babylon.js  
I want to do it, but I have a lot of difficulties. Can you help me?

💥If I use DirectX when I use Webgpu, do I bypass the Vulkan function?

[![](https://img.youtube.com/vi/hvdAVsjrQRM/maxresdefault.jpg "OpenGL vs Vulkan") ](https://www.youtube.com/watch?v=hvdAVsjrQRM)

I want to do a test similar to this. If I can’t use Vulkan, I want to know why…

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [January 2, 2023, 11:19am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/9 "2023-01-02T11:19:17Z")

</div>

If you are browser based, you should not be concerned about which underlying API the browser is using because you won’t be able to use it directly. I guess that your example is a native example and has direct calls to either OpenGL or Vulkan APIs.

On some platform, you will be able to choose an API (as shown in one of my post above), but normally you don’t need to do that and the “default” setting should be the right setting.

> [@qkrxotn7287](#):
>
> If I use DirectX when I use Webgpu, do I bypass the Vulkan function?

Yes.

DirectX (12), Vulkan and Metal are the 3 APIs used for state of the art graphics these days. Broadly speaking, DirectX is for Windows, Vulkan for Linux and Metal for Mac OS. Of course, Vulkan can be used in Windows too, but DirectX is the primary API in Windows.

The browser will use the appropriate API depending on your hardware and settings.

We have a [Ocean WebGPU demo](https://doc.babylonjs.com/features/featuresDeepDive/materials/shaders/computeShader#ocean-demo) in Babylon.js if you are interested:

> **[Babylon.js Playground](https://playground.babylonjs.com/#YX6IB8%2373)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Note that WebGPU is not yet released and won’t be released for a few months, so a number of things are still likely to change before v1 is released.

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [January 3, 2023, 5:41am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/10 "2023-01-03T05:41:31Z")

</div>

Thank you so much!!  
Lastly, may I know how to bypass the Graphics API?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [January 3, 2023, 9:19am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/11 "2023-01-03T09:19:23Z")

</div>

What do you mean by bypassing the graphics API? The browser has to use a graphics API to render things. What you can do is choosing the one it should use in the list provided (it also depends on the browser, I guess, I only checked in Chrome).

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 3, 2023, 12:15pm UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/12 "2023-01-03T12:15:46Z")

</div>

Yeah there’s no way to force the user’s browser to use a specific API, and it shouldn’t matter to a WebGPU developer anyway as its entire point is to be independent of them

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [January 4, 2023, 12:24am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/13 "2023-01-04T00:24:28Z")

</div>

I’m sorry. This is the only place I can ask…  
By bypassing it means turning around like a VPN and using Vulkan on DirectX!

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [January 4, 2023, 10:17am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/14 "2023-01-04T10:17:29Z")

</div>

As said above, in Chrome / Edge you can force the browser to use a specific API here:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/9/795514c2267d05ae651a0c8a2ccb88888c1f6e2d.png)

There’s probably the same possibility in Firefox.

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [January 5, 2023, 12:03am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/15 "2023-01-05T00:03:46Z")

</div>

I know that I can choose from a browser, but what I’m curious about is that even if I select DirectX from a browser, do I bring and use the Vulkan function?It is.

If I choose DirectX, I don’t use Vulkan at all?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [January 5, 2023, 12:43am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/16 "2023-01-05T00:43:46Z")

</div>

DirectX, Vulkan and Metal are 3 different APIs to do graphics. If you choose one, you don’t use the others.

So, when using DirectX, you don’t use Vulkan nor Metal.

---

<div class="post-metadata">

**Author:** ![qkrxotn7287](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qkrxotn7287/32/21866_2.png) [@qkrxotn7287](https://forum.babylonjs.com/u/qkrxotn7287)\
**Post date:** [January 5, 2023, 5:36am UTC](https://forum.babylonjs.com/t/i-have-an-important-question-about-webgpu/36896/17 "2023-01-05T05:36:06Z")

</div>

Oh, I see. Thank you.
