Commit Graph

1369 Commits

Author SHA1 Message Date
mihnea balta
e4dd7a950d Fix assert when the render thread crashes which was obscuring the real location of the crash.
The ERenderingThread named thread tag is not removed from ActiveNamedThreads when the render thread crashes, because the stack isn't unwound; this causes the assert in FTaskTagScope to fire when the Exit() method tries to set the tag. This resulted in the assert showing up as the cause of the crash, obscuring logs, crash reports etc.

#rnx
#lockdown Juan.Canada
#jira UE-143055
#rb Andriy.Tylychko, Arne.Schober, danny.couture
#preflight 620e35768b6428e701a2098d

#ROBOMERGE-AUTHOR: mihnea.balta
#ROBOMERGE-SOURCE: CL 19068406 in //UE5/Release-5.0/... via CL 19087994
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19130574 by mihnea balta in ue5-main branch]
2022-02-24 18:45:28 -05:00
Jason Nadro
dcd55e3f15 Fix Game Thread and Render Thread access issues when performing shader compilation using FMaterial.
- SubmitCompileJobs was assumed to be render thread only.  Make this explicit in the function name and add a render thread check.
- Add SubmitCompileJobs_GameThread to perform shader compilation submitted from the Game Thread safe.
- Keep a ref to a GameThreadPendingCompilerEnvironment because the one on the GameThreadShaderMap goes away after we clone.
- Add render thread check to GetRuntimeVirtualTextureOutputAttibuteMask_RenderThread
- Move simple enum types from ShaderCompiler.h to ShaderCompilerCore.h so we can access EShaderCompileJobPriority in MaterialShared.h
- Fixup incorrect usage SubmitCompileJobs that was submitted from the Game Thread using the Render Thread maps.

#rb Ben.Ingram
#jira none
#preflight 6216879fdb60b6b592f1d97f

[CL 19098715 by Jason Nadro in ue5-main branch]
2022-02-23 14:59:45 -05:00
Jason Nadro
52f9210b79 Fix a bug with GetMaxNumInstructionsForShader that report the incorrect instruction count for the given shader type.
- The function was not checking to see if the shader type in the pipeline was the same as the shader type we are asking for.

#rb Ben.Ingram
#jira none
#preflight 62156610840463c99a740f2f

[CL 19089930 by Jason Nadro in ue5-main branch]
2022-02-23 08:41:47 -05:00
Jeremy Moore
5c2bc8c5b2 Move ShaderMetaDataBuilder code into ComputeFramework which is the only place using it.
Preliminary to adding better support for nested structs.
#rnx
#preflight 62155451dc0170cfb36dfc69

[CL 19081188 by Jeremy Moore in ue5-main branch]
2022-02-22 16:34:35 -05:00
robert millar
b7b8b8d70c Fixes for memory image names.
Correctly write to MemoryImageNames array, copy contents of TArrayView rather than the layout of the view object itself, handle name layout during patch application on foreign platforms.

#rb none
[FYI] johan.torp, ben.ingram

#ROBOMERGE-OWNER: Ben.Woodhouse
#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 19068807 via CL 19068829 via CL 19074886 via CL 19075335 via CL 19077116
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19077183 by robert millar in ue5-main branch]
2022-02-22 14:13:32 -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
Sebastien Hillaire
7c6830b98e Strata - new blending mode.
- works for starta and legacy conversion material
- legacy converted to strata setup the strata blending mode
- strata material also affect legacy blending mode because it is used in multiple places in the engine.
- works for lit and unlit legacy material
- to be fixed:
    - lit with premultiplied alpha
    - materials with multiple shading models

#preflight https://horde.devtools.epicgames.com/job/6214893c3577e44741abf99f
#rb charles.derousiers

[CL 19069633 by Sebastien Hillaire in ue5-main branch]
2022-02-22 02:26:20 -05:00
lukas hermanns
35efe2a2e0 Allow DXC precompilation for selected shaders.
Patch SPIR-V and HLSL intermediate source when DXC precompilation is used.
Workaround HLSL cross-compilation packing issue by rearranging members in FVolumetricFogGlobalData.

#rb michal.valient
#jira UE-142918
#preflight 620d8c8b7e2cef4bf1c34ab1
#rnx

#ROBOMERGE-AUTHOR: lukas.hermanns
#ROBOMERGE-SOURCE: CL 19029598 in //UE5/Release-5.0/... via CL 19059758
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066338 by lukas hermanns in ue5-main branch]
2022-02-21 02:06:52 -05:00
Jeremy Moore
49a6a9b49c Add a prebuilt nested struct to a ShaderParametersMetadataBuilder.
Will be useful for Optimus programatic metadata building.
#rnx
#preflight 620fbe9e6c6c638c07026314

[CL 19050461 by Jeremy Moore in ue5-main branch]
2022-02-18 10:56:11 -05:00
guillaume abadie
31f640693c Fixes black mip 0 in DumpGPU when a texture have a mip chain on D3D11 by using the capture by compute shader
#rb juan.canada
#jira none
#preflight none

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 18994510 in //UE5/Release-5.0/... via CL 18994530 via CL 18994569
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18997947 by guillaume abadie in ue5-main branch]
2022-02-15 12:06:09 -05:00
mihnea balta
1a0654f905 Allow r.ForceLOD in shipping editor builds.
#rnx
#rb trivial
#preflight 620a2cb9d332bab85315e3c6

#ROBOMERGE-AUTHOR: mihnea.balta
#ROBOMERGE-SOURCE: CL 18977627 via CL 18978035 via CL 18978043 via CL 18978044 via CL 18992701 via CL 18992998
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18997314 by mihnea balta in ue5-main branch]
2022-02-15 11:33:51 -05:00
carlmagnus nordin
73b0e31128 Fixed double delete when destroying shader code libraries
#rnx
#rb arciel.rekman

#ROBOMERGE-AUTHOR: carlmagnus.nordin
#ROBOMERGE-SOURCE: CL 18976878 via CL 18976901 via CL 18976906 via CL 18992591 via CL 18992966
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18997224 by carlmagnus nordin in ue5-main branch]
2022-02-15 11:30:47 -05:00
aurel cordonnier
a6fca32d43 Fix for content worker
#rnx
[FYI] jason.hoerner

#ROBOMERGE-AUTHOR: aurel.cordonnier
#ROBOMERGE-SOURCE: CL 18973286 via CL 18973292 via CL 18992571 via CL 18992948
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18997179 by aurel cordonnier in ue5-main branch]
2022-02-15 11:29:24 -05:00
aurel cordonnier
86060477cf Fix some integration fallout
#rnx

#ROBOMERGE-OWNER: aurel.cordonnier
#ROBOMERGE-AUTHOR: aurel.cordonnier
#ROBOMERGE-SOURCE: CL 18973123 via CL 18973124 via CL 18992353 via CL 18992916
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18993023 by aurel cordonnier in ue5-main branch]
2022-02-15 01:55:27 -05:00
guillaume abadie
9e050bfe3f Adds a UE-DumpGPUPath environment variables to dump across perforce workspaces at the same location by default on a dev machine
#rb juan.canada
#jira none
#preflight none
#lockdown juan.canada

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 18978917 in //UE5/Release-5.0/... via CL 18978987 via CL 18979086
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18979099 by guillaume abadie in ue5-main branch]
2022-02-14 09:56:14 -05:00
evgenii babinets
b2a6f3b688 Another attempt at fixing a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.
Last attempt failed some editor tests since those tests construct buffers with bNeedsCpuAccess = false even though editors must keep all resources. Changing the condition for freeing the resource object to see if its array was freed directly.

Original description:

It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.
This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).

#rb jordan.cristiano
#preflight 620529984c6c33118fa6fdc7

[CL 18937113 by evgenii babinets in ue5-main branch]
2022-02-10 11:26:38 -05:00
arciel rekman
35ecf94fcb Do not attempt to split 1 shader groups even if they are larger than the threshold (UE-141903).
#rb PJ.Kack
#jira UE-141903
[REVIEW] [at]PJ.Kack
#preflight 6203d3c30927956f66b87cc2

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18917857 in //UE5/Release-5.0/... via CL 18926686 via CL 18928199
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18928444 by arciel rekman in ue5-main branch]
2022-02-09 19:03:46 -05:00
carl lloyd
7119eccc6d Added support for framebuffer fetch and pixel local storage to OpenGLES with DXC
(Submitting for Carl.Lloyd)
#rb Dmitriy.Dyomin, Laura.Hermanns
#lockdown Jack.Porter
#jira UE-120580
#preflight None

#ROBOMERGE-OWNER: carl.lloyd
#ROBOMERGE-AUTHOR: jack.porter
#ROBOMERGE-SOURCE: CL 18916240 in //UE5/Release-5.0/... via CL 18926540 via CL 18927298
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18927326 by carl lloyd in ue5-main branch]
2022-02-09 18:32:08 -05:00
evgenii babinets
7dd8af4ddb Backing out 18896978 due to another EngineTest failure. Original description:
Second attempt at fixing a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.

It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.

This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).

#rb josie.yang
#preflight 62017cbae9567e667308aa18

#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18894475 via CL 18894521 via CL 18894553 via CL 18896447 via CL 18896609
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
#ROBOMERGE-CONFLICT from-shelf
#preflight 6203cc23530b346f8618b67b

[CL 18917352 by evgenii babinets in ue5-main branch]
2022-02-09 09:35:00 -05:00
christopher waters
343ba94423 Deprecating RHI*CommandList::SetComputeShader and switching uses to the PSO cache's SetComputePipelineState. This is to get compute shaders in our PSO cache lists as well as move towards ComputePipelineState as the default binding method.
#jira none
#rb arciel.rekman, mihnea.balta, jeannoe.morissette
#preflight 6202a549e85c7a08bbee815f

[CL 18905326 by christopher waters in ue5-main branch]
2022-02-08 13:19:37 -05:00
evgenii babinets
00605f283c Second attempt at fixing a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.
It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.

This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).

#rb josie.yang
#preflight 62017cbae9567e667308aa18

#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18894475 via CL 18894521 via CL 18894553 via CL 18896447 via CL 18896609
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
#ROBOMERGE-CONFLICT from-shelf

[CL 18896978 by evgenii babinets in ue5-main branch]
2022-02-07 20:04:27 -05:00
pj kack
6a68bde0d8 Fix non-deterministic sorting in iostore shader group compression logic.
Replace the map with an array for efficiency.

#jira UE-141110
#rb arciel.rekman
#rnx
#preflight 61fc374ca540d6e61bba7104

#ROBOMERGE-AUTHOR: pj.kack
#ROBOMERGE-SOURCE: CL 18886818 in //UE5/Release-5.0/... via CL 18886830 via CL 18887180
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18887383 by pj kack in ue5-main branch]
2022-02-07 12:30:43 -05:00
eric mcdaniel
4ae57bc005 [Backout] - CL18864159
- backing out this change as it broke Xbox in UE5/Main
 - Example failed Horde tests:
  - https://horde.devtools.epicgames.com/job/61fd7dc8a6165e535689f6e4?step=0856
   - https://horde.devtools.epicgames.com/job/61fd7dc8a6165e535689f6e4?step=0250

#rb evgenii.babinets
#jira none
#preflight 61fdcfa1e65336d1455736bc
#fyi evgenii.babinets

Original CL Desc
-----------------------------------------------------------------
Fixed a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.

It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.

This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).

#rb josie.yang
#preflight Horde doesn't work, but compiled locally.

#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18862796 via CL 18862801 via CL 18862826 via CL 18863875 via CL 18864138
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18878916 by eric mcdaniel in ue5-main branch]
2022-02-04 20:48:30 -05:00
richard wallis
c13b410b24 Fix DumpGPU on macOS. Begin Resource Dump occurs in: FSlateApplication::Get().Tick(ESlateTickType::PlatformAndInput); which is after GEngine->Tick(FApp::GetDeltaTime(), bIdleMode);. Make the defered dump command request a GPU dump for the next frame by adding an InitDump function so it's clear for any platform when to begin. Could add 1 when setting the DumpingFrameCounter_GameThread but that seems brittle across platforms.
Allow more flexibility of the Metal RHICopyToResolveTarget to include compatable texture view pixelformats.  Fixes validation error when resolving between sRGB and RGB formats.

FMetalContext: don't assert then go into the weeds on macOS when there are no render targets.

#jira UE-140658,  UE-120222
#preflight  61fd124b2839dd07cb98d771
[REVIEW] [at]will.damon,  [at]Guillaume.Abadie
#rb will.damon,  Guillaume.Abadie
#lockdown cristina.riveron
#rnx

#ROBOMERGE-AUTHOR: richard.wallis
#ROBOMERGE-SOURCE: CL 18864871 in //UE5/Release-5.0/... via CL 18864881 via CL 18865081
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18865102 by richard wallis in ue5-main branch]
2022-02-04 12:01:46 -05:00
evgenii babinets
1446e36b0f Fixed a GameThread stall (waiting for render thread) whenever a CVar is changed during gameplay.
It seems like the intent of the callback sink for r.FreeSkeletalMeshBuffers was to free eligible CPU buffers when the CVar was raised to 1, but unfortunately we're currently relying on this sink to free certain helper structures.

This change allows those structures to be freed after submitting the buffers to RHI so that we can change the callback sink to only do work on the rising edge (which generally only happens when switching game-mode/device profile and not during gameplay).

#rb josie.yang
#preflight Horde doesn't work, but compiled locally.

#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 18862796 via CL 18862801 via CL 18862826 via CL 18863875 via CL 18864138
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18864159 by evgenii babinets in ue5-main branch]
2022-02-04 11:07:20 -05:00