fixing vulkan loader, moving vulkan pfns to RenderCore

This commit is contained in:
2024-09-20 16:14:14 +02:00
parent f4e4672cc6
commit 092e5acd9b
22 changed files with 821 additions and 684 deletions

View File

@@ -106,8 +106,8 @@ namespace mlx
sprite->GetTexture()->Update(cmd);
sprite->Bind(frame_index, cmd);
std::array<VkDescriptorSet, 2> sets = { p_viewer_data_set->GetSet(frame_index), sprite->GetSet(frame_index) };
vkCmdBindDescriptorSets(cmd, m_pipeline.GetPipelineBindPoint(), m_pipeline.GetPipelineLayout(), 0, sets.size(), sets.data(), 0, nullptr);
vkCmdPushConstants(cmd, m_pipeline.GetPipelineLayout(), VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(SpriteData), &sprite_data);
mlx::RenderCore::Get().vkCmdBindDescriptorSets(cmd, m_pipeline.GetPipelineBindPoint(), m_pipeline.GetPipelineLayout(), 0, sets.size(), sets.data(), 0, nullptr);
mlx::RenderCore::Get().vkCmdPushConstants(cmd, m_pipeline.GetPipelineLayout(), VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(SpriteData), &sprite_data);
sprite->GetMesh()->Draw(cmd, renderer.GetDrawCallsCounterRef(), renderer.GetPolygonDrawnCounterRef());
}
m_pipeline.EndPipeline(cmd);

View File

@@ -61,8 +61,8 @@ namespace mlx
m_pipeline.BindPipeline(cmd, renderer.GetSwapchainImageIndex(), { 0.0f, 0.0f, 0.0f, 1.0f });
VkDescriptorSet set = p_set->GetSet(renderer.GetCurrentFrameIndex());
vkCmdBindDescriptorSets(cmd, m_pipeline.GetPipelineBindPoint(), m_pipeline.GetPipelineLayout(), 0, 1, &set, 0, nullptr);
vkCmdDraw(cmd, 3, 1, 0, 0);
RenderCore::Get().vkCmdBindDescriptorSets(cmd, m_pipeline.GetPipelineBindPoint(), m_pipeline.GetPipelineLayout(), 0, 1, &set, 0, nullptr);
RenderCore::Get().vkCmdDraw(cmd, 3, 1, 0, 0);
renderer.GetDrawCallsCounterRef()++;
renderer.GetPolygonDrawnCounterRef()++;
m_pipeline.EndPipeline(cmd);