Skip to content

Chapter 1: Vulkan Init Code - VK_CHECK() custom macro only referenced in legacy guide, but used in modern guide. #142

@Fabxx

Description

@Fabxx

Would be better to include the code snippet of the VK_CHECK() function inside the modern guide as well, since there are no references or links to where to find the definition of this function. Can lead users to think they did something wrong, or that there is a missing dependency.

A suggested alternative would be to scratch the custom macro, and define the functions inside vk_init.hpp where we have helper functions.

VkResult vkInit::VK_CHECK(VkResult x) {
	if (x != VK_SUCCESS) {
		std::cerr << "Error occurred: " << x << "\n";
                abort();
	}
	return x;
}

and then:

namespace vkInit {
        VkCommandPoolCreateInfo poolInfo(VkCommandPoolCreateFlagBits flags);
        VkCommandBufferAllocateInfo commandBufferInfo();
        VkResult VK_CHECK(VkResult x);

       // other helper functions
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions