metalbrot-playground | interactive playground showing how to use Metal compute | iOS library

 by   jtbandes Swift Version: v3 License: MIT

kandi X-RAY | metalbrot-playground Summary

kandi X-RAY | metalbrot-playground Summary

metalbrot-playground is a Swift library typically used in Mobile, iOS applications. metalbrot-playground has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Metalbrot.playground is an interactive playground showing how to use Metal compute kernels with Swift. More information can be found on my blog. (This demo is free for personal and educational use. If you plan to use it for anything else, please credit me — see LICENSE.txt for details.).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              metalbrot-playground has a low active ecosystem.
              It has 78 star(s) with 12 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 2 have been closed. On average issues are closed in 77 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of metalbrot-playground is v3

            kandi-Quality Quality

              metalbrot-playground has no bugs reported.

            kandi-Security Security

              metalbrot-playground has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              metalbrot-playground 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

              metalbrot-playground releases are available to install and integrate.

            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 metalbrot-playground
            Get all kandi verified functions for this library.

            metalbrot-playground Key Features

            No Key Features are available at this moment for metalbrot-playground.

            metalbrot-playground Examples and Code Snippets

            No Code Snippets are available at this moment for metalbrot-playground.

            Community Discussions

            Trending Discussions on metalbrot-playground

            QUESTION

            Drawable presented late, causes steady state delay
            Asked 2021-Feb-21 at 16:38

            I have a little Swift playground that uses a Metal compute kernel to draw into a texture each time the mouse moves. The compute kernel runs very fast, but for some reason, as I start dragging the mouse, some unknown delays build up in the system and eventually the result of each mouse move event is displayed as much as 4 frames after the event is received.

            All my code is here: https://github.com/jtbandes/metalbrot-playground

            I copied this code into a sample app and added some os_signposts around the mouse event handler so I could analyze it in Instruments. What I see is that the first mouse drag event completes its compute work quickly, but the "surface queued" event doesn't happen until more than a frame later. Then once the surface is queued, it doesn't actually get displayed at the next vsync, but the one after that.

            The second mouse drag event's surface gets queued immediately after the compute finishes, but it's now stuck waiting for another vsync because the previous frame was late. After a few frames, the delay builds and later frames have to wait a long time for a drawable to be available before they can do any work. In the steady state, I see about 4 frames of delay between the event handler and when the drawable is finally presented.

            1. What causes these initial delays and can I do something to reduce them?
            2. Is there an easy way to prevent the delays from compounding, for example by telling the system to automatically drop frames?
            ...

            ANSWER

            Answered 2021-Feb-21 at 16:38

            I still don't know where the initial delay came from, but I found a solution to prevent the delays from compounding.

            It turns out I was making an incorrect assumption about mouse events. Mouse events can be delivered more frequently than the screen updates — in my testing, often there is less than 8ms between mouse drag events and sometimes even less than 3ms, while the screen updates at ~16.67ms intervals. So the idea of rendering the scene on each mouse drag event is fundamentally flawed.

            A simple way to work around this is to keep track of queued draws and simply don't begin drawing again if another drawable is still queued. For example, something like:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install metalbrot-playground

            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/jtbandes/metalbrot-playground.git

          • CLI

            gh repo clone jtbandes/metalbrot-playground

          • sshUrl

            git@github.com:jtbandes/metalbrot-playground.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

            Explore Related Topics

            Consider Popular iOS Libraries

            swift

            by apple

            ionic-framework

            by ionic-team

            awesome-ios

            by vsouza

            fastlane

            by fastlane

            glide

            by bumptech

            Try Top Libraries by jtbandes

            SpacePOD

            by jtbandesSwift

            DSCOVR.playground

            by jtbandesSwift

            battery-logger

            by jtbandesSwift

            glacier-swift

            by jtbandesSwift

            pdfsnip

            by jtbandesSwift