Error checking [skip CI]
This commit is contained in:
parent
beab768ffd
commit
d26fb8831e
1 changed files with 3 additions and 2 deletions
|
|
@ -107,7 +107,7 @@ namespace vks
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Model {
|
struct Model {
|
||||||
VkDevice device;
|
VkDevice device = nullptr;
|
||||||
vk::Buffer vertices;
|
vk::Buffer vertices;
|
||||||
vk::Buffer indices;
|
vk::Buffer indices;
|
||||||
uint32_t indexCount = 0;
|
uint32_t indexCount = 0;
|
||||||
|
|
@ -133,7 +133,8 @@ namespace vks
|
||||||
|
|
||||||
/** @brief Release all Vulkan resources of this model */
|
/** @brief Release all Vulkan resources of this model */
|
||||||
void destroy()
|
void destroy()
|
||||||
{
|
{
|
||||||
|
assert(device);
|
||||||
vkDestroyBuffer(device, vertices.buffer, nullptr);
|
vkDestroyBuffer(device, vertices.buffer, nullptr);
|
||||||
vkFreeMemory(device, vertices.memory, nullptr);
|
vkFreeMemory(device, vertices.memory, nullptr);
|
||||||
if (indices.buffer != VK_NULL_HANDLE)
|
if (indices.buffer != VK_NULL_HANDLE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue