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

Method Render

examples/meshlets/meshlets.cpp:77–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75 }
76
77 void Render(nvrhi::IFramebuffer* framebuffer) override
78 {
79 if (!m_Pipeline)
80 {
81 nvrhi::MeshletPipelineDesc psoDesc;
82 psoDesc.AS = m_AmplificationShader;
83 psoDesc.MS = m_MeshShader;
84 psoDesc.PS = m_PixelShader;
85 psoDesc.primType = nvrhi::PrimitiveType::TriangleList;
86 psoDesc.renderState.depthStencilState.depthTestEnable = false;
87
88 m_Pipeline = GetDevice()->createMeshletPipeline(psoDesc, framebuffer->getFramebufferInfo());
89 }
90
91 m_CommandList->open();
92
93 nvrhi::utils::ClearColorAttachment(m_CommandList, framebuffer, 0, nvrhi::Color(0.f));
94
95 nvrhi::MeshletState state;
96 state.pipeline = m_Pipeline;
97 state.framebuffer = framebuffer;
98 state.viewport.addViewportAndScissorRect(framebuffer->getFramebufferInfo().getViewport());
99
100 m_CommandList->setMeshletState(state);
101
102 m_CommandList->dispatchMesh(1);
103
104 m_CommandList->close();
105 GetDevice()->executeCommandList(m_CommandList);
106 }
107
108};
109

Callers 3

RenderSceneMethod · 0.45
RenderLightProbeMethod · 0.45
buildUIMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected