mTvare6 / hello-world.rs

🚀Memory safe, blazing fast, configurable, minimal hello world written in rust(🚀) in a few lines of code with few(1092🚀) dependencies🚀
Other
3.19k stars 1 forks source link

Vulkan is a low-overhead, cross-platform API, open standard for 3D graphics and computing.[16][17][18] #422

Open DragonFire1230 opened 1 year ago

DragonFire1230 commented 1 year ago

Overview

Vulkan targets high-performance real-time 3D-graphics applications, such as video games and interactive media, and highly parallelized computing. Vulkan is intended to offer higher performance and more efficient CPU and GPU usage compared to the older OpenGL and Direct3D 11 APIs. It does so by providing a considerably lower-level API for the application than the older APIs that more closely resembles how modern GPUs work.

Vulkan is comparable to Apple's Metal API and Microsoft's Direct3D 12, and is harder to use than the higher-level OpenGL and Direct3D 11 APIs[according to whom?]. In addition to its lower CPU usage, Vulkan is designed to allow developers to better distribute work among multiple CPU cores.[19]

Vulkan was first announced by the non-profit Khronos Group at GDC 2015.[14][20][21] The Vulkan API was initially referred to as the "next generation OpenGL initiative", or "OpenGL next"[22] by Khronos, but use of those names was discontinued when "Vulkan" was announced.[23]

Vulkan is derived from and built upon components of AMD's Mantle API, which was donated by AMD to Khronos with the intent of giving Khronos a foundation on which to begin developing a low-level API that they could standardize across the industry.[14]

Features

OpenGL and Vulkan are both rendering APIs. In both cases, the GPU executes shaders, while the CPU executes everything else.

Vulkan is intended to provide a variety of advantages over other APIs as well as its predecessor, OpenGL. Vulkan offers lower overhead, more direct control over the GPU, and lower CPU usage.[21] The overall concept and feature set of Vulkan is similar to concepts seen in Mantle and later adopted by Microsoft with Direct3D 12 and Apple with Metal.

Intended advantages of Vulkan over previous-generation APIs include the following:

Unified API

Vulkan provides a single API for both desktop and mobile graphics devices, whereas previously these were split between OpenGL and OpenGL ES respectively.

Cross platform

Vulkan is available on multiple modern operating systems. Like OpenGL, and in contrast to Direct3D 12, the Vulkan API is not locked to a single OS or device form factor. Vulkan runs natively on Android, Linux, BSD Unix, QNX, Haiku,[24] Nintendo Switch, Raspberry Pi, Stadia, Fuchsia, Tizen, and Windows 7, 8, 10, and 11. MoltenVK provides freely-licensed[25][26][27] third-party support for macOS, iOS and tvOS by wrapping over Apple's Metal API.[28]

Lower CPU usage

Vulkan reduces load on CPUs through the use of batching and other low-level optimizations, therefore reducing CPU workloads and leaving the CPU free to do more computation or rendering than would otherwise be possible.[29][30]

Multi-threading friendly design

Direct3D 11 and OpenGL 4 were initially designed for use with single-core CPUs and only received augmentation to be executed on multi-cores. Even when application developers use the augmentations, these APIs regularly do not scale well on multi-cores. Vulkan offers improved scalability on multi-core CPUs due to the modernized threading architecture.[31][32]

Pre-compiled shaders

OpenGL uses the high-level language GLSL for writing shaders, which forces each OpenGL driver to implement its own compiler for GLSL. This then executes at application runtime to translate the program's shaders into the GPU's machine code. In contrast, Vulkan drivers are supposed to ingest shaders already translated into an intermediate binary format called SPIR-V (Standard Portable Intermediate Representation), analogous to the binary format that HLSL shaders are compiled into in Direct3D. By allowing shader pre-compilation, application initialization speed is improved and a larger variety of shaders can be used per scene. A Vulkan driver only needs to perform GPU specific optimization and code generation, resulting in easier driver maintenance, and potentially smaller driver packages.[33] The developers of applications now can also more easily obfuscate proprietary shader code, due to shaders not being stored directly as source code, however tools are provided that can decompile SPIR-V to human-readable high-level code.[32][18]

Others

OpenGL vs. Vulkan

OpenGL | Vulkan[35] -- | -- One single global state machine | Object-based with no global state State is tied to a single context | All state concepts are localized to a command buffer Operations can only be executed sequentially | Multi-threaded programming is possible GPU memory and synchronization are usually hidden | Explicit control over memory management and synchronization Extensive error checking | Vulkan drivers do no error checking at runtime;there is a validation layer for developers

The Khronos Group began a project to create a next generation graphics API in July 2014 with a kickoff meeting at Valve.[56] At SIGGRAPH 2014, the project was publicly announced with a call for participants.[14]

According to the US Patent and Trademark Office, the trademark for Vulkan was filed on February 19, 2015.[57]

Vulkan was formally named and announced at Game Developers Conference 2015, although speculation and rumors centered around a new API existed beforehand and referred to it as "glNext".[58]

2015

In early 2015, LunarG (funded by Valve) developed and showcased a Linux driver for Intel which enabled Vulkan compatibility on the HD 4000 series integrated graphics, despite the open-source Mesa drivers not being fully compatible with OpenGL 4.0 until later that year.[59][60] There is still the possibility[61] of Sandy Bridge support, since it supports compute through Direct3D11.

On August 10, 2015, Google announced that future versions of Android would support Vulkan.[62] Android 7.x "Nougat" launched support for Vulkan on August 22, 2016. Android 8.0 "Oreo" has full support.

On December 18, 2015, the Khronos Group announced that the 1.0 version of the Vulkan specification was nearly complete and would be released when conforming drivers were available.[21]

2016

The full Vulkan specification and the open-source Vulkan SDK were released on February 16, 2016.[1]

2018

On February 26, 2018, Khronos Group announced that the Vulkan API became available to all on macOS and iOS through the MoltenVK library, which enables Vulkan to run on top of Metal.[63] Other new developments were shown at SIGGRAPH 2018.[64] Previously MoltenVK was a proprietary and commercially licensed solution, but Valve made an arrangement with developer Brenwill Workshop Ltd to open-source MoltenVK under the Apache 2.0 license and as a result the library is now available on GitHub. Valve also announced that Dota 2 can as of February 26, 2018 run on macOS using the Vulkan API, which is based on MoltenVK.[65]

2019

On February 25, 2019, the Vulkan Safety Critical (SC) Working Group was announced to bring Vulkan GPU acceleration to safety critical industries.[66]

Google's Stadia streaming cloud gaming service uses Vulkan on Linux based servers with AMD GPUs.[67]

2020

On January 15, 2020, Vulkan 1.2 was released.

Alongside the Vulkan 1.2 release, the Khronos Group posted a blog post which considered that HLSL support in Vulkan had reached "production ready" status, given the improvements in Microsoft's DXC compiler and Khronos's glslang compiler, and new features in Vulkan 1.2 which enhance HLSL support.[68]

On February 3, 2020, the Raspberry Pi Foundation announced that it was working on an open source Vulkan driver for their Raspberry Pi, a popular single board computer.[69] On June 20, 2020, a graphics engineer revealed that he had created one after two years of work that was capable of running VkQuake3 at over 100FPS on the small computer.[70]

On March 17, 2020, Khronos Group released the Ray Tracing extensions, based on Nvidia's proprietary extension, with some major extensions and many minor changes, which in turn was based on Nvidia's OptiX API.[71][72] On November 23, 2020, these Ray Tracing extensions were finalized.[73]

On November 24, 2020, Raspberry Pi Foundation announced that their driver for the Raspberry Pi 4 is Vulkan 1.0 conformant.[74]

2022

On January 25, 2022, Vulkan 1.3 was released.

On March 1, 2022, Vulkan SC 1.0 was released, bringing Vulkan graphics and compute for the safety-critical industry while being based on the Vulkan 1.2 standard.[75]

On August 1, 2022, Raspberry Pi Foundation announced that their driver for the Raspberry Pi 4 is Vulkan 1.2 conformant.[76]

On September 1, 2022, Mesh Shading for Vulkan was released[77][78]

Support across vendors

Screenshot of vulkaninfo, showing information about supported Vulkan instances and vkcube, a program to test Vulkan implementation on a system

Initial specifications stated that Vulkan drivers can be implemented on any hardware that supports OpenGL ES 3.1 or OpenGL 4.x and up.[79] As Vulkan support requires new graphics drivers, this does not necessarily imply that every existing device that supports OpenGL ES 3.1 or OpenGL 4.x will have Vulkan drivers available.

Intel

As of March 2023, Intel has split Vulkan driver support on Windows[80] and on Linux.[81] All drivers are developed by Intel.

On Windows, Skylake through Ice Lake supports up to Vulkan 1.3,[82] with limited support after July 2022 as future updates will only cover security fixes.[80] Iris and newer are fully supported as of March 2023.[83]

On Linux, as of March 2023 there is incomplete Vulkan support for Haswell[84] with it not being Vulkan 1.0 compliant.[85] Apart from Haswell, Ivy Bridge and Broadwell are also supported by a legacy Vulkan driver in Mesa called HASVK.[81] Skylake and newer being supported by a driver in Mesa called ANV.[81]

rilysh commented 1 year ago

супер красиво!

oijdfdg commented 1 year ago

супер красиво!

е не 💀

ShakalnyKot commented 1 year ago

why do you fuckin need an 3d render stuff for an fuckin cli app? does this hello world does a lot of math?

rilysh commented 1 year ago

супер красиво!

е не 💀

хотя это была шутка

oijdfdg commented 1 year ago

супер красиво!

е не 💀

хотя это была шутка

nvm I thought you was from another country :D

ivabus commented 10 months ago

супер красиво!

е не 💀

хотя это была шутка

сделай пр с вулканчиком

ShakalnyKot commented 10 months ago

давайте переведём наш hello-world.rs (:rocket:) на Codeberg!

DragonFire1230 commented 10 months ago

согласен, давайте