Skip to content

Commit

Permalink
minor bug fixes;
Browse files Browse the repository at this point in the history
  • Loading branch information
NateSeymour committed Dec 1, 2024
1 parent b23a73f commit 699e306
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/calculator/renderer/VulkanPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ ui::VulkanPipeline::VulkanPipeline(CreateVulkanPipelineInfo const &info) : windo
.pViewportState = &viewport_state_info,
.pRasterizationState = &rasterization_state_info,
.pMultisampleState = &multisample_state_info,
.pDepthStencilState = &depth_stencil_state_info,
.pDepthStencilState = nullptr,
.pColorBlendState = &color_blend_state_info,
.pDynamicState = &dynamic_state_info,
.layout = this->pipeline_layout_,
Expand Down
11 changes: 5 additions & 6 deletions src/calculator/renderer/VulkanRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ void VulkanRenderer::initResources()

VkDescriptorPoolSize descriptor_pool_size{
.type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
.descriptorCount = this->contexts_.size(),
.descriptorCount = QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT,
};

VkDescriptorPoolCreateInfo descriptor_pool_info{
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.maxSets = this->contexts_.size(),
.maxSets = QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT,
.poolSizeCount = 1,
.pPoolSizes = &descriptor_pool_size,
};
Expand Down Expand Up @@ -74,7 +74,6 @@ void VulkanRenderer::initResources()
for (int i = 0; i < this->window_->concurrentFrameCount(); i++)
{
this->contexts_[i].valid = false;
this->contexts_[i].scene = this->window_->scene;
this->contexts_[i].camera_buffer = VulkanBuffer::Create<unlogic::Camera>(this->window_, BufferType::Uniform);
this->contexts_[i].plot_buffers.clear();

Expand Down Expand Up @@ -139,7 +138,7 @@ void VulkanRenderer::startNextFrame()
// Begin render pass
VkCommandBuffer cmd = this->window_->currentCommandBuffer();

VkClearColorValue clearColor = {0.f, 0.f, 0.f, 0.f};
VkClearColorValue clearColor = {1.f, 1.f, 1.f, 1.f};
VkClearDepthStencilValue clearDS = {1.0f, 0};
VkClearValue clearValues[2];
memset(clearValues, 0, sizeof(clearValues));
Expand Down Expand Up @@ -202,13 +201,13 @@ void VulkanRenderer::startNextFrame()
}

this->grid_pipeline_->Bind(cmd);
this->dev_->vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, this->grid_pipeline_->GetLayout(), 0, 1, &ctx.descriptor_set, 0, nullptr);
this->grid_pipeline_->BindDescriptorSets(cmd, &ctx.descriptor_set, 1);

ctx.grid_buffer->Bind(cmd);
this->dev_->vkCmdDraw(cmd, ctx.grid_buffer->GetCount(), 1, 0, 0);

this->plot_pipeline_->Bind(cmd);
this->dev_->vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, this->plot_pipeline_->GetLayout(), 0, 1, &ctx.descriptor_set, 0, nullptr);
this->plot_pipeline_->BindDescriptorSets(cmd, &ctx.descriptor_set, 1);

for (auto &plot_buffer: ctx.plot_buffers)
{
Expand Down

0 comments on commit 699e306

Please sign in to comment.