fgviewer: visualize intermediate buffers#9862
Conversation
|
It looks great! Thank you! Couple questions:
|
f16d488 to
a1089b8
Compare
|
Got it! For your question, like Structure Buffer and Bloom Out Texture in your screenshot are both written by 2 passes? |
a1089b8 to
2dc479d
Compare
I see, I think different mip levels and layers are written to by different passes, but I'm guessing, for one layer/level in one texture, it's only ever written to once per-frame. |
| static void handleFgReadbacks(FEngine& engine, FrameGraph& fg, | ||
| backend::Handle<backend::HwRenderTarget> viewTarget, uint32_t viewId); | ||
| static void update(FEngine& engine, FrameGraph& fg, FView const& view); | ||
| static void tick(FEngine& engine); |
There was a problem hiding this comment.
some documentation would be nice
| #if FILAMENT_ENABLE_FGVIEWER | ||
| struct ReadbackRequest { | ||
| using Callback = std::function<void(fgviewer::DebugServer::PixelBuffer, uint32_t, uint32_t, | ||
| fgviewer::DebugServer::PixelDataFormat, fgviewer::DebugServer::FormatInfo)>; | ||
| fgviewer::ViewHandle viewId; | ||
| uint32_t id; | ||
| utils::CString name; | ||
| Callback callback; | ||
| }; | ||
|
|
||
| void requestTextureReadback(fgviewer::ViewHandle viewId, uint32_t id, | ||
| utils::CString const& name, | ||
| std::function<void(fgviewer::DebugServer::PixelBuffer, uint32_t, uint32_t, | ||
| fgviewer::DebugServer::PixelDataFormat, fgviewer::DebugServer::FormatInfo)>&& | ||
| callback); | ||
|
|
||
| utils::Mutex mReadbackRequestsMutex; | ||
| std::vector<ReadbackRequest> mReadbackRequests; | ||
| #endif |
There was a problem hiding this comment.
does this needs to be on Engine? Could it be on the new FgviewerManager?
There was a problem hiding this comment.
moved to FgviewerManager
| case VK_FORMAT_D16_UNORM: return PixelDataType::USHORT; | ||
| case VK_FORMAT_D32_SFLOAT: return PixelDataType::FLOAT; | ||
| case VK_FORMAT_X8_D24_UNORM_PACK32: return PixelDataType::UINT; | ||
| case VK_FORMAT_B10G11R11_UFLOAT_PACK32: return PixelDataType::UINT_10F_11F_11F_REV; |
There was a problem hiding this comment.
I would move all the VK changes in a different CL (or PR), seems unrelated.
| // fg.forwardResource(fgViewRenderTarget, debug ? debug : input); | ||
|
|
||
| fg.forwardResource(fgViewRenderTarget, input); | ||
| FgviewerManager::handleFgReadbacks(engine, fg, viewRenderTarget, view.getViewHandle()); |
There was a problem hiding this comment.
does this have to be done before present()?
IF not, you could hide all this inside the FRameGraph itself.
Like you could call handleFgReadbacks at the beginging of compile(), update() at the end of compile() and tick() at the end of execute().
It would be all contained inside the FrameGraph, and FgviewerManager could become an implementation detail of FrameGraph.
There was a problem hiding this comment.
I've moved all the fgviewer logic to FrameGraph
5a16ffe to
3da9dea
Compare
* Intermediate Buffer Visualization: Enabled live monitoring of internal
`FrameGraph` render targets directly in the `fgviewer` web UI.
* HTTP Polling Architecture: Switched from WebSocket binary pushes to native
`<img>` polling (`/api/image`)
* Robust Resource Tracking: Replaced string-based lookups with
`(ViewId, ResourceId)` composite keys to prevent cross-view collisions and
ensure accurate reads.
* Format Post-Processing: Extracted readback conversions (HDR tonemapping,
depth normalization, MSAA downsampling, single-channel expansion) into
`DebugServer`.
* UI Polish: Added a live-updating full-screen image modal and explicitly
filtered internal debug passes from the Graphviz/JSON exports to prevent
DOM thrashing.
* WIP: Currently Unsupported:
* GL backend: failed with:
OpenGL framebuffer error 0x8cd6 (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) in "readTexture" at line 4198
* Mipmaps & Subresources: Reading specific mip levels or array layers is
explicitly skipped.
* Shadowmaps: Variance Shadow Maps (VSM) will physically evaluate to `0.0`
and appear completely empty/black in scenes without active shadow
casters (due to inverted-Z).
* Stencil: Resolving and reading stencil buffer data is not supported by
the backend.
* WIP: Untested outside of MacOS+metal/vk
3da9dea to
496a1ef
Compare
* Intermediate Buffer Visualization: Enabled live monitoring of internal
`FrameGraph` render targets directly in the `fgviewer` web UI.
* HTTP Polling Architecture: Switched from WebSocket binary pushes to native
`<img>` polling (`/api/image`)
* Robust Resource Tracking: Replaced string-based lookups with
`(ViewId, ResourceId)` composite keys to prevent cross-view collisions and
ensure accurate reads.
* Format Post-Processing: Extracted readback conversions (HDR tonemapping,
depth normalization, MSAA downsampling, single-channel expansion) into
`DebugServer`.
* UI Polish: Added a live-updating full-screen image modal and explicitly
filtered internal debug passes from the Graphviz/JSON exports to prevent
DOM thrashing.
* WIP: Currently Unsupported:
* GL backend: failed with:
OpenGL framebuffer error 0x8cd6 (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) in "readTexture" at line 4198
* Mipmaps & Subresources: Reading specific mip levels or array layers is
explicitly skipped.
* Shadowmaps: Variance Shadow Maps (VSM) will physically evaluate to `0.0`
and appear completely empty/black in scenes without active shadow
casters (due to inverted-Z).
* Stencil: Resolving and reading stencil buffer data is not supported by
the backend.
* WIP: Untested outside of MacOS+metal/vk
FrameGraphrender targets directly in thefgviewerweb UI.<img>polling (/api/image), eliminating severe frontend memory leaks and GC thrashing.(ViewId, ResourceId)composite keys to prevent cross-view collisions and ensure accurate reads.DebugServer.0.0and appear completely empty/black in scenes without active shadow casters (due to inverted-Z).