diff --git a/core/rhi/slang_handle.cpp b/core/rhi/slang_handle.cpp index c615e21..783e603 100644 --- a/core/rhi/slang_handle.cpp +++ b/core/rhi/slang_handle.cpp @@ -32,22 +32,21 @@ bool slang_handle::init_slang_module(const std::string& module_name, const std:: spdlog::error("slang: create composite component type failed"); return false; } - // get entry point index - for (int i = 0; i < module->getDefinedEntryPointCount(); ++i) + + slang::ProgramLayout* layout = program->getLayout(target_index); + + // get entry point index and shader type + for (int i = 0; i < layout->getEntryPointCount(); ++i) { - Slang::ComPtr temp_entry_point; - module->getDefinedEntryPoint(i, temp_entry_point.writeRef()); - if (temp_entry_point == entry_point) + const auto entry_reflection = layout->getEntryPointByIndex(i); + if (strcmp(entry_reflection->getName(), entry_name.c_str()) == 0) { entry_point_index_ = i; + shader_type_ = entry_reflection->getStage(); break; } } - slang::ProgramLayout* layout = program->getLayout(target_index); - const auto entry_reflection = layout->getEntryPointByIndex(entry_point_index_); - shader_type_ = entry_reflection->getStage(); - #if _DEBUG spdlog::info("slang: shader type: {}", shader_type_); spdlog::info("================parameters================");