blurrypiano / littlevulkanengine Goto Github PK
View Code? Open in Web Editor NEWCode repo for video tutorial series teaching Vulkan and computer graphics
License: MIT License
Code repo for video tutorial series teaching Vulkan and computer graphics
License: MIT License
Because vulkan has such a beautiful eco system with SDK libraries that are open source you can integrate that directly inside your environment. To do that I use CPM: cmake/CPM.cmake:
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
set(CPM_DOWNLOAD_VERSION 0.38.7)
set(CPM_HASH_SUM "83e5eb71b2bbb8b1f2ad38f1950287a057624e385c238f6087f94cdfc44af9c5")
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
)
include(${CPM_DOWNLOAD_LOCATION})```
With that you can download the lunar-G and glfw3 and other dependencies in the most recent version:
```include(cmake/CPM.cmake)
set(khronos_version v1.3.272)
set(vulkan_sdk vulkan-sdk-1.3.268.0)
CPMAddPackage(
NAME GLFW
GITHUB_REPOSITORY glfw/glfw
GIT_TAG 3.3.8
OPTIONS
"GLFW_BUILD_TESTS OFF"
"GLFW_BUILD_EXAMPLES OFF"
"GLFW_BULID_DOCS OFF")
CPMAddPackage(
NAME VulkanHeaders
GITHUB_REPOSITORY KhronosGroup/Vulkan-Headers
GIT_TAG ${khronos_version}
)
# Vulkan-Headers defines a header target but not one for the module.
if(VulkanHeaders_ADDED)
add_library(VulkanModule INTERFACE)
## this only applies with gcc-14 and clang-17? and most recent cl...
##target_sources(VulkanModule
## PUBLIC FILE_SET CXX_MODULES
## BASE_DIRS "${VulkanHeaders_SOURCE_DIR}/include"
## FILES "${VulkanHeaders_SOURCE_DIR}/include/vulkan/vulkan.cppm"
## )
target_compile_features(VulkanModule INTERFACE cxx_std_23)
target_compile_definitions(VulkanModule INTERFACE
VULKAN_HPP_NO_CONSTRUCTORS=1
VULKAN_HPP_NO_STRUCT_CONSTRUCTORS=1
VULKAN_HPP_NO_STRUCT_SETTERS=1
# Your options here, project-dependent:
# https://github.com/KhronosGroup/Vulkan-Hpp#configuration-options
)
target_link_libraries(VulkanModule INTERFACE Vulkan::Headers)
endif()
CPMAddPackage(NAME robin_hood
GITHUB_REPOSITORY martinus/robin-hood-hashing
GIT_TAG 3.11.5
)
CPMAddPackage(NAME VulkanUtilityLibraries
GITHUB_REPOSITORY KhronosGroup/Vulkan-Utility-Libraries
GIT_TAG ${khronos_version}
OPTIONS
"BUILD_TESTS OFF"
"BUILD_EXAMPLES OFF"
)
CPMAddPackage(NAME SPIRV-Headers
GITHUB_REPOSITORY KhronosGroup/SPIRV-Headers
GIT_TAG ${vulkan_sdk}
)
CPMAddPackage(NAME SPIRV-Tools
GITHUB_REPOSITORY KhronosGroup/SPIRV-Tools
GIT_TAG ${vulkan_sdk}
OPTIONS
"robin_hood_DIR ${robin_hood_SOURCE_DIR}"
)
CPMAddPackage(NAME VulkanValidationLayers
GITHUB_REPOSITORY KhronosGroup/Vulkan-ValidationLayers
GIT_TAG ${khronos_version}
OPTIONS
"BUILD_TESTS OFF"
)
CPMAddPackage(NAME glslang
GITHUB_REPOSITORY KhronosGroup/glslang
GIT_TAG ${vulkan_sdk}
)
## TODO GLM is missing here
get_target_property(GLSLANG_PATH glslang-standalone BINARY_DIR)
set(GLSLANG_NAME "glslang-standalone")
get_target_property(GLSLANG_NAME glslang-standalone OUTPUT_NAME)
function(create_spirv target in)
cmake_path(GET in STEM name)
cmake_path(GET in EXTENSION ext)
if(ext STREQUAL ".frag")
set(name "${name}_frag")
elseif(ext STREQUAL ".vert")
set(name "${name}_vert")
endif()
set(out ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
set(in ${CMAKE_CURRENT_SOURCE_DIR}/${in})
add_custom_command(OUTPUT ${out}
COMMAND ${GLSLANG_PATH}/${GLSLANG_NAME} --target-env vulkan1.0 -x --vn ${name} -o ${out} ${in}
DEPENDS ${in}
glslang-standalone)
target_sources(${target} PRIVATE ${out})
target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
endfunction()
Vulkan does not link for me on macOS with target_link_libraries(${PROJECT_NAME} glfw ${Vulkan_LIBRARIES})
CMakeLists.txt#L105.
If I amend the target_link_libraries
to include Vulkan::Vulkan
, it works fine.
ccmake -GNinja ..
finds the Vulkan library okay:
Vulkan_GLSLANG_VALIDATOR_EXECU /Users/junglie85/VulkanSDK/1.2.182.0/macOS/bin/glslangValidator
Vulkan_GLSLC_EXECUTABLE /Users/junglie85/VulkanSDK/1.2.182.0/macOS/bin/glslc
Vulkan_INCLUDE_DIR /Users/junglie85/VulkanSDK/1.2.182.0/macOS/include
Vulkan_LIBRARY /Users/junglie85/VulkanSDK/1.2.182.0/macOS/lib/libvulkan.dylib
I'm on an M1 MacBook Pro, which I've found can have some slight oddities, but not sure why linking fails in this case.
¯_(ツ)_/¯
I'm watching your tutorial on the Vulkan Game Engine Tutorial, but after completing the 13th tutorial, I realise a problem. even re-watching the this episode multiple time, when I resize the window, the cube always stay at the same position from the corner of the screen [image for reference]
I believe the problem comes from the fact that I'm using Windows11 compare to you on Apple, but I do not know how I can solve this issues. inspecting the variable when running the code, I can see that the windowExtent and swapChainExtant never changes, no matter if I scale it up or down. the code of those two has already been inspected, so the problem also isn't comming from there, do you have any idea or suggestion on what is the problem and how to solve it?
if you want any more information, I'll be happy to oblige
[Edit1] if I put a Breakpoint at the FramebufferResizeCallback, I can see that the size of vulWindow does change, but this information doesn't really help me -> if the new size is given, then why does it return back latter on?
[Edit2] I realise that the VK_ERROR_OUT_OF_DATE_KHR error was never called, so the swapChain cannot recreate itself (I don't know what information you need to help me so I'm giving everything I can think of)
Hi, I got stucked in Tut8, after I edited all the codes there are three linking errors and I cannot figure out where is wrong
Here are the build output:
Build started...
1>------ Build started: Project: VulkanEngine, Configuration: Debug Win32 ------
1>first_app.cpp
1>lve_model.cpp
1>lve_pipeline.cpp
1>lve_window.hpp
1>lve_window.cpp
1>main.cpp
1>lve_device.cpp
1>lve_swap_chain.cpp
1>D:\Dev\Vulkan\LittleVulkanEngine\VulkanEngine\VulkanEngine\lve_swap_chain.cpp(46,27): warning C4018: '<': signed/unsigned mismatch
1>D:\Dev\Vulkan\LittleVulkanEngine\VulkanEngine\VulkanEngine\lve_swap_chain.cpp(266,27): warning C4018: '<': signed/unsigned mismatch
1>lve_model.hpp
1>Generating Code...
1>Debug\lve_window.obj : warning LNK4042: object specified more than once; extras ignored
1>Debug\lve_model.obj : warning LNK4042: object specified more than once; extras ignored
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>first_app.obj : error LNK2019: unresolved external symbol "public: __thiscall lve::LveWindow::LveWindow(int,int,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (??0LveWindow@lve@@QAE@HHV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) referenced in function "public: __thiscall lve::FirstApp::FirstApp(void)" (??0FirstApp@lve@@QAE@XZ)
1>first_app.obj : error LNK2019: unresolved external symbol "public: __thiscall lve::LveWindow::~LveWindow(void)" (??1LveWindow@lve@@QAE@XZ) referenced in function __unwindfunclet$??0FirstApp@lve@@QAE@XZ$1
1>lve_device.obj : error LNK2019: unresolved external symbol "public: void __thiscall lve::LveWindow::createWindowSurface(struct VkInstance_T *,unsigned __int64 *)" (?createWindowSurface@LveWindow@lve@@QAEXPAUVkInstance_T@@PA_K@Z) referenced in function "private: void __thiscall lve::LveDevice::createSurface(void)" (?createSurface@LveDevice@lve@@AAEXXZ)
1>D:\Dev\Vulkan\LittleVulkanEngine\VulkanEngine\Debug\VulkanEngine.exe : fatal error LNK1120: 3 unresolved externals
1>Done building project "VulkanEngine.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
validation layer: vkCreateInstance: Found drivers that contain devices which support the portability subset, but the portability enumeration bit was not set! Applications that wish to enumerate portability drivers must set the VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR bit in the VkInstanceCreateInfo flags and enable the VK_KHR_portability_enumeration instance extension.
validation layer: vkCreateInstance: Found no drivers!
libc++abi: terminating with uncaught exception of type std::runtime_error: failed to create instance!
MacBook Pro
mac os 12.6.3
vulkan 1.3.239.0
I felt that reporting this would help other developers who might run into the same issue with undecipherable errors. The code will build and run with no error reported. However, mid-way you will run into the error in the attached image.
If you accidentally leave attributeDescriptions ie 2 instead of 1,
std::vector<VkVertexInputAttributeDescription> attributeDescriptions(1);
std::vector<VkVertexInputAttributeDescription> attributeDescriptions(2);
you will get the following undecipherable error saying that it "has triggered a breakpoint"
The solution is obviously to set attributeDescriptions(2);
Some peculiar bug that may occur if you accidentally make a typo with gameObjects.push_back(std::move(quad));
. the code will build but when you try to run it. You will get a weird runtime error with vkCmdBindVertexBuffers(commandBuffer, 1, 0, offsets);
ERROR
lveModel = LveModel::createModelFromFile(lveDevice, "models/quad.obj");
auto quad = LveGameObject::createGameObject();
quad.model = lveModel;
quad.transform.translation = { 0.5f, 0.5f, 0.0f };
quad.transform.scale = { 3.0f,1.5f,3.0f };
gameObjects.push_back(std::move(smoothVase)); //<----
Hi Brendan,
I just wanted to post this here to let you know of potential issue with Tutorial 18.
Polka dotted vases using Visual Studio 2019.
I've tried comparing your code and mine but I can't seem to see where the error is.
As always, Youtube does not allow me to upload images, so I felt it was best that you could see it yourself.
The error says, "CMake Error at CMakeLists.txt:47 (find_package):
By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "glfw3", but
CMake did not find one.
Could not find a package configuration file provided by "glfw3" (requested
version 3.3) with any of the following names:
glfw3Config.cmake
glfw3-config.cmake
Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
"glfw3_DIR" to a directory containing one of the above files. If "glfw3"
provides a separate development package or SDK, be sure it has been
installed."
I made sure to update the .env file and I looked through the CMakeLists to make sure that all the paths were correct.
While it is good to know how to natively allocate buffers in vulkan, IMO it would be good to also teach vulkan with a memory allocator, such as vulkan memory allocator, as any real world vulkan app would almost certainly use a mem allocator.
Great series. I'm following it on YouTube and implementing in Python.
I've got to the end of Command Buffers Overview but when I run the application my whole window is filled with red. There are no errors and no validation layer errors until I close the window.
I don't know enough Vulkan to understand why this would be the case and wondered if you had any advice on why this might be the case or how to approach debugging it?
At numerous occasions in the tutorial you made it clear that it is important to delete the copy constructors. I find that using some sort of NoCopy
class to inherit from is more convenient than doing it manually:
class NoCopy
{
public:
NoCopy(NoCopy const&) = delete;
NoCopy& operator=(NoCopy const&) = delete;
NoCopy() = default;
};
For any other class you can simply inherit privately:
class LveDevice : NoCopy {
...
}
Whether or not you find this helpful, thanks so much for the high quality videos <3
Hello! I get this error:
validation layer: Validation Error: [ VUID-VkGraphicsPipelineCreateInfo-alphaToCoverageEnable-08891 ] | MessageID = 0xd9edb6c4 | vkCreateGraphicsPipelines(): pCreateInfos[0].pDepthStencilState is NULL when rasterization is enabled and subpass uses a depth/stencil attachment. The Vulkan spec states: If the pipeline is being created with fragment shader state, the VkPipelineMultisampleStateCreateInfo::alphaToCoverageEnable is not ignored and is VK_TRUE, then the Fragment Output Interface must contain a variable for the alpha Component word in Location 0 at Index 0 (https://vulkan.lunarg.com/doc/view/1.3.268.0/windows/1.3-extensions/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-alphaToCoverageEnable-08891)
From what I understand:
VkPipelineMultisampleStateCreateInfo::alphaToCoverageEnable is written in as "VK_FALSE" but due to using a "Fragment Shader State" it ignores that flag and enables it.
I am unsure to exactly what it means or what to do about it. I am doing exactly as it states, I am unsure if there is any other way to go about it or if I missed something.
Thank you, Nicholas.
Hello,
Why don't you use branches to split the different chapters of your tutorials, so we would have tuto-01
branch, etc... ?
It would be also easier on your side to maintain and modify the code from all different versions, without having to stock all the versions, cause we'll only want to use one, even if we change. So we could easily do :
# active branch : tuto-01
$ make && ./a.out
$ git checkout tuto-02 # change tuto version
$ make && ./a.out
So we're on the same solution, but we don't stock all the version in the same directory, and we can run really easily and fastly all the version as we want.
Hi,
I am following your tutorial, which is great, thanks a lot!
So, I've spotted a problem with PipelineConfigInfo LvePipeline::defaultPipelineConfigInfo(uint32_t width, uint32_t height);
function. This generates a self-referencing structure that contains pointers to its own members. When returning the structure a copy is performed (at least with MS Visual Studio compiler I use, perhaps clang implements return move optimisation here), so that the PipelineConfigInfo
structure pointers become invalid.
This can be fixed by changing the signature to
static void defaultPipelineConfigInfo(PipelineConfigInfo& configInfo, uint32_t width, uint32_t height);
or similar.
Also the validation layer complains that viewportInfo.flags
, multisampleInfo.flags
, and depthStencilInfo.flags
have not been set to zero.
In tutorial shader modules destroed after create Graphics Pipelines(https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Shader_modules). What a reason why in this code we destroed in destructor?
Why not like this:
void LvePipeline::createGraphicsPipeline(
const std::string& vertFilepath,
const std::string& fragFilepath,
const PipelineConfigInfo& configInfo
) {
//... skip the code that is not relevant to the question
VkShaderModule vertShaderModule = createShaderModule(vertCode);
VkShaderModule fragShaderModule = createShaderModule(fragCode);
//... skip the code that is not relevant to the question
if (vkCreateGraphicsPipelines(
lveDevice.device(),
VK_NULL_HANDLE,
1,
&pipelineInfo,
nullptr,
&graphicsPipeline
) != VK_SUCCESS)
{
throw std::runtime_error("failed to create graphics pipeline");
}
vkDestroyShaderModule(lveDevice.device(), vertShaderModule, nullptr);
vkDestroyShaderModule(lveDevice.device(), fragShaderModule, nullptr);
}
Or have a reason for store modules in class LvePipeline
?
In the descriptor header is a bug: an unordered map does not guarantee its order or that index_n + 1 = index_{n + 1} when iterating. For Vulkan the bindings must be in order so you should use something like ordered_map. Also in vulkan its perfectly valid to not specify a binding in a set layout which would not be possible here.
LveDescriptorSetLayout::LveDescriptorSetLayout(
LveDevice &lveDevice, std::unordered_map<uint32_t, VkDescriptorSetLayoutBinding> bindings)
: lveDevice{lveDevice}, bindings{bindings} {
std::vector<VkDescriptorSetLayoutBinding> setLayoutBindings{};
for (auto kv : bindings) {
setLayoutBindings.push_back(kv.second);
}
VkDescriptorSetLayoutCreateInfo descriptorSetLayoutInfo{};
descriptorSetLayoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
descriptorSetLayoutInfo.bindingCount = static_cast<uint32_t>(setLayoutBindings.size());
descriptorSetLayoutInfo.pBindings = setLayoutBindings.data();
if (vkCreateDescriptorSetLayout(
lveDevice.device(),
&descriptorSetLayoutInfo,
nullptr,
&descriptorSetLayout) != VK_SUCCESS) {
throw std::runtime_error("failed to create descriptor set layout!");
}
Hi Brenda,
I can't get the same results with windows resizing as Tutorial 11 in Visual Studio 2019.
What happens is that when you try to resize, the app stops running and the triangle stops rotating.
If you contract and expand the window, "artifacts" will remain and black zones with appear.
Once you release the mouse click, the window will resize and the app resets correctly.
I've attached a video to let you see what it is.
Is this Windows specific?
First off, thank you so much for these videos! I've been following along very well, but I've been getting these validation layer warnings and I'm not sure what to do with them. Ideas?
validation layer: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] Object 0: handle = 0x600003346de0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID = 0x3a3b6ca0 | vkCreateDevice: VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x600003346de0[] supports it The Vulkan spec states: If the VK_KHR_portability_subset extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensionNames must include "VK_KHR_portability_subset" (https://vulkan.lunarg.com/doc/view/1.3.211.0/mac/1.3-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pProperties-04451)
validation layer: vkCreateDevice: Attempting to create a VkDevice from a VkPhysicalDevice which is from a portability driver without the VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR bit in the VkInstanceCreateInfo flags being set and the VK_KHR_portability_enumeration extension enabled. In future versions of the loader this VkPhysicalDevice will not be enumerated.
Also, after making the changes for Lesson 5, I'm getting a "EXC_BAD_ACCESS (code=1, address=0x30)" when trying to create the pipeline. I'm wondering if it is related to these validation warnings or something I messed up in following along.
All advice most appreciated!
i recently began refactoring and rewriting my vulkan engine which i began following your tutorial and i either dont understand vulkan or you forgot the buffer alignment on writeToBuffer(...)
.
your code:
void Buffer::writeToBuffer(const void* data, const VkDeviceSize size, const VkDeviceSize data_offset, const VkDeviceSize mapped_offset) const {
assert(mapped && "writeToBuffer: Cannot copy to unmapped buffer");
if(size == VK_WHOLE_SIZE) memcpy(mapped, data, bufferSize);
else memcpy(static_cast<char*>(mapped) + mapped_offset, static_cast<const char*>(data) + data_offset, size);
}
the thing is that the buffer is (as far as i understood) aligned with "data, padding, ..." because buffer size = alignmentSize * instance_count
. So on writeToBuffer you should either document that you want the padding (which would be weird to anticipate since the buffer should take care of it) or you copy the elements one by one and insert padding every time. This also would create problems if you want to index into the buffer when only rendering half a model or multiple models in a buffer or whatever since these calculations would have to know the buffer alignment size
The thing is that i dont think thats even required since (im speculating i dont know for sure) the alignment size should only be relevant for the whole buffer size because its allocated all at once. If thats right you can create the buffer with only some very small padding at the end by calculating padding = minAlignmentSize - bufferSize % minAlignmentSize
and adding this to the total buffer size. This would also remove the need for additional padding insertion between the elements and every calculation requirement that would come with it
would be nice if you could answer soon :)
and also this was an amazing tutorial very well done and explained. i could have never understood vulkan without this
Hello,
After doing the tutorial 3 & 4, even the 5, an issue persists in VS19.
in pipeline.cpp :: createGraphicsPipeline :
if (vkCreateGraphicsPipelines(lveDevice.device(), VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &graphicsPipeline) != VK_SUCCESS) {
throw std::runtime_error("Failed to create graphics pipeline");
}
Then :
# -- in the console --
Exception thrown at 0x00007FF9C850737B (nvoglv64.dll) in VulkanDemo.exe: 0xC0000005: Access violation reading location 0x0000000000000066.
# -- in a popup, next to the corresponding line --
read access violation : rpstate->_Ptr was nullptr.
I've fixed the self-referencing structure issue, and I've done the t05, but this issue has not been fixed.
If you want more (or specific) code, just ask me.
When I run the tutorial 08 code, I get the following validation layer error that vkBeginCommandBuffer
is being called on an active command buffer. I get the same error when running my own version of the code, but instead of getting it for a single command buffer it occurs for all 3 command buffers.
validation layer: Validation Error: [ VUID-vkBeginCommandBuffer-commandBuffer-00049 ] Object 0: handle = 0x6000029add58, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x84029a9f | Calling vkBeginCommandBuffer() on active VkCommandBuffer 0x6000029add58[] before it has completed. You must check command buffer fence before this call. The Vulkan spec states: commandBuffer must not be in the recording or pending state (https://vulkan.lunarg.com/doc/view/1.2.182.0/mac/1.2-extensions/vkspec.html#VUID-vkBeginCommandBuffer-commandBuffer-00049)
validation layer: Validation Error: [ VUID-vkBeginCommandBuffer-commandBuffer-00049 ] Object 0: handle = 0x6000029ade28, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x84029a9f | Calling vkBeginCommandBuffer() on active VkCommandBuffer 0x6000029ade28[] before it has completed. You must check command buffer fence before this call. The Vulkan spec states: commandBuffer must not be in the recording or pending state (https://vulkan.lunarg.com/doc/view/1.2.182.0/mac/1.2-extensions/vkspec.html#VUID-vkBeginCommandBuffer-commandBuffer-00049)
validation layer: Validation Error: [ VUID-vkBeginCommandBuffer-commandBuffer-00049 ] Object 0: handle = 0x6000029adef8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x84029a9f | Calling vkBeginCommandBuffer() on active VkCommandBuffer 0x6000029adef8[] before it has completed. You must check command buffer fence before this call. The Vulkan spec states: commandBuffer must not be in the recording or pending state (https://vulkan.lunarg.com/doc/view/1.2.182.0/mac/1.2-extensions/vkspec.html#VUID-vkBeginCommandBuffer-commandBuffer-00049)
I can make the error go away by adding vkWaitDeviceIdle()
in the main loop after draw_frame()
. Both LveSwapChain::acquireNextImage()
and LveSwapChain::submitCommandBuffers()
wait for the fences but this doesn't seem to have the correct effect now that buffers are being recorded each frame rather than once at command buffer creation.
I note that in the relevant tutorial video, these validation errors do not show.
Relevant specs:
==========
VULKANINFO
==========
Vulkan Instance Version: 1.2.182
Presentable Surfaces:
=====================
GPU id : 0 (Apple M1)
Hi!
I get an acess violation when I bind my commandBuffer (pipeline->bind(commandBuffers[i]))
My buffer isn't empty and everytime I try to access it after the vkCmdBeginRenderPass, I get the same error.
(Before this line, I don't get the access violation).
Does anyone know how to deal with this issue ?
I absolutely love the tutorial so far and i hope it continues and i am just wondering if you will cover how to render 2d sprites?
I would assume that getAlignmentSize() is suposed to return alignmentSize and not instanceSize?
Hi,
I just wanted to give some feedback on Tutorial 02.
I thought I should share it with everyone, just in case they made the same mistake I did.
I made a small mistake with capitalization and the compiler error message will be very confusing.
In 19:15 of your video, you want to create an instance of LvePipeline.
However, if you accidentally type in "LvePipeline" instead of "lvePipeline", you will create a member function instead of creating an instance.
Severity Code Description Project File Line Suppression State
Error C2059 syntax error: 'string' vlkGameEngine C:\Users\user\source\repos\vlkGameEngine\vlkGameEngine\first_app.h 20
Thanks.
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.