MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / setMeshVertices

Method setMeshVertices

Source/Falcor/Scene/Scene.cpp:4081–4102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4079 }
4080
4081 void Scene::setMeshVertices(MeshID meshID, const std::map<std::string, ref<Buffer>>& buffers)
4082 {
4083 if (!mpUpdateMeshPass)
4084 mpUpdateMeshPass = ComputePass::create(mpDevice, kMeshIOShaderFilename, "setMeshVertices", getSceneDefines());
4085 const auto& meshDesc = getMesh(meshID);
4086
4087 // Bind variables.
4088 auto var = mpUpdateMeshPass->getRootVar()["meshUpdater"];
4089 var["vertexCount"] = meshDesc.vertexCount;
4090 var["vbOffset"].setBlob(meshDesc.vbOffset);
4091 mMeshStaticData.bindShaderData(var["vertexData"]);
4092 for (const auto& name : kMeshUpdaterRequiredBufferNames)
4093 {
4094 FALCOR_CHECK(buffers.find(name) != buffers.end(), "Mesh data buffer '{}' is missing.", name);
4095 var[name] = buffers.at(name);
4096 }
4097
4098 mpUpdateMeshPass->execute(mpDevice->getRenderContext(), meshDesc.vertexCount, 1, 1);
4099
4100 // Update BLAS/TLAS.
4101 updateForInverseRendering(mpDevice->getRenderContext(), false, true);
4102 }
4103
4104 inline pybind11::dict toPython(const Scene::SceneStats& stats)
4105 {

Callers 1

setMeshVerticesPythonFunction · 0.80

Calls 6

getRootVarMethod · 0.80
createFunction · 0.50
setBlobMethod · 0.45
bindShaderDataMethod · 0.45
endMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected