All Projects → RippeR37 → Gl_vs_vk

RippeR37 / Gl_vs_vk

Licence: mit
Comparison of OpenGL and Vulkan API in terms of performance.

Projects that are alternatives of or similar to Gl vs vk

Bsf
Modern C++14 library for the development of real-time graphical applications
Stars: ✭ 1,640 (+2423.08%)
Mutual labels:  opengl, graphics, vulkan
Bansheeengine
Modern C++14 game engine with Vulkan support, fully featured editor and C# scripting
Stars: ✭ 2,906 (+4370.77%)
Mutual labels:  opengl, graphics, vulkan
Filament
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
Stars: ✭ 13,215 (+20230.77%)
Mutual labels:  opengl, graphics, vulkan
Rust Game Development Frameworks
List of curated frameworks by the **Game Development in Rust** community.
Stars: ✭ 81 (+24.62%)
Mutual labels:  opengl, graphics, vulkan
Gfx
[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
Stars: ✭ 5,045 (+7661.54%)
Mutual labels:  opengl, graphics, vulkan
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+15672.31%)
Mutual labels:  opengl, graphics, vulkan
Diligentcore
Core functionality of Diligent Engine
Stars: ✭ 263 (+304.62%)
Mutual labels:  opengl, graphics, vulkan
Are We Fast Yet
Are We Fast Yet? Comparing Language Implementations with Objects, Closures, and Arrays
Stars: ✭ 161 (+147.69%)
Mutual labels:  comparison, performance, benchmark
Vulkan best practice for mobile developers
Vulkan best practice for mobile developers
Stars: ✭ 424 (+552.31%)
Mutual labels:  graphics, vulkan, performance
Shadergen
Proof-of-concept library for generating HLSL, GLSL, and Metal shader code from C#,
Stars: ✭ 395 (+507.69%)
Mutual labels:  opengl, graphics, vulkan
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+17896.92%)
Mutual labels:  opengl, graphics, vulkan
Renderdoc
RenderDoc is a stand-alone graphics debugging tool.
Stars: ✭ 5,969 (+9083.08%)
Mutual labels:  opengl, graphics, vulkan
Shaderconductor
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
Stars: ✭ 1,146 (+1663.08%)
Mutual labels:  opengl, graphics, vulkan
Veldrid
A low-level, portable graphics library for .NET.
Stars: ✭ 1,784 (+2644.62%)
Mutual labels:  opengl, graphics, vulkan
Magnum
Lightweight and modular C++11 graphics middleware for games and data visualization
Stars: ✭ 3,728 (+5635.38%)
Mutual labels:  opengl, graphics, vulkan
Silk.net
The high-speed OpenAL, OpenGL, Vulkan, and GLFW bindings library your mother warned you about.
Stars: ✭ 534 (+721.54%)
Mutual labels:  opengl, graphics, vulkan
Pbr
An implementation of physically based shading & image based lighting in D3D11, D3D12, Vulkan, and OpenGL 4.
Stars: ✭ 722 (+1010.77%)
Mutual labels:  opengl, graphics, vulkan
Bonzomatic
Live shader coding tool and Shader Showdown workhorse
Stars: ✭ 829 (+1175.38%)
Mutual labels:  opengl, graphics
Sfml
Simple and Fast Multimedia Library
Stars: ✭ 7,316 (+11155.38%)
Mutual labels:  opengl, graphics
Swfw
Pure C Simple Window Framework (to be rebased soon).
Stars: ✭ 23 (-64.62%)
Mutual labels:  opengl, vulkan

OpenGL vs Vulkan

This project is part of my master-thesis and aims to compare OpenGL and Vulkan API in terms of API-related overhead and performance user can gain (or lose) by using given API. Core idea resolves around creating pairs of almost-identical tests in each API and benchmark them.

Disclaimer ⚠️

Tests used in this project are fairly simple and doesn't involve any advanced techniques to avoid drivers overhead in OpenGL (commonly known as AZDO techniques). The reason for this is to be able to measure raw overhead of each API and their drivers instead of implementing something in most-efficient way possible. The tests were also chosen to replicate some real-life scenarios, so they don't use some available features that to replicate situations where they can't be used (e.g. I'm not using instancing becasue I want to simulate a scene with multile different objects to be rendered).

Implemented tests

