Fixed Push constant setup errros

This commit is contained in:
Pasha Bibko
2025-11-22 15:55:00 +00:00
parent 201f5896ce
commit c12325d30c

View File

@@ -623,7 +623,7 @@ namespace PB::Renderer
} }
bool VulkanManager::CreateGraphicsPipeline() bool VulkanManager::CreateGraphicsPipeline()
{ {
VkShaderModule vertShaderModule = CreateShaderModule("../shaders/vert.spv"); VkShaderModule vertShaderModule = CreateShaderModule("../shaders/vert.spv");
VkShaderModule fragShaderModule = CreateShaderModule("../shaders/frag.spv"); VkShaderModule fragShaderModule = CreateShaderModule("../shaders/frag.spv");
@@ -719,8 +719,19 @@ namespace PB::Renderer
colorBlending.attachmentCount = 1; colorBlending.attachmentCount = 1;
colorBlending.pAttachments = &colorBlendAttachment; colorBlending.pAttachments = &colorBlendAttachment;
VkPushConstantRange range{};
range.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;
range.offset = 0;
range.size = sizeof(Color); // TEMPORARY
VkPipelineLayoutCreateInfo pipelineLayoutInfo{}; VkPipelineLayoutCreateInfo pipelineLayoutInfo{};
pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
pipelineLayoutInfo.setLayoutCount = 0;
pipelineLayoutInfo.pNext = nullptr;
pipelineLayoutInfo.pushConstantRangeCount = 1;
pipelineLayoutInfo.pPushConstantRanges = ⦥
if (vkCreatePipelineLayout(s_Device, &pipelineLayoutInfo, nullptr, &s_PipelineLayout) != VK_SUCCESS) if (vkCreatePipelineLayout(s_Device, &pipelineLayoutInfo, nullptr, &s_PipelineLayout) != VK_SUCCESS)
{ {
@@ -754,7 +765,7 @@ namespace PB::Renderer
vkDestroyShaderModule(s_Device, fragShaderModule, nullptr); vkDestroyShaderModule(s_Device, fragShaderModule, nullptr);
return true; return true;
} }
VkShaderModule VulkanManager::CreateShaderModule(const std::string& filename) VkShaderModule VulkanManager::CreateShaderModule(const std::string& filename)
{ {