diff options
| author | hachem <im@hachem.wtf> | 2026-09-22 06:40:02 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-22 06:40:02 +0200 |
| commit | e321beb543311dcb591942ec42464e38cbeae0f0 (patch) | |
| tree | 1b0c1a9747d19a2cb74ad09a0365c139ef36b5d4 /src/platform/vulkan/vulkan_common.h | |
| parent | 53fa01afb052fd64c99e87fd53c22654e796b64f (diff) | |
fix: Vulkan backend on Windows
Diffstat (limited to 'src/platform/vulkan/vulkan_common.h')
| -rw-r--r-- | src/platform/vulkan/vulkan_common.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/platform/vulkan/vulkan_common.h b/src/platform/vulkan/vulkan_common.h index 4f93fdc..2c778c1 100644 --- a/src/platform/vulkan/vulkan_common.h +++ b/src/platform/vulkan/vulkan_common.h @@ -171,6 +171,7 @@ namespace Donut::RHI auto bind_pipeline(Pipeline* p) -> void override { m_pipe = static_cast<VkPipelineR*>(p); + if (!m_pipe || m_pipe->m_pipeline == VK_NULL_HANDLE) { m_pipe = nullptr; return; } vkCmdBindPipeline(m_cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipe->m_pipeline); } auto set_viewport(int x, int y, int w, int h, bool flip_y) -> void override @@ -200,9 +201,9 @@ namespace Donut::RHI auto bind_index_buffer(Buffer* ib) -> void override { vkCmdBindIndexBuffer(m_cmd, static_cast<VkBufferR*>(ib)->m_buf, 0, VK_INDEX_TYPE_UINT32); } auto draw(uint32_t vertex_count) -> void override - { flush_descriptors(); vkCmdDraw(m_cmd, vertex_count, 1, 0, 0); } + { if (!m_pipe) return; flush_descriptors(); vkCmdDraw(m_cmd, vertex_count, 1, 0, 0); } auto draw_indexed(uint32_t index_count) -> void override - { flush_descriptors(); vkCmdDrawIndexed(m_cmd, index_count, 1, 0, 0, 0); } + { if (!m_pipe) return; flush_descriptors(); vkCmdDrawIndexed(m_cmd, index_count, 1, 0, 0, 0); } auto flush_descriptors() -> void { |