Test \ API implementation OpenGL Multithreaded OpenGL Vulkan Multithreaded Vulkan
Test #1
Test #2
Test #3
Test #4

Test #2 and #3 doesn't have multithreaded version with OpenGL API as they don't have easily scalable CPU-bound work that could benefit from dispatching to multiple threads.

Test #1 - static scene

This test resolves around single static scene with variable number of rendered objects which quality can be chosen (each is a sphere with specific ammount of vertices).

Number of vertices, number of vertices and update work is customizable to give possibility to emulate different ammount of CPU and GPU work (this gives us an opportunity to test CPU-bound and GPU-bound scenarios).

Test #2 - terrain with dynamic LoD

In this test, a terrain is rendered (as wireframe) with active dynamic level-of-detail changes. Each vertex is colored in fragment shader with regard to it's height. At startup, it loads 1024x1024 heightmap and pre-computes any necessary data. At runtime it traverses quad-tree structure and decides which elements should be rendered with current resolution, or if map's segment should be rendered with higher resoltuion and thus the node should be split.

Test #3 - shadow mapping

In this test we render a "checkboard" floor with differently-colored cubes and above that we render one high-res sphere and many cubes in different positions. We render it in two passes - depth pass from light PoV to acquire shadowmap and then real render pass which simply renderes scene shadowing necessary fragments.

Test #4 - initialization

Test measures time from initialization start of OpenGL/Vulkan objects up to first draw (and present/swap buffer) call, synchronizes between CPU and GPU to make sure that everything is executed and measures elapsed time. This is non-practical test, but I wanted to know how both APIs behave. For Vulkan I've added support for pipeline cache.

Results

This project was described and tested by Michael Larabel at Phoronix.com.

Link to article with results: http://www.phoronix.com/scan.php?page=article&item=gl-vs-vk.

Results of my tests will be posted here at a later time.

Building

Requirements

  • C++11 compiler
    • MSVC project provided for Windows
    • CMake project script provivded for Windows and Linux
  • VulkanSDK might be needed on Windows (v1.0.46.0 or higher)
    • Vulkan-Hpp is one of dependencies
  • Hardware and drivers supporting OpenGL and Vulkan
  • OpenGL and Vulkan drivers

Windows

  1. Clone or download this repository
  2. Initialize GIT submodules
  3. (Optional) Install OpenGL/Vulkan system dependencies (drivers etc.)
  4. Install project's third-party dependencies (script available in scripts/ directory) 4.1. If you're using provided MSVC project, make sure that third_party/glew-win/glew-win-src.zip is extracted.
  5. Build
  6. Run some tests
git clone https://github.com/RippeR37/GL_vs_VK.git
cd GL_vs_VK
git submodule update --init

# Install third-party dependencies
cd scripts/windows/
install_msvc_dependencies.bat
cd ../..

# Build using MSVC project or CMake

# Run tests
cd bin
GL_vs_VK.exe -t (1|2|3) -api (gl|vk) (-m)

Linux

  1. Clone or download this repository
  2. Initialize GIT submodules
  3. Install dependencies
  4. Build
  5. Run some tests
# Initialize repository
git clone https://github.com/RippeR37/GL_vs_VK.git
cd GL_vs_VK
git submodule update --init

# Install dependencies
sudo apt-get install xorg-dev libgl1-mesa-dev libglu1-mesa-dev libvulkan-dev

# Build
mkdir build && cd build
cmake ..
make -j 4

# Run tests
cd ../bin/
./GL_vs_VK -t (1|2|3) -api (gl|vk) (-m)

Runtime arguments

Name Argument type Description
-t integer Specifies test number.
-api string Specifies used API. Valid options: gl, vk.
-m - Optional. Asks for multithreaded version of test (might not be available).
-benchmark - Optional. Enables benchmarking mode.
-time float Optional. Changes default time of test benchmarking.

In benchmarking mode, test will end automatically in some time (default: 15 seconds, but can be changed with -time argument), after which statistics will be presented on screen. Test 4 will always run in benchmark mode.

Author

I'm the only author of this repository and due to it's nature, for now I can't approve any code contributions. If you have any notes or issues, please raise them and make sure to include your hardware, software and driver version (link to http://vulkan.gpuinfo.org entry would be nice).

Contributions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].