Skip to content

Commit aec8fec

Browse files
author
kevyuu
committed
Fix specializatio for ray tracing shaders
Signed-off-by: kevyuu <[email protected]>
1 parent 0660230 commit aec8fec

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/nbl/video/CVulkanLogicalDevice.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ void CVulkanLogicalDevice::createRayTracingPipelines_impl(
14431443
});
14441444
core::vector<VkPipelineShaderStageCreateInfo> vk_shaderStage(maxShaderStages, { VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, nullptr });
14451445
core::vector<VkRayTracingShaderGroupCreateInfoKHR> vk_shaderGroup(maxShaderStages, { VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR, nullptr});
1446-
core::vector<VkSpecializationInfo> vk_specializationInfos(createInfos.size(), { 0, nullptr, 0, nullptr });
1446+
core::vector<VkSpecializationInfo> vk_specializationInfos(maxShaderStages, { 0, nullptr, 0, nullptr });
14471447
core::vector<VkSpecializationMapEntry> vk_specializationMapEntry(validation.count);
14481448
core::vector<uint8_t> specializationData(validation.dataSize);
14491449

@@ -1487,14 +1487,7 @@ void CVulkanLogicalDevice::createRayTracingPipelines_impl(
14871487
{
14881488
if (specInfo.shader)
14891489
{
1490-
const auto stage = specInfo.shader->getStage();
1491-
*(outShaderStage++) = {
1492-
.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
1493-
.pNext = nullptr,
1494-
.stage = static_cast<VkShaderStageFlagBits>(stage),
1495-
.module = static_cast<const CVulkanShader*>(specInfo.shader)->getInternalObject(),
1496-
.pName = specInfo.entryPoint.c_str(),
1497-
};
1490+
*(outShaderStage++) = getVkShaderStageCreateInfoFrom(specInfo,outRequiredSubgroupSize,outSpecInfo,outSpecMapEntry,outSpecData);
14981491
}
14991492
}
15001493
outCreateInfo->stageCount = std::distance<decltype(outCreateInfo->pStages)>(outCreateInfo->pStages,outShaderStage);

0 commit comments

Comments
 (0)