19 ms·
> As someone who spends a lot of time in that space I don't really see what this is solving, WebGL is good enough and anyone serious about performance/compute a
by JoshTriplett 10y ago
> As someone who spends a lot of time in that space I don't really see what this is solving, WebGL is good enough and anyone serious about performance/compute are going to drop down to native anyway.
Not true at all; if your primary performance bottleneck is the GPU code, not CPU code, you could use a better web API modeled after Vulkan, for the same reason people switch from GL to Vulkan.
In general, if there's ever something where people feel they "have to" use native instead of web, that needs fixing in the web platform.
- vvanders 10y agoAs soon as you clear up that GPU bottleneck guess what's going to be your next one? (Here's a hint, it's the thing that's dispatching to your GPU). Another aspect that scares me about this is the security implications of exposing compute to the browser. Esp when you start talking about unified memory architectures. There's been more than a few exploits from a clever soul calling glReadPixels in the right circumstances. Increasing the surface area here doesn't seem like a great idea. Shader compilers are also great targets for instability and obscure bugs.
- JoshTriplett 10y ago> As soon as you clear up that GPU bottleneck guess what's going to be your next one? Memory bandwidth for your textures, geometry, and other data, quite often. Or nothing at all, if you can successfully reach your desired target framerate. But if CPU turns out to be an issue, that's what WebAssembly is for.
- vvanders 10y ago> Memory bandwidth for your textures, geometry, and other data, quite often. So in other words a GPU bottleneck?
- JoshTriplett 10y agoNo, a memory bottleneck. (That may be GPU memory or system memory, depending on the architecture of your graphics stack.) That's not the same as a GPU processing bottleneck. You can have a bottleneck in GPU processing, or a bottleneck in getting enough data to the GPU.
- vvanders 10y agoOh I see, we're getting pedantic over semantics. If your GPU is designed with a small bus between system and GPU memory, that's still a GPU issue. You could make the same argument on the CPU side for caches and DRAM if you want to go that far. I appreciate the education lesson but I think you'll find most graphics programmers will consider it a GPU problem :). At the end of the day though here's the thing. The intersection of users that have a GPU capable of discrete pipelines, compute shaders and all the other things that make this interesting but won't go through the effort of installing a native app is relatively small. You can't polyfill(otherwise why use the GPU in the first place?) on the users don't have a cutting edge machine so you're going to have a swath of people that your WebApp won't work for. From a value proposition it just doesn't make sense.
- JoshTriplett 10y agoThe reason for the distinction is that that's one of the specific things Vulkan helps with: keeping the GPU well-fed with work to do. (Also, keep in mind the architectural differences between integrated graphics and discrete graphics.) You potentially can polyfill, if you have a graphics engine with a higher-performance Vulkan/WebVulkan backend and a lower-performance GL/GLES/WebGL backend. The Vulkan version will make better use of resources and allow you to turn up the quality higher while still hitting the all-important framerate targets. All the same problems apply just as much if you go native as if you go web. You either have to work with older APIs (often via an engine), or write off older GPUs and some subset of users. Whether you can do that depends on what you're doing.
- jolux 10y ago>You can't polyfill(otherwise why use the GPU in the first place?) on the users don't have a cutting edge machine so you're going to have a swath of people that your WebApp won't work for. I'm pretty sure you just argued in favor of creating a new API instead of using Vulkan...
- om2 10y agoModern graphics APIs help you reduce the CPU bottleneck for CPU-bound graphics code. Parallelism, command buffers and generally thinner drivers all help reduce the CPU overhead.
- JoshTriplett 10y agoExactly. They also help you keep the GPU saturated, and minimize round-trips between the GPU and CPU.
- zanny 10y agoPeople aren't really switching from GL to vk for performance reasons. If you were able to get a full AZDO OpenGL environment everywhere you would probably be getting better frames from that (since a lot of driver performance optimization in vk is pushed on the user, and the GL drivers are more mature). Problem is you cannot get anything close to that on any reasonable sampling of OpenGL platforms, in anything close to working condition. At best you just end up using the degenerate subset of APIs that can actually work across all your targeted systems - for a fully cross-platform title, that would include Android, and probably limit you to OpenGL ES 2. If you drop mobile, it would be around OpenGL 3.1-3.3. If you throw out some hardware as new as 2012, you could get stuck at Apple's last supported (which is buggy and broken all the same) OpenGL at 4.1. You can throw out Apple, and get stuck at recent Windows AMD and Intel support around 4.2. But that is the best case - where you don't then pick your target and find out all the drivers are broken in a dozen different ways each for the extensions you are using. It is only OpenGL 4.4 and 4.5 that Khronos has required conformance testing for certification for, and very few people are targeting those for development because of how limited a subset of the market actually supports them. So that is the point where you throw the whole mess out and just use Vulkan - which only has one major release version, and has 3 feature support levels you can pick from, with conformance testing for all of them.