webgpu | WebGPU Samples & RnD | Learning library

 by   redcamel JavaScript Version: Current License: MIT

kandi X-RAY | webgpu Summary

kandi X-RAY | webgpu Summary

webgpu is a JavaScript library typically used in Tutorial, Learning applications. webgpu has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

These study samples run in Chrome Canary() behind the flag --enable-unsafe-webgpu.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              webgpu has a low active ecosystem.
              It has 51 star(s) with 10 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 0 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of webgpu is current.

            kandi-Quality Quality

              webgpu has 0 bugs and 0 code smells.

            kandi-Security Security

              webgpu has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              webgpu code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              webgpu is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              webgpu releases are not available. You will need to build from source code and install.
              webgpu saves you 284 person hours of effort in developing the same functionality from scratch.
              It has 687 lines of code, 0 functions and 43 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of webgpu
            Get all kandi verified functions for this library.

            webgpu Key Features

            No Key Features are available at this moment for webgpu.

            webgpu Examples and Code Snippets

            No Code Snippets are available at this moment for webgpu.

            Community Discussions

            QUESTION

            Async function return type forces Promise< T | undefined> instead of Promise
            Asked 2021-Mar-06 at 21:03

            I have some trouble understanding the return type of an async function. Here I would like to have a promise that returns only the type Promise< Glslang > and not Promise. Here is the code:

            ...

            ANSWER

            Answered 2021-Mar-06 at 20:29

            First of all, you can simplify the code to always import the module. As I see you use Webpack to bundle the app, it will take care of importing and caching so you can delete ~75% of the logic - basically keep only this part:

            Source https://stackoverflow.com/questions/66510256

            QUESTION

            Ordering instances in WebGL
            Asked 2020-Dec-20 at 01:09

            I'm drawing a lot of rectangles, thus I'm using the WebGL2RenderingContext.drawArraysInstanced() for it. I'm also using a lot of buffers to control shaders per instance (containing such data as position, colors, state, etc). I want now to affect the order in which my instances are being drawn (for example, to bring to the front the instance clicked by the user) and I'm looking for something like INSTANCE_ARRAY_BUFFER, something similar to ELEMENT_ARRAY_BUFFER, but for instances instead of vertices. Something that would allow me to tell "draw instances in the following order: 3,1,2,0,...". Is there any API which would allow me to control the order of the drawn instances without modifying the order of elements of all the data buffers?

            Based on my research so far I suspect the answer will be "no", but maybe I missed some hidden WebGL API. Moreover, as a bonus question – was something like that introduced maybe in recent OpenGL versions or the WebGPU?

            ...

            ANSWER

            Answered 2020-Dec-20 at 01:09

            Your only actual question is

            Is there any API which would allow me to control the order of the drawn instances without modifying the order of elements of all the data buffers?

            Yes, put your data in textures, pass in an array of ids in a buffer

            Some examples, not just quads here and here

            I have no idea how much faster or slower this would be. My intuition is it would be slower but I haven't tested.

            It would be strange to me that the only thing you're optimizing for is draw order and that you don't need to position all the quads and change their UVs. If you do need to position all the quads and change their UVs then just write them in the correct order in the first place.

            Other comments based on the comments

            • Are instances the best way to draw lots of quads?

              I think the verdict here is not so clear. 10 years ago my experience was instancing was 30% slower than just creating the data for all the quads. My tests indicate that's no longer true, at least not on any GPU I own and not in WebGL.

            • Is writing 4 or 6 vertices to buffers per quad a good solution?

              It's common to just write all the data to buffers every frame for UIs. See pretty much every ImGUI library

            Source https://stackoverflow.com/questions/65373620

            QUESTION

            Does browser JavaScript allow for SIMD or Vectorized operations?
            Asked 2020-May-07 at 18:26

            I want to write applications in JavaScript that require a large amount of numerical computation. However, I'm very confused about the state of efficient linear-algebra-like computation in client-side JavaScript. There seems to be many approaches, but no clear indication of their readiness. Most of them seem to have restrictions of the size of vectors and matrices allowed for computation.

            WebGL

            Obviously allows for vector and matrix computations on the GPU, but I'm not clear on the limitations. Attempted wrappers around this library seem to limit size of matrices and vectors. Is this a practical limitation (browsers don't support anything else) or just a development limitation (someone need to write the code)?

            WebCL

            WebCL is a proposed browser-level implementation of OpenCL, but appears to be stuck in development.

            WebGPU

            Apple has recently put forth an alternative to WebCL called WebGPU. So far, there is a prototype and demos, but it's not clear to me if this will see wide adoption.

            SIMD

            Mozilla has put out an API for SIMD operations, but it only has experimental support.

            Are vectorized computations on the browser-side supported by JavaScript?

            Notes:

            • My question is not "What's a good library for numerical computation in JavaScript" but "Are vectorized operations possible in JavaScript?" An acceptable answer would link to a demo of vectorized computation working in a non-experimental browser.

            • I may be getting SIMD, vectorization and GPU computation confused. I thought it was okay to use them synonymously in this context, given they all allow for efficient computations involving high-dimensional vectors using hardware acceleration.

            ...

            ANSWER

            Answered 2017-Apr-16 at 04:50

            The state of SIMD in JavaScript is partly a practical and a developmental problem.

            Practical

            Web browsers are kind of like virtual machines. This means they need a ton of drivers for hardware. The drivers for exposing the few shaders and whatnot for WebGL are significantly different than the arbitrary kernel execution required for SIMD operations.

            Developmental

            Hypothetically, one could just wrap WebGL to make it a general purpose GPU computer and someone has attempted to with gpgpu.js. However, it's got finicky support and is probably slower than just directly piping a kernel to the GPU.

            Conclusion

            The web isn't ready for SIMD yet. There are quite a few big companies working to make it ready. Until then, you're going to have to rely on WebWorkers for large batches of numerical computations.

            Source https://stackoverflow.com/questions/42917578

            QUESTION

            How to activate webgpu backend on Tensorflow.JS
            Asked 2019-Nov-18 at 09:20

            Current release on Github of Tensorflow.js includes a WEBGPU backend, but when running tf.getBackend() I get webgl even with Chrome Canary with WEBGPU enabled. Also running tf.backend() doesn't seem to indicate that WEBGPU is there.

            ...

            ANSWER

            Answered 2019-Sep-26 at 11:06

            Which tf package are you importing? The WebGPU backend is not bundled with tfjs by default - you need to import it specifically, like this:

            Source https://stackoverflow.com/questions/58112073

            QUESTION

            inavalid element type in machine learning model
            Asked 2019-Nov-08 at 12:41

            I'm using a simple model of @tensorflow/tfjswhich simply shows accuracy. The same code when ran in code sandbox doesn't give any error while running it in visual studio code an invariant type error occur. My code is attached below. Also guide about input shape and unit term used in code and how to implement this code in react native.

            ...

            ANSWER

            Answered 2019-Nov-08 at 12:41

            You need to import the @tensorflow/tfjs-react-native package. Additionnaly, tf.ready() should be be used if the backend is asynchronous Here is an example of how your react app should look like

            Source https://stackoverflow.com/questions/58724591

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install webgpu

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/redcamel/webgpu.git

          • CLI

            gh repo clone redcamel/webgpu

          • sshUrl

            git@github.com:redcamel/webgpu.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link