Commit Graph

172 Commits

Author SHA1 Message Date
christopher waters
784625ccec Include Reflection data with SM6 embedded PDBs. This makes them way more useful in PIX.
#jira none
#rb jason.nadro, arciel.rekman, zach.bethel
#preflight 628e8695592ae524e3daac98

[CL 20400241 by christopher waters in ue5-main branch]
2022-05-27 17:56:55 -04:00
laura hermanns
9108353e55 Expand handling of D3D internal compiler errors.
#rb Jason.Nadro
#jira UE-154204
#rnx

#ROBOMERGE-AUTHOR: laura.hermanns
#ROBOMERGE-SOURCE: CL 20382878 via CL 20382903 via CL 20382926
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20385710 by laura hermanns in ue5-main branch]
2022-05-26 17:10:39 -04:00
tiago costa
fc62d1fc0e Initial support for deferred decals in path tracer.
- Decals materials are evaluated using callable shaders in PathTracingKernel.
- Decals are culled using a 2D grid similar to the existing light grid.
- In order to correctly handle decal blending order, decals are sorted using the same logic as the rasterizer on CPU. The compute shader that builds the decal grid maintains the correct order.
- Decal materials are wrapped in FRayTracingDecalMaterialShader. The instance parameters of each decal are bound using uniform buffers.

#preflight 628f3fed2f2409bc1e7a6414
#rb Yuriy.ODonnell, chris.kulla, Jeremy.Moore

[CL 20377336 by tiago costa in ue5-main branch]
2022-05-26 05:59:55 -04:00
Laura Hermanns
71b90823ed Force DXC precompilation when FXC contains an "internal error: out of memory" report.
#rb Jason.Nadro
#jira FORT-478366
#preflight 62840e8f82530182723e144b
#rnx

[CL 20260406 by Laura Hermanns in ue5-main branch]
2022-05-18 09:58:29 -04:00
christopher waters
1e01768e33 Bindless shader parameters
- Adding support for bindless resources/samplers. The loose resources have to be wrapped in a macro that generates an index and proxy resource when bindless is enabled. Reflection has to parse these differently from other resources since they're parsed as uint parameters. The runtime also has to bind these differently since they end up needing to find their real resource in the binding data and then update a constant buffer.
- To assist in conversions, the shader compiler will detect if a shader is compiled with both bindless and non-bindless resources/samplers and will emit errors if that is the case.
- Adding support for bindless Uniform Buffer resources/samplers. Because Uniform Buffers aren't per-shader, they'll always update their constants with the bindless indices of their resources.
- Adding more flags to FShaderCodePackedResourceCounts required changing all the array initializations to individual parameters since not all the new flags are used everywhere.
- No shaders have been configured to support bindless resources/samplers. Yet.

#jira UE-139616
#rb zach.bethel, arciel.rekman
#preflight 6282b8ec44349a6581a21a39

[CL 20250348 by christopher waters in ue5-main branch]
2022-05-17 16:30:48 -04:00
Jeremy Moore
07188d9a76 Remove USE_WPO_PRECISE
Instead make the output VelocityPrevScreenPosition interpolant INVARIANT which is a better match for the other approaches to INVARIANT in the shader code.
Initially the USE_WPO_PRECISE code was added for DXBC only, to prevent mismatch between depth and base pass. This type of error was later more widely fixed by 19392831.
This fix led to another need for USE_WPO_PRECISE. That came from the output position now being (correctly) INVARIANT but the output VelocityPrevScreenPosition didn't have INVARIANT. This could lead to very different calculations between current and previous position and therefore incorrect velocity vectors.
#preflight 62755e8be31cfc52d5c5d21d

[CL 20080347 by Jeremy Moore in ue5-main branch]
2022-05-06 14:03:50 -04:00
christopher waters
4e12726208 Migrating back to using UniformBuffer structs.
Since the cbuffer uses the same name as the struct, we have to rename the cbuffer using a consistent prefix. The reflection handling also needs to reinterpret the renamed cbuffer as the correct UniformBuffer.

#jira none
#rb mihnea.balta
#preflight 626c1762ce3959ce8fe7766e

[CL 20026049 by christopher waters in ue5-main branch]
2022-05-03 11:09:45 -04:00
Laura Hermanns
f73012d4af Rebuild ShaderConductor as appendix to CL 19924020. Bumped GUID numbers in *Common.ush headers.
#rb Christopher.Waters
#jira none
#rnx
#preflight 62685030853fdb6fddd3992f

[CL 19927891 by Laura Hermanns in ue5-main branch]
2022-04-26 16:27:45 -04:00
Laura Hermanns
c951912300 Rebuild ShaderConductor for Win64, Mac, and Linux with DXC update from Apr 2022.
Replace outdated DXC API headers from DirectX SDK folder with primary DXC source folder.

#review-19909455 19605490
#fyi Mihnea.Balta, Rolando.Caloca, Jeannoe.Morissette, Will.Damon, Brandon.Schaefer, Michael.Sartain, Guillaume.Abadie, Graham.Wihlidal, Christopher.Waters
#jira none
#rnx
#preflight 6267ec17853fdb6fddb97dd5

[CL 19924020 by Laura Hermanns in ue5-main branch]
2022-04-26 13:29:01 -04:00
Jeremy Moore
1b2a1e57ea #jira UE-149712
Use MakePrecise() on WPO
This was happening for FXC compiler but not DXC compiler.
It was causing broken velocity vectors, and broken editor outlines on SM6.
#preflight 6260629add47b4ad2180eb83

[CL 19837321 by Jeremy Moore in ue5-main branch]
2022-04-20 16:18:10 -04:00
eric mcdaniel
bf7658a0f6 [Backout] - CL19813742
- backing out due to assertions in Vulkan shader compiler
  - constant buffer renaming causes failures to lookup parameter name

#preflight 625f6ed5e239763df51ba585
#fyi christopher.waters

Original CL Desc
-----------------------------------------------------------------
Migrating back to using UniformBuffer structs.
Since the cbuffer uses the same name as the struct, we have to rename the cbuffer using a consistent prefix. The reflection handling also needs to reinterpret the renamed cbuffer as the correct UniformBuffer.

#jira none
#rb kenzo.terelst
#preflight 625edc5f034d8924cdcc35e2

[CL 19825755 by eric mcdaniel in ue5-main branch]
2022-04-19 22:40:31 -04:00
christopher waters
5c395bb058 Migrating back to using UniformBuffer structs.
Since the cbuffer uses the same name as the struct, we have to rename the cbuffer using a consistent prefix. The reflection handling also needs to reinterpret the renamed cbuffer as the correct UniformBuffer.

#jira none
#rb kenzo.terelst
#preflight 625edc5f034d8924cdcc35e2

[CL 19813742 by christopher waters in ue5-main branch]
2022-04-19 14:32:30 -04:00
Laura Hermanns
8559b47f2f Allow environment variable FXC to be used with shader debugging batch scripts to avoid hardcoded system path.
#rb Arciel.Rekman
#fyi Christopher.Waters, Rolando.Caloca
#jira none
#rnx
#preflight 6230dc44fc4d442f893619c1

[CL 19793860 by Laura Hermanns in ue5-main branch]
2022-04-18 16:37:06 -04:00
christopher waters
46d39f296a Reorganizing reflection handling to funnel through common functions.
This is a prerequisite for upcoming bindless changes as it centralizes key points where we register the different binding types.

#jira none
#rb jason.nadro, eric.mcdaniel, jeannoe.morissette
#preflight 62574453f7476d662c8dd2fe

[CL 19761676 by christopher waters in ue5-main branch]
2022-04-14 15:46:20 -04:00
Jason Nadro
e76f354daa Set InstructionCount when compiling shaders with DXC
- This fixes an issue where all SM6 compiles were reporting 0 instructions.

#rb christopher.waters
#jira FORT-468097
#preflight none

[CL 19742347 by Jason Nadro in ue5-main branch]
2022-04-13 13:37:00 -04:00
christopher waters
0a8074d5a5 RemoveUniformBuffersFromSource shouldn't implicitly call TransformStringIntoCharacterArray.
#jira none
#rb jason.nadro
#preflight 624ddf0f090236773a1ad8c1

[CL 19656058 by christopher waters in ue5-main branch]
2022-04-06 17:19:38 -04:00
Charles deRousiers
546f1b27c6 Add ROV type support for shader binding.
#rb mihnea.balta
#jira none
#preflight 623b31aaca34ffd7bf7ca796

[CL 19481254 by Charles deRousiers in ue5-main branch]
2022-03-23 13:02:24 -04:00
Jason Nadro
65a90154a6 Add scoped cpu markers to various D3D shader compiler functions to make this easier to profile when shader compilation is done in process.
#rb trivial
#jira none
#preflight 62389f8fec68595f3b78e9df

[CL 19453136 by Jason Nadro in ue5-main branch]
2022-03-21 12:17:22 -04:00
Lukas Hermanns
2e57229bd3 Added uint64_t type to lexer grammar of HlslParser and improved warning output for removal of unused shader interpolators.
#rb Christopher.Waters
#fyi Kevin.Ortegren
#jira UE-145738
#rnx
#preflight 623219ca6d230f4cc800a13d

[CL 19409711 by Lukas Hermanns in ue5-main branch]
2022-03-16 15:04:39 -04:00
guillaume abadie
dc0b2fa6e9 Works arround a bunch of HLSL2021 bugs
DXC is missing some override of select()
DXC's -spirv is missing and() and or() intrinsics
Fixes CFLAG_WarningsAsErrors that would cause a compilation failure if rewritted HLSL for FXC had warning
Adds a COMPILER_SUPPORTS_HLSL2021

#rb rune.stubbe
#preflight 622aaaf2f44b0772ad9f743a

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 19352013 via CL 19352023
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19356591 by guillaume abadie in ue5-main branch]
2022-03-11 12:09:32 -05:00
Lukas Hermanns
999fb99c6c Enable HLSL 2021 language version (CFLAG_HLSL2021) in shader compiler backends.
#rb Guillaume.Abadie, Will.Damon
#fyi Carl.Lloyd, Ryan.Vance, Christopher.Waters, Mihnea.Balta, Rolando.Caloca, Yuriy.ODonnell, Graham.Wihlidal
#jira UE-138358
#preflight 6227b6b3c653e7ef9f571dc8

[CL 19319858 by Lukas Hermanns in ue5-main branch]
2022-03-09 09:47:28 -05:00
Lukas Hermanns
bb4b53d95d Patch separate atomic counter resource in HLSL precompilation step.
#rb Jamie.Hayes
#fyi Arciel.Rekman, Christopher.Waters
#jira none
#preflight 62265976123eef55e6f49362
#rnx

[CL 19302341 by Lukas Hermanns in ue5-main branch]
2022-03-08 09:39:42 -05:00
christopher waters
b7f30cbbaf Adding minimal interfaces to D3D11 and D3D12 RHIs
- Adding ID3D12DynamicRHI and ID3D11DynamicRHI interfaces for plugins that want to touch DirectX resources/devices directly.
- Adding specific headers for including DirectX headers: D3D12ThirdParty.h and D3D11ThirdParty.h
- Modifying plugins that were using D3D11RHIPrivate.h and D3D12RHIPrivate.h to use the interfaces instead.
- Removing plugin references to UE Modules and ThirdParty libraries that were only needed because they included the private RHI headers.
- Removing D3D11RHI/Private and D3D12RHI/Private from plugin include paths.

#jira none
#rb jeannoe.morissette, kenzo.terelst, mihnea.balta, eric.mcdaniel
#preflight 6222395bb066ef60bbad004a

[CL 19267223 by christopher waters in ue5-main branch]
2022-03-04 11:34:00 -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
lukas hermanns
1191c5566c Use DXC re-compilation when FXC crashed or ran out of memory.
#rb Rolando.Caloca
#jira UE-142759
#preflight 620be47901253d2e19e2c0c4
#rnx

#ROBOMERGE-AUTHOR: lukas.hermanns
#ROBOMERGE-SOURCE: CL 19002613 in //UE5/Release-5.0/... via CL 19003108 via CL 19004533
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 19004719 by lukas hermanns in ue5-main branch]
2022-02-15 17:08:37 -05:00