blurrypiano / littleVulkanEngine

Code repo for video tutorial series teaching Vulkan and computer graphics
MIT License
829 stars 147 forks source link

[FEEDBACK] Tutorial 21 Possible Cause of Runtime Error : Brendan Galea #25

Closed yeokaiwei closed 2 years ago

yeokaiwei commented 2 years ago

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)); //<----

Bug1 Bug2

blurrypiano commented 2 years ago

... you can't move the same variable twice that's why you get a runtime error. Of course if you make a typo you will get an error, this isn't an issue worth sharing.

I've also told before that for issues like this to not post on the github repo, unless there's an actual problem with the code. Something like his can be shared in the youtube comments or on the discord, this isn't the place for it.

I appreciate that you are finding the tutorials useful and really don't want to come across as being rude, but please post in the correct location.