martty / vuk Goto Github PK
View Code? Open in Web Editor NEWvuk - A rendergraph-based abstraction for Vulkan
License: MIT License
vuk - A rendergraph-based abstraction for Vulkan
License: MIT License
When allocating eGPUonly
buffers, vuk uses the device-local memory. This limits usage on integrated GPUs, which usually have very little dedicated memory, and a large amount of shared memory. As an example, the Ryzen 5900HX has 512MB device-local memory and 8GB shared memory.
A workaround is to always use eCPUtoGPU
when running on an integrated GPU. It would be nice though if the vuk user didn't have to care about whether the host device is integrated or dedicated.
Assert if using a compute pipeline in a graphics pass and vice versa.
Adreno devices do not support VkPhysicalDeviceBufferDeviceAddressFeaturesKHR.bufferDeviceAddressCaptureReplay
. If we could conditionally disable BDA, we could use RenderDoc to debug code running on Adreno devices
Relates to #65
Add includes for GLSL :)
PipelineBaseCreateInfo
functions like add_spirv()
currently take the source as std::vector
. This makes sense for sources loaded at runtime, but requires a needless copy if the sources are embedded in the executable. These functions could have variants that accept a std::span
, with the requirement that the underlying buffer will live as long as the vuk context. This is low priority but would reduce API friction a little in this scenario.
This would probably need a change to ShaderSource
so that it owns a span and optionally a vector of data.
vuk::LegacyGPUAllocator::noop_cb
trues to use setdebugutilsnameext
to set the name of a VkMemory, but this function isn't always available
I propose adding operator+
for vuk::Name
, which returns a new concatenated Name with an optional joiner string in between (underscore sounds like a sensible default.) It could also be an alternate constructor taking two Name arguments.
The purpose is to support basic scoping of rendergraph identifiers. Currently, it is difficult to create rendergraph components that can be appended to a rendergraph more than once, because of resource name collisions. Concatenation would allow for an interface where the component itself is passed a Name on creation, and it uses that name as a prefix for all the resources it creates.
Hello, I'm currently using this library to help with the vulkan work in a OpenXR renderer, I'd like to be able to use this vulkan extension, but requires that I pass extra info into the VkRenderPassCreateInfo::pNext. Is this possible with vuk, right now?
I'm looking into using VUK on Android and I've hit a couple problems
The biggest one is that VUK seems to rely on extensions that aren't available on Android, such as VK_KHR_synchronization2
and VK_KHR_timeline_semaphore
. How much does VUK actually rely on these? Would I have to change some core parts of the library to remove them?
Steps to reproduce:
vuk_all_examples
exampleResult (This one happens after pressing the 05_position
button in the deferred example):
$ ../../../../build/vuk_all_examples
[WARNING: General](user defined)
terminator_CreateInstance: Failed to CreateInstance in ICD 1. Skipping ICD.
[WARNING: Performance](user defined)
Validation Performance Warning: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x5625759b1f40, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | vkCmdBlitImage: For optimal performance VkImage 0x5ef3070000000063[] layout should be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL instead of GENERAL.
[WARNING: Performance](user defined)
Validation Performance Warning: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x562576106730, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | vkCmdBlitImage: For optimal performance VkImage 0x33f7660000000075[] layout should be VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL instead of GENERAL.
[ERROR: Validation](user defined)
Validation Error: [ UNASSIGNED-CoreValidation-DrawState-DescriptorSetNotBound ] Object 0: handle = 0x562575b6c940, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xcde11083 | vkCmdDispatch(): VkPipeline 0x4e6ce70000004c37[Pipeline:stupidsort.comp] uses set #4 but that set is not bound.
/usr/include/c++/11.2.0/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = LAST_BOUND_STATE::PER_SET; _Alloc = std::allocator<LAST_BOUND_STATE::PER_SET>; std::vector<_Tp, _Alloc>::reference = LAST_BOUND_STATE::PER_SET&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Aborted (core dumped)
Happens on my Linux Manjaro system using an AMD card.
Currently, Vuk loads the function pointers for the debug utils functions itself. This fails on my system. My Android phone does not provide the debug utils extension itself, so trying to load the function pointers from the system fails
Volk is able to load the function pointers for the debug utils functions just fine, however. The Vulkan validation layers provide the debug utils extension for systems such as mine, and Volk is able to load the debug utils functions from those layers. I'm not entirely sure how Volk does it
I've gotten unblocked locally by changing the places where Vuk uses debug utils functions to use the function pointers from Volk
It's unsigned long on 64-bit Linux and causes e.g. src/Allocator.cpp:492 to error
Most CommandBuffer
member functions, like bind_buffer
, can take either a Buffer
or a Name
. Some of them though, like bind_index_buffer
or draw_indexed_indirect
, take only a Buffer
, and that needs to be worked around with the verbose *cmd.get_resource_buffer("bufferName")
. Would be nice to have full feature parity for names here.
Seems that because I FetchContent'd VMA into my project, subsequently trying to compile VUK broke from it already being a target. Not sure how to fix it.
Please provide documentation somewhere with all the Vulkan features that VUK requires. Currently I have to look at the examples and hope the features they enable are truly needed
D:\workspace\graphics_dev\vuk\examples\build>cmake --build .
[41/148] Building CXX object CMakeFiles\vuk_all_examples.dir\01_triangle.cpp.obj
FAILED: CMakeFiles/vuk_all_examples.dir/01_triangle.cpp.obj
"D:\Program_Filesx86\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe" /nologo /TP -DGLM_ENABLE_EXPERIMENTAL -DGLM_FORCE_DEPTH_ZERO_TO_ONE -DGLM_FORCE_EXPLICIT_CTOR -DGLM_FORCE_RADIANS -DGLM_FORCE_SIZE_FUNC -ID:\workspace\graphics_dev\vuk\examples\build\_deps\vk-bootstrap-src\src -ID:\SDKs\VulkanSDK\1.3.204.0\Include -ID:\workspace\graphics_dev\vuk\examples\build\_deps\glfw-src\include -ID:\workspace\graphics_dev\vuk\examples\build\_deps\glm-src\glm\.. -ID:\workspace\graphics_dev\vuk\examples\..\ext\stb -ID:\workspace\graphics_dev\vuk\examples\..\ext\imgui -ID:\workspace\graphics_dev\vuk\examples\..\ext\plf_colony -ID:\workspace\graphics_dev\vuk\examples\..\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /std:c++latest /permissive- /Zc:char8_t- /showIncludes /FoCMakeFiles\vuk_all_examples.dir\01_triangle.cpp.obj /FdCMakeFiles\vuk_all_examples.dir\ /FS -c D:\workspace\graphics_dev\vuk\examples\01_triangle.cpp
D:\workspace\graphics_dev\vuk\examples\build\_deps\vk-bootstrap-src\src\VkBootstrap.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
D:\workspace\graphics_dev\vuk\examples\01_triangle.cpp(21): error C2039: 'add_glsl': is not a member of 'vuk::PipelineBaseCreateInfo'
D:\workspace\graphics_dev\vuk\include\vuk\Pipeline.hpp(62): note: see declaration of 'vuk::PipelineBaseCreateInfo'
D:\workspace\graphics_dev\vuk\examples\01_triangle.cpp(22): error C2039: 'add_glsl': is not a member of 'vuk::PipelineBaseCreateInfo'
D:\workspace\graphics_dev\vuk\include\vuk\Pipeline.hpp(62): note: see declaration of 'vuk::PipelineBaseCreateInfo'
[42/148] Building CXX object CMakeFiles\vuk_example_01_triangle.dir\01_triangle.cpp.obj
Simplify VMA code for this.
When a few specific requirements are met, memory is not freed as expected:
DeviceFrameResource
,eGPUonly
,eCPUtoGPU
.This leaks all allocated memory (it's not freed after the "frames in flight" number of frames), which leads to VRAM exhaustion within about a second.
The issue is not related to the recent large allocation support (997ad59), behavior is the same even before that commit.
I am currently trying to use vuk in conjunction with the VK_EXT_descriptor_buffer. Currently, I have shader code that resembles this:
layout (set = 0, binding = 0) buffer model_payload_buffer
{
model_payload models[OBJECT_COUNT];
};
layout (set = 0, binding = 1) uniform scene_payload_buffer
{
mat4 projection;
mat4 view;
};
layout (set = 0, binding = 2) uniform texture2D texture_buffer[IMAGE_COUNT];
layout (set = 0, binding = 3) uniform sampler sampler_buffer[SAMPLER_COUNT];
When I go to draw with vuk, it tries to validate descriptor bindings and fails. I would like to have a mechanism to:
Currently, there is no way to poll if a Future has completed - this can be useful to avoid needing to spawn threads just to wait.
Cannot open include file: 'span': No such file or directory
windows 10 with vs2017
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.