Commit Graph

145 Commits

Author SHA1 Message Date
mark lintott
c604aff49b Fix for HRESULT return value
#rb trivial
#jira none
#preflight 61ee86a3ef289ffc6de12b99

#ROBOMERGE-AUTHOR: mark.lintott
#ROBOMERGE-SOURCE: CL 18706928 in //UE5/Release-5.0/... via CL 18706930 via CL 18706941
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18706945 by mark lintott in ue5-main branch]
2022-01-24 06:12:09 -05:00
christopher waters
cb6d99d667 Switching ERHIFeatureLevel:SM6 from SM6.5 to SM6.6 which allows us to use the built-in 64bit atomics.
AMD still has issues with SM6.6 but we can't wait on their fixes much longer.

#jira none
#rb mihnea.balta, lukas.hermanns
#preflight 61eb15ae731e3b40889d249c

[CL 18697016 by christopher waters in ue5-main branch]
2022-01-21 16:50:04 -05:00
mark lintott
bc890828d2 Status Analysis fix.
[FYI] christopher.waters
#rb none
#jira none
#preflight 61eadd9eea0da8133dce0e29

#ROBOMERGE-AUTHOR: mark.lintott
#ROBOMERGE-SOURCE: CL 18690463 in //UE5/Release-5.0/... via CL 18690505 via CL 18690525
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18690546 by mark lintott in ue5-main branch]
2022-01-21 11:40:12 -05:00
Lukas Hermanns
1d839de73a Fix static analysis warning in IDxcResult::GetOutput function call.
#rb none
#fyi Kevin.Ortegren
#jira UE-137627
#preflight 61dd91ae582e125e5126a809
#rnx

[CL 18576611 by Lukas Hermanns in ue5-main branch]
2022-01-11 16:01:07 -05:00
christopher waters
4cfc94b91a DXC provides the PDB name along with the DXC_OUT_PDB blob so we should use that instead of trying to (incorrectly) generate the hash ourselves. Removing the unnecessary string blob argument from all the other calls to GetOutput.
#jira none
#rb Yujiang.Wang
#preflight 61b8ca009c7c3936c8c7e6f0

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 18455753 in //UE5/Release-5.0/... via CL 18455789
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v898-18417669)

[CL 18455825 by christopher waters in ue5-release-engine-test branch]
2021-12-14 12:22:58 -05:00
christopher waters
fe5ee0b7c9 D3D shader debug data changes
- Putting UniformBuffer name array key in a global header
- UniformBuffer name array shouldn't even been compiled in configurations that don't populate it
- Load shader UniformBuffer names in D3D12
- Adding error logging to D3D12 resource binding, uses shader UniformBuffer names. Implementation copied from D3D11.

#jira none
#rb kenzo.terelst
#preflight 61b23198e0430ca438c973de

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 18420494 in //UE5/Release-5.0/... via CL 18422574
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18422839 by christopher waters in ue5-release-engine-test branch]
2021-12-09 14:50:45 -05:00
aleksander netzel
ec1898348b Add default InlineRayTracing support.
* Add shader implementation of TraceRayInline
* Add required RHI changes

#rb Yuriy.Odonnell
#preflight 619d69dff934c1a291078e0d

#ROBOMERGE-AUTHOR: aleksander.netzel
#ROBOMERGE-SOURCE: CL 18280920 in //UE5/Release-5.0/... via CL 18280924
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18280927 by aleksander netzel in ue5-release-engine-test branch]
2021-11-24 04:53:51 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
christopher waters
8d9fb8186f Initial work on SM6.6 support
- SM6.6 not enabled just yet.
- Adding our own defines of __SHADER_TARGET_MAJOR and __SHADER_TARGET_MINOR to mimic the DXC defines. Since we preprocess, we can't rely on DXC to define them for us.
- Adding support for 64bit atomic operations
- Changing part of Nanite PC atomic permutation selection to be based on DataDrivenPlatformInfo
- Fixing DXC shader debugging. The PDB section was still being stripped from the final DXIL.

#jira none
#rb rune.stubbe
#preflight 61548928f5e4fd0001d7d0b3

#ROBOMERGE-OWNER: christopher.waters
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 17665881 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v875-17642767)
#ROBOMERGE-CONFLICT from-shelf

[CL 17665943 by christopher waters in ue5-release-engine-test branch]
2021-09-29 15:13:20 -04:00
christopher waters
fb46ed18a4 D3D shader cleanup:
- Removed some unnecessary code from D3D shader compilers.
- Removing shader VendorExtensions runtime data from platforms that don't need them.
- Turning FShaderCodeFeatures into a set of flags to reduce its size. Adding a few new flags for future use.
- Moved the common D3D12 shader data and creation code into shared locations to cut down on code duplication.
- Removed the unnecessary copying of header data from all D3D12 shader types.
- Removed FD3D12ShaderBytecode since its values can be inferred from other shader data.

#jira none
#rb rolando.caloca, arciel.rekman
#preflight 6140c2df3aa82d000149f13b

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 17509617 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17509631 by christopher waters in ue5-release-engine-test branch]
2021-09-14 16:28:37 -04:00
guillaume abadie
d56bfe7b07 Migrates D3D to submit all loose shaders parameters in a single RHISetShaderParameter()
#rb none
#preflight 61323f857d30040001b77b61

#ROBOMERGE-OWNER: guillaume.abadie
#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17431343 via CL 17438616
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17438618 by guillaume abadie in ue5-release-engine-test branch]
2021-09-06 11:28:30 -04:00
lukas hermanns
c5400b94fe Replace EHlslShaderFrequency with EShaderFrequency in ShaderConductor interface.
Also remove further references to Hull and Domain shaders as tessellation is no longer supported in UE5.

#rb Will.Damon, Brian.White, Christopher.Waters, Jeannoe.Morissette
[FYI] Carl.Lloyd, Florin.Pascu, Ryan.Vance, Rolando.Caloca, Mihnea.Balta
#jira none
#rnx

#ROBOMERGE-SOURCE: CL 17408818 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17408845 by lukas hermanns in ue5-release-engine-test branch]
2021-09-02 16:41:03 -04:00
lukas hermanns
b405def68b Undo //UE5/Main/Engine/Source/... changelist 17355504
[FYI] Krzysztof.Narkowicz, Rolando.Caloca, Mihnea.Balta
#jira none
#rnx

#ROBOMERGE-SOURCE: CL 17408288 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17408305 by lukas hermanns in ue5-release-engine-test branch]
2021-09-02 16:06:07 -04:00
lukas hermanns
2825679ac2 Enable '-fdiagnostics-format' option in DXC and emit asbolute file paths in '#line'-directives.
#rb Krzysztof.Narkowicz
[FYI] Rolando.Caloca, Mihnea.Balta
#jira none
#rnx

#ROBOMERGE-SOURCE: CL 17355504 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17355524 by lukas hermanns in ue5-release-engine-test branch]
2021-08-30 14:05:48 -04:00
lukas hermanns
011e219a20 Fix mapping of EHlslShaderFrequency when cross-compiling HLSL-to-HLSL as appendix to CL 17291947.
#rb Christopher.Waters
#jira UE-117831
#rnx

#ROBOMERGE-SOURCE: CL 17317441 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17317452 by lukas hermanns in ue5-release-engine-test branch]
2021-08-26 10:22:08 -04:00
lukas hermanns
3c7f7188c0 Cross-compile HLSL-to-HLSL after FXC crashed due to internal error.
#rb Christopher.Waters
[FYI] Mihnea.Balta, Jonathan.Bard
#jira UE-117831

#ROBOMERGE-SOURCE: CL 17291947 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17291953 by lukas hermanns in ue5-release-engine-test branch]
2021-08-24 15:34:07 -04:00
christopher waters
1c21a5489c Shader symbol terminology changes
- Splitting symbol generation and shader "debug info" generation into two different cvars. This should now allow us to generate symbols post-packaging without generating different shader variants. This should also enable us to always generate symbols and still have the final deduplicated shader sizes.
- r.Shaders.Symbols is now the primary way to enable shader symbols for debugging.
- r.Shaders.GenerateSymbols can be enabled to always generate symbols without writing them to disk.
- r.Shaders.WriteSymbols can be used to force write symbols if they were previously generated.
- r.Shaders.ExtraData can be used to generate shader names for engine runtime systems to use.
- NotifyShaderCooked replaced with NotifyShaderCompiled, prep for upcoming non-cook symbol writing.
- PC DXC shader compiles should only generate debug info when requested, not all the time.
- PC FXC shader compiles should generate debug info when requested, not just when r.Shaders.Optimize is 0.

#jira none
#rb arciel.rekman, lukas.hermanns
#preflight 611ad9035e737200015992db

#ROBOMERGE-SOURCE: CL 17186155 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17186162 by christopher waters in ue5-release-engine-test branch]
2021-08-16 23:18:23 -04:00
guillaume abadie
ecff5e4123 Implements CFLAG_AllowRealTypes on SP_PCD3D_SM6
#rb chris.waters
#preflight 611ab4c19db7df0001caead4

#ROBOMERGE-SOURCE: CL 17179929 via CL 17179943
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17179974 by guillaume abadie in ue5-release-engine-test branch]
2021-08-16 15:12:30 -04:00
lukas hermanns
4ecb8af76e Added 'precise' qualifier to fix Z-fighting with World Position Offset (WPO) in MaterialTemplate.ush. Only affects D3D11/DXBC shaders on Windows.
#rb Kevin.Ortegren
[FYI] Mihnea.Balta
#jira UE-102725
#rnx

#ROBOMERGE-SOURCE: CL 16911422 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16911426 by lukas hermanns in ue5-release-engine-test branch]
2021-07-21 13:01:49 -04:00
christopher waters
5c38dbfd39 Removing validation skipping from the SM6.6 code path as it's a fully supported feature in our version of DXC.
#rb none
#jira none
[FYI] graham.wihlidal, rune.stubbe

#ROBOMERGE-SOURCE: CL 16756585 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16756586 by christopher waters in ue5-release-engine-test branch]
2021-06-23 10:14:53 -04:00
Lukas Hermanns
b5aafce030 Dump preprocessed shader source in log on D3DCompile exception.
#rb Rolando.Caloca
#fyi Michal.Valient, Mihnea.Balta, Luke.Thatcher, Arciel.Rekman, Chris.Bunner
#jira UE-114967
#rnx

[CL 16518546 by Lukas Hermanns in ue5-main branch]
2021-06-01 14:24:07 -04:00
Lukas Hermanns
b7a50e1d3d Report error code and addresses on D3DCompile exception.
#rb Rolando.Caloca
#jira UE-114967
#rnx

[CL 16437813 by Lukas Hermanns in ue5-main branch]
2021-05-24 14:02:01 -04:00
Arciel Rekman
d1e2a85fce Keep rewriting unused inputs until they stop changing (UE-115083)
- In a complex material, compiler may not be able to see through the code to discover all unused inputs.

E.g. first pass compilation says that input A is unused, but B and C are used. After we rewrite the code to remove A, the code is simpler and compiler is now able to see that B is also unused.

Since we pass the "used attributes" to the next stage, this creates a mismatch where vertex shader outputs only C, but pixel shader (rewritten based on the first pass results) expects B and C.

- The fixed code will check if the unused inputs changed, and if so, will go back and rewrite the code based on a more complete info.

- This fixes a bug that JonL ran into for which I haven't yet created a JIRA (will do before checkin).

#rb Ben.Ingram, Rolando.Caloca, Jason.Nadro
#review @Lukas.Hermanns, @Rolando.Caloca, @Ben.Ingram, @Jason.Nadro, @Kevin.Ortegren
#jira UE-115083

[CL 16312596 by Arciel Rekman in ue5-main branch]
2021-05-13 10:21:33 -04:00
Yuriy ODonnell
aa9e6a0c41 Added a basic implementation of assert in shaders for D3D12. Requires SM6 support which can be enabled through r.D3D12.AllowShaderModel6=1.
Example usage in a shader:

PLATFORM_ASSERT4(GroupThread > 4321, 0xDF7DC903, GroupThread, GroupIndex, GroupBase, asuint(123.456f));

Example GPU crash report output:

LogD3D12RHI: Error: [GPUBreadCrumb] Last tracked GPU operations:
LogD3D12RHI: Error: [GPUBreadCrumb]	3D Queue 0 - Begin: Frame 348 - Scene - ReflectionIndirect - RayTracingReflections - RayTracingDeferredReflectionsShade 957x466
LogD3D12RHI: Error: [GPUBreadCrumb]	Shader assertion failed! ID: 0xDF7DC903
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload  [int32]: 416 42 172032 1123477881
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload [uint32]: 416 42 172032 1123477881
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload    [hex]: 0x000001A0 0x0000002A 0x0002A000 0x42F6E979
LogD3D12RHI: Error: [GPUBreadCrumb]	Payload  [float]: 0.000000 0.000000 0.000000 123.456001

This works through automatic diagnostic buffer binding in D3D12 RHI, which becomes available in *any* shader as a UAV.
Opens the door for arbitrary human-readable message output from any shader in the future.

PLATFORM_ASSERT macro is always enabled and available on supported platforms. It is intended to be a low-level mechanism for a higher-level check() that would be controlled via CVars.

#rb Christopher.Waters

[CL 16167404 by Yuriy ODonnell in ue5-main branch]
2021-04-30 08:37:35 -04:00