Commit Graph

42 Commits

Author SHA1 Message Date
Guillaume Abadie
8c8f521883 Fixes resource transition bug in DumpGPU
#rb trivial
#jira UE-187344
#preflight 64790a0f7a6aeda41b646b96

[CL 25744068 by Guillaume Abadie in ue5-main branch]
2023-06-01 17:36:08 -04:00
Guillaume Abadie
b374168d80 Adds a LogDumpGPU category for improved log search
#rb trivial
#jira none
#preflight 647604654b0d5a1eb1cf537e

[CL 25677309 by Guillaume Abadie in ue5-main branch]
2023-05-30 10:33:20 -04:00
Guillaume Abadie
481856a89f Implements DumpGPU streaming to better diagnose temporal problems on isolated feature like TSR without tanking frame rate
r.DumpGPU.Stream=1 instead allocate and reuse staging resources from its own pool, only issuing copy to staging and gpu fence rhi commands.
Then every frame it polls whether the resource staging is lockable with the GPU fence on render thread.
When ready, the render thread kicks of a background task that cakes care of resource CPU post processing and disk writing.
Once disk write is complete, the render thread polls everyframe a FEvent to know when complete and unlock the staging resource.
The staging resource is then release to staging resource pool ready to be reused for dumping another resource of the current frame.

#rb none
#jira UE-179496
#preflight 64713ebcb310540a8d8e7da3

[CL 25657285 by Guillaume Abadie in ue5-main branch]
2023-05-26 21:01:27 -04:00
Guillaume Abadie
30c80b4d2e Fixes missing RHIUnmapStagingSurface() call in DumpGPU caused by 25447955
#rb trivial
#jira UE-186281
#preflight 647135490515781578e40efc

[CL 25656365 by Guillaume Abadie in ue5-main branch]
2023-05-26 19:06:04 -04:00
Guillaume Abadie
23c87be73c Allows DumpGPU to captures GSystemTextures that have SkipTracking
#rb trivial
#jira none
#preflight 6470f740b20adf94d795b672

[CL 25650053 by Guillaume Abadie in ue5-main branch]
2023-05-26 14:42:30 -04:00
Guillaume Abadie
cde79087c6 Moves DumpGPU's texture post processing in its own PostProcessTexture()
This notiably make the difference between a PreprocessedPixelFormat and PostprocessedPixelFormat in
FTextureSubresourceDumpDesc to handle the special logic for GL not able to write uav with less than 4byte
directly in TranslateSubresourceDumpDesc().

Motivation of this change is to have a very modular PostProcessTexture() easily reusable from asynchronous
stream GPU resource capture to disk.


#rb dmitriy.dyomin
#jira none
#preflight 645bc04d8f4d53ff22a289fa

[CL 25447955 by Guillaume Abadie in ue5-main branch]
2023-05-12 09:55:33 -04:00
mihnea balta
5c24794294 Fix crashes caused by processing the deferred deletion queue at the wrong time, especially when running without an RHI thread.
Since FRHICommandListImmediate::ImmediateFlush() was calling FlushPendingDeletes() after executing the current list of commands, the lambda enqueued by that function was actually running as part of the next command list. Besides unnecessarily extending resource lifetimes, this also meant that the new command list started by flushing the deferred deletion queue, so anything added directly in there (instead of via another enqueued command) would be deleted before the commands were executed on the GPU. This was very easy to reproduce with -norhithread on DX12, because texture unlock operations add the staging buffer to the deferred deletion queue immediately, instead of enqueuing a command to do it, so the staging buffers were gone by the time the GPU tried to copy from them.

This changelist adds a boolean to RHISubmitCommandLists() which is true when we're flushing the immediate command list with the FlushRHIThreadFlushResources mode, so that the RHI can process the deletion queue internally after submission, instead of doing it in RHIPerFrameRHIFlushComplete(). I didn't want to move RHIPerFrameRHIFlushComplete() itself to another point in the timeline, because old RHIs (D3D11 and OpenGL) use that for other purposes, and it seems unwise to alter their behavior (e.g. D3D11 wants to resolve timing queries in there with a blocking wait, and running that at the end of the current command list would introduce a CPU/GPU sync point).

Also:
* deprecated FRHIResource::FlushPendingDeletes(), since all it does is call FlushPendingDeletes() on the command list being passed in, and code outside of the RHI really shouldn't be doing that.
* made FlushPendingDeleteRHIResources_RenderThread() flush the immediate command list instead of calling FlushPendingDeletes() directly

#jira UE-184426
#rnx
#preflight https://horde.devtools.epicgames.com/job/6455194d023fe5d3ad8faa64
#rb Luke.Thatcher

[CL 25423894 by mihnea balta in ue5-main branch]
2023-05-11 06:25:32 -04:00
Guillaume Abadie
706885ec10 Implements r.DumpGPU.FixedTickRate to tick the engine at fixed delta time when dumping many frames
#rb none
#jira none
#fyi jason.hoerner
#preflight 645bb49d7e39940634a7b8cd

[CL 25406503 by Guillaume Abadie in ue5-main branch]
2023-05-10 11:41:42 -04:00
Guillaume Abadie
fecf7b32f5 Fixes an error in DumpGPU viewer when the log's name is not ProjectName.log
#preflight 6459360e2d27fa25b3a3a2f4

[CL 25373783 by Guillaume Abadie in ue5-main branch]
2023-05-08 14:01:36 -04:00
jeannoe morissette
1a99ad4e08 VulkanRHI: Use the DimensionOverride in DumpGPU when dumping slices of arrays individually.
#rb Guillaume.Abadie
#preflight 64540c32fd4b8f4e0d8b1d4c
#rnx

[CL 25341401 by jeannoe morissette in ue5-main branch]
2023-05-04 16:04:03 -04:00
Guillaume Abadie
5bc5350126 Fixes a bug on DumpGPU with Texture2DArray bound to FRenderTargetBinding with ArraySlice==-1
#rb trivial
#jira UE-181710
#preflight 642af2ccce01db47aca7f812

[CL 24947763 by Guillaume Abadie in ue5-main branch]
2023-04-06 13:26:04 -04:00
Guillaume Abadie
77df14a99e Fixes ERHIAccess::CopyDest not being in DumpGPU's output resources
#rb trivial
#jira none
#preflight 6425f79c50546ea3365d02ce

[CL 24860823 by Guillaume Abadie in ue5-main branch]
2023-03-30 17:28:52 -04:00
guillaume abadie
6437b3972e Implements r.DumpGPU.FrameCount
#jira IRON-449
#rb trivial
#preflight 6400b588a20ddf1bf4320725

[CL 24483054 by guillaume abadie in ue5-main branch]
2023-03-02 11:10:48 -05:00
guillaume abadie
5f9147b105 Fixes a crash in DumpGPU due to cvar using ECVF_SetByGameOverride
#rb trivial
#preflight skip

[CL 24224869 by guillaume abadie in ue5-main branch]
2023-02-14 20:22:16 -05:00
christopher waters
1f21b73b25 Ran IWYU on RHI and RenderCore, private only.
#preflight 63d358c85c69f453c1f79c37

[CL 23889591 by christopher waters in ue5-main branch]
2023-01-27 14:54:10 -05:00
christopher waters
c6c2200520 Adding includes before cleaning up RHI dependencies.
[CL 23888475 by christopher waters in ue5-main branch]
2023-01-27 14:17:39 -05:00
zach bethel
b852db62b9 Added RHI resource lifetime scopes which defer deletion of unreferenced resources until all scopes are closed.
The RDG builder holds a scope in order to avoid deletion of any resources during the graph setup / execution. This resolves the need to hold a strong reference during the RDG graph lifetime.

If FlushPendingDeletes is called within one of these scopes, the resources are instead queued onto the immediate command list and flushed at the end of the scope.

This change removes strong references held of uniform buffers held by RHI commands and certain platform contexts. When a flush is encountered, the backends will clear all caches removing any potential dangling references.

Resources can opt out of lifetime extension by calling ->DisableLifetimeExtension(). Subsequent calls to FlushPendingDeletes will release the resource immediately. This is used by a couple edge cases where resources must be deleted mid-frame (namely, DumpGPU and BVH building).

#rb christopher.waters
#preflight 63c5e5722e714f64ad017cfd

[CL 23734079 by zach bethel in ue5-main branch]
2023-01-16 19:13:49 -05:00
bob tellez
971983eb65 [Backout] - CL23624045
[FYI] christopher.waters
Original CL Desc
-----------------------------------------------------------------
RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.

#preflight 63bca752577437afe604b097

[CL 23631957 by bob tellez in ue5-main branch]
2023-01-10 15:28:15 -05:00
christopher waters
3df5dae685 RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.

#preflight 63bca752577437afe604b097

[CL 23631946 by christopher waters in ue5-main branch]
2023-01-10 15:27:33 -05:00
christopher waters
fa2ebfe998 Adding includes to rendering cpp files in preparation for header changes.
#preflight 6387bd29fa053c489ad45427

[CL 23343615 by christopher waters in ue5-main branch]
2022-11-30 18:29:09 -05:00
guillaume abadie
efedd65122 Implements r.DumpGPU.Delay
#rb none
#preflight 635859ac2e6690262ac2a16e

[CL 22798566 by guillaume abadie in ue5-main branch]
2022-10-26 19:11:42 -04:00
guillaume abadie
bde0b242e7 Fixes warning for missing FDumpTextureCS in shipping builds
#rb trivial
#preflight 633c2431896655606e4ac58b

[CL 22331042 by guillaume abadie in ue5-main branch]
2022-10-04 11:07:08 -04:00
brian white
3c09ace274 Deprecate RHISupportsComputeShaders()
#jira UE-107293
#rb Stu.Mckenna Chris.Waters
#preflight https://horde.devtools.epicgames.com/job/6318a06e967ffc68fb919bae

[CL 21850273 by brian white in ue5-main branch]
2022-09-07 10:18:52 -04:00
Guillaume Abadie
babd5c6738 Limits the size of staged buffer when dump large resources with DumpGPU
#rb none
#jira UE-160972
#preflight 62fad020e41faed68ae265c1

[CL 21404209 by Guillaume Abadie in ue5-main branch]
2022-08-16 09:41:50 -04:00
Jason Nadro
9c36c843b8 Removed unacceptable words from RenderCore.
#rb trivial
#jira UE-158668
#preflight 62c840a57e606620fd5c2847

[CL 21007335 by Jason Nadro in ue5-main branch]
2022-07-08 10:54:10 -04:00