Commit Graph

224 Commits

Author SHA1 Message Date
christopher waters
e27a32c90b Disabling the ignored-attributes warning when compiling bindless resources. DXC is incorrect that the attribute is ignored, see github issue: https://github.com/microsoft/DirectXShaderCompiler/issues/4537
#rb mihnea.balta
#preflight 6407a0028832f48a4d48a69d

[CL 24547309 by christopher waters in ue5-main branch]
2023-03-07 15:59:11 -05:00
Laura Hermanns
413c2d6795 Report SCW error code for E_OUTOFMEMORY in DXBC backend.
#rb Dan.Elksnitis
#fyi Jason.Nadro
#jira none
#preflight 63ed05b3956709374a0b604d
#rnx

[CL 24234442 by Laura Hermanns in ue5-main branch]
2023-02-15 13:08:05 -05:00
Laura Hermanns
168b1eda5f Add compiler invocations to shader compilation stats.
Example output with D3D11 RHI: "Compiler invocations: DXC (72 pre-compile steps / 74), Legacy FXC (5736), Platform compiler (NO)"

#rb Jason.Nadro
#fyi Dan.Elksnitis, Arciel.Rekman, Carl.Lloyd, JeanNoe.Morissette
#jira none
#rnx
#preflight 63e68f03432f5b48694e5401

[CL 24124722 by Laura Hermanns in ue5-main branch]
2023-02-10 14:14:14 -05:00
dan elksnitis
7652723a90 [shaders] d3d (both dxc & fxc) compile backend multithreading fixes; stripping out vestigial path allowing FXC DLL to be overridden by a parameter.
#rb Jason.Nadro
#rb Laura.Hermanns
#preflight 63e273719910415ae2f9b47d

[CL 24049999 by dan elksnitis in ue5-main branch]
2023-02-07 11:09:42 -05:00
Yuriy ODonnell
1dfc32d42d Enable r.Shaders.RemoveDeadCode by default for all back-ends except Metal and OpenGL
* Significantly reduces the size of shader debug data and improves shader compilation time (reducing parsing cost in the native shader compiler)
* Remove "experimental" label for the feature

#rb Jason.Nadro
#preflight 63d455d9be1970f8824c3f9b

[CL 23894592 by Yuriy ODonnell in ue5-main branch]
2023-01-27 18:24:18 -05:00
bryan sefcik
1309f08d58 Added helper functions to the DirectX module that returns paths to the DirectX include, lib and dll directories.
#rb joe.kirchoff
#preflight 63cf0f5af2318350a220c710
#jira

[CL 23824085 by bryan sefcik in ue5-main branch]
2023-01-23 18:19:13 -05:00
dan elksnitis
e76b6207a1 [shaders] remove unneccessary global vars from D3D compile backend
#preflight 63c980120274c9f5fb7a3434
#rb Yuriy.ODonnell
#rb Jason.Nadro

[CL 23778371 by dan elksnitis in ue5-main branch]
2023-01-19 14:36:43 -05:00
Laura Hermanns
9beca15f48 Fix loop unrolling issue in DOFGatherKernel shader for updated DXC.
#rb Guillaume.Abadie
#fyi Yuriy.Odonnell
#jira none
#rnx
#preflight 63c6be337763631ba1295c28

[CL 23738444 by Laura Hermanns in ue5-main branch]
2023-01-17 10:34:52 -05:00
bob tellez
971983eb65 [Backout] - CL23624045
[FYI] christopher.waters
Original CL Desc
-----------------------------------------------------------------
RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.

#preflight 63bca752577437afe604b097

[CL 23631957 by bob tellez in ue5-main branch]
2023-01-10 15:28:15 -05:00
christopher waters
3df5dae685 RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.

#preflight 63bca752577437afe604b097

[CL 23631946 by christopher waters in ue5-main branch]
2023-01-10 15:27:33 -05:00
laura hermanns
b3a1d2a276 Fix temporary string object in D3DShaderCompiler. Related CL 20260406.
#rb Brandon.Schaefer
#preflight 63b495cc35203bc7aac92606
#rnx

[CL 23571271 by laura hermanns in ue5-main branch]
2023-01-03 17:49:20 -05:00
Yuriy ODonnell
bddca76c94 ShaderMinifier - Add support for dead code removal to all shader formats
* Add code to all shader format back-ends to take dead code removal into account when computing the version ID
* Not enabled in Metal and OpenGL back-ends (require further testing)

#rb dan.elksnitis
#preflight 6390f1f15c5308d18c7364fb

[CL 23433448 by Yuriy ODonnell in ue5-main branch]
2022-12-07 15:13:42 -05:00
laura hermanns
bcf95545bd Add host machine name to OOM report in DXC backend and refactor global SCW error-code handling. Bumped ShaderCompileWorkerOutputVersion to 9.
#rb Jason.Nadro, Dan.Elksnitis, Yuriy.Odonnell, Arciel.Rekman
#preflight 638e610c255f07df8ea212f4
#rnx

[CL 23428544 by laura hermanns in ue5-main branch]
2022-12-07 10:29:08 -05:00
kate ellis
839f9f1889 [Backout] - CL23401851
[FYI] Laura.Hermanns
Original CL Desc
-----------------------------------------------------------------
Add host machine name to OOM report in DXC backend and refactor global SCW error-code handling.

#rb Jason.Nadro, Dan.Elksnitis, Yuriy.Odonnell, Arciel.Rekman
#preflight 638e610c255f07df8ea212f4
#rnx

[CL 23421737 by kate ellis in ue5-main branch]
2022-12-06 19:47:06 -05:00
laura hermanns
c17b2976f9 Add host machine name to OOM report in DXC backend and refactor global SCW error-code handling.
#rb Jason.Nadro, Dan.Elksnitis, Yuriy.Odonnell, Arciel.Rekman
#preflight 638e610c255f07df8ea212f4
#rnx

[CL 23421619 by laura hermanns in ue5-main branch]
2022-12-06 19:45:07 -05:00
christopher waters
0d2b7d75a0 Adding correct checks for SV_StencilRef support
- SM6.0+ shader reflection now checks for D3D_SHADER_REQUIRES_STENCIL_REF and sets EShaderCodeFeatures::StencilRef if it's set.
- D3D12 initialization now correctly sets GRHISupportsStencilRefFromPixelShader.
- D3D12 shader loading makes sure that EShaderCodeFeatures::StencilRef shaders are only loaded when GRHISupportsStencilRefFromPixelShader is set.

#jira none
#rb arciel.rekman, graham.wihlidal, jamie.hayes
#preflight 63869441170bc34a93e55135

[CL 23354305 by christopher waters in ue5-main branch]
2022-12-01 12:03:34 -05:00
chris kulla
408b0b8553 Ray Tracing: Compute the maximum payload size from the shader's payload type
Serialize the payload size as part of the raytracing shader so it can be examined in the RHI layer.

Validate that the RTPSO is configured with the appropriate payload size.

Add macros to ensure the payloads have the expected size

Ensure that all raytracing pipelines explicitly bind a miss shader

Add a shared shader header to implement static asserts for those shader compilers that support them (like dxc).

Fix payload type on main deferred reflection raygen shader

Fix incorrect raygen shader included in the deferred RTPSO list for RTGI

Don't add builtin shaders to the RTPSO from the RHI layer as these are unlikely to ever match the required payload type

Add new method to register payload types so that plugins can more easily describe custom payloads they may be using (up to a maximum of 32 unique payload types since we use a bitmask to represent payload sets).

#rb Yuriy.ODonnell
#jira UE-157946
#preflight 636aff4363037c102679f13a
#preflight 63869dde170bc34a93e8c90e

[CL 23337139 by chris kulla in ue5-main branch]
2022-11-30 13:53:00 -05:00
luke thatcher
ee70bc02da Remove use of FRHIBoundShaderState resources in D3D12RHI
- No longer necessary, since they were only used to find/create root signatures, which can be implemented directly in the adapter class.
 - RHICreateBoundShaderState is never called.

Remove D3D12_SUPPORTS_PARALLEL_RHI_EXECUTE
 - This is always true.

#rb Chris.Waters
#preflight 6384cd3afa053c489af10129

[CL 23300192 by luke thatcher in ue5-main branch]
2022-11-28 19:13:10 -05:00
christopher waters
0e8e4d0dd6 After extracting all parameters from D3D12 reflection, the "bSucceeded" flag was being forced to true which would prevent any parameter validation from being reported. Most notably, this would hide errors caused by missing global parameters when using shader parameter structs.
Bumping D3D_SM5 and D3D_SM6 versions.

#jira none
#rb jason.nadro
#preflight 6384f5d2170bc34a935c960c

[CL 23298219 by christopher waters in ue5-main branch]
2022-11-28 17:06:24 -05:00
Luke Thatcher
f5136f75e2 Unify code that binds shader resources from uniform buffers across platform RHIs
- All platforms were extending FBaseShaderResourceTable to add a TArray<uint32> TextureMap member, along with copies of the same RHI code to bind these resources.
 - Moved the TextureMap member into the base shader table type, and removed all platform versions. They are all serializer-compatible with the original code, so no shader DDC keys need to be bumped.
 - Also moved the "ResourceTable" array of RHI resources into the base FRHIUniformBuffer class.
 - Added a SetResourcesFromTables function in RHICoreShader.h

Removed GetD3D11TextureFromRHITexture in D3D11RHI, replaced with a ResourceCast.
 - The ResourceCast function for FRHITexture types now always follows the texture reference pointer via the vtable call, like other platforms.

#jira none
#rb Chris.Waters
#preflight 637e6cd43377450900f10fd2

[CL 23252815 by Luke Thatcher in ue5-main branch]
2022-11-23 14:17:01 -05:00
Laura Hermanns
6cac5e04e5 Allow allocation of zero bytes in DXC custom allocator, use portable STDCALL declaration, and add error code translation for DXC specific HRESULT values.
#rb Yuriy.Odonnell
#fyi Dan.Elksnitis, Jason.Nadro
#jira none
#preflight 63779846f514e1ded9af11b0
#rnx

[CL 23194073 by Laura Hermanns in ue5-main branch]
2022-11-18 09:43:23 -05:00
laura hermanns
58e529b618 Use custom memory allocator for DXC to report better callstack on OOM event.
#rb Yuriy.ODonnell
[FYI] Jason.Nadro, Dan.Elksnitis, Carl.Lloyd
#preflight none
#rnx

[CL 23072013 by laura hermanns in ue5-main branch]
2022-11-10 01:18:07 -05:00
laura hermanns
b3e8c553e3 Fix "Compile failed without errors" message and unify this error report for FXC and DXC.
#rb Dan.Elksnitis
#rnx

[CL 23034307 by laura hermanns in ue5-main branch]
2022-11-08 14:20:14 -05:00
laura hermanns
b32256418b Log available system memory when DXC crashes on E_OUTOFMEMORY to verify system is in fact out of memory.
#rb Jason.Nadro, Yuriy.Odonnell
[FYI] Dan.Elksnitis
#preflight 636924014d3c1d9d925e05ab
#rnx

[CL 23029673 by laura hermanns in ue5-main branch]
2022-11-08 11:15:46 -05:00
yuriy odonnell
9de862ab0b Add UE::ShaderCompilerCommon::RemoveDeadCode() high-level wrapper for shader minifier, to be consistently used in all shader compiler back-ends
#preflight 635af3aa1b7de936a5295629
#rb jason.nadro

[CL 22850483 by yuriy odonnell in ue5-main branch]
2022-10-29 01:51:27 -04:00