626 Commits

Author SHA1 Message Date
Laura Hermanns
1f94e475f3 Add [loop] attribute to Substrate shader to fix HLSL cross-compilation error on D3D11.
#rb Sebastien.Hillaire
#jira UE-186066, UE-193202
#rnx
#lockdown Michal.Valient

#ushell-cherrypick of 26774226 by Laura.Hermanns

[CL 27208751 by Laura Hermanns in 5.3 branch]
2023-08-18 13:02:22 -04:00
Joe Kirchoff
5346b920a9 Fix several more Shipping compile errors
#rnx
#jira UE-192219
#jira UE-192222
#jira UE-192227
#lockdown Francis.Hurteau
#rb dan.oconnor

[CL 26957739 by Joe Kirchoff in 5.3 branch]
2023-08-09 11:33:17 -04:00
christopher waters
6976d77eae Fixing various issues with shader previews
- PC previews of SM6 platforms weren't going to DXC correctly.
- Preview platform include paths weren't initialized when compiling with local-only shader compiles.
- A few preview platform DDSPI settings weren't being initialized correctly based on the capabilites of the preview format.

#rb arciel.rekman, dan.elksnitis

[CL 26587878 by christopher waters in 5.3 branch]
2023-07-25 16:41:44 -04:00
rweber89
5387219ffe PR #10502: D3DShaderCompiler Memleak Fix
#jira UE-187961
#rb Mihnea.Balta
#rnx

[CL 26087768 by rweber89 in 5.3 branch]
2023-06-19 08:49:30 -04:00
tim smith
adfa8805f3 Fix to live coding shutdown to eliminate a somewhat rare crash on exit.
#rb Dan.Engelbrecht
#jira UE-188767

[CL 26058571 by tim smith in 5.3 branch]
2023-06-16 12:57:55 -04:00
dan elksnitis
f765d6f552 [shaders] change d3d backend to not fail on minification failure; ensure preprocess warnings are appended for independent preprocessing shader formats regardless of whether preprocessing fails
#rb Jason.Nadro

[CL 25897074 by dan elksnitis in ue5-main branch]
2023-06-09 12:42:57 -04:00
christopher waters
2a7a142bfc Fixing CompileFXC.bat issues.
- Setting FXC="..." is different from setting "FXC=...", the former will break uses of just %FXC% when the path has spaces in it.
- Switching to all "FXC=..." and "%FXC%" to make the variable consistent.
- Tweaking the bat file formatting inside of D3DShaderCompiler to make it more readable.

#rb dan.elksnitis

[CL 25853249 by christopher waters in ue5-main branch]
2023-06-07 15:02:30 -04:00
dan elksnitis
2acbcb9533 [shaders]
- add new fields to FShaderCompilerOutput which should be populated with the shader source and entry point name if modified by a backend compile process (in a format implementing the independent preprocessing API). this is intended to supercede "OptionalFinalShaderSource" for such shader formats, as well as being used as the source for preprocessed debug dumps when enabled.
- modify the PCD3D shader format to use these fields as intended (and so fix the debug output for pipelines which remove unused interpolators to match the final modified source).

#rb Laura.Hermanns
#preflight 64777f850848b7126dda194c

[CL 25706448 by dan elksnitis in ue5-main branch]
2023-05-31 13:31:39 -04:00
christopher waters
1fab74d63a Restricting PLATFORM_SUPPORTS_STATIC_SAMPLERS to SM6 and RayTracing shaders and making sure that PC DX12 SM6 requires Resource Binding Tier 2 or higher.
We don't want to restrict other shaders to resource binding tier 2 or higher even for CFLAG_ForceDXC or CFLAG_WaveOperations.
Invalidating PCD3D_SM5 and PCD3D_SM6 shaders.

#rb yuriy.odonnell
#preflight 646cd8d764351d76f32b449c

[CL 25585973 by christopher waters in ue5-main branch]
2023-05-23 13:05:47 -04:00
christopher waters
20984328ea Removing the cvar lookup string for shader dead code removal in all shader formats. This cvar can't be loaded on SCW startup so it was causing a hash mismatch.
#rb yuriy.odonnell
#preflight 646bc8f764351d76f3c85f5e

[CL 25570191 by christopher waters in ue5-main branch]
2023-05-22 16:57:05 -04:00
christopher waters
5b751e83bd Cleaning up more platform code.
#jira UE-185135
#rb robert.srinivasiah
#preflight 64628533aa3c584c0b0af08d

[CL 25480257 by christopher waters in ue5-main branch]
2023-05-15 16:56:55 -04:00
bryan sefcik
da92084a12 Optimized out more private modules includes and dependencies.
#preflight 64627c382965f6ea8ea83bd6

[CL 25479683 by bryan sefcik in ue5-main branch]
2023-05-15 16:26:12 -04:00
bryan sefcik
d205101cc8 Removed unnecessary private include modules.
#preflight 645da640cf788a25581110bb

[CL 25451545 by bryan sefcik in ue5-main branch]
2023-05-12 12:13:52 -04:00
Steve Robb
e8df23c174 Fixed mismatched copy constructor/assignment operator in FixedSizeString.
#rb none
#jira none
#preflight 645919bc6c35ad81e621217a

[CL 25372020 by Steve Robb in ue5-main branch]
2023-05-08 12:18:34 -04:00
Laura Hermanns
b8c526c389 DXC and SPIRV-Cross fixes to enable Substrate in D3D11:
- Support structured buffers in HLSL backend of SPIRV-Cross (PR #2143).
- Integrate SPIRV-Cross fix to forward opaque types in GLSL backend (PR #2110).
- Integrate SPIRV-Cross fix to use actual field offset to validate vec4 boundary alignment (#PR 2139).
- Integrate SPIRV-Cross fix to not restrict SV_RenderTargetArrayIndex to GS and MS (#PR 2138).
- Make SV_Position decoration as implicitly invariant optional (Used to address Z-fighting issues in Vulkan and Metal; Drastically impacts vertex shader performance on certain platforms).
- Don't force DXC for all shaders when r.Substrate is enabled.

#jira UE-174555
#rb Sebastien.Hillaire, Carl.Lloyd, Dan.Elksnitis
#fyi Brian.White, Jason.Nadro, JeaNoe.Morissette, Yuriy.Odonnell, Guillaume.Abadie
#preflight 6453d3df0e33f2d51d2b032e

[CL 25353473 by Laura Hermanns in ue5-main branch]
2023-05-05 09:21:36 -04:00
dan elksnitis
0294247b5a [shaders] migrate PC D3D backends to independent preprocessing shaderformat API
#rb Yuriy.ODonnell
#rb Laura.Hermanns
#preflight 6453b1861c2846595c5e7919

[CL 25333986 by dan elksnitis in ue5-main branch]
2023-05-04 09:36:33 -04:00
Joe Kirchoff
9e16fda808 Set LiveCodingServer to compile with c++17
#rnx
#rb trivial
#preflight 6442df10f126d87e4532e22c

[CL 25151841 by Joe Kirchoff in ue5-main branch]
2023-04-21 15:33:02 -04:00
dan elksnitis
26464b581b [shaders] further rework of parameter parser API to simplify the independent preprocessing use case, plus adding serialization support and some minor cleanup.
#preflight 6442af0ec023bb1f734fc0d1
#rb Christopher.Waters

[CL 25148947 by dan elksnitis in ue5-main branch]
2023-04-21 13:45:43 -04:00
dan elksnitis
d934fe3be0 [shaders] move ShaderParameterParser & some related functions to RenderCore so it can be used in the core shader compilation code (forthcoming change requires this)
#preflight 643eda5473470c177c27590d
#rb Yuriy.ODonnell
#rb Christopher.Waters

[CL 25106284 by dan elksnitis in ue5-main branch]
2023-04-19 10:32:12 -04:00
christopher waters
a037734fec D3D Shader Compiler cleanup
- Changes focused around making our DXC interface less dependent on FXC flags.
- Moving FDxcArguments to D3DShaderCompilerDXC
- Making FDxcArguments depend on FShaderCompilerInput instead of reinterpreting the FXC API arguments.
- Changing DXC arguments to use "-" prefix instead of "/"

#rb dan.elksnitis
#preflight 643efd109566b6145063e5d7

[CL 25094077 by christopher waters in ue5-main branch]
2023-04-18 16:39:44 -04:00
jeannoe morissette
75364b7008 VulkanRHI: Add VULKAN_SM6. Move features and requirements around to match what was done on d3d.
#rb arciel.rekman, carl.lloyd
#preflight 643996128901e5ef982dc887

[CL 25045731 by jeannoe morissette in ue5-main branch]
2023-04-14 14:26:06 -04:00
dan elksnitis
2971b65bc4 [shaders] deprecated FShaderPipelineCompileJob::bFailedRemovingUnused field; this is only used to append some dubiously useful information to a log message (the underlying error causing the failure is always reported as any other shader preprocess/compile error). opting to remove rather than dragging this along with forthcoming preprocessing refactoring.
#preflight 6435679c1d61ecec3b56c78d
#rb Jason.Nadro

[CL 24991496 by dan elksnitis in ue5-main branch]
2023-04-11 11:05:47 -04:00
christopher waters
7231cf0144 Changing vendor extensions code to use EGpuVendorId instead of hardcoded IDs.
#rb jeannoe.morissette
#preflight 64304facb4329f6f1a32206a

[CL 24978127 by christopher waters in ue5-main branch]
2023-04-10 11:32:55 -04:00
Laura Hermanns
239c88929d Remove DXC rewriter invocation from D3D12 backend.
This was originally added to have parity between Vulkan and D3D12, but it only emitted a debug file and wasn't even feeding the rewritten HLSL back into the D3D compiler.
In an effort to be independent of the DXC rewriter, this is a first step as this rewriter invocation served solely a debugging purpose anyway.

#rb Dan.Elksnitis
#fyi Jason.Nadro, Rolando.Caloca
#jira none
#preflight 642ddad58f078cc7031925d3

[CL 24936708 by Laura Hermanns in ue5-main branch]
2023-04-05 17:06:22 -04:00
christopher waters
ae1bd451f9 Bindless Resources
- Adding correct handling for bindless uniform buffer parameters.
- Reworking RHITextureReference creation to allow the RHI to create them differently, especially with bindless views.
- Adding RHITextureReference bindless view updates to D3D12RHI.

#jira UE-162014
#rb mihnea.balta, jeannoe.morissette
#preflight 642dba03c6769c6082f592f6

[CL 24936647 by christopher waters in ue5-main branch]
2023-04-05 17:03:17 -04:00