MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut-Samples / Init

Method Init

examples/meshlets/meshlets.cpp:46–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 using IRenderPass::IRenderPass;
45
46 bool Init()
47 {
48 auto nativeFS = std::make_shared<vfs::NativeFileSystem>();
49
50 std::filesystem::path appShaderPath = app::GetDirectoryWithExecutable() / "shaders/meshlets" / app::GetShaderTypeName(GetDevice()->getGraphicsAPI());
51
52 engine::ShaderFactory shaderFactory(GetDevice(), nativeFS, appShaderPath);
53 m_AmplificationShader = shaderFactory.CreateShader("shaders.hlsl", "main_as", nullptr, nvrhi::ShaderType::Amplification);
54 m_MeshShader = shaderFactory.CreateShader("shaders.hlsl", "main_ms", nullptr, nvrhi::ShaderType::Mesh);
55 m_PixelShader = shaderFactory.CreateShader("shaders.hlsl", "main_ps", nullptr, nvrhi::ShaderType::Pixel);
56
57 if (!m_AmplificationShader || !m_MeshShader || !m_PixelShader)
58 {
59 return false;
60 }
61
62 m_CommandList = GetDevice()->createCommandList();
63
64 return true;
65 }
66
67 void Animate(float fElapsedTimeSeconds) override
68 {

Callers 1

meshlets.cppFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected