No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (2024)

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (1) Hacker News new | past | comments | ask | show | jobs | submit login

No, WebGPU will be easier to use than WebGL, because it doesn't have the global state. Global state is the worst thing about OpenGL and requires a lot of code to get it under control.

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (2)

WebGL is different than legacy OpenGL from 20 years ago. WebGL is pretty easy to work with.

WebGPU is a low-level API is more flexible than WebGL, which means more complexity. That is why it is being introduced, after all!

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (3)

mmis1000 on May 6, 2020 | parent [–]


However It still use global state, you need to flush state everywhere when switch scenes.

Run another filter? good, switch everything on global state.Render another scene with different texture? Set everything again.

Moreover... if you forgot to reset something after change it. You got weird bug that only happen under some specific order of operation. Because everything share a global state.

And it is full sync. A shader takes long time for render also makes your whole page non responsive, which is a pain. (open the list page of shadertoy, you will know what am I saying)

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (4)

jfkebwjsbx on May 6, 2020 | root | parent [–]


You don't need to reset everything, only whatever you change. Yeah, other APIs allow you to keep the state pre-packaged and switch from what appears a single command, but the state is still there nevertheless.

The full sync is a problem of how WebGL is provided. They could easily change it to allow parallel rendering as long it is to independent contexts.

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (5)

rezmason on May 6, 2020 | root | parent | next [–]


I'd like to chime in by pointing you fine folks to http://regl.party — a functional, partial-application, "stateless WebGL" library that lets you model rendering commands as nested little scopes. It offers "the rest of us" a graphics programming foundation that's lower level than three.js, and I can't recommend it enough.

IMO, WebGL's implementation has some glaring wrinkles that REGL-like libraries can't smooth away, but at least REGL does a decent job of tackling the state problems you're discussing, while offering a more flexible approach (I think?) than the out-of-the-box WebGPU API's render pass command encoder.

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (6)

mmis1000 on May 7, 2020 | root | parent | prev [–]


I am not sure it is easy to change opengl to run parallelly given it all shares a global state. How do you not mess up anything when render two scene at same time if two pipeline shares the same variable but you want to fill it with different value? And if you really want to change it so hard to give pipelines standalone context. Why not use the webgpu? It seems just designed in a stateless way that I just described.

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (7)

skocznymroczny on May 8, 2020 | root | parent [–]


OpenGL wasn't designed with multithreading/parallel execution in mind. Before running any OpenGL call, you have to bind the application-wide context to a specific thread. Vulkan, DX12 work differently - they allow you to create command lists from separate threads, but in exchange you have to work on the synchronization yourself via semaphores and fences.

No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (8)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
No, WebGPU will be easier to use than WebGL, because it doesn't have the global ... (2024)
Top Articles
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 6389

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.