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

Method execute

Source/RenderPasses/SDFEditor/SDFEditor.cpp:1210–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1208}
1209
1210void SDFEditor::execute(RenderContext* pRenderContext, const RenderData& renderData)
1211{
1212 if (!mpScene || !mpGUIPass)
1213 return;
1214
1215 auto pOutput = renderData.getTexture(kOutputChannel);
1216 auto pInputColor = renderData.getTexture(kInputColorChannel);
1217 FALCOR_ASSERT(pOutput && pInputColor);
1218
1219 mFrameDim = uint2(pOutput->getWidth(), pOutput->getHeight());
1220 mpFbo->attachColorTarget(pOutput, 0);
1221
1222 // Make a copy of the vBuffer and the linear z-buffer before editing.
1223 ref<Texture> pVBuffer = renderData.getTexture(kInputVBuffer);
1224 ref<Texture> pDepth = renderData.getTexture(kInputDepth);
1225 if (!mEditingKeyDown)
1226 {
1227 fetchPreviousVBufferAndZBuffer(pRenderContext, pVBuffer, pDepth);
1228 }
1229 else // When editing, use the copies instead to not add SDF primitives on the current edits.
1230 {
1231 pVBuffer = mpEditingVBuffer;
1232 }
1233
1234 // Wait for the picking info from the previous frame.
1235 mpReadbackFence->wait();
1236 mPickingInfo = *reinterpret_cast<const SDFPickingInfo*>(mpPickingInfoReadBack->map());
1237 mpPickingInfoReadBack->unmap();
1238
1239 setup2DGUI();
1240 handleActions();
1241
1242 // Set shader data.
1243 auto rootVar = mpGUIPass->getRootVar();
1244 bindShaderData(rootVar, pInputColor, pVBuffer);
1245
1246 mpGUIPass->execute(pRenderContext, mpFbo);
1247
1248 // Copy picking info into a staging buffer.
1249 pRenderContext->copyResource(mpPickingInfoReadBack.get(), mpPickingInfo.get());
1250 pRenderContext->submit(false);
1251 pRenderContext->signal(mpReadbackFence.get());
1252
1253 // Prepare next frame.
1254 {
1255 mUI2D.keyboardButtonsPressed.registerCurrentStatesIntoPrevious();
1256
1257 mUI2D.prevMousePosition = mUI2D.currentMousePosition;
1258 mUI2D.scrollDelta = 0.0f;
1259 mInstanceTransformationEdit.prevState = mInstanceTransformationEdit.state;
1260 mInstanceTransformationEdit.prevScrollTotal = mInstanceTransformationEdit.scrollTotal;
1261 mPrimitiveTransformationEdit.prevState = mPrimitiveTransformationEdit.state;
1262 mPrimitiveTransformationEdit.prevAxis = mPrimitiveTransformationEdit.axis;
1263 }
1264}
1265
1266void SDFEditor::renderUI(RenderContext* pRenderContext, Gui::Widgets& widget)
1267{

Callers

nothing calls this directly

Calls 14

getWidthMethod · 0.80
getHeightMethod · 0.80
attachColorTargetMethod · 0.80
mapMethod · 0.80
unmapMethod · 0.80
getRootVarMethod · 0.80
copyResourceMethod · 0.80
bindShaderDataFunction · 0.50
getTextureMethod · 0.45
waitMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected