vulkan | Vulkan API bindings for Go programming language | Graphics library

 by   vulkan-go C Version: Current License: MIT

kandi X-RAY | vulkan Summary

kandi X-RAY | vulkan Summary

vulkan is a C library typically used in User Interface, Graphics applications. vulkan has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Vulkan API is the result of 18 months in an intense collaboration between leading hardware, game engine and platform vendors, built on significant contributions from multiple Khronos members. Vulkan is designed for portability across multiple platforms with desktop and mobile GPU architectures. Read the brief: The binding allows one to use Vulkan API directly within Go code, avoiding adding lots of C/C++ in the projects, also can be used to study Vulkan without diving too deep into C/C++ language semantics. For me it's just a matter of taste, writing Go code is simply more pleasant experience.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              vulkan has a low active ecosystem.
              It has 682 star(s) with 53 fork(s). There are 37 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 24 open issues and 30 have been closed. On average issues are closed in 105 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of vulkan is current.

            kandi-Quality Quality

              vulkan has no bugs reported.

            kandi-Security Security

              vulkan has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              vulkan 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

              vulkan releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

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

            vulkan Key Features

            No Key Features are available at this moment for vulkan.

            vulkan Examples and Code Snippets

            No Code Snippets are available at this moment for vulkan.

            Community Discussions

            QUESTION

            Vulkan - what "stages" exist out of a render pass for setting in vkCmdPipelineBarrier command
            Asked 2021-Jun-13 at 16:12

            What stages can be set for srcStageMask/dstStageMask when submitting a vkCmdPipelineBarrier out of a renderpass, because in such case there is no subpass bind point to graphics pipeline?

            The same question for when submitting vkCmdPipelineBarrier in subpass that has a bind point to a compute pipeline which I guess doesn't have stages like VK_PIPELINE_STAGE_VERTEX_SHADER_BIT and maybe many more.

            Thanks

            Edit

            First, thanks to @Nicol Bolas comment, a compute shader can not be dispatched in middle of subpass.

            And I would like to clarify my question:

            Say I have an image that after a renderpass will have the layout of VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL.

            After the renderpass, I want to update the image with new data and wish to change its layout to VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL.

            Thus, after recording vkCmdEndRenderPass I record a vkCmdPipelineBarrier command as follows:

            ...

            ANSWER

            Answered 2021-Jun-13 at 11:14

            Just inspect the Valid Usage.

            All of them are permitted, except those that have its feature disabled on whole device (e.g. geometry shader), or those the queue family does not support.

            For subpass dependencies, only those supported by pipelineBindPoint pipeline (i.e. currently just graphics) are allowed.

            I think the main problem that makes you deeply confused is that you think pipeline is a finite state machine. But pipeline is not a FSM, it is a pipeline (as the name suggests). It always exists (as do all its stages), even if nothing currently flows through the pipeline.

            Specifically, in english your barrier simply says: "Before any commands recorded after me start copying into this image, make sure all commands recorded before me finished reading this image as texture."

            When stages "exist" is not a valid question (as explained above); existence and non-existence is not really a property they have. And as you see in the semantics of the barrier, it would not even matter to change its meaning.

            Some stages are forbidden by the valid usage, but that is more to reduce confusion than anything. Even if they weren't forbidden, it would change nothing. The barriers with such stages would simply be no-op, or would translate to logically-earlier or later stage.

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

            QUESTION

            Android emulator freeze my whole system when it can't connect to adb daemon
            Asked 2021-Jun-07 at 13:47

            I recently changed my computer and took the opportunity to move from Mageia to Fedora. But I can't do any Android development anymore because, as stated in the title, starting any AVD makes the whole system to freeze (screen, mouse and keybord) if the AVD can't connect to adb daemon. The only thing I can do is hard shutdown.

            The problem here is adb daemon is always started when I try to launch an AVD as the service is enabled by default, so that shouldn't happen.

            What I've been able to collect so far is a few logs in a file by lauching the emulator from command-line. All it says before freezing is:

            emulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local
            emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037

            But, if I manually restart the adb service just before lauching the AVD, I don't experience the freeze. Instead, I get the following errors before the AVD crashes:

            cannot add library .../android-sdk-linux/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
            added library .../android-sdk-linux/emulator/lib64/vulkan/libvulkan.so
            cannot add library .../android-sdk-linux/emulator/lib64/vulkan/libvulkan.so.1: full

            My best guess here is there's something bad going on with the graphic card. Something I am seemingly the only one to exprerience as I couldn't find any relevant result on internet. I must mention here that I've already tried to run several AVDs in multiple API versions, both software and hardware rendered graphics and I always get the same result.

            My system configuration is

            • AMD Ryzen 9
            • Nvidia GeForce RTX 2070 using the Nouveau drivers
            • kernel 5.11.
            ...

            ANSWER

            Answered 2021-Jun-07 at 13:47

            If anyone ever stumbles upon this question facing the same issue than me, that was solved by getting rid of the Nouveau drivers and using Nvidia's proprietary drivers. A handful of other disturbing bugs on my computer were solved by doing just that.

            I really don't understand why some Linux distribution still strongly advise to use the Nouveau drivers over Nvidia'as when they have a such a really poor support of the GPUs...

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

            QUESTION

            Fail to import semaphore from Vulkan to Cuda
            Asked 2021-Jun-06 at 08:08

            I'm trying to import a Vulkan semaphore for using by CUDA on the windows platform, but always get a cudaErrorInvalidValue error. I can’t figure out what causes the problem.

            Considering I have already a HANDLE for the Vulkan semaphore object, the Cuda side is at DLL1 as follows:

            ...

            ANSWER

            Answered 2021-Jun-06 at 08:08

            As @talonmies commented, indeed, the structure cudaExternalSemaphoreHandleDesc is actually not fully initialized with the code shown. The problem is solved when initializing the structure to zero:

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

            QUESTION

            Vulkan swapchain format UNORM to SRGB using VK_KHR_swapchain_mutable_format?
            Asked 2021-May-31 at 17:26

            Creating swapchain images with wrong format result this obviously:

            ...

            ANSWER

            Answered 2021-May-31 at 17:26

            VkImageFormatListCreateInfo Provided by VK_VERSION_1_2

            You linked to the Vulkan 1.2 specification. So of course it cites itself. The extension in question is a core part of 1.2, as is VkImageFormatListCreateInfo.

            The actual extension cites another extension:

            Requires VK_KHR_image_format_list

            Which defines the VkImageFormatListCreateInfoKHR structure used by the swapchain format extension. This structure is of course equivalent to the core 1.2 structure VkImageFormatListCreateInfo, since "image_format_list" was promoted to core in Vulkan 1.2.

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

            QUESTION

            Android Device Manager fails to launch after updating to MacOS Big Sur 11.3
            Asked 2021-May-30 at 06:08

            So my Mac just forced updated to Big Sur 11.3. I've been trying to access the Android Device Manager to run an emulated device and it has been silently failing each time. When I tried to run it from the command line, I get this error message:

            ...

            ANSWER

            Answered 2021-May-02 at 14:51

            Update 2021-04-29: Emulator version 30.5.6 now in stable channel and it fixes this issue. Old answer preserved below.

            Apple has changed hypervisor entitlements (permissions), deprecating com.apple.vm.hypervisor with com.apple.security.hypervisor. Before Google fixes emulator code signing with the new entitlements you can work around the issue by granting the entitlement yourself.

            Create a file entitlements.xml with the following content:

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

            QUESTION

            How do I access a timer from within a Vulkan shader?
            Asked 2021-May-28 at 20:46

            In a Vulkan shader I want to query a timer so that I can query it twice at two points in my code and use the difference. For example, I want to convert the difference to a color so I can see a visualization of how long various pixels take.

            I’m looking for something like the Cuda clock() intrinsic function.

            ...

            ANSWER

            Answered 2021-May-28 at 20:46

            clockARB() of the ARB_shader_clock GLSL extension. At Vulkan side uses VK_KHR_shader_clock extension.

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

            QUESTION

            Issue: C compiler used for C++ in CMake | CMake + git
            Asked 2021-May-28 at 13:28

            I've been using CMake to build my next C++ project, and I had to link a library named 'GLFW' to my executable. I've been having strange issues with this:

            Here is my project structure

            GLFW is cloned into the 'dep' directory. The 'build' directory is my CMake build directory. The 'src' directory is a subdirectory to my top-level CMakeLists.txt and contains the source code.

            Top-level CMakeLists.txt:

            ...

            ANSWER

            Answered 2021-May-28 at 13:28

            Your project is fine. You just happened to run into a bug within glfw: https://github.com/glfw/glfw/issues/1807

            It's been fixed already, but not released yet. So your best options are to clone the master branch, or to manually apply whichever fix resolved the issue in your version of the source until 3.3.5 gets released.

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

            QUESTION

            Vulkan API calls to GPU drivers
            Asked 2021-May-28 at 07:56

            Background:
            I have been eyeing writing an application which needs very basic but fast graphics (just drawing lines and squares), and I'm probably going to use a library such as GLFW, or Vulkano if i'm going with Rust.

            I want to understand a specific, and I guess quite practical, detail of the Vulkan API. I understand that GPUs can be quite a complicated topic, but I want to emphasize that I don't have any background in low-level graphics or Vulkan, so I understand if my question cannot be answered, or if my question does not even make sense. I'll try my best to use the correct terminology. I have to admit, I'm not the best at skimming through and looking at large amounts of source code I don't quite understand and still grasp the overall concept, which is why I hope I can find my answer here. I've tried looking at the source code for Vulkan and Mesa drivers, but it bore no fruit.

            ORIGINAL Question:
            I want to understand how an API call is propagated to the GPU driver.

            I have searched around, but couldn't find the specifics I am searching for. The closest posts I've found are these two:
            https://softwareengineering.stackexchange.com/questions/279069/how-does-a-program-talk-to-a-graphics-card
            https://superuser.com/questions/461022/how-does-the-cpu-and-gpu-interact-in-displaying-computer-graphics

            They both mention something similar to "In order to make the GPU do something, you have to make a call via a supported API". I know that, but neither of the two dig into the specifics of how that API call is made. Hopefully, the diagram below illustrates my question.

            ...

            ANSWER

            Answered 2021-May-26 at 14:02

            You are looking for the Vulkan-Loader/LoaderAndLayerInterface.md documentation.

            The app interfaces with The Loader (sometimes called Vulkan RT, or Vulkan Runtime). That is the vulkan-1.dll (or so).

            The Loader also has vulkan-1.lib, which is classic dll shim. It is where the loading of core version and WSI commands happens, but you can skip the lib and do it all manually directly from the dll using vkGetInstanceProcAddr.

            Then you have ICDs (Installable Client Drivers). Those are something like nvoglv64.dll, and you can have more of them on your PC (e.g. Intel iGPU + NV). The name is arbitrary and vendor specific. The Loader finds them via config files.

            Now when you call something to a command obtained with vkGetInstanceProcAddress (which is everything if you use the *.lib only), you get onto a loader trampoline, which calls a chain of layers, after which the relevant ICD (or all of them) are called. Then the callstack is unwound, so it goes the other direction until the returned to the app. The loader mutexes and merges the the input and output to the ICD.

            Commands obtained with vkGetDeviceProcAddress are little bit more streamlined, as they do not require to be mutexed or merged and are meant to be passed to the ICD without much intervention from the Loader.

            The code is also at the same repo: trampoline.c, and loader.c. It's pretty straightforward; every layer just calls the layer below it. Starts at the trampoline, and ends with the terminator layer which in turn will call the ICD layer.

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

            QUESTION

            Vulkan validation error when I try to reset a commandPool after vkQueueWaitIddle
            Asked 2021-May-27 at 22:02

            I have a small Vulkan program that runs a compute shader in a loop.

            There is only one commandBuffer that is allocated from the only commandPool I have.

            After the commandBuffer is built, I submit it to the queue, and wait for it to comple with vkQueueWaitIddle. I does indeed wait for a while in that line of code. After that, I call vkResetCommandPool, which should reset all commandBuffer allocated with that pool (there is only one anyways).

            ...

            ANSWER

            Answered 2021-May-27 at 22:02

            I have found my problem. In vkCmdDispatch, I thought the paremeters specify the global size (number of compute shader invocations) but it's actually the number of work groups. Therefore, I was dispatching more threads than I intended, and my buffer wasn't big enough, so the threads were writing out of bounds. I believe the validation layer wasn't giving me the right hints though.

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

            QUESTION

            Create video from single images
            Asked 2021-May-27 at 15:43

            I have these Images in a folder (~/Downloads/output_frames) I want to use the command I got from https://github.com/nihui/dain-ncnn-vulkan

            ffmpeg -framerate 48 -i output_frames/%06d.png -i audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output.mp4

            I get this error:

            [image2 @ 0x14681b800] Could find no file with path 'output_frames/%06d.png' and index in the range 0-4

            output_frames/%06d.png: No such file or directory

            ...

            ANSWER

            Answered 2021-May-27 at 15:43

            Use %08d.png as there are 8 digits.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install vulkan

            You can download it from GitHub.

            Support

            vulkanGo.comSaschaWillems Demos (C++)LunarG Vulkan SamplesOfficial list of Vulkan resourcesVulkan API quick reference
            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/vulkan-go/vulkan.git

          • CLI

            gh repo clone vulkan-go/vulkan

          • sshUrl

            git@github.com:vulkan-go/vulkan.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