You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add asset manager to nbl::ext::imgui::UI::S_CREATION_PARAMETERS, remove NSC from the ImGUI extension build system & embed shader sources instead (leave some comments), codegen & compile shaders on fly with respect to new optional S_RESOURCE_PARAMETERS (leave user freedom to specify set & resource bindings with certain required constraints), add more validation to the UI creation, update examples_tests submodule
uint32_t subpassIx = 0u; //! optional, default value if not provided
34
-
video::IGPUDescriptorSetLayout* const descriptorSetLayout = nullptr; //! optional, default layout used if not provided [STILL TODO, currently its assumed its not nullptr!]
35
-
video::IGPUPipelineCache* const pipelineCache = nullptr; //! optional, no cache used if not provided
36
-
typename MDI::COMPOSE_T* const streamingMDIBuffer = nullptr; //! optional, default MDI buffer allocated if not provided
uint32_t subpassIx = 0u; //! optional, default value used if not provided
41
+
nbl::video::IGPUDescriptorSetLayout* const descriptorSetLayout = nullptr; //! optional, default layout used if not provided [STILL TODO, currently its assumed its not nullptr!]
42
+
nbl::video::IGPUPipelineCache* const pipelineCache = nullptr; //! optional, no cache used if not provided
43
+
typename MDI::COMPOSE_T* const streamingMDIBuffer = nullptr; //! optional, default MDI buffer allocated if not provided
44
+
S_RESOURCE_PARAMETERS texturesInfo = { .setIx = 0u, .bindingIx = 0u }, //! optional, default values used if not provided
45
+
samplerStateInfo = { .setIx = 0u, .bindingIx = 1u }; //! optional, default values used if not provided
37
46
};
38
47
39
48
//! parameters which may change every frame, used with the .update call to interact with ImGuiIO; we require a very *required* minimum - if you need to cover more IO options simply get the IO with ImGui::GetIO() to customize them (they all have default values you can change before calling the .update)
# (*) -> I wish we could just take NSC, offline-precompile to SPIRV, embed into builtin resource library (as we did!) but then be smart & adjust at runtime OpDecorate of our resources according to wishes - unfortunately no linker yet we have and we are not going to make one ourselves so we compile imgui shaders at runtime
LIST_BUILTIN_RESOURCE(RESOURCES_TO_EMBED"vertex.hlsl") # (*) -> this we could precompile [no resources for which set/binding Ixs could be adjusted] but I'm not going to mix stuff
36
+
LIST_BUILTIN_RESOURCE(RESOURCES_TO_EMBED"fragment.hlsl") # (*) -> but this we could not since we let users to provide pipeline layout + set/binding Ixs at runtime
auto pipelineLayout = m_creationParams.utilities->getLogicalDevice()->createPipelineLayout(pushConstantRanges, core::smart_refctd_ptr<video::IGPUDescriptorSetLayout>(m_creationParams.descriptorSetLayout));
35
+
auto createPipelineLayout = [&](constuint32_t setIx) -> core::smart_refctd_ptr<IGPUPipelineLayout>
auto pipelineLayout = createPipelineLayout(m_creationParams.texturesInfo.setIx); //! its okay to take the Ix from textures info because we force user to use the same set for both textures and samplers [also validated at this point]
auto system = smart_refctd_ptr<system::ISystem>(m_creationParams.assetManager->getSystem()); //! proxy the system, we will touch it gently
64
+
auto archive = make_smart_refctd_ptr<nbl::ext::imgui::builtin::CArchive>(smart_refctd_ptr<system::ILogger>(m_creationParams.utilities->getLogger())); //! we should never assume user will mount our internal archive since its the extension and not user's job to do it, hence we mount only to compile our extension sources then unmount the archive
65
+
auto compiler = make_smart_refctd_ptr<CHLSLCompiler>(smart_refctd_ptr(system)); //! note we are out of default logical device's compiler set scope so also a few special steps are required to compile our extension shaders to SPIRV
66
+
auto includeFinder = make_smart_refctd_ptr<IShaderCompiler::CIncludeFinder>(smart_refctd_ptr(system));
67
+
auto includeLoader = includeFinder->getDefaultFileSystemLoader();
return compiler->compileToSPIRV(newCode.c_str(), options); // but here we do patch the code with additional define directives for which values are taken from the creation parameters
std::make_pair(bool(m_creationParams.texturesInfo.setIx == m_creationParams.samplerStateInfo.setIx), "Invalid `m_creationParams.texturesInfo.setIx` is not equal to `m_creationParams.samplerStateInfo.setIx`!"),
620
+
std::make_pair(bool(m_creationParams.texturesInfo.bindingIx != m_creationParams.samplerStateInfo.bindingIx), "Invalid `m_creationParams.texturesInfo.bindingIx` is equal to `m_creationParams.samplerStateInfo.bindingIx`!")
0 commit comments