730 Commits

Author SHA1 Message Date
kenzo terelst
6bfa613964 - Use non uniform resource index for sampling bindless resources in raytracing shaders
- Re-enable bindless for raytracing

#jira UE-227550
#rb Krzysztof.Narkowicz

[CL 37167932 by kenzo terelst in 5.5 branch]
2024-10-16 05:42:42 -04:00
charles lefebvre
47718bb848 Fix LiveCoding console not starting when activated through command line
#rnx
#rb Tim.Smith

[CL 36761985 by charles lefebvre in 5.5 branch]
2024-10-01 20:13:18 -04:00
Tim Smith
e0faa51c3e Fix issue with content browser now properly detecting new classes from live coding.
#rnx
#rb Julien.StJean
#jira UE-225318

[CL 36592555 by Tim Smith in 5.5 branch]
2024-09-25 17:41:09 -04:00
laura hermanns
5b8ac7153e [Shaders] Change re-ordering of shader interpolators in D3D backend back to order of original source input.
This was previously changed to move all system value semantics (e.g. SV_Position) at the end of the declaration in entry points because sometimes these values are not used in the pixel shader (see CL 34200367).
This change relys solely on the input shader source to re-construct the original order of interpolators after it has been cross-compiled via DXC/SPIRV-Cross.

#jira UE-223808
#rnx
#rb dan.elksnitis

[CL 36451425 by laura hermanns in 5.5 branch]
2024-09-19 17:03:44 -04:00
aleksander netzel
f22aed4334 Remove r.RayTracing.RequireSM6.
#rb jeannoe.morissette, mihnea.balta
#jira UE-224569
[RN] Ray tracing is no longer supported on SM5

[CL 36404245 by aleksander netzel in 5.5 branch]
2024-09-18 15:09:04 -04:00
kenzo terelst
457d330d29 Use bindless for sampling index and vertex buffers from the hitgroup parameters
#jira UE-220250
#rb Mihnea.Balta

[CL 36032700 by kenzo terelst in ue5-main branch]
2024-09-05 03:47:28 -04:00
florian penzkofer
77ae86207a Use min16float precision in mobile preview
#rb carl.lloyd, Laura.Hermanns
#jira UE-213149

[CL 35935275 by florian penzkofer in ue5-main branch]
2024-08-30 15:41:56 -04:00
andrew rodham
7e74749c93 Core: Added a container for global debugging pointers that is visible to natvis
This new concept aims to abstract the complexities of dealing global debugging state that is tricky with the symbol resolution scoping rules in Visual Studio's natvis specification, and fragile with live-coding.
The specification causes natvis authors to often need to add explicit scoping to global variables (using {,,UnrealEditor-ModuleName.dll} or UnrealEditor-ModuleName.dll! scoping), which is fragile for different build types (Editor vs Server vs Client) and configurations (Debug, Shipping etc).

This change adds a GDebuggingState symbol to every dll with which any engine module or third-party library can register global pointers using a unique GUID. The GUID string can then be used to locate that pointer from any other module through a natvis intrinsic function using strstr, without having to inject a specific symbol name into every DLL.

This allows authors to write generic natvis expressions that will work robustly when being viewed from the context of any other module, or in code that has been patched by LiveCoding.

#rb Nicholas.Frechette, Tim.Smith

[CL 35592824 by andrew rodham in ue5-main branch]
2024-08-16 09:36:37 -04:00
jonathan bard
08898836fe Fixed LiveCoding not detecting changes when working from vanilla editor
#rb Tim.Smith

[CL 35366022 by jonathan bard in ue5-main branch]
2024-08-07 08:44:03 -04:00
guillaume abadie
6643fb6cd6 Fixes a bug where CFLAG_HLSL2021 was ignoring CFLAG_WarningsAsErrors on D3D11
#rb Laura.Hermanns

[CL 35120275 by guillaume abadie in ue5-main branch]
2024-07-26 17:18:00 -04:00
dan elksnitis
0320312a2b [Backout] - CL35053495
[FYI] dan.elksnitis
Original CL Desc
-----------------------------------------------------------------
[shaders]
- move population of output.target field into core code so each backend doesn't need to do it manually (do so before calling the compile function so any existing code expecting the output field to be set at any point during the compile process is unaffected)
- add a check in FShaderCompileJob::SerializeOutput and FShaderCompileJob::SerializeWorkerOutput that the FShaderTarget for a job output matches that of its input. This should catch cases of shaders with the wrong frequency being associated with jobs; further the callstack should indicate where this incorrect association is coming from (since SerializeOutput is called in different places for each cache path: duplicate in-flight jobs, jobs which hit in the in-memory job cache, and jobs which hit in the DDC cache, and SerializeWorkerOutput is only called when the job is read back from SCW output).

#rb Laura.Hermanns

[CL 35080902 by dan elksnitis in ue5-main branch]
2024-07-25 10:12:01 -04:00
dan elksnitis
ddbc683598 [shaders]
- move population of output.target field into core code so each backend doesn't need to do it manually (do so before calling the compile function so any existing code expecting the output field to be set at any point during the compile process is unaffected)
- add a check in FShaderCompileJob::SerializeOutput and FShaderCompileJob::SerializeWorkerOutput that the FShaderTarget for a job output matches that of its input. This should catch cases of shaders with the wrong frequency being associated with jobs; further the callstack should indicate where this incorrect association is coming from (since SerializeOutput is called in different places for each cache path: duplicate in-flight jobs, jobs which hit in the in-memory job cache, and jobs which hit in the DDC cache, and SerializeWorkerOutput is only called when the job is read back from SCW output).

#rb Laura.Hermanns

[CL 35053511 by dan elksnitis in ue5-main branch]
2024-07-24 10:09:55 -04:00
tom holmes
3abe8cbada Fix Shader SymbolsInfo Causing Non-Determinism and Defeating Deduplication
Info is now stored in shader map in editor only data alongside platform data
Includes shader bump

#jira UE-218748
#rb dan.elksnitis
#tests local tests on Lyra cooking and DDC-Verify
[FYI] Zousar.Shaker

[CL 34906103 by tom holmes in ue5-main branch]
2024-07-18 13:35:59 -04:00
dan elksnitis
49e65b9086 [shaders]
- add strings as an option for shader statistics, and a flags member/option to hide specific shader statistics from UI (so we can use statistics for other internal usage)
- add debug output for shader platform hashes (use to track down cases of shader job output which has identical bytecode but differing metadata), using the above to record a stat containing the shader hash computed by the compiler. currently only implemented for a subset of platforms
- fix a bug in shader diagnostic remapping for cache hits - the value stored in the cache/DDC for a job should contain non-remapped diagnostics (so cache hits can properly remap them to their version of the unstripped shader code). this also slightly improves deduplication within the job cache/DDC. fixed by storing the job output in the cache/DDC before running the job oncomplete callback (which performs the remapping)
- cleanup dxc hash retrieval code to use actual type instead of hacking around with an offset into the opaque blob

#rb Jason.Nadro

[CL 34864220 by dan elksnitis in ue5-main branch]
2024-07-17 08:55:02 -04:00
steve robb
f40be2d759 Fixed some 'deprecated' FString usage.
#rb james.hopkin

[CL 34603027 by steve robb in ue5-main branch]
2024-06-24 09:25:50 -04:00
christopher waters
cfc6f343df Uniform Buffer improvements
- Moving various UB booleans into a flags enum.
- UB booleans could not be reasonably deprecated without incurring memory overhead, so this will break custom code that uses them.
- Adding UB flag to force the shader compilers to generate reflection for the UB members which are normally excluded from reflection.
- Adding UB flag that tells MeshCommands that a UB will be bound during pass drawing and that it doesn't need to be set via MDCs.
- New flags are not used in this CL, they are prerequisites for subsequent, larger changes.

#rb jeannoe.morissette

[CL 34356503 by christopher waters in ue5-main branch]
2024-06-13 17:59:13 -04:00
maxime mercier
f602aaf8b6 Fix LiveCoding hitting a check upon starting.
#rb matt.breindel, Tim.Smith

[CL 34285568 by maxime mercier in ue5-main branch]
2024-06-11 14:50:11 -04:00
laura hermanns
dd3eb79c6b [Shaders] Add special case to parsing HLSL semantics in cross-compilation pipeline.
There are special cases for semantics when the index is omitted and defaults to zero, e.g. "SV_ClipDistance0" or "SV_ClipDistance[0]".
In those cases, our HlslParser does not provide the semantic index so we have to handle it when re-ordering the interpolators in the DXBC backend.

#rnx
#rb Charles.deRousiers

[CL 34274363 by laura hermanns in ue5-main branch]
2024-06-11 09:27:37 -04:00
laura hermanns
5c17f21798 [Shaders] Fixed re-ordering of shader interpolators in D3D ES31 backend.
When cross-compiling HLSL 2021 to HLSL 2018 for D3D11, DXC/SPIRV-Cross re-arrange the vertex/pixel interpolators in a way that can cause mismatches in the PSO.
The previous method to re-order shader interpolators was to just search the source for their variable declaration semantics, but that search can confuse semantics like TEXCOORD1 with TEXCOORD10.

This change includes two fixes:
1. The new approach parses the semantics and match the entire name, not just searching for the presence of the respective semantic identifier.
2. Always declare system value semantics such as SV_Position after user-defined semantics in case they are not used in the pixel shader to preserve the DXBC register assignments.

This fixes issues with Substrate as we have to cross-compile lots of shaders for D3D11 and some ES31 preview platforms.

#jira UE-214192
#rnx
#rb Jason.Nadro

[CL 34200377 by laura hermanns in ue5-main branch]
2024-06-07 09:38:41 -04:00
arciel rekman
7818ba6bae Fix reflection data unnecessarily kept in compiled PCD3D_SM6 shaders.
- Found while investigating compressed size (by FabianG), seemst to have been that way since 22233889. Shader size down significanty, to about  30-40% of the previous (both disk size and the runtime footprint).

#rb christopher.waters, dan.elksnitis, Laura.Hermanns

[CL 34155347 by arciel rekman in ue5-main branch]
2024-06-06 09:37:28 -04:00
joe kirchoff
748e7aac60 UnrealBuildTool: Auto disable SharedPCH if a module is compiling using a CppStandard older than the engine
#rnx
#jira UE-207533

[CL 33955046 by joe kirchoff in ue5-main branch]
2024-05-28 17:53:24 -04:00
carl lloyd
d64722152b RHI Validation
- Removed reliance on ShaderParameterParser for most platforms as it doesn't always parse parameters

#rb Luke.Thatcher

[CL 33822449 by carl lloyd in ue5-main branch]
2024-05-22 04:15:09 -04:00
florian penzkofer
f45f20f45b Fix fatal error when using Editor Preview
#jira UE-215384
#rb dan.elksnitis, Laura.Hermanns, Yuriy.ODonnell

[CL 33792687 by florian penzkofer in ue5-main branch]
2024-05-21 09:36:25 -04:00
Yuriy ODonnell
29ef258f59 Support GPU diagnostic buffer binding when using static root signature
#rb graham.wihlidal
#jira none

[CL 33634764 by Yuriy ODonnell in ue5-main branch]
2024-05-14 15:13:55 -04:00
kenzo terelst
3df923dab2 - Add FShaderBindingLayout as RenderCore wrapper for FRHIShaderBindingLayout which can also cache static uniform buffer declerations used during shader code gen
- Add option for ShaderType to declare which FShaderBindingLayout needs to be used for shader gen and runtime binding
- Add helper function to generate FShaderBindingLayoutContainer from array of uniform buffers and EShaderResourceTableFlags (only supports bindless mode right now)
- Serialize the FRHIShaderBindingLayout in FShaderCompilerEnvironment so it can be used by the shader compiler backends
- FShaderBindingLayout can add required symbols to the FShaderCompilerInput which shouldn't be dead code eliminated (required for Shader resource table building)
- Serialize the hash of RHIShaderResourceTable in the platform specific shader binary data so it can be used during runtime RTPSO validation (all shaders in the RTPSO need the same RHIShaderResourceTable)
- Renamed pRootSignaure member to RootSignature (style guide)

#jira UE-212347

[CL 33624453 by kenzo terelst in ue5-main branch]
2024-05-14 04:49:23 -04:00