Giter Club home page Giter Club logo

vkbasalt's Introduction

vkBasalt

vkBasalt is a Vulkan post processing layer to enhance the visual graphics of games.

Currently, the build in effects are:

  • Contrast Adaptive Sharpening
  • Denoised Luma Sharpening
  • Fast Approximate Anti-Aliasing
  • Enhanced Subpixel Morphological Anti-Aliasing
  • 3D color LookUp Table

It is also possible to use Reshade Fx shaders.

Disclaimer

This is one of my first projects ever, so expect it to have bugs. Use it at your own risk.

Building from Source

Dependencies

Before building, you will need:

  • GCC >= 9
  • X11 development files
  • glslang
  • SPIR-V Headers
  • Vulkan Headers

Building

These instructions use --prefix=/usr, which is generally not recommened since vkBasalt will be installed in directories that are meant for the package manager. The alternative is not setting the prefix, it will then be installed in /usr/local. But you need to make sure that ld finds the library since /usr/local is very likely not in the default path.

In general, prefer using distro provided packages.

git clone https://github.com/DadSchoorse/vkBasalt.git
cd vkBasalt

64bit

meson setup --buildtype=release --prefix=/usr builddir
ninja -C builddir install

32bit

Make sure that PKG_CONFIG_PATH=/usr/lib32/pkgconfig and --libdir=lib32 are correct for your distro and change them if needed. On Debian based distros you need to replace lib32 with lib/i386-linux-gnu, for example.

ASFLAGS=--32 CFLAGS=-m32 CXXFLAGS=-m32 PKG_CONFIG_PATH=/usr/lib32/pkgconfig meson setup --prefix=/usr --buildtype=release --libdir=lib32 -Dwith_json=false builddir.32
ninja -C builddir.32 install

Packaging status

Debian sudo apt install vkbasalt

Fedora sudo dnf install vkBasalt

Void Linux sudo xbps-install vkBasalt

Usage

Enable the layer with the environment variable.

Standard

When using the terminal or an application (.desktop) file, execute:

ENABLE_VKBASALT=1 yourgame

Lutris

With Lutris, follow these steps below:

  1. Right click on a game, and press configure.
  2. Go to the System options tab and scroll down to Environment variables.
  3. Press on Add, and add ENABLE_VKBASALT under Key, and add 1 under Value.

Steam

With Steam, edit your launch options and add:

ENABLE_VKBASALT=1 %command% 

Configure

Settings like the CAS sharpening strength can be changed in the config file. The config file will be searched for in the following locations:

  • a file set with the environment variableVKBASALT_CONFIG_FILE=/path/to/vkBasalt.conf
  • vkBasalt.conf in the working directory of the game
  • $XDG_CONFIG_HOME/vkBasalt/vkBasalt.conf or ~/.config/vkBasalt/vkBasalt.conf if XDG_CONFIG_HOME is not set
  • $XDG_DATA_HOME/vkBasalt/vkBasalt.conf or ~/.local/share/vkBasalt/vkBasalt.conf if XDG_DATA_HOME is not set
  • /etc/vkBasalt.conf
  • /etc/vkBasalt/vkBasalt.conf
  • /usr/share/vkBasalt/vkBasalt.conf

If you want to make changes for one game only, you can create a file named vkBasalt.conf in the working directory of the game and change the values there.

Reshade Fx shaders

To run reshade fx shaders e.g. shaders from the reshade repo, you have to set reshadeTexturePath and reshadeIncludePath to the matching dirctories from the repo. To then use a specific shader you need to set a custom effect name to the shader path and then add that effect name to effects like every other effect.

effects = colorfulness:denoise

colorfulness = /home/user/reshade-shaders/Shaders/Colourfulness.fx
denoise = /home/user/reshade-shaders/Shaders/Denoise.fx
reshadeTexturePath = /home/user/reshade-shaders/Textures
reshadeIncludePath = /home/user/reshade-shaders/Shaders

Ingame Input

The HOME key can be used to disable and re-enable the applied effects, the key can also be changed in the config file. This is based on X11 so it won't work on pure wayland. It should however at least not crash without X11.

Debug Output

The amount of debug output can be set with the VKBASALT_LOG_LEVEL env var, e.g. VKBASALT_LOG_LEVEL=debug. Possible values are: trace, debug, info, warn, error, none.

By default the logger outputs to stderr, a file as output location can be set with the VKBASALT_LOG_FILE env var, e.g. VKBASALT_LOG_FILE="vkBasalt.log".

FAQ

Why is it called vkBasalt?

It's a joke: vulkan post processing โ†’ after vulcan โ†’ basalt

Does vkBasalt work with dxvk and vkd3d?

Yes.

Will vkBasalt get me banned?

Maybe. To my knowledge this hasn't happened yet but don't blame me if your frog dies.

