Commit Graph

110 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Charles deRousiers
6e9c5e788f * Simplify shader print API: Context/Print/Newline.
* Added small inline documentation for shader print
* Fix incorrect slider/checkbox text alignement.

#rb none
#jira none
#preflight 6212a4d7f448f38bd82d944e

[CL 19064616 by Charles deRousiers in ue5-main branch]
2022-02-20 15:34:53 -05:00
Charles deRousiers
a0b4e64895 Add (experimental) shader-driven widgets (slider/checkbox).
* Split FontSize into FontSize/FontSpacing
* Add ShaderPrintContext to easier create/manage cursor position

#rb none
#jira none
#preflight 62120b06326e31b71fbad51f

[CL 19064190 by Charles deRousiers in ue5-main branch]
2022-02-20 07:20:20 -05:00
Lukas Hermanns
5b8643add8 Fix shader parameter parser: Also erase 'const'-qualifier alongside global parameter.
#rb Christopher.Waters
[FYI] Rolando.Caloca, Mihnea.Balta
#jira UE-142529
#preflight 620a859d803d9066e6834d7c
#rnx

#ROBOMERGE-OWNER: Lukas.Hermanns
#ROBOMERGE-AUTHOR: lukas.hermanns
#ROBOMERGE-SOURCE: CL 18986629 in //UE5/Release-5.0/... via CL 18990115 via CL 18990512
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)
#ROBOMERGE-CONFLICT from-shelf

[CL 18991175 by Lukas Hermanns in ue5-main branch]
2022-02-14 21:40:37 -05:00
carl lloyd
7119eccc6d Added support for framebuffer fetch and pixel local storage to OpenGLES with DXC
(Submitting for Carl.Lloyd)
#rb Dmitriy.Dyomin, Laura.Hermanns
#lockdown Jack.Porter
#jira UE-120580
#preflight None

#ROBOMERGE-OWNER: carl.lloyd
#ROBOMERGE-AUTHOR: jack.porter
#ROBOMERGE-SOURCE: CL 18916240 in //UE5/Release-5.0/... via CL 18926540 via CL 18927298
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18927326 by carl lloyd in ue5-main branch]
2022-02-09 18:32:08 -05:00
christopher waters
5f8dab7623 Removing usage of DDSPI from ValidateShaderParameterTypes
#jira none
#rb lukas.hermanns, arciel.rekman
#preflight 6196a1ce89733d53862e1af8

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 18243604 in //UE5/Release-5.0/... via CL 18243617
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18243627 by christopher waters in ue5-release-engine-test branch]
2021-11-18 15:53:43 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
carl lloyd
39da721538 Enabled half precision support for OpenGL and Vulkan DXC
#rb Lukas.Hermanns

#ROBOMERGE-AUTHOR: carl.lloyd
#ROBOMERGE-COMMAND: FNMain
#ROBOMERGE-SOURCE: CL 18034354 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0
#ROBOMERGE[bot1]: Main

[CL 18034363 by carl lloyd in ue5-release-engine-test branch]
2021-11-03 11:15:35 -04:00
christopher waters
a43a3f735f More bring-up work on bindless in D3D12RHI and initial public RHI support:
- Bindless rendering is not enabled anywhere yet.
- Adding bSupportsBindless to DDSPI.
- Moving ED3D12DescriptorHeapType into RHI and renaming to ERHIDescriptorHeapType.
- Adding FRHIDescriptorHandle for public usage of bindless indices.
- Adding GetBindlessHandle() to RHI SamplerState, SRV, UAV.
- Adding GetDefaultShaderResourceView() to RHI Textures.
- Adding bindless Sampler heap support to D3D12.
- Cleaned up some common shader code in prep for future bindless work.

#jira none
#rb mihnea.balta
#preflight 6169f8fafeab330001591bd0

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 17846249 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v883-17842818)

[CL 17846289 by christopher waters in ue5-release-engine-test branch]
2021-10-18 12:00:17 -04:00
guillaume abadie
5f34bdd406 Fixes shader compile worker crash on vulkan
#rb none
#preflight trivial

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17438300 via CL 17439818
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17439944 by guillaume abadie in ue5-release-engine-test branch]
2021-09-06 15:24:08 -04:00
guillaume abadie
d56bfe7b07 Migrates D3D to submit all loose shaders parameters in a single RHISetShaderParameter()
#rb none
#preflight 61323f857d30040001b77b61

#ROBOMERGE-OWNER: guillaume.abadie
#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17431343 via CL 17438616
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17438618 by guillaume abadie in ue5-release-engine-test branch]
2021-09-06 11:28:30 -04:00
guillaume abadie
3f0a1b9fb2 Allows SHADER_USE_PARAMETER_STRUCT() to submit all shader parameters in a single RHISetShaderParameter()
#rb yuriy.odonnell
#preflight 611d572d9db7df000134eb13

#ROBOMERGE-SOURCE: CL 17222098 via CL 17222140
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17222165 by guillaume abadie in ue5-release-engine-test branch]
2021-08-18 16:56:25 -04:00
ryan vance
2263d0caa5 VKRT:
Add ray tracing shader types
Add initial ray tracing pipeline creation
Add acceleration structure descriptor type
Add basic ray tracing pipeline, occlusion support initially
Strip reflection from ray tracing shader spirv to deal with validation warnings
Don't use an array of vk descriptor types directly, this breaks with non-contiguous enum values which are common in extensions. Using a TMap from descriptor type to values instead.
Don't store vk types in the serialized shader header, translate to and from our own internal enum types to avoid similar non-contiguous value issues.
Re-enabled ray tracing compilation on windows desktop, explicitly disable runtime support using GRHISupportsRayTracing

Todo:
We need to deal with the lack of a 1:1 mapping between shader stages and frequencies for ray tracing hit groups. This is a one to many mapping which doesn't work with how most of the Vulkan RHI is authored. For now I'm assuming a hitgroup maps to a CHS.
Ray tracing shader descriptor allocation and pending state support. While we are serializing the descriptors for ray tracing shaders, we're not allocating or updating them yet which is the last large chunk needed to trace rays.
Fix spirv binary version mismatch validation error. This basically needs a local dxc modification which explicitly sets the spirv binary version to work around incorrect assuptions in dxc which is causing validation failures.
Add another local dxc modification to allow for arbirary struct size support using VK_EXT_scalar_block_layout for ray tracing shaders.

#rb jeannoe.morissette, lukas.hermanns

#ROBOMERGE-SOURCE: CL 16711940 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16711955 by ryan vance in ue5-release-engine-test branch]
2021-06-17 17:15:40 -04:00
charles derousiers
b402ba8720 Fix vulkan compilation issue with new ShaderPrint coloring.
Vulkan/DXC does not support initialization of static const variable having complex type. This change lines change the initialization to some simple define instead.

#rb none


#ROBOMERGE-SOURCE: CL 16574414
#ROBOMERGE-BOT: (v828-16531559)

[CL 16574416 by charles derousiers in ue5-main branch]
2021-06-07 14:15:34 -04:00
charles derousiers
0390184ee4 Add color support for shader print.
#rb none
#preflight 60bded2c0249c30001e4eceb


#ROBOMERGE-SOURCE: CL 16568047
#ROBOMERGE-BOT: (v828-16531559)

[CL 16568081 by charles derousiers in ue5-main branch]
2021-06-07 06:25:15 -04:00
charles derousiers
76466fc4e4 Add proper ASCII texture to print standard character set from shader.
#rb none


#ROBOMERGE-SOURCE: CL 16566309
#ROBOMERGE-BOT: (v828-16531559)

[CL 16566349 by charles derousiers in ue5-main branch]
2021-06-06 16:05:31 -04:00
charles derousiers
8c6a059f03 Add ShaderPrintText function for print TEXT("") string within shader.
#rb yuriy.odonnel, sebatien.hillaire
#jira none
#preflight 60b7570fc744b2000146292e

#ROBOMERGE-SOURCE: CL 16531948 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v828-16531559)

[CL 16531979 by charles derousiers in ue5-main branch]
2021-06-02 07:03:05 -04:00
Steve Robb
1f3fe8c9ac Some ANSICHAR/UTF8CHAR cast fixes for upcoming changes to StringConv.h.
#rb none
#jira none

[CL 16469364 by Steve Robb in ue5-main branch]
2021-05-26 10:45:12 -04:00
Lukas Hermanns
2a6092c316 Replace custom Disassemble function in ShaderConductor interface with the one that was already there.
#rb Ryan.Vance
#fyi Carl.Lloyd
#jira none
#rnx

[CL 16118857 by Lukas Hermanns in ue5-main branch]
2021-04-26 17:13:29 -04:00