Commit Graph

60 Commits

Author SHA1 Message Date
eric mcdaniel
502749c59a Fix for async compute on platforms with memory boundary restrictions on async compute dispatch indirect arguments
*** This change will incur a full shader invalidation across all platforms ***

Issues:
  - Some platforms require async compute dispatch indirect arguments to not cross specific memory boundaries
    - This places restrictions on the valid sizes for a dispatch indirect argument set.  We were not conforming to these restrictions which could result in GPU crashes on these async passes

Fixes:
  - FRHIDispatchIndirectParameters is padded out to meet per-platform memory boundary restrictions
    - This is driven via new per-platform preprocessor define PLATFORM_DISPATCH_INDIRECT_ARGUMENT_BOUNDARY_SIZE
    - Some platforms require FRHIDispatchIndirectParameters to align with their internal structure hence we cannot universally size to meet all platform's requirements

  - Introduce new FRHIDispatchIndirectParametersNoPadding for uses when we explicitly do not want the padding and otherwise avoid the memory boundary restrictions

  - Revise and expand indirect argument validation code to catch further such issues in the future

  - Update shaders which write to dispatch indirect argument buffers to account for optional per-platform padding
    - New utility function WriteDispatchIndirectArgs introduced to faciliate this
    - platforms which require other than the default nonpadded dispatch indirect arguments must define DISPATCH_INDIRECT_UINT_COUNT and their own WriteDispatchIndirectArgs in their CommonPlatform.ush

  - move creation of DispatchIndirectGraphicsCommandSignature command signature to be per-platform
    - DispatchIndirectGraphicsCommandSignature and DispatchIndirectComputeCommandSignature stride changed to account for additional padding on impacted platforms

Testing:
  - ran Lyra with and without async compute Lumen on impacted platforms as well as Win64
  - ran FN replay on impacted platforms

#rb Krzysztof.Narkowicz, Ben.Woodhouse, Benjamin.Rouveyrol
#jira UE-167950
#preflight 6359563b2e6690262a11bc06

[CL 22862498 by eric mcdaniel in ue5-main branch]
2022-10-31 10:15:11 -04:00
Sebastien Hillaire
e27b68cc9b Strata - moving SSSData at the end of the strata material buffer to reduce UAV count limitation on dx11.
Fixed a bug wehre loadiung fast material would not be done correctly inside the classification pass for the sharedmemeory path.
#rb none
#jira UE-161415
#preflight https://horde.devtools.epicgames.com/job/630909b9987e7155b1af0aec
#fyi charles.derousiers

[CL 21661992 by Sebastien Hillaire in ue5-main branch]
2022-08-29 02:55:17 -04:00
Sebastien Hillaire
11039589f0 Strata - fixed compilation issue due to recent SSS change.
#rb none
#preflight shader

[CL 20754679 by Sebastien Hillaire in ue5-main branch]
2022-06-21 04:20:27 -04:00
tiantian xie
869d7abbcb Add CVar to fix subsurface border artifact when checkerboard is turned on. It is off by default due to performance concern, 1 extra profile id access per pixel at low quality (TAA mode by default), 4 extra profile id access per pixel at high quality.
Set `r.SSS.Checkerboard.NeighborSSSValidation 1` to turn it on to have a clear border.

#preflight 62b076011c62a6555a84fe34
#rb sebastien.hillaire, kevin.ortegren
#ushell-cherrypick of 20186575 by Tiantian.Xie
#preflight 62b095182405b4ac9e5128ae

#ROBOMERGE-OWNER: tiantian.xie
#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 20740138 via CL 20740214 via CL 20740283 via CL 20740853 via CL 20740871
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20742741 by tiantian xie in ue5-main branch]
2022-06-20 15:33:15 -04:00
Charles deRousiers
0a30a91970 Add Strata wrap-sub-surface lighting support.
This is the initial version for supporting wrap lighting with Strata, allowing to convert legacy subsurface surface into Strata. This initial version is not fully correct (energy perservation is not correct due to non-normalized phase function, which needs to be revisited).

#rb none
#jira none
#fyi sebastien.hillaire
#preflight shaders

[CL 20345473 by Charles deRousiers in ue5-main branch]
2022-05-24 04:52:51 -04:00
Sebastien Hillaire
8e389aec73 Strata - SSS data rework and optimisation for classification and SSS. Gain quite a bit of performance back on low end deferred platforms.
Now header is only uint and extra data is only read if needed.

#rb none
#preflight https://horde.devtools.epicgames.com/job/62821984046b81bf9393b136
#fyi charles.derousiers

[CL 20221584 by Sebastien Hillaire in ue5-main branch]
2022-05-16 05:54:34 -04:00
Charles deRousiers
2257ad3325 Fix/Add split screen & VR support for Strata (i.e., Tiling/Lighting/SSS/Distortion).
This CL split the resources shared between views (non-buffer/tiled data) and resources unique to view (e.g., tile data). This is to ease overall setup, but we might re-regroup them later.

#rb none
#jira none
#preflight 62488f4d927e60e3418751db
#fyi sebastien.hillaire

[CL 19601993 by Charles deRousiers in ue5-main branch]
2022-04-02 14:31:01 -04:00
Sebastien Hillaire
d28a031400 Strata - beginning of rough refraction of sub layers (with scene lighting split into untouched, sss and rough reffracted luminance)
- separate SSS, opaque rough refraction and scene color output when strata project setting is enabled.
- simple placeholder per pixel variance from roughness/layers computation
- SSS only reads from subsurface buffer when ORR is enabled
- Added simple combine pass to final scene lighting (no blur for now)
- Started adding tiling but reached UAV count limit. I will refactor code later to workaround that.
- Updated light rendering, reflection environment pixel shader. Next will be lumen and clustered deferred shading.

#preflight https://horde.devtools.epicgames.com/job/622fc09fe348fe2ada4214f8
#rb none
#fyi charles.derousiers, tiantian.xie

[CL 19382940 by Sebastien Hillaire in ue5-main branch]
2022-03-15 03:11:08 -04:00
Tiantian Xie
a004021851 Update strata DMFP to MFP
#jira UE-145947
#rb sebastien.hillaire
#preflight 622fba3e306f46da145bdfc3

[CL 19379700 by Tiantian Xie in ue5-main branch]
2022-03-14 18:22:52 -04:00
Charles deRousiers
f0a55fdc1f Move #if STRATA_ENABLED within the strata shader files to simplify strata includes.
#rb none
#jira none
#preflight shader
#fyi sebastien.hillaire

[CL 19110961 by Charles deRousiers in ue5-main branch]
2022-02-24 03:40:43 -05:00
Charles deRousiers
a02d41c4ee Renamed PROJECT_STRATA into STRATA_ENABLED.
This avoids to define STRATA_ENABLED as 'env. define' for all global shaders needing a Strata specific path.

#rb none
#jira none
#fyi sebastien.hillaire
#preflight 62151b25797dbbeb472ae2eb

[CL 19074999 by Charles deRousiers in ue5-main branch]
2022-02-22 12:35:58 -05:00
jeannoe morissette
96d49c3875 Fix SubsurfaceScattering indirect args (causes artefacts in Vulkan).
#rb Tiantian.Xie,Charles.deRousiers
#preflight 61f32a708255dba0d6bd4508

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18770335 in //UE5/Release-5.0/... via CL 18770336 via CL 18770453
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18770462 by jeannoe morissette in ue5-main branch]
2022-01-28 08:50:38 -05:00
tiantian xie
0bf7142f83 Fix splitscreen subsurface scattering issue, and reduce unnecessary calculation in splitscreen settings.
#jira UE-137138
#preflight 61e6f9cb837b79f7cced8d2e

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18642689 in //UE5/Release-5.0/... via CL 18644166 via CL 18644455
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18644692 by tiantian xie in ue5-main branch]
2022-01-18 14:18:49 -05:00
tiantian xie
319e7999ef Fix subsurface scattering alpha issue with alpha compositing on
#ushell-cherrypick of 18584689 by Tiantian.Xie

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18586850 via CL 18586900 via CL 18587137 via CL 18587159 via CL 18587185
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18587209 by tiantian xie in ue5-main branch]
2022-01-12 13:41:35 -05:00
UnrealBot
c47e81b2cb Branch snapshot for CL 18531810
[CL 18531810 in ue5-main branch]
2022-01-06 16:44:09 +00:00
UnrealBot
2987349d36 Branch snapshot for CL 18514113
[CL 18514113 in ue5-main branch]
2022-01-05 20:41:17 +00:00
tiantian xie
63f63d8e15 Remove the parameterization of Dipole code path for Separable SSS.
#jira UE-136412
#rb sebastien.hillaire, wei.liu
#preflight 61d49b935d522c9b40837c1c

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18518799 in //UE5/Release-5.0/... via CL 18518817
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18518828 by tiantian xie in ue5-release-engine-test branch]
2022-01-05 10:06:19 -05:00
tiantian xie
c79a6428e7 Fix mac crash for subsurface scattering recombine fall back pass when engine flag of SSS is disabled.
#jira UE-135508
#rb Lukas.Hermanns

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18406205 in //UE5/Release-5.0/... via CL 18406230
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18406235 by tiantian xie in ue5-release-engine-test branch]
2021-12-08 10:41:58 -05:00
tiantian xie
708cb3100b Fix subsurface profile id visualization.
#jira UE-136376
#rb none

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18382603 in //UE5/Release-5.0/... via CL 18382614
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18382628 by tiantian xie in ue5-release-engine-test branch]
2021-12-06 10:32:46 -05:00
tiantian xie
2577f56ac1 Add separable filter support for non-Subsurface profile subsurface scattering material using strata.
#jira UE-135176
#preflight 61a6968cbf3f1ffda2aa7853
#rb Charles.deRousiers, Sebastien.Hillaire

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18338900 in //UE5/Release-5.0/... via CL 18338923
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18338938 by tiantian xie in ue5-release-engine-test branch]
2021-12-01 09:56:22 -05:00
charles derousiers
078f5165f1 Move SS profiles and SS pre-intregrated profiles textures onto the view in order to make them accessible to all passes without extra manual binding.
#rb sebastien.hillaire, tiantian.xie, wei.liu
#jira none
#preflight 61a61f01f70a9e92dbe9e700

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18323676 in //UE5/Release-5.0/... via CL 18323690
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18323696 by charles derousiers in ue5-release-engine-test branch]
2021-11-30 08:27:29 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
tiantian xie
397158cfb6 Subsurface Scattering Engine flag changes the albedo
#jira UE-133510
#rb Juan.Canada

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18223413 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v895-18170469)

[CL 18223467 by tiantian xie in ue5-release-engine-test branch]
2021-11-17 10:05:03 -05:00
tiantian xie
f97ab2884f [Major] Reduce SSS performance overhead when SSS only occupies a small region (e.g., from 0.7ms to 0.2ms).
1. Reduce unnecessary UAV Clear with property velocity projection. Only subpass one UAV is cleared conditionally when separable tiles are detected.
            2. Remove subsurface view copy and use tile based recombine.
            3. Mipmaps are generated only when there are many Burley tiles ( default r.SSS.Burley.MinGenerateMipsTileCount to 4000)
[Minor] Rename pass and texture names, and use proper descriptors.

#jira UE-131573
#rb jian.ru
#ushell-cherrypick of 17979880 by Tiantian.Xie
#preflight 617c0c6b5dbdbc00016ea885

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 17983475 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)

[CL 17983481 by tiantian xie in ue5-release-engine-test branch]
2021-10-29 12:53:33 -04:00
tiantian xie
9d860a038e Improve cinematic human skin rendering performance when filling most of the screens, and fix half resolutioin boundary flickering.
#jira UE-132026
#rb Krzysztof.Narkowicz
#preflight 61798fbe4d944500010ee4ff

#ushell-cherrypick of 17947828 by Tiantian.Xie

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 17951326 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)

[CL 17951354 by tiantian xie in ue5-release-engine-test branch]
2021-10-27 16:39:57 -04:00