Will there be a openGl version?

No. I don't know anything about openGl and I don't want to either. Also openGl has no layer system like vulkan.

Will there be a GUI in the future?

Maybe, but not soon.

So is vkBasalt just a reshade port for linux?

Not really, most of the code was written from scratch. vkBasalt directly uses reshade source code for the shader compiler (thanks @crosire), but that's about it.

Does every reshade shader work?

No. Shaders that need multiple techniques do not work, there might still be problems with stencil and blending and depth buffer access isn't ready yet.

You said that "depth buffer access isn't ready yet", what does this mean?

There is a wip version that you can enable with depthCapture = on. It will lead to many problems especially on non nvidia hardware. Also the selected depth buffer isn't always the one you would want.

Is there a way to change settings for reshade shaders?

There is some support for it #46. One easy way so to simply edit the shader file.

vkbasalt's People

Contributors

atomsymbol-notifications avatar dadschoorse avatar doitsujin avatar fluffykittyrevenge avatar gasinvein avatar juan-lunarg avatar mcoffin avatar nicokoch avatar pchome avatar serebit avatar stephanlachnit avatar theevilskeleton avatar tim77 avatar tytydraco avatar yakoyakoyokuyoku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vkbasalt's Issues

Deband effect

Would it be possible to add a deband/dithering effect? Along with CAS and SMAA it's one of my main uses for ReShade and it would great to have it in vkBasalt.

Request for versioned release tarballs

It would be helpful for distribution packagers to have the version in the actual release tarball filename. Right now fetching any version would result in just vkBasalt.tar.gz. Please consider naming release tarballs e.g. vkBasalt-0.3.0.tar.gz

EDIT: going with it the top level directory in the tarball should of course also be renamed from just vkBasalt to vkBasalt-0.3.0 then.

Use separate images for read and write operations

I was trying to implement this, and currently, it seems to me, the approach we should take depends on whether swapchain images have a format that is supported for storage images.

If they do, we can read from swapchain image, store to the temporary image, and then perform a blit back to the swapchain image.

If they don't we take almost the same approach, except that we'll read using sampler.

And then there might be an issue with sRGB: we should be fine on reading, as sRGB to linear does have a hardware support on load. But for the store operation we would have to implement conversion in the shader.

@doitsujin, may I ask you to clarify whether my understanding is correct?

Testing needed on AMD

vkBasalt now uses a graphics pipeline instead of a compute pipeline and accesses the image through a sampler. As always I am only able to test on NVIDIA, so any help testing the new build before I release it would be appreciated.

If something does not work, please attach the terminal output.

vkBasalt.tar.gz

Can't build after tag v0.3.0

Hi. I can't build vkBasalt with version >= v0.3.0.
I got this error:

`
mkdir -p ../build
c++ effect_fxaa.cpp -o ../build/effect_fxaa.64.o -c -O3 -fPIC -Wall -Wextra -Wno-unused-parameter -std=c++2a -I../reshade/deps/spirv/include/spirv/unified1 -m64
In file included from effect_fxaa.cpp:12:
sampler.hpp:14:10: fatal error: ../reshade/source/effect_module.hpp: No such file or directory
14 | #include "../reshade/source/effect_module.hpp"

`
There is something missing?

Higher input lag in Doom when the game presents from a compute queue

GCN can present frames from a hardware compute queue to improve performance. Doom uses this when the game's anti-aliasing is either set to disabled or 8xTSSAA.
When combined with vkBasalt, these artifacts occur (tested with radv):
Screenshot_20191108_142236
The white stripes disappear when turning off async compute by switching to a different AA mode like FXAA.

It would be nice if these artifacts could be fixed without decreasing performance. Doom is not the only example, this e.g. also applies to Rage 2 (at least it should, as it uses async compute as well).

Mesa overlay also has issues with it:
https://gitlab.freedesktop.org/mesa/mesa/issues/946#note_246418

Support Reshade FX shaders

You could add support for Reshade FX shaders (like nvidia did for Freestyle).
Reshade is open-source too and can be found at https://github.com/crosire/reshade/

With support for Reshade FX shaders you would gain access to running all of the shader effects we make, and would not have to take time to port them to glsl.
And vice-versa if you add any interesting effects we could also run them on Reshade.

Don't hesitate to reach out in our forums or on our discord if you want to discuss this or other ideas.

Corrupted output image on Intel

I tested the latest master c6eb5f9 on UHD Graphics 630, 19.2.2:

image

Validation layers complain on several things (Click me)

    #casSharpness specifies the amount of sharpning in the CAS shader.
    #0.0 less sharp, less artefacts, but not off
    #1.0 maximum sharp more artefacts
    #Everything in between in possible
    set option casSharpness equal to 0.4
    casSharpness=0.4

    #enableFxaa enables fxaa but currently turns off cas
    #0 fxxa off cas on
    #1 fxxa on  cas off
    set option enableFxaa equal to 0
    enableFxaa=0

    interrupted create instance
    set count 1
    before writing buffer descriptor Sets 
    0.4
    found graphic capable queue
    1
    queue 0x555772f4ef88
    queue 0x555772f4ef88
    queue 0x555772f4ef88
    format 50
    device 0x555772f4d1a0
    swapchain 0x16
    Interrupted create swapchain
    Interrupted get swapchain images 0
    Interrupted get swapchain images 3
    queue 0x555772f4ef88
    swapchain 0x16
    format 50
    device 0x555772f4d1a0
    fake image size: 8134676
    fake image alignment: 4096
    VUID-vkBindImageMemory-memoryOffset-01048(ERROR / SPEC): msgNum: 0 - vkBindImageMemory(): memoryOffset is 0x7c2014 but must be an integer multiple of the VkMemoryRequirements::alignment value 0x1000, returned from a call to vkGetImageMemoryRequirements with image. The Vulkan spec states: memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkBindImageMemory-memoryOffset-01048)
        Objects: 1
            [0] 0x18, type: 10, name: NULL
    VUID-vkBindImageMemory-memoryOffset-01048(ERROR / SPEC): msgNum: 0 - vkBindImageMemory(): memoryOffset is 0xf84028 but must be an integer multiple of the VkMemoryRequirements::alignment value 0x1000, returned from a call to vkGetImageMemoryRequirements with image. The Vulkan spec states: memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkBindImageMemory-memoryOffset-01048)
        Objects: 1
            [0] 0x19, type: 10, name: NULL
    after createFakeSwapchainImages 
    before creating swapchain image views 
    VUID-VkImageViewCreateInfo-usage-02275(ERROR / SPEC): msgNum: 0 - vkCreateImageView(): pCreateInfo->format VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT. The Vulkan spec states: If usage contains VK_IMAGE_USAGE_STORAGE_BIT, then the image view's format features must contain VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-usage-02275)
        Objects: 1
            [0] 0x1b, type: 10, name: NULL
    VUID-VkImageViewCreateInfo-usage-02275(ERROR / SPEC): msgNum: 0 - vkCreateImageView(): pCreateInfo->format VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT. The Vulkan spec states: If usage contains VK_IMAGE_USAGE_STORAGE_BIT, then the image view's format features must contain VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-usage-02275)
        Objects: 1
            [0] 0x1c, type: 10, name: NULL
    VUID-VkImageViewCreateInfo-usage-02275(ERROR / SPEC): msgNum: 0 - vkCreateImageView(): pCreateInfo->format VK_FORMAT_B8G8R8A8_SRGB with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT. The Vulkan spec states: If usage contains VK_IMAGE_USAGE_STORAGE_BIT, then the image view's format features must contain VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-usage-02275)
        Objects: 1
            [0] 0x1d, type: 10, name: NULL
    before creating framebuffers 
    before creating fake swapchain image views 
    before creating descriptor Pool 
    set count 3
    after creating descriptor Pool 
    before allocating descriptor Sets 1
    before writing descriptor Sets 
    before writing descriptor Sets 
    before writing descriptor Sets 
    before creating descriptor Pool 
    0x7f76d7562b00
    0x7f76d7562b00
    0x555772ffc778
    0x555772e7f520
    0x555773005450
    0x55577300b1c0
    after allocateCommandBuffer 
    0x555772e7f520
    0x555773005450
    0x55577300b1c0
    VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184(ERROR / SPEC): msgNum: 0 - vkCmdPipelineBarrier(): pImageMemBarriers[0].srcAccessMask (0x20) is not supported by srcStageMask (0x400). The Vulkan spec states: Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184)
        Objects: 1
            [0] 0x555772e7f520, type: 6, name: NULL
    VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184(ERROR / SPEC): msgNum: 0 - vkCmdPipelineBarrier(): pImageMemBarriers[0].srcAccessMask (0x20) is not supported by srcStageMask (0x400). The Vulkan spec states: Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184)
        Objects: 1
            [0] 0x555773005450, type: 6, name: NULL
    VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184(ERROR / SPEC): msgNum: 0 - vkCmdPipelineBarrier(): pImageMemBarriers[0].srcAccessMask (0x20) is not supported by srcStageMask (0x400). The Vulkan spec states: Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184)
        Objects: 1
            [0] 0x55577300b1c0, type: 6, name: NULL
    0writen commandbuffer0x555772e7f520
    1writen commandbuffer0x555773005450
    2writen commandbuffer0x55577300b1c0

Windows support?

Hi,
I know we have Reshade and Nvidia Freestyle on Windows but still interested on testing VkBasalt on Windows for Intel GPUs..
any plans on supporting Windows?
thanks..

AUR package link

Hello,

I've created an AUR package for this and was suggested on reddit to have a link to it here.
Is this something you'd be interested in? If so I can create a PR on the readme.

Thank you!

Launching any game with ANY reshade effect enabled causes the game to just be a blank window and never fully launch

The title says it all but basically whenever I launch a game with any of the reshade effects enabled the game just launches into a blank window thats looks like whatever was on my screen at the time. All of the basic shaders that come with vkBasalt like CAS and SMAA work.
Im also using a navi gpu specifically the rx 5700xt.

This is my file if that makes any difference because for all I know I might just be doing something wrong.
new screenshot of my configs:
Screenshot_20200416_161356

Building with any gcc optimization causes freeze or crash

-O3 and -O2 cause a freeze that requires sshing in to kill vkcube. -O1 and -Os cause a segmentation fault. But no optimizations works fine. The builds on the release page also work without issues.

Maybe the cause is the gcc version (assuming you built it with -O3)? I'm using gcc 9.2

Fatal error when trying to build vkBasalt (vulkan/vulkan.h: No such file or directory)

I get this error when trying to build vkBasalt:

for i in src shader; do make -C $i; done
make[1]: Entering directory '/home/ahmed/Downloads/vkBasalt-master/src'
g++ compute_pipeline.cpp -o ../build/compute_pipeline.64.o -c -O3 -fPIC -m64
In file included from compute_pipeline.cpp:1:0:
compute_pipeline.hpp:9:10: fatal error: vulkan/vulkan.h: No such file or directory
#include "vulkan/vulkan.h"
^~~~~~~~~~~~~~~~~
compilation terminated.
makefile:22: recipe for target '../build/compute_pipeline.64.o' failed
make[1]: *** [../build/compute_pipeline.64.o] Error 1
make[1]: Leaving directory '/home/ahmed/Downloads/vkBasalt-master/src'
make[1]: Entering directory '/home/ahmed/Downloads/vkBasalt-master/shader'
glslangValidator -V cas.comp.glsl -o ../build/shader/cas.comp.spv
make[1]: glslangValidator: Command not found
makefile:11: recipe for target '../build/shader/cas.comp.spv' failed
make[1]: *** [../build/shader/cas.comp.spv] Error 127
make[1]: Leaving directory '/home/ahmed/Downloads/vkBasalt-master/shader'
makefile:4: recipe for target 'compile' failed
make: *** [compile] Error 2

lib32-glslang isn't needed

The cas shader can be built without it and works fine in 32bit apps. And it can only be found in the AUR so you can't use the pacman command in the README to install it.

The Evil Within crashes when vkBasalt is turned on

The Evil Within crashes when vkBasalt is turned on. I don't think that I need to use it with this game, because it is so dark already, but I thought that it worth mentioning.

System Specs:
CPU: Intel I5 4200M
GPU: AMD HD 8750M
Driver: Mesa 19.2.99 LLVM 10 (Padoka Unstable PPA)
Kernel: 5.3.8
OS: KDE neon 5.17 User Edition

vkBasalt doesn't work at all.

I've installed vkbasalt but it doesn't work.

when I tried to debug in order to see the log I used the comand bellow but there is no log.

mangohud ENABLE_VKBASALT=1 VKBASALT_CONFIG_FILE=~/.local/share/vkBasalt/vkBasalt.conf VKBASALT_LOG_LEVEL=debug VKBASALT_LOG_FILE="vkBasalt.log" ./vkcube

System Info:

Operating System Version:
KDE neon User Edition 5.18 (64 bit)
Kernel Name: Linux
Kernel Version: 5.3.0-45-generic
X Server Vendor: The X.Org Foundation
X Server Release: 11906000
X Window Manager: KWin
Steam Runtime Version: steam-runtime_0.20200318.2

Video Card:
Driver: NVIDIA Corporation GeForce GTX 1060 6GB/PCIe/SSE2
Driver Version: 4.6.0 NVIDIA 440.64
OpenGL Version: 4.6
Primary Bus: PCI Express 16x
Primary VRAM: 6144 MB
Supported MSAA Modes: 2x 4x 8x 16x

Requirement for specifying a path for every ReShade effect additionally to reshadeIncludePath

For using ReShade shaders we have to specify reshadeIncludePath so my guess was it works when I just enable an effect via effects = monochrome. But (like also stated in the example) we also have to specify an explicit path for every single effect like monochrome = /usr/share/vkBasalt/reshade-shaders/Shaders/Monochrome.fx. So I wonder what the reshadeIncludePath actually is all about? It doesn't work if it's emitted. Shouldn't it be enough to require one path only, preferably just reshadeIncludePath which then picks up the shaders automatically depending on the specified effect name?

