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

Method beginFrame

Source/Falcor/Utils/Debug/PixelDebug.cpp:50–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48{}
49
50void PixelDebug::beginFrame(RenderContext* pRenderContext, const uint2& frameDim)
51{
52 FALCOR_CHECK(!mRunning, "Logging is already running, did you forget to call endFrame()?");
53
54 mFrameDim = frameDim;
55 mRunning = true;
56
57 // Reset previous data.
58 mPrintData.clear();
59 mAssertData.clear();
60 mDataValid = false;
61 mWaitingForData = false;
62
63 if (mEnabled)
64 {
65 // Prepare buffers.
66 if (!mpPrintBuffer)
67 {
68 // Allocate GPU buffers.
69 const ref<Device>& pDevice = pRenderContext->getDevice();
70 mpCounterBuffer = pDevice->createBuffer(sizeof(uint32_t) * 2);
71 mpPrintBuffer = pDevice->createStructuredBuffer(sizeof(PrintRecord), mPrintCapacity);
72 mpAssertBuffer = pDevice->createStructuredBuffer(sizeof(AssertRecord), mAssertCapacity);
73
74 // Allocate readback buffer. This buffer is shared for copying all the above buffers to the CPU
75 mpReadbackBuffer = pDevice->createBuffer(
76 mpCounterBuffer->getSize() + mpPrintBuffer->getSize() + mpAssertBuffer->getSize(),
77 ResourceBindFlags::None,
78 MemoryType::ReadBack
79 );
80 }
81
82 pRenderContext->clearUAV(mpCounterBuffer->getUAV().get(), uint4(0));
83 }
84}
85
86void PixelDebug::endFrame(RenderContext* pRenderContext)
87{

Callers

nothing calls this directly

Calls 8

createBufferMethod · 0.80
clearUAVMethod · 0.80
clearMethod · 0.45
getDeviceMethod · 0.45
getSizeMethod · 0.45
getMethod · 0.45
getUAVMethod · 0.45

Tested by

no test coverage detected