Commit Graph

184 Commits

Author SHA1 Message Date
florin pascu
dbcd6198d0 Add the Frequency name to the "Unrecognized shader frequency" Shader Compiler error
#jira none
#rb Carl.Lloyd
#preflight 6319e1662b7fe03eb6a70f52

[CL 21907568 by florin pascu in ue5-main branch]
2022-09-08 19:36:17 -04:00
Yuriy ODonnell
bdcb1cc814 Move duplicated implementations of ParseRayTracingEntryPoint() to ShaderCommon module
#preflight 631a28a0967ffc68fbe3d8a7
#rb jason.nadro

[CL 21900443 by Yuriy ODonnell in ue5-main branch]
2022-09-08 15:20:52 -04:00
Florin Pascu
6b3c1469ba Preview Shader Platform using different ShaderMaps and the DDPI/Cvar values of the Previewable Actual Platform
NumPlatforms limit changed from 64 to 65536, limited by NumBits
#jira UE-120561
#rb Chris.Waters, Jack.Porter, Mihnea.Balta
#preflight 630f1604f92416fb92b373ab

[CL 21718179 by Florin Pascu in ue5-main branch]
2022-08-31 04:38:34 -04:00
christopher waters
56b4134b24 Fixing debug DXC shader compiles.
When D3DCOMPILE_SKIP_OPTIMIZATION is set, none of the other D3DCOMPILE_OPTIMIZATION_LEVEL flags are set. Given that D3DCOMPILE_OPTIMIZATION_LEVEL1 is "0", this always forced debug shader builds to be compiled with "/Od /O1".
The fix is to ignore the other flags when D3DCOMPILE_SKIP_OPTIMIZATION is set.

#jira none
#rb massimo.tristano, mihnea.balta
#preflight 630e1989e54ec9d581800a92

[CL 21701349 by christopher waters in ue5-main branch]
2022-08-30 11:08:48 -04:00
christopher waters
bd14aa177e Moving bindless resource count validation into the new UE::ShaderCompilerCommon::ValidatePackedResourceCounts
#jira UE-161950
#rb kenzo.terelst, yuriy.odonnell
#preflight 6307a0d03703fd9528673032

[CL 21567446 by christopher waters in ue5-main branch]
2022-08-25 13:02:21 -04:00
Yujiang Wang
f6dc5c0058 Make sure every uniform buffer name in shader optional data is a valid name, i.e. no more "None"-s. Usually it's $Global being removed
#rb laura.hermanns
#preflight 62f1216bd76ea4b503e25128

[CL 21269863 by Yujiang Wang in ue5-main branch]
2022-08-08 12:01:59 -04:00
Laura Hermanns
5217d615d5 Only clear loop control mask instead of replacing Unroll with Loop mask when cross-compiling HLSL-to-HLSL.
#rb Christopher.Waters
#fyi Ryan.Hummer, Andrew.Wang
#preflight 62dae116d54af4b9a244c1dc
#jira UE-160185
#rnx

[CL 21226240 by Laura Hermanns in ue5-main branch]
2022-07-22 14:36:08 -04:00
aleksander netzel
f5fc355c09 Require DXR Tier 1.1 for ray tracing and use shader model 6.5 for all ray tracing shaders in SM5 mode.
#rb Yuriy.Odonnell
#preflight 62d87aad185da2495f0fba0f

[CL 21200656 by aleksander netzel in ue5-main branch]
2022-07-21 10:27:22 -04:00
Arciel Rekman
09175d79ea Multi-viewport on PC (D3D11/12, Vulkan).
- RHISupportsMultiviewport made to work on relevant shader platforms.
- RHISetStereoViewport implemented
- Unused outputs removal fixed to always consider viewport index used.
- Renamed confusing terminology (multiview -> multiviewport).
- Added a CVar (vr.MultiViewport) to force disable
- Added a canvas output to know the method in non-Shipping

#jira UE-151349
#review @Robert.Srinivasiah, @Jules.Blok, @JeanNoe.Morissette
#rb Robert.Srinivasiah, Jules.Blok, Chris.Waters
#preflight 62d193c43b057e727491c9d2

[CL 21153050 by Arciel Rekman in ue5-main branch]
2022-07-18 17:31:15 -04:00
christopher waters
a987160f55 Reworking the parameter rewrite code to do automatic bindless
- Refactoring FShaderParameterParser to use more string views since we can rely on OriginalParsedShader not changing.
- Split FShaderParameterParser::ParseAndMoveShaderParametersToRootConstantBuffer into smaller functions
- Moving FShaderParametersMetadata::IterateShaderParameterMembers into the only module it's used in, ShaderParameterParser.cpp
- Adding CFLAG_BindlessResources which will be set when ENABLE_BINDLESS_RESOURCES is set
- Adding CFLAG_BindlessSamplers which will be set when ENABLE_BINDLESS_SAMPLERS is set
- Adding resource/sampler detection and conversion to bindless in FShaderParameterParser

#jira UE-139616
#rb guillaume.abadie, jeannoe.morissette, yuriy.odonnell, laura.hermanns
#preflight 62d180cce468fcfd0b7001a0

[CL 21111994 by christopher waters in ue5-main branch]
2022-07-15 12:25:44 -04:00
christopher waters
b28a0c467f Moving ShaderParameterParser into its own source files.
#jira none
#rb guillaume.abadie, kenzo.terelst
#preflight 62b0ecb8ec13d14b5a1897ba

[CL 20757788 by christopher waters in ue5-main branch]
2022-06-21 10:49:56 -04:00
christopher waters
0c8638b589 Removing the "equality comparison with extraneous parentheses" warning from DXC compiles.
#jira none
#rb laura.hermanns
#preflight 62aa2c56da0af39a474fbb74

[CL 20677503 by christopher waters in ue5-main branch]
2022-06-15 17:57:39 -04:00
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