Skip to content

What about the GPU? #273

Description

@BrendanEich

https://github.com/WebAssembly/design/FutureFeatures.md has long-SIMD, you can see other uses of SIMD by searching the design repository. Searching for GPU finds nothing; if you search closed issues, the GPU is invoked to broaden thinking about subnormals and similar such edge cases.

My question for everyone: should we consider lifting WebGL primitives -- or really OpenGL/ES3.1 and beyond -- into WebAssembly? Treating WebGL as a black box API has the following drawbacks:

  1. WebGL lags OpenGL/ES3.1 and common extensions such as ARB_compute_shader, never mind OpenGL 4.5 (non-ES) or Vulkan.
  2. Separating concerns loses vs. exposing GPU primitives via WebAssembly, which enables compilers to move if/else logic to the GPU via a predication layer, and do other optimizations that span the CPU and GPU.

See some work by Khronos Group that started from LLVM IR and diverged into SPIR-V:

https://www.khronos.org/spir

Of course the WebAssembly community group can say "not in scope, use WebGL or SPIR-V or whatever the embedding provides." That's a possible answer, but I suspect we should not "default" into it for want of asking the question.

I know folks at OTOY would be interested in this approach. It does not need to slow anything down in WebAssembly as scoped so far. I'm really asking whether the GPU is in-bounds as a hardware unit to program via WebAssembly in the same way, as directly and with full optimization wins, as the SIMD units and the CPU are. Thanks,

/be

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions