Commit Graph

919 Commits

Author SHA1 Message Date
joe kirchoff
d31b8ce8a3 Resolve several module public include paths not using references
#rnx

[CL 26558470 by joe kirchoff in ue5-main branch]
2023-07-24 18:35:16 -04:00
adam kinge
74b072896b iOS A8 devices do not support Virtual Textures, so if they have been enabled via r.Mobile.VirtualTextures, give a log Warning that it's not supported when running on an A8 device. Don't use Fatal as level might not use VTs.
#jira UE-190545
#rb dmitriy.dyomin

[CL 26504525 by adam kinge in ue5-main branch]
2023-07-20 22:51:10 -04:00
axel riffard
af34956548 Bring back MTL argument for older MacOS and iOS
#rb carl.lloyd
#jira UE-189806

[CL 26421682 by axel riffard in ue5-main branch]
2023-07-17 19:32:05 -04:00
carl lloyd
c42df3f2f9 Fixes for Nanite on Mac
- Disable COMPILER_SUPPORTS_WAVE_VOTE for Mac
- Fixed bug where Texture2DArray was flattened due to atomics, but bound as Texture2D
- Fixed bug where defines were read incorrectly in shader compiler

#rb Zack.Neyland, Jamie.Hayes

[CL 26291315 by carl lloyd in ue5-main branch]
2023-06-28 13:49:35 -04:00
wei liu
cf993b07b2 Fix a typo in MetalRHI.
#rb Dmitriy.Dyomin

[CL 26279166 by wei liu in ue5-main branch]
2023-06-28 02:11:42 -04:00
axel riffard
de98664667 Metal 3.1, iOS17 and tvOS17
#jira UE-187878
#rb adam.kinge
[FYI] jack.porter,  carl.lloyd,  zack.neyland,  josh.adams

[CL 26277868 by axel riffard in ue5-main branch]
2023-06-27 21:41:51 -04:00
josh adams
82ea6a767a [Backout] - CL26223564
[FYI] keaton.stewart
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL26221679 [Main CIS Issue] Errors in Incremental FortniteServer Linux and Incremental Compile Monolithics - Linux
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
- Very super early support for VisionOS (requires Xcode 15 beta2 or later).
- THIS IS NOT USABLE YET - WORK IN PROGRESS!
- It builds, links with IOS libs (warnings, not errors), can cook and it boots in Simulator, but is dying in MetalRHI
- UnrealTargetPlatform.VisionOS is currently defined in Engine code, it is not pulled out like would be correct for a full true platform extension
- Refactored a lot of Build.cs files to use UnrealPlatformGroup.IOS/Apple instead of individual platform checks, to make VisionOS integration simpler
#rb zack.neyland

[CL 26226852 by josh adams in ue5-main branch]
2023-06-24 17:52:48 -04:00
keaton stewart
1fd1a77412 [Backout] - CL26221679 [Main CIS Issue] Errors in Incremental FortniteServer Linux and Incremental Compile Monolithics - Linux
#fyi Josh.Adams
#jira FORT-626566 (edited)
Original CL Desc
-----------------------------------------------------------------
- Very super early support for VisionOS (requires Xcode 15 beta2 or later).
- THIS IS NOT USABLE YET - WORK IN PROGRESS!
- It builds, links with IOS libs (warnings, not errors), can cook and it boots in Simulator, but is dying in MetalRHI
- UnrealTargetPlatform.VisionOS is currently defined in Engine code, it is not pulled out like would be correct for a full true platform extension
- Refactored a lot of Build.cs files to use UnrealPlatformGroup.IOS/Apple instead of individual platform checks, to make VisionOS integration simpler
#rb zack.neyland

[CL 26223564 by keaton stewart in ue5-main branch]
2023-06-23 20:29:27 -04:00
Josh Adams
e25e1b3daf - Very super early support for VisionOS (requires Xcode 15 beta2 or later).
- THIS IS NOT USABLE YET - WORK IN PROGRESS!
- It builds, links with IOS libs (warnings, not errors), can cook and it boots in Simulator, but is dying in MetalRHI
- UnrealTargetPlatform.VisionOS is currently defined in Engine code, it is not pulled out like would be correct for a full true platform extension
- Refactored a lot of Build.cs files to use UnrealPlatformGroup.IOS/Apple instead of individual platform checks, to make VisionOS integration simpler
#rb zack.neyland

[CL 26221679 by Josh Adams in ue5-main branch]
2023-06-23 19:12:47 -04:00
zach bethel
dc6c9e4da7 Fixed build break.
[CL 26218297 by zach bethel in ue5-main branch]
2023-06-23 16:34:30 -04:00
zach bethel
995e98f5a6 Moved RHICalcRayTracingGeometrySize to a command list since some platforms create resources.
[CL 26209325 by zach bethel in ue5-main branch]
2023-06-23 09:58:15 -04:00
zach bethel
aa1b0c680f Deprecated non-command list RHI methods.
- RHICreate{Vertex, Index, Structured}Buffer
 - RHICreate{ShaderResource, UnorderedAccess}View
 - RHIUpdateUniformBuffer
 - Various initialization / locking methods for helper buffer types in RHIUtilities.h

The goal is to continue to force resource creation through command lists to avoid surprises with moving things off the render thread.

#rb christopher.waters

[CL 26183242 by zach bethel in ue5-main branch]
2023-06-22 11:08:27 -04:00
christopher waters
e908b9544b Working on making Texture and Buffer memory accounting consistent
- Renaming GRHIGlobals.CurrentTextureMemorySize to GRHIGlobals.StreamingTextureMemorySizeInKB
- Renaming GRHIGlobals.CurrentRendertargetMemorySize to GRHIGlobals.NonStreamingTextureMemorySizeInKB
- Adding GRHIGlobals.BufferMemorySize and GRHIGlobals.UniformBufferMemorySize
- Deduplicating RHI stat accounting code and changing it to use RHI Descs.
- UE::RHICore::UpdateGlobalTextureStats is for StreamingTextureMemorySizeInKB and NonStreamingTextureMemorySizeInKB. This still allows platforms to control where the memory is counted.
- Adding more Buffer RHI stat accounting code to RHIs that were missing it.
- UE::RHICore::UpdateGlobalBufferStats is for BufferMemorySize and UniformBufferMemorySize.
- FillBaselineTextureMemoryStats initializes and fills the common members of FTextureMemoryStats.
- Adding ETextureCreateFlags::ForceIntoNonStreamingMemoryTracking which will force the texture to be counted in NonStreamingTextureMemorySizeInKB.
- Changing all RenderTargetPool textures to be flagged with ETextureCreateFlags::ForceIntoNonStreamingMemoryTracking so they aren't counted against streaming budgets.
- Adding UAV Texture stats instead of lumping them with regular textures
- Adding Buffer stats for ByteAddressBuffer, DrawIndirect and Misc

#jira UE-188415
#rb mihnea.balta, zach.bethel

[CL 26158360 by christopher waters in ue5-main branch]
2023-06-21 15:19:41 -04:00
carl lloyd
8b05dfb4f2 Fixed Nanite bugs with Atomic64Compatible on Mac
Fixed missing AtomicCompatible flags in NaniteCullRaster
Fixed incorrect image transition when using DumpGPU

#rb Luke.Thatcher

[CL 26125943 by carl lloyd in ue5-main branch]
2023-06-20 12:38:45 -04:00
zach bethel
a7a9029b20 Deprecated InitRHI() in favor of InitRHI(FRHICommandListBase&).
#rb mihnea.balta, luke.thatcher, christopher.waters

[CL 26097009 by zach bethel in ue5-main branch]
2023-06-19 13:56:56 -04:00
Wei Liu
0ea7de8705 Refactor resource transitions on Metal.
Removed PrologueEncoder since it's not synchronized properly.
It fixed the flickering/crash issue on Iphone14 with mobile GPUScene enabled.

#jira none

#rb Carl.Lloyd, Dmitriy.Dyomin

[CL 26086935 by Wei Liu in ue5-main branch]
2023-06-19 07:24:25 -04:00
carl lloyd
a793c2fcd1 Add support to enable an SM6 platform for Mac
#rb Zack.Neyland
#jira UE-184435

[CL 26062749 by carl lloyd in ue5-main branch]
2023-06-16 14:24:06 -04:00
carl lloyd
581a960915 MetalRHI: Added encoder fault tracking
#rb Zack.Neyland
#jira none

[CL 25921822 by carl lloyd in ue5-main branch]
2023-06-12 05:24:20 -04:00
zach bethel
6cef8be37e Moved RHI view and ray tracing geometry creation to support non-immediate command lists.
#preflight 6467f3cccb141b29df90222c
#rb luke.thatcher

[CL 25743163 by zach bethel in ue5-main branch]
2023-06-01 17:25:42 -04:00
adam kinge
8a697061cd Add a CVar to allow disabling memoryless textures on Metal iOS devices. In some low memory conditions, lower spec'd iOS devices appear to crash if it is enabled.
#jira UE-185666
#rb jack.porter
#preflight 6477b5325d23eca37d36f839

[CL 25714869 by adam kinge in ue5-main branch]
2023-05-31 17:16:01 -04:00
christopher waters
523ee6df6d Adding a fast path for shader parameter unsets, or "Unbinds"
- FRHIBatchedShaderUnbinds acts like FRHIBatchedShaderParameters but doesn't need to collect pointers.
- The context code can also avoid any attempts to access the resource since we know it's always null.
- This change will let us easily remove Unbinds for RHIs that won't need them in the future, aka after the parameter batching is done once per draw.
- This addresses the bulk of unbind performance regressions but there is still some a minor regression in the single unbind case.

#jira UE-186381
#rb jeannoe.morissette
#preflight 646d3ec9f85111e06c4b696f

[CL 25622480 by christopher waters in ue5-main branch]
2023-05-25 11:49:17 -04:00
ben woodhouse
31208ca2a1 Add a new set of ASTC pixel formats for storing high precision normals in RG channels. The texture is encoded as LA for higher precision, swizzled to RG at runtime for shader compatibility with BC5. Requires RHI support.
Runtime pixel formats are named  PF_ASTC_<blocksize>_NORM_RG. Use texture format name ASTC_NormalRG_Precise for encoding.

[CL 25563983 by ben woodhouse in ue5-main branch]
2023-05-22 10:41:55 -04:00
carl lloyd
9ec6f64e66 MetalRHI: Fixed Screenshot crash when ConvertSurfaceDataToFColor is called with HDR format
#rb trivial
#jira UE-178477
#preflight none

[CL 25487597 by carl lloyd in ue5-main branch]
2023-05-16 08:00: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
carl lloyd
2df6c54e5c MetalRHI: Fix for incorrect alignment on linear textures when using buffer backed SRV/UAV
#fyi Wei.liu
#rb Luke.Thatcher
#preflight 644a90811150e908d0327d0d

[CL 25215450 by carl lloyd in ue5-main branch]
2023-04-27 11:22:24 -04:00