Thinking a bit further this would allow distributions to set the reshadeIncludePath globally via /usr/share/vkBasalt/vkBasalt.conf (or maybe /etc/vkBasalt.conf in the future) and have users just need to create a vkBasalt.conf with only effects = monochrome in it. Granted vkBasalt would stack/merge both configuration files on runtime, which I don't think it currently does(?).

fps limiter and vsync strategy

I know there are already 2 implementation of this.
One from the (seems abandoned) libstrangle, the other one via VkGHL, but it would be nice to have it implemented right here.
Thanks!

Option to disable (or enable) verbose/debug output

Right now a lot of information is displayed when running an application making use of vkBasalt.

$ vkcube

vs.

$ ENABLE_VKBASALT=1 vkcube
/home/user/.config/vkBasalt/vkBasalt.conf
set option effects equal to monochrome
set option monochrome equal to /usr/share/vkBasalt/reshade-shaders/Shaders/Monochrome.fx
set option reshadeTexturePath equal to /usr/share/vkBasalt/reshade-shaders/Textures
set option reshadeIncludePath equal to /usr/share/vkBasalt/reshade-shaders/Shaders
interrupted create instance
found graphic capable queue
50 44
format 50
Interrupted create swapchain
Interrupted get swapchain images 0
Interrupted get swapchain images 3
fake image size: 1052692
fake image alignment: 4096
after createFakeSwapchainImages 
3swapchain images
current effectString monochrome
3 images in firstImages
using swapchain images as second images
3 images in secondImages
in creating ReshadeEffect 
after creating input ImageViews
after creating ImageViews
after creating shaderModule
Stencil Format: 129
after creating descriptorSetLayouts
after creating descriptorPool
after creating Pipeline layout
0
before allocating descriptor Sets
before writing descriptor Sets 
before writing descriptor Sets 
before writing descriptor Sets 
after writing ImageSamplerDescriptorSets


500 x 500
F__PostProcessVS
F__MonochromePass
finished creating Reshade effect
effect string count: 1
effect count: 2
after allocateCommandBuffer 3 for swapchain 0x56385118dba0
before applying effect 0x5638511921f0
applying ReshadeEffect0x563851197be0
after the first pipeline barrier
after binding image sampler
before beginn renderpass
after beginn renderpass
after bind pipeliene
after draw
after end renderpass
after the second pipeline barrier
before applying effect 0x563850bf35d0
before applying effect 0x5638511921f0
applying ReshadeEffect0x5638511ad960
after the first pipeline barrier
after binding image sampler
before beginn renderpass
after beginn renderpass
after bind pipeliene
after draw
after end renderpass
after the second pipeline barrier
before applying effect 0x563850bf35d0
before applying effect 0x5638511921f0
applying ReshadeEffect0x5638511a3300
after the first pipeline barrier
after binding image sampler
before beginn renderpass
after beginn renderpass
after bind pipeliene
after draw
after end renderpass
after the second pipeline barrier
before applying effect 0x563850bf35d0
after write CommandBuffer
after create semaphores
0writen commandbuffer0x563851197be0
1writen commandbuffer0x5638511ad960
2writen commandbuffer0x5638511a3300
after getswapchainimages

Missing license

Please add a license to the project.
It will then be cleaner to package it by distributions.

3D LUT shader for colour correction

Useful in particular for playing sRGB content on wide gamut monitors, which are becoming more and more common. You could also use it for any type of colour manipulation (e.g to intentionally over/under saturate), by generating your own 3D LUT.

DisplayCAL has a Reshade shader that implements this: https://sourceforge.net/p/dispcalgui/code/HEAD/tree/trunk/DisplayCAL/ColorLookupTable.fx, which I use with Wine + DXVK effectively (but it would be nice for native games, and games that don't play nice with Reshade).

Rebindable/configurable effects toggle key

It would be nice if we could change the effects toggle key via config file.

Some of the games I'm using vkBasalt with actually have an in-game action mapped to Home. In most cases it's not THAT annoying, but having the possibility to rebind it to something unused would be a nice feature.

Darksiders Genesis crashes when using vkBasalt v. 0.3.1

Darksiders Genesis crashes when using vkBasalt version 0.3.1, it worked fine when I was using vkBasalt version 0.3.0.

Here is a log from the terminal: log.txt

System info:

CPU: Intel Core I5 4200M
GPU: AMD Radeon HD 8750M
OS: Kubuntu 19.10 - KDE Plasma 5.18.3
Kernel: 5.3.0-40
WINE version 5.4 staging
vkBasalt version 0.3.1

Testing for ReShade Fx shaders

I'm working on supporting reshade shaders (see #41) in wip-reshade-fx. Some shaders should now work, so testing would be quite good. Here is a build: vkBasalt.tar.gz Edit: use a newer build from below

Please install spriv-cross and glslang before testing.
Edit: You don't need spriv-cross and glslang anymore

To use Reshade Shaders, download https://github.com/crosire/reshade-shaders
Then set in the config:

effects = reshade

disableSpirvWorkaround = 0
reshade = *path to a shader from the repo*
reshadeTexturePath = *path to the texture dircetory from the repo*
reshadeIncludePath = *path to the shader dircetory from the repo*

Shaders that should work: LUT.fx, SMAA.fx, LumaSharpen.fx

please also test with Edit: the workaround has been removed and isn't useful anymore

disableSpirvWorkaround = 1

in games and in vkcube.

Found a GUI for vkBasalt

Hello, I have found an awesome project made by benjamimgois, which brings a GUI to vkBasalt. In case you want to, you can add it in your README.

Here's the link: https://github.com/benjamimgois/goverlay

In case you are wondering, this is not advertisement. I am not associated with him in any way, shape or form. I independently decided to create this issue because I support both of your projects.

vkBasalt runtime dependency on libstdc++.so.6

First off, I'd like to thank you for this little nifty piece of work. I'm mostly using it to enhance older games I'm running with DXVK by applying FXAA or SMAA, and it works great so far!

That being said, I'm a Debian/Ubuntu user and I've had a hard time getting it to run because of its dependency on libstdc++.so.6. Just to be clear, I'm picking the neat and easy way of getting the binary package and make install-ing.

The problem is that whenever I try to run anything I get:

ERROR: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.26' not found (required by /home/snowfall/.local/share/vkBasalt/libvkbasalt64.so)

on Ubuntu 18.04/Mint 19 (the current LTS). This is because it only ships with gcc-8 and somewhat outdated libraries. I've worked around it by getting a newer version of the lib and using LD_LIBRARY_PATH for now.

I understand the need for gcc-9 & libs to be there for compilation, but even during runtime?

I'm hardly the person to preach or an expert, since I haven't written any C/C++ code in about, oh, 15 years, so there may be things I'm not aware of when I'm saying this, but have you considered statically linking with -static-libstdc++ ?

Add support for CAS after FXAA

Currently, enabling FXAA disables CAS. Problems when trying to implement the option to run one after the other are:

  1. Is a separate render pass necessary, or can this be solved with sub passes?
  2. The config has to become better, so that the order of effects and their settings can be set in a more pretty way.
  3. The code must be able to support a variable amount of pipelines, descriptor sets and other stuff.
  4. When more memory is allocated, we need to start thinking about writing a allocater. VMA sadly can not be used.

Dependencies for Solus need updating in README

To properly compile vkBasalt on solus two additional dependencies need to be installed along with the one mentioned in the README.MD:

  • glslang: needed for glslangValidator

  • spirv-tools: needed for spirv-opt

Running make seems to fail (Ubuntu 20.04)

Here's the output of running make:

slay@slay-System-Product-Name:~/vkBasalt$ make
for i in src shader; do make -C $i; done
make[1]: Entering directory '/home/slay/vkBasalt/src'
mkdir -p ../build
g++ effect_fxaa.cpp -o ../build/effect_fxaa.64.o -c -O3 -Wall -Wextra -Wno-unused-parameter -fPIC -std=c++2a -I../reshade/deps/spirv/include/spirv/unified1 -I../include -m64
make[1]: g++: Command not found
make[1]: *** [makefile:28: ../build/effect_fxaa.64.o] Error 127
make[1]: Leaving directory '/home/slay/vkBasalt/src'
make[1]: Entering directory '/home/slay/vkBasalt/shader'
mkdir -p ../build/tmp
mkdir -p ../build/shader
glslangValidator -V fxaa.frag.glsl -o ../build/tmp/fxaa.frag.spv
make[1]: glslangValidator: Command not found
make[1]: *** [makefile:19: ../build/tmp/fxaa.frag.spv] Error 127
make[1]: Leaving directory '/home/slay/vkBasalt/shader'
make: *** [makefile:9: compile] Error 2

TAA? and possible for OpenGL also?

Just wondering if something like this could be implemented in OGL?

Currently I have several OGL games that only have FXAA as a option and its terrible!

Also wondering if TAA and HQ TAA options are possible with vkbasalt.

PS. I do not know of any projects doing a similar thing for OpenGL, at least that's compatible with both amd and nvidia hardware.

Quick and Dirty UI

Sorry, I usually lurk and don't post much on GitHub if at all, so I wasn't sure if this was the correct format. Feel free to delete if this is wrong.

Looking at how this works (To much of my limited knowledge) is there a way for an outside program to send a command to vkBasalt in the form of a reset/refresh of the injection? I'm asking because if there is, one could write a simple script (or slightly more complex GUI) that interacts with said command while allowing easy editing of configuration files on the fly even while ingame through sliders and bool toggles.

That way a simple UI could be made that could allow you to keep working on the more important parts of vkBasalt, while increasing adoption rates for those less likely to edit .conf files manually and probably help speed up testing of shaders. Since it only sends a reset/refresh command, that project could be dropped later on when vkBasalt gains it's own GUI without actually being a detriment the main project.

vkcube segfault

specs

~ >>> inxi -bM                                                                                                                                                                                                                                              
System:    Host: mjb Kernel: 5.3.6-13-tkg-pds x86_64 bits: 64 Desktop: KDE Plasma 5.17.0 Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: ASUSTeK model: TUF B450M-PLUS GAMING v: Rev X.0x serial: <root required> 
           UEFI: American Megatrends v: 1201 date: 04/25/2019 
CPU:       6-Core: AMD Ryzen 5 2600 type: MT MCP speed: 2452 MHz min/max: 1550/3400 MHz 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] driver: amdgpu 
           v: kernel 
           Display: x11 server: X.Org 1.20.5 driver: amdgpu tty: N/A 
           OpenGL: renderer: Radeon RX 580 Series (POLARIS10 DRM 3.33.0 5.3.6-13-tkg-pds LLVM 9.0.0) 
           v: 4.5 Mesa 19.3.0-devel (git-48d617118a) 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 
Drives:    Local Storage: total: 1.59 TiB used: 1003.17 GiB (61.5%) 
Info:      Processes: 350 Uptime: 2d 18h 58m Memory: 15.63 GiB used: 4.10 GiB (26.2%) Shell: zsh inxi: 3.0.36

Tried with latest RADV:

~ >>> ENABLE_VKBASALT=1 vkcube                                                                                                                                                                                                                              
i am doing something
found graphic capable queue
1
queue 0x55b879c8cae0
queue 0x55b879c8cae0
queue 0x55b879c8cae0
format 50
format 50
device 0x55b879d56040
format 50
swapchain 0x55b879eb8070
Interrupted create swapchain
Interrupted get swapchain images 0
Interrupted get swapchain images 3
queue 0x55b879c8cae0
swapchain 0x55b879eb8070
format 50
device 0x55b879d56040
before creating descriptor Pool 
set count 3
after creating descriptor Pool 
before allocating descriptor Sets 1
before writing descriptor Sets 
before writing descriptor Sets 
before writing descriptor Sets 
0x7f5604f1ca60
0x55b879fc2840
0x8
0x55b87a1e7a20
0x55b87a2ab820
0x55b87a276ea0
after allocateCommandBuffer 
0x55b87a1e7a20
0x55b87a2ab820
0x55b87a276ea0
before begin commandbuffer 0x55b87a1e7a20
before command buffer step 1
before command buffer step 2
zsh: segmentation fault (core dumped)  ENABLE_VKBASALT=1 vkcube

With amdgpu-pro:

~ >>> VK_ICD_FILENAMES=/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json ENABLE_VKBASALT=1 vkcube                                                                                                                                                        [139]
i am doing something
found graphic capable queue
1
queue 0x55612f19a4b0
queue 0x55612f19a4b0
queue 0x55612f19a4b0
format 44
format 44
device 0x55612f179ee0
format 44
swapchain 0x55612f51b380
Interrupted create swapchain
Interrupted get swapchain images 0
Interrupted get swapchain images 3
queue 0x55612f19a4b0
swapchain 0x55612f51b380
format 44
device 0x55612f179ee0
before creating descriptor Pool 
set count 3
after creating descriptor Pool 
before allocating descriptor Sets 1
before writing descriptor Sets 
before writing descriptor Sets 
before writing descriptor Sets 
0x7f64fabbda40
0x7f64fabbda40
0
0x55612f2d1260
0x55612f2d7040
0x55612f27b7d0
after allocateCommandBuffer 
0x55612f2d1260
0x55612f2d7040
0x55612f27b7d0
before begin commandbuffer 0x55612f2d1260
before command buffer step 1
before command buffer step 2
zsh: segmentation fault (core dumped)  VK_ICD_FILENAMES=/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json =1 vkcube

Vulkan errors and crash when running the Witcher 3 with FXAA

I'm getting these errors and a crash when I try to run the Witcher 3 GOTY (GOG version) with FXAA enabled in my vkBasalt.conf, through Lutris (with WINE):

info:  Game: witcher3.exe
info:  DXVK: v1.5.5
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
warn:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
vkBasalt info:  config file: /usr/share/vkBasalt/vkBasalt.conf
vkBasalt info:  effects = fxaa
vkBasalt info:  fxaaQualitySubpix = 0.75
vkBasalt info:  fxaaQualityEdgeThreshold = 0.166
vkBasalt info:  fxaaQualityEdgeThresholdMin = 0
WARNING: radv is not a conformant vulkan implementation, testing use only.
info:  AMD RADV NAVI10 (LLVM 9.0.1):
info:    Driver: 19.3.4
info:    Vulkan: 1.1.107
info:    Memory Heap[0]: 
info:      Size: 7936 MiB
info:      Flags: 0x1
info:      Memory Type[0]: Property Flags = 0x1
info:    Memory Heap[1]: 
info:      Size: 256 MiB
info:      Flags: 0x1
info:      Memory Type[2]: Property Flags = 0x7
info:    Memory Heap[2]: 
info:      Size: 8176 MiB
info:      Flags: 0x0
info:      Memory Type[1]: Property Flags = 0x6
info:      Memory Type[3]: Property Flags = 0xe
info:  D3D11CoreCreateDevice: Probing D3D_FEATURE_LEVEL_11_0
info:  D3D11CoreCreateDevice: Using feature level D3D_FEATURE_LEVEL_11_0
info:  Device properties:
info:    Device name:     : AMD RADV NAVI10 (LLVM 9.0.1)
info:    Driver version   : 19.3.4
info:  Enabled device extensions:
info:    VK_EXT_depth_clip_enable
info:    VK_EXT_host_query_reset
info:    VK_EXT_memory_priority
info:    VK_EXT_shader_stencil_export
info:    VK_EXT_shader_viewport_index_layer
info:    VK_EXT_transform_feedback
info:    VK_EXT_vertex_attribute_divisor
info:    VK_KHR_create_renderpass2
info:    VK_KHR_depth_stencil_resolve
info:    VK_KHR_draw_indirect_count
info:    VK_KHR_driver_properties
info:    VK_KHR_image_format_list
info:    VK_KHR_sampler_mirror_clamp_to_edge
info:    VK_KHR_swapchain
info:  Device features:
info:    robustBufferAccess                     : 1
info:    fullDrawIndexUint32                    : 1
info:    imageCubeArray                         : 1
info:    independentBlend                       : 1
info:    geometryShader                         : 1
info:    tessellationShader                     : 1
info:    sampleRateShading                      : 1
info:    dualSrcBlend                           : 1
info:    logicOp                                : 1
info:    multiDrawIndirect                      : 1
info:    drawIndirectFirstInstance              : 1
info:    depthClamp                             : 1
info:    depthBiasClamp                         : 1
info:    fillModeNonSolid                       : 1
info:    depthBounds                            : 1
info:    multiViewport                          : 1
info:    samplerAnisotropy                      : 1
info:    textureCompressionBC                   : 1
info:    occlusionQueryPrecise                  : 1
info:    pipelineStatisticsQuery                : 1
info:    vertexPipelineStoresAndAtomics         : 0
info:    fragmentStoresAndAtomics               : 1
info:    shaderImageGatherExtended              : 1
info:    shaderStorageImageExtendedFormats      : 1
info:    shaderStorageImageReadWithoutFormat    : 1
info:    shaderStorageImageWriteWithoutFormat   : 1
info:    shaderClipDistance                     : 1
info:    shaderCullDistance                     : 1
info:    shaderFloat64                          : 1
info:    shaderInt64                            : 1
info:    variableMultisampleRate                : 1
info:  VK_EXT_conditional_rendering
info:    conditionalRendering                   : 1
info:  VK_EXT_depth_clip_enable
info:    depthClipEnable                        : 1
info:  VK_EXT_host_query_reset
info:    hostQueryReset                         : 1
info:  VK_EXT_memory_priority
info:    memoryPriority                         : 1
info:  VK_EXT_shader_demote_to_helper_invocation
info:    shaderDemoteToHelperInvocation         : 0
info:  VK_EXT_transform_feedback
info:    transformFeedback                      : 1
info:    geometryStreams                        : 1
info:  VK_EXT_vertex_attribute_divisor
info:    vertexAttributeInstanceRateDivisor     : 1
info:    vertexAttributeInstanceRateZeroDivisor : 1
info:  Queue families:
info:    Graphics : 0
info:    Transfer : 0
info:  DXVK: Read 2629 valid state cache entries
info:  DXVK: Using 5 compiler threads
warn:  DXGI: VK_FORMAT_D24_UNORM_S8_UINT -> VK_FORMAT_D32_SFLOAT_S8_UINT
Waiting on children
All children gone
Exit with returncode 0

This is my vkBasalt.conf:

effects = fxaa
fxaaQualitySubpix = 0.75
fxaaQualityEdgeThreshold = 0.166
fxaaQualityEdgeThresholdMin = 0

I have an AMD GPU, so I'm thinking that might have something to do with it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.