9#include "Algo/BinarySearch.h"
10#include "Containers/Array.h"
14#include "Containers/HashTable.h"
16#include "Containers/Map.h"
17#include "Containers/Set.h"
91template<
typename MetaShaderType>
110 return !(*
this ==
Other);
124template<
typename MetaShaderType>
139 return A.PermutationId >
B.PermutationId;
161 Ar <<
Info.BaseIndex;
167 return BaseIndex == Rhs.BaseIndex;
172 return BaseIndex < Rhs.BaseIndex;
196 Ar <<
Info.BaseIndex;
197 Ar <<
Info.BufferIndex;
204 return BaseIndex == Rhs.BaseIndex
205 && BufferIndex == Rhs.BufferIndex
211 return BaseIndex < Rhs.BaseIndex;
233 Ar <<
Info.BaseIndex;
240 return BaseIndex == Rhs.BaseIndex
246 return BaseIndex < Rhs.BaseIndex;
270 Ar <<
Info.BaseIndex;
272 Ar <<
Info.Parameters;
278 return BaseIndex == Rhs.BaseIndex
280 && Parameters == Rhs.Parameters;
285 return BaseIndex < Rhs.BaseIndex;
301 Ar <<
Info.UniformBuffers;
302 Ar <<
Info.TextureSamplers;
304 Ar <<
Info.LooseParameterBuffers;
311 return Hash == Rhs.Hash;
330#define IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT2( x, y ) x##y
331#define IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT( x, y ) IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT2( x, y )
332#define IMPLEMENT_RT_PAYLOAD_TYPE(PayloadType, PayloadSize) static FRegisterRayTracingPayloadTypeHelper IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT(PayloadHelper, __COUNTER__) = FRegisterRayTracingPayloadTypeHelper(PayloadType, PayloadSize, nullptr);
333#define IMPLEMENT_RT_PAYLOAD_TYPE_FUNCTION(PayloadType, PayloadSizeFunction) static FRegisterRayTracingPayloadTypeHelper IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT(PayloadHelper, __COUNTER__) = FRegisterRayTracingPayloadTypeHelper(PayloadType, 0u, PayloadSizeFunction);
351 return NumRHIShaders;
356 return static_cast<uint32>(ShaderIndex) < NumRHIShaders;
361 return RHIShaders[ShaderIndex].load(std::memory_order_acquire) !=
nullptr;
396 return bAtLeastOneRHIShaderCreated;
405 FRHIShader*
Shader = RHIShaders[ShaderIndex].load(std::memory_order_acquire);
408 Shader = CreateShaderOrCrash(ShaderIndex, bRequired);
426 UE_DEPRECATED(5.6,
"GetRayTracingHitGroupLibrary needs current EShaderPlatform")
431 UE_DEPRECATED(5.6,
"GetRayTracingCallableShaderLibrary needs current EShaderPlatform")
436 UE_DEPRECATED(5.6,
"GetRayTracingMissShaderLibrary needs current EShaderPlatform")
476 SIZE_T Size = NumRHIShaders *
sizeof(std::atomic<FRHIShader*>);
509 uint32 NumRHIShaders : 31;
512 uint32 bAtLeastOneRHIShaderCreated : 1;
517 std::atomic<int32> NumRefs;
523#if WITH_EDITORONLY_DATA
556 return Ar << Entry.DebugInfo << Entry.CompilerWarnings << Entry.ShaderTypeHashes << Entry.ShaderStatistics;
578#if WITH_EDITORONLY_DATA
584 UE_DEPRECATED(5.6,
"AddShaderCompilerOutput now accepts an FShaderCompileJobKey instead of DebugName")
591#if WITH_EDITORONLY_DATA
605#if WITH_EDITORONLY_DATA
674 return X.MaterialShaderMapHash ==
Y.MaterialShaderMapHash
675 &&
X.ShaderPipeline ==
Y.ShaderPipeline
676 &&
X.VertexFactoryType ==
Y.VertexFactoryType
677 &&
X.PermutationId ==
Y.PermutationId
678 &&
X.Platform ==
Y.Platform;
726 return X.Type ==
Y.Type
727 &&
X.MaterialShaderMapHash ==
Y.MaterialShaderMapHash
728 &&
X.ShaderPipelineName ==
Y.ShaderPipelineName
729 &&
X.VFType ==
Y.VFType
730 &&
X.PermutationId ==
Y.PermutationId
731 &&
X.Platform ==
Y.Platform;
897 inline bool IsFrozen()
const {
return Type.IsFrozen(); }
899#if WITH_EDITORONLY_DATA
912 template<
typename UniformBufferStructType>
1019template<
typename ShaderType,
typename Po
interTableType>
1027 template<
typename OtherShaderType,
typename OtherPo
interTableType>
1032 template<
typename OtherShaderType,
typename OtherPo
interTableType>
1035 ShaderContent = Rhs.GetShader();
1036 ShaderMap = Rhs.GetShaderMap();
1040 template<
typename OtherShaderType,
typename OtherPo
interTableType>
1046 template<
typename OtherShaderType,
typename OtherPo
interTableType>
1052 inline bool IsValid()
const {
return ShaderContent !=
nullptr; }
1053 inline bool IsNull()
const {
return ShaderContent ==
nullptr; }
1055 inline void Reset() { ShaderContent =
nullptr; ShaderMap =
nullptr; }
1057 inline ShaderType*
GetShader()
const {
return ShaderContent; }
1075 if (RHIShader ==
nullptr)
1077 UE_LOG(
LogShaders,
Log,
TEXT(
"Failed to create shader for type %s with resource index %d."),
GetType()->GetName(), ShaderContent->GetResourceIndex());
1092 if (RHIShader ==
nullptr)
1094 UE_LOG(
LogShaders,
Log,
TEXT(
"Failed to create shader for type %s with resource index %d."),
GetType()->GetName(), ShaderContent->GetResourceIndex());
1162 UE_DEPRECATED(5.1,
"GetRayTracingMaterialLibraryIndex is deprecated. Use GetRayTracingHitGroupLibraryIndex instead.")
1172 return GetResourceChecked().GetRayTracingHitGroupLibraryIndex(ShaderContent->GetResourceIndex());
1179 return GetResourceChecked().GetRayTracingCallableShaderLibraryIndex(ShaderContent->GetResourceIndex());
1186 return GetResourceChecked().GetRayTracingMissShaderLibraryIndex(ShaderContent->GetResourceIndex());
1197 ShaderType* ShaderContent;
1200 template<
typename ShaderType1>
1211 template<
typename ShaderType1>
1219template<
typename ShaderType>
1222#define SHADER_TYPE_LIST \
1223 SHADER_TYPE_ENTRY(Global), \
1224 SHADER_TYPE_ENTRY(Material), \
1225 SHADER_TYPE_ENTRY(MeshMaterial), \
1226 SHADER_TYPE_ENTRY(Niagara), \
1227 SHADER_TYPE_ENTRY(OCIO), \
1228 SHADER_TYPE_ENTRY(ComputeKernel), \
1229 SHADER_TYPE_ENTRY(NNERuntimeIREE),
1240#define SHADER_TYPE_ENTRY(Name) Name
1246#undef SHADER_TYPE_ENTRY
1257 typedef class FShader* (*ConstructSerializedType)();
1292 const TCHAR* InName,
1296 int32 TotalPermutationCount,
1365 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Global) ?
reinterpret_cast<FGlobalShaderType*
>(
this) :
nullptr;
1369 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Global) ?
reinterpret_cast<const FGlobalShaderType*
>(
this) :
nullptr;
1373 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Material) ?
reinterpret_cast<FMaterialShaderType*
>(
this) :
nullptr;
1377 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Material) ?
reinterpret_cast<const FMaterialShaderType*
>(
this) :
nullptr;
1381 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::MeshMaterial) ?
reinterpret_cast<FMeshMaterialShaderType*
>(
this) :
nullptr;
1385 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::MeshMaterial) ?
reinterpret_cast<const FMeshMaterialShaderType*
>(
this) :
nullptr;
1389 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Niagara) ?
reinterpret_cast<const FNiagaraShaderType*
>(
this) :
nullptr;
1393 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Niagara) ?
reinterpret_cast<FNiagaraShaderType*
>(
this) :
nullptr;
1397 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::OCIO) ?
reinterpret_cast<const FOpenColorIOShaderType*
>(
this) :
nullptr;
1401 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::OCIO) ?
reinterpret_cast<FOpenColorIOShaderType*
>(
this) :
nullptr;
1405 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::ComputeKernel) ?
reinterpret_cast<const FComputeKernelShaderType*
>(
this) :
nullptr;
1409 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::ComputeKernel) ?
reinterpret_cast<FComputeKernelShaderType*
>(
this) :
nullptr;
1413 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::NNERuntimeIREE) ?
reinterpret_cast<const FNNERuntimeIREEShaderType*
>(
this) :
nullptr;
1417 return (ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::NNERuntimeIREE) ?
reinterpret_cast<FNNERuntimeIREEShaderType*
>(
this) :
nullptr;
1422 checkf(ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Global,
TEXT(
"ShaderType %s is not Global"),
GetName());
1428 checkf(ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Material,
TEXT(
"ShaderType %s is not Material"),
GetName());
1434 checkf(ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::MeshMaterial,
TEXT(
"ShaderType %s is not MeshMaterial"),
GetName());
1440 checkf(ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::Niagara,
TEXT(
"ShaderType %s is not Niagara"),
GetName());
1446 checkf(ShaderTypeForDynamicCast == EShaderTypeForDynamicCast::OCIO,
TEXT(
"ShaderType %s is not OCIO"),
GetName());
1452 return ShaderTypeForDynamicCast;
1478 return SourceFilename;
1482 return HashedSourceFilename;
1486 return FunctionName;
1501 return TotalPermutationCount;
1507 return RootParametersMetadata;
1513 return ReferencedUniformBuffers;
1533 const TCHAR* SourceFilename;
1534 const TCHAR* FunctionName;
1537 int32 TotalPermutationCount;
1570#define SHADER_TYPE_ENTRY(Name) TEXT(#Name)
1575#undef SHADER_TYPE_ENTRY
1592 : LazyShaderTypeAccessor(LazyShaderTypeAccessor)
1594 checkf(!
AreShaderTypesInitialized(),
TEXT(
"Shader type was loaded too late, use ELoadingPhase::PostConfigInit on your module to cause it to load earlier. This shader will not be compiled or function. The module and shader will appear in the callstack of this assert."));
1605 static bool bShaderTypesInitialized;
1638 #define SHADER_DECLARE_EDITOR_VTABLE(ShaderClass) \
1639 static void ModifyCompilationEnvironmentImpl(const FShaderPermutationParameters& Parameters, FShaderCompilerEnvironment& OutEnvironment) \
1641 const typename ShaderClass::FPermutationDomain PermutationVector(Parameters.PermutationId); \
1642 PermutationVector.ModifyCompilationEnvironment(OutEnvironment); \
1643 ShaderClass::ModifyCompilationEnvironment(static_cast<const typename ShaderClass::FPermutationParameters&>(Parameters), OutEnvironment); \
1645 static void GetPermutationIdStringImpl(int32 PermutationId, FString& OutString, bool bFullNames) \
1647 const typename ShaderClass::FPermutationDomain PermutationVector(PermutationId); \
1648 UE::ShaderPermutationUtils::FormatPermutationDomain(PermutationVector, OutString, bFullNames, nullptr); \
1651 #define SHADER_DECLARE_EDITOR_VTABLE(ShaderClass)
1654#define SHADER_DECLARE_VTABLE(ShaderClass) \
1655 static FShader* ConstructSerializedInstance() { return new ShaderClass(); } \
1656 static FShader* ConstructCompiledInstance(const typename FShader::CompiledShaderInitializerType& Initializer) \
1657 { return new ShaderClass(static_cast<const typename ShaderMetaType::CompiledShaderInitializerType&>(Initializer)); }\
1658 static bool ShouldCompilePermutationImpl(const FShaderPermutationParameters& Parameters) \
1659 { return ShaderClass::ShouldCompilePermutation(static_cast<const typename ShaderClass::FPermutationParameters&>(Parameters)); } \
1660 static EShaderPermutationPrecacheRequest ShouldPrecachePermutationImpl(const FShaderPermutationParameters& Parameters) \
1661 { return ShaderClass::ShouldPrecachePermutation(static_cast<const typename ShaderClass::FPermutationParameters&>(Parameters)); } \
1662 SHADER_DECLARE_EDITOR_VTABLE(ShaderClass)
1665#define INTERNAL_DECLARE_SHADER_TYPE_COMMON(ShaderClass,ShaderMetaTypeShortcut,RequiredAPI) \
1667 using ShaderMetaType = F##ShaderMetaTypeShortcut##ShaderType; \
1668 using ShaderMapType = F##ShaderMetaTypeShortcut##ShaderMap; \
1670 static RequiredAPI ShaderMetaType& GetStaticType(); \
1672 static FShaderTypeRegistration ShaderTypeRegistration; \
1675 SHADER_DECLARE_VTABLE(ShaderClass)
1683#define DECLARE_EXPORTED_SHADER_TYPE(ShaderClass,ShaderMetaTypeShortcut,RequiredAPI, ...) \
1684 INTERNAL_DECLARE_SHADER_TYPE_COMMON(ShaderClass, ShaderMetaTypeShortcut, RequiredAPI); \
1685 DECLARE_EXPORTED_TYPE_LAYOUT(ShaderClass, RequiredAPI, NonVirtual); \
1688#define DECLARE_SHADER_TYPE(ShaderClass,ShaderMetaTypeShortcut,...) \
1689 DECLARE_EXPORTED_SHADER_TYPE(ShaderClass,ShaderMetaTypeShortcut,, ##__VA_ARGS__)
1691#define DECLARE_SHADER_TYPE_EXPLICIT_BASES(ShaderClass,ShaderMetaTypeShortcut,...) \
1692 INTERNAL_DECLARE_SHADER_TYPE_COMMON(ShaderClass, ShaderMetaTypeShortcut,); \
1693 DECLARE_EXPORTED_TYPE_LAYOUT_EXPLICIT_BASES(ShaderClass,, NonVirtual, __VA_ARGS__); \
1698#define SHADER_TYPE_EDITOR_VTABLE(ShaderClass) \
1699 , ShaderClass::ModifyCompilationEnvironmentImpl \
1700 , ShaderClass::ValidateCompiledResult \
1701 , ShaderClass::GetOverrideJobPriority
1703#define SHADER_TYPE_EDITOR_PERMUTATION_METADATA(ShaderClass) \
1704 , ShaderClass::GetPermutationIdStringImpl
1708#define SHADER_TYPE_EDITOR_VTABLE(ShaderClass)
1709#define SHADER_TYPE_EDITOR_PERMUTATION_METADATA(ShaderClass)
1713#define SHADER_TYPE_VTABLE(ShaderClass) \
1714 ShaderClass::ConstructSerializedInstance, \
1715 ShaderClass::ConstructCompiledInstance, \
1716 ShaderClass::ShouldCompilePermutationImpl, \
1717 ShaderClass::ShouldPrecachePermutationImpl, \
1718 ShaderClass::GetRayTracingPayloadType, \
1719 ShaderClass::GetShaderBindingLayout \
1720 SHADER_TYPE_EDITOR_VTABLE(ShaderClass)
1724#define IMPLEMENT_SHADER_TYPE(TemplatePrefix,ShaderClass,SourceFilename,FunctionName,Frequency) \
1725 IMPLEMENT_UNREGISTERED_TEMPLATE_TYPE_LAYOUT(TemplatePrefix, ShaderClass); \
1727 ShaderClass::ShaderMetaType& ShaderClass::GetStaticType() \
1729 static ShaderClass::ShaderMetaType StaticType( \
1730 ShaderClass::StaticGetTypeLayout(), \
1731 TEXT(#ShaderClass), \
1735 ShaderClass::FPermutationDomain::PermutationCount, \
1736 SHADER_TYPE_VTABLE(ShaderClass), \
1737 sizeof(ShaderClass), \
1738 ShaderClass::GetRootParametersMetadata() \
1739 SHADER_TYPE_EDITOR_PERMUTATION_METADATA(ShaderClass) \
1741 return StaticType; \
1743 TemplatePrefix FShaderTypeRegistration ShaderClass::ShaderTypeRegistration{TFunctionRef<::FShaderType&()>{ShaderClass::GetStaticType}};
1746#define IMPLEMENT_SHADER_TYPE_WITH_DEBUG_NAME(TemplatePrefix,ShaderClass,SourceFilename,FunctionName,Frequency) \
1747 IMPLEMENT_UNREGISTERED_TEMPLATE_TYPE_LAYOUT(TemplatePrefix, ShaderClass); \
1749 typename ShaderClass::ShaderMetaType& ShaderClass::GetStaticType() \
1751 static typename ShaderClass::ShaderMetaType StaticType( \
1752 ShaderClass::StaticGetTypeLayout(), \
1753 ShaderClass::GetDebugName(), \
1757 ShaderClass::FPermutationDomain::PermutationCount, \
1758 SHADER_TYPE_VTABLE(ShaderClass), \
1759 sizeof(ShaderClass), \
1760 ShaderClass::GetRootParametersMetadata() \
1761 SHADER_TYPE_EDITOR_PERMUTATION_METADATA(ShaderClass) \
1763 return StaticType; \
1765 TemplatePrefix FShaderTypeRegistration ShaderClass::ShaderTypeRegistration{TFunctionRef<::FShaderType&()>{ShaderClass::GetStaticType}};
1768#define IMPLEMENT_SHADER_TYPE2_WITH_TEMPLATE_PREFIX(TemplatePrefix,ShaderClass,Frequency) \
1769 IMPLEMENT_UNREGISTERED_TEMPLATE_TYPE_LAYOUT(TemplatePrefix, ShaderClass); \
1771 ShaderClass::ShaderMetaType& ShaderClass::GetStaticType() \
1773 static ShaderClass::ShaderMetaType StaticType( \
1774 ShaderClass::StaticGetTypeLayout(), \
1775 TEXT(#ShaderClass), \
1776 ShaderClass::GetSourceFilename(), \
1777 ShaderClass::GetFunctionName(), \
1779 ShaderClass::FPermutationDomain::PermutationCount, \
1780 SHADER_TYPE_VTABLE(ShaderClass), \
1781 sizeof(ShaderClass), \
1782 ShaderClass::GetRootParametersMetadata() \
1783 SHADER_TYPE_EDITOR_PERMUTATION_METADATA(ShaderClass) \
1785 return StaticType; \
1787 TemplatePrefix FShaderTypeRegistration ShaderClass::ShaderTypeRegistration{TFunctionRef<::FShaderType&()>{ShaderClass::GetStaticType}};
1789#define IMPLEMENT_SHADER_TYPE2(ShaderClass,Frequency) \
1790 IMPLEMENT_SHADER_TYPE2_WITH_TEMPLATE_PREFIX(template<>, ShaderClass, Frequency)
1793#define IMPLEMENT_SHADER_TYPE3(ShaderClass,Frequency) \
1794 IMPLEMENT_UNREGISTERED_TEMPLATE_TYPE_LAYOUT(,ShaderClass); \
1795 ShaderClass::ShaderMetaType& ShaderClass::GetStaticType() \
1797 static ShaderClass::ShaderMetaType StaticType( \
1798 ShaderClass::StaticGetTypeLayout(), \
1799 TEXT(#ShaderClass), \
1800 ShaderClass::GetSourceFilename(), \
1801 ShaderClass::GetFunctionName(), \
1803 ShaderClass::FPermutationDomain::PermutationCount, \
1804 SHADER_TYPE_VTABLE(ShaderClass), \
1805 sizeof(ShaderClass), \
1806 ShaderClass::GetRootParametersMetadata() \
1807 SHADER_TYPE_EDITOR_PERMUTATION_METADATA(ShaderClass) \
1809 return StaticType; \
1811 FShaderTypeRegistration ShaderClass::ShaderTypeRegistration{TFunctionRef<::FShaderType&()>{ShaderClass::GetStaticType}};
1814#define IMPLEMENT_SHADER_TYPE4_WITH_TEMPLATE_PREFIX(TemplatePrefix,RequiredAPI,ShaderClass,Frequency) \
1815 IMPLEMENT_UNREGISTERED_TEMPLATE_TYPE_LAYOUT(TemplatePrefix, ShaderClass); \
1816 TemplatePrefix RequiredAPI \
1817 ShaderClass::ShaderMetaType& ShaderClass::GetStaticType() \
1819 static ShaderClass::ShaderMetaType StaticType( \
1820 ShaderClass::StaticGetTypeLayout(), \
1821 TEXT(#ShaderClass), \
1822 ShaderClass::GetSourceFilename(), \
1823 ShaderClass::GetFunctionName(), \
1825 ShaderClass::FPermutationDomain::PermutationCount, \
1826 SHADER_TYPE_VTABLE(ShaderClass), \
1827 sizeof(ShaderClass), \
1828 ShaderClass::GetRootParametersMetadata() \
1829 SHADER_TYPE_EDITOR_PERMUTATION_METADATA(ShaderClass) \
1831 return StaticType; \
1833 TemplatePrefix FShaderTypeRegistration ShaderClass::ShaderTypeRegistration{TFunctionRef<::FShaderType&()>{ShaderClass::GetStaticType}};
1837#define IMPLEMENT_SHADER_TYPE_CONSTRUCTOR(ShaderClass, InShaderTypeForDynamicCast, InShaderClassUserFriendlyName) \
1839 FTypeLayoutDesc& InTypeLayout, \
1840 const TCHAR* InName, \
1841 const TCHAR* InSourceFilename, \
1842 const TCHAR* InFunctionName, \
1843 uint32 InFrequency, \
1844 int32 InTotalPermutationCount, \
1845 ConstructSerializedType InConstructSerializedRef, \
1846 ConstructCompiledType InConstructCompiledRef, \
1847 ShouldCompilePermutationType InShouldCompilePermutationRef, \
1848 ShouldPrecachePermutationType InShouldPrecachePermutationRef, \
1849 GetRayTracingPayloadTypeType InGetRayTracingPayloadTypeRef, \
1850 GetShaderBindingLayoutType InGetShaderBindingLayoutTypeRef, \
1851 ModifyCompilationEnvironmentType InModifyCompilationEnvironmentRef, \
1852 ValidateCompiledResultType InValidateCompiledResultRef, \
1853 GetOverrideJobPriorityType InGetOverrideJobPriorityRef, \
1854 uint32 InTypeSize, \
1855 const FShaderParametersMetadata* InRootParametersMetadata = nullptr, \
1856 GetPermutationIdStringType InGetPermutationIdStringRef = nullptr \
1859 InShaderTypeForDynamicCast, \
1865 InTotalPermutationCount, \
1866 InConstructSerializedRef, \
1867 InConstructCompiledRef, \
1868 InShouldCompilePermutationRef, \
1869 InShouldPrecachePermutationRef, \
1870 InGetRayTracingPayloadTypeRef, \
1871 InGetShaderBindingLayoutTypeRef, \
1872 InModifyCompilationEnvironmentRef, \
1873 InValidateCompiledResultRef, \
1874 InGetOverrideJobPriorityRef, \
1876 InRootParametersMetadata, \
1877 InGetPermutationIdStringRef \
1880 checkf(FPaths::GetExtension(InSourceFilename) == TEXT("usf"), \
1881 TEXT("Incorrect virtual shader path extension for %s '%s': Only .usf files should be compiled."), \
1882 InShaderClassUserFriendlyName, InSourceFilename); \
1887#define IMPLEMENT_SHADER_TYPE_CONSTRUCTOR(ShaderClass, InShaderTypeForDynamicCast, InShaderClassUserFriendlyName) \
1889 FTypeLayoutDesc& InTypeLayout, \
1890 const TCHAR* InName, \
1891 const TCHAR* InSourceFilename, \
1892 const TCHAR* InFunctionName, \
1893 uint32 InFrequency, \
1894 int32 InTotalPermutationCount, \
1895 ConstructSerializedType InConstructSerializedRef, \
1896 ConstructCompiledType InConstructCompiledRef, \
1897 ShouldCompilePermutationType InShouldCompilePermutationRef, \
1898 ShouldPrecachePermutationType InShouldPrecachePermutationRef, \
1899 GetRayTracingPayloadTypeType InGetRayTracingPayloadTypeRef, \
1900 GetShaderBindingLayoutType InGetShaderBindingLayoutTypeRef, \
1901 uint32 InTypeSize, \
1902 const FShaderParametersMetadata* InRootParametersMetadata = nullptr \
1905 InShaderTypeForDynamicCast, \
1911 InTotalPermutationCount, \
1912 InConstructSerializedRef, \
1913 InConstructCompiledRef, \
1914 InShouldCompilePermutationRef, \
1915 InShouldPrecachePermutationRef, \
1916 InGetRayTracingPayloadTypeRef, \
1917 InGetShaderBindingLayoutTypeRef, \
1919 InRootParametersMetadata \
1922 checkf(FPaths::GetExtension(InSourceFilename) == TEXT("usf"), \
1923 TEXT("Incorrect virtual shader path extension for %s '%s': Only .usf files should be compiled."), \
1924 InShaderClassUserFriendlyName, InSourceFilename); \
1936 const TCHAR* InName,
2018#define IMPLEMENT_SHADERPIPELINE_TYPE_VSPS(PipelineName, VertexShaderType, PixelShaderType, bRemoveUnused) \
2019 static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), nullptr, &PixelShaderType::GetStaticType(), false, bRemoveUnused);
2021#define IMPLEMENT_SHADERPIPELINE_TYPE_VS(PipelineName, VertexShaderType, bRemoveUnused) \
2022 static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), nullptr, nullptr, false, bRemoveUnused);
2024#define IMPLEMENT_SHADERPIPELINE_TYPE_VSGSPS(PipelineName, VertexShaderType, GeometryShaderType, PixelShaderType, bRemoveUnused) \
2025 static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), &GeometryShaderType::GetStaticType(), &PixelShaderType::GetStaticType(), false, bRemoveUnused);
2027#define IMPLEMENT_SHADERPIPELINE_TYPE_VSGS(PipelineName, VertexShaderType, GeometryShaderType, bRemoveUnused) \
2028 static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), &GeometryShaderType::GetStaticType(), nullptr, false, bRemoveUnused);
2031#define IMPLEMENT_SHADERPIPELINE_TYPE_MSPS(PipelineName, MeshShaderType, PixelShaderType, bRemoveUnused) \
2032 static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &MeshShaderType::GetStaticType(), nullptr, &PixelShaderType::GetStaticType(), true, bRemoveUnused);
2034#define IMPLEMENT_SHADERPIPELINE_TYPE_MSASPS(PipelineName, MeshShaderType, AmplificationShaderType, PixelShaderType, bRemoveUnused) \
2035 static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &MeshShaderType::GetStaticType(), &AmplificationShaderType::GetStaticType(), &PixelShaderType::GetStaticType(), true, bRemoveUnused);
2054 SourceHash =
InShaderType->GetSourceHash(ShaderPlatform);
2062 Ar << Ref.ShaderTypeName;
2063 Ar << Ref.SourceHash;
2067 Ar << Ref.PermutationId;
2075 return ShaderTypeName == Reference.ShaderTypeName && PermutationId == Reference.PermutationId && SourceHash == Reference.SourceHash;
2080 return !(*
this == Reference);
2131 Ar << Ref.ShaderPipelineTypeName;
2132 Ar << Ref.StagesSourceHash;
2143 return !(*
this == Reference);
2205 template<
typename ShaderType>
2208 const FShaderType& Type = ShaderType::GetStaticType();
2215 return static_cast<ShaderType*
>(
Shader);
2269 return Lhs.TypeName.GetHash() < Rhs.TypeName.GetHash();
2278 inline bool IsValid()
const {
return ShaderPipeline !=
nullptr; }
2279 inline bool IsNull()
const {
return ShaderPipeline ==
nullptr; }
2281 template<
typename ShaderType>
2294 return ShaderPipeline->
GetShaders(*ShaderMap);
2331 template<
typename ShaderType>
2336 return static_cast<ShaderType*
>(
Shader);
2340 template<
typename ShaderType>
2359 return Shader !=
nullptr;
2364 return HasShader(Type->GetHashedName(), PermutationId);
2374 return ShaderPipelines;
2398#if !UE_BUILD_SHIPPING
2419#if WITH_EDITORONLY_DATA
2426 return Shaders.Num() == 0;
2435 return ShaderPipelines.Num();
2495#if !UE_BUILD_SHIPPING
2513 return PermutationFlags;
2518#if WITH_EDITORONLY_DATA
2578template<
typename ContentType,
typename Po
interTableType = FShaderMapPo
interTable>
2589 check(LocalContent);
2591 LocalContent->Validate(*
this);
2600template<
typename ShaderType,
typename Po
interTableType>
2607template<
typename ShaderType,
typename Po
interTableType>
2611 return ShaderMap->GetResource();
2627template<
typename ShaderType>
2635 std::is_same_v<typename ShaderType::FPermutationDomain, FShaderPermutationNone>,
2636 "Missing permutation vector argument for shader that have a permutation domain.");
2640 const typename ShaderType::ShaderMapType* ShaderIndex,
2647template<
typename ShaderType>
2680 uint32 ThreadGroupCountX,
2681 uint32 ThreadGroupCountY,
2682 uint32 ThreadGroupCountZ);
2694 uint32 ThreadGroupCountX,
2695 uint32 ThreadGroupCountY,
2696 uint32 ThreadGroupCountZ)
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
bool LoadFromCompactBinary(FCbFieldView Field, FAssetDependency &Dependency)
Definition AssetRegistry.cpp:10420
#define WITH_EDITOR
Definition Build.h:67
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define DECLARE_DELEGATE_EightParams(DelegateName, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type, Param6Type, Param7Type, Param8Type)
Definition DelegateCombinations.h:111
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
FArchive & operator<<(FArchive &Ar, FEnvQueryDebugProfileData::FStep &Data)
Definition EnvQueryTypes.cpp:489
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
#define LAYOUT_FIELD(T, Name,...)
Definition MemoryLayout.h:471
#define DECLARE_EXPORTED_TYPE_LAYOUT(T, RequiredAPI, Interface)
Definition MemoryLayout.h:559
#define DECLARE_EXPORTED_TEMPLATE_INTRINSIC_TYPE_LAYOUT(TemplatePrefix, T, RequiredAPI)
Definition MemoryLayout.h:706
#define LAYOUT_FIELD_EDITORONLY(T, Name,...)
Definition MemoryLayout.h:488
const bool
Definition NetworkReplayStreaming.h:178
EShaderFrequency
Definition RHIDefinitions.h:202
@ SF_NumGraphicsFrequencies
Definition RHIDefinitions.h:219
@ SF_Compute
Definition RHIDefinitions.h:208
@ SF_NumFrequencies
Definition RHIDefinitions.h:216
@ SF_Amplification
Definition RHIDefinitions.h:205
@ SF_Vertex
Definition RHIDefinitions.h:203
@ SF_Mesh
Definition RHIDefinitions.h:204
@ SF_Geometry
Definition RHIDefinitions.h:207
@ SF_RayGen
Definition RHIDefinitions.h:209
@ SF_RayCallable
Definition RHIDefinitions.h:212
@ SF_RayMiss
Definition RHIDefinitions.h:210
@ SF_RayHitGroup
Definition RHIDefinitions.h:211
@ SF_Pixel
Definition RHIDefinitions.h:206
EUniformBufferBaseType
Definition RHIDefinitions.h:634
bool IsWorkGraphShaderFrequency(EShaderFrequency Frequency)
Definition RHIDefinitions.h:1702
bool IsValidGraphicsFrequency(EShaderFrequency InShaderFrequency)
Definition RHIDefinitions.h:228
FName LegacyShaderPlatformToShaderFormat(EShaderPlatform Platform)
Definition RHIStrings.cpp:237
EShaderPlatform GMaxRHIShaderPlatform
Definition RHI.cpp:1335
EShaderParameterType
Definition ShaderCore.h:248
EShaderCompileJobPriority
Definition ShaderCore.h:803
TShaderPermutationDomain<> FShaderPermutationNone
Definition ShaderPermutation.h:467
EShaderPermutationFlags
Definition ShaderPermutation.h:19
RENDERCORE_API uint32 GetRayTracingPayloadTypeMaxSize(ERayTracingPayloadType PayloadType)
Definition Shader.cpp:2956
RENDERCORE_API void DispatchComputeShader(FRHIComputeCommandList &RHICmdList, FShader *Shader, uint32 ThreadGroupCountX, uint32 ThreadGroupCountY, uint32 ThreadGroupCountZ)
Definition Shader.cpp:1631
int16 GetParameterIndex(const FShaderParameterBindings::FResourceParameter &Parameter)
Definition Shader.h:802
EShaderPermutationPrecacheRequest
Definition Shader.h:807
bool operator<(const FShaderPipeline &Lhs, const FShaderPipeline &Rhs)
Definition Shader.h:2267
RENDERCORE_API EShaderPermutationFlags GetShaderPermutationFlags(const FPlatformTypeLayoutParameters &LayoutParams)
Definition Shader.cpp:2934
const int32 kUniqueShaderPermutationId
Definition Shader.h:121
RENDERCORE_API bool IsUsingEmulatedUniformBuffers(EShaderPlatform Platform)
Definition Shader.cpp:1676
RENDERCORE_API void ShaderMapAppendKey(EShaderPlatform Platform, FShaderKeyGenerator &KeyGen)
Definition Shader.cpp:1692
RENDERCORE_API void DispatchIndirectComputeShader(FRHIComputeCommandList &RHICmdList, FShader *Shader, FRHIBuffer *ArgumentBuffer, uint32 ArgumentOffset)
Definition Shader.cpp:1641
#define SHADER_TYPE_LIST
Definition Shader.h:1222
uint32(* TRaytracingPayloadSizeFunction)()
Definition Shader.h:316
RENDERCORE_API void DumpShaderPipelineStats(EShaderPlatform Platform)
Definition Shader.cpp:1580
TSet< FName > FShaderMapAssetPaths
Definition Shader.h:88
RENDERCORE_API void ShaderMapAppendKeyString(EShaderPlatform Platform, FString &KeyString)
Definition Shader.cpp:1686
RENDERCORE_API void SetAdditionalShaderPermutationFlags(EShaderPermutationFlags AdditionalFlags)
Definition Shader.cpp:2928
RENDERCORE_API bool IsDxcEnabledForPlatform(EShaderPlatform Platform, bool bHlslVersion2021=false)
Definition Shader.cpp:1650
RENDERCORE_API FShaderType * FindShaderTypeByName(const FHashedName &ShaderTypeName)
Definition Shader.cpp:1620
RENDERCORE_API void DumpShaderStats(EShaderPlatform Platform, EShaderFrequency Frequency)
Definition Shader.cpp:1449
FString LexToString(FShaderType::EShaderTypeForDynamicCast ShaderType)
Definition Shader.h:1568
RENDERCORE_API const FTypeLayoutDesc & GetTypeLayoutDesc(const FPointerTableBase *PtrTable, const FShader &Shader)
Definition Shader.cpp:964
RENDERCORE_API void RegisterRayTracingPayloadType(ERayTracingPayloadType PayloadType, uint32 PayloadSize, TRaytracingPayloadSizeFunction PayloadSizeFunction)
Definition Shader.cpp:2944
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
uint32 Size
Definition VulkanMemory.cpp:4034
Definition Archive.h:1208
virtual CORE_API void UsingCustomVersion(const struct FGuid &Guid)
Definition Archive.cpp:590
CORE_API int32 CustomVer(const struct FGuid &Key) const
Definition Archive.cpp:602
Definition CompactBinary.h:610
Definition CompactBinaryWriter.h:68
bool operator()(const FShaderType &A, const FShaderType &B) const
Definition Shader.h:2167
Definition CompressedBuffer.h:50
Definition RenderDeferredCleanup.h:11
Definition GlobalShader.h:87
Definition MemoryImage.h:858
Definition MaterialShaderType.h:95
Definition MaterialShared.h:2058
Definition MemoryImageWriter.h:14
Definition MemoryImageWriter.h:78
Definition MeshMaterialShaderType.h:26
Definition NameTypes.h:617
Definition MemoryImage.h:49
Definition RHIResources.h:966
Definition RHIResources.h:1581
Definition RHICommandList.h:2735
Definition RHIResources.h:1018
Definition RHIResources.h:978
Definition RHIResources.h:947
Definition RHIResources.h:960
Definition RHIResources.h:972
Definition RHIResources.h:984
Definition RHIShaderBindingLayout.h:72
Definition RHIResources.h:854
EShaderFrequency GetFrequency() const
Definition RHIResources.h:911
Definition RHIResources.h:954
Definition RHIResources.h:1033
Definition RenderResource.h:37
Definition SecureHash.h:314
Definition SecureHash.h:226
Definition ShaderCore.h:466
const FVertexFactoryType * VFType
Definition Shader.h:708
friend bool operator!=(const FShaderId &X, const FShaderId &Y)
Definition Shader.h:734
const FShaderType * Type
Definition Shader.h:707
int32 PermutationId
Definition Shader.h:711
FHashedName ShaderPipelineName
Definition Shader.h:709
friend bool operator==(const FShaderId &X, const FShaderId &Y)
Definition Shader.h:724
FShaderId(const FShaderType *InType, const FSHAHash &InMaterialShaderMapHash, const FHashedName &InShaderPipeline, const FVertexFactoryType *InVertexFactoryType, int32 InPermutationId, EShaderPlatform InPlatform)
Definition Shader.h:698
friend uint32 GetTypeHash(const FShaderId &Id)
Definition Shader.h:714
FSHAHash MaterialShaderMapHash
Definition Shader.h:710
uint32 Platform
Definition Shader.h:712
FShaderId()
Definition Shader.h:697
Definition ShaderKeyGenerator.h:29
FVertexFactoryType * VertexFactoryType
Definition Shader.h:683
const FShaderPipelineType * ShaderPipeline
Definition Shader.h:684
int32 PermutationId
Definition Shader.h:686
FShaderKey(const FSHAHash &InMaterialShaderMapHash, const FShaderPipelineType *InShaderPipeline, FVertexFactoryType *InVertexFactoryType, int32 PermutationId, EShaderPlatform InPlatform)
Definition Shader.h:656
FSHAHash MaterialShaderMapHash
Definition Shader.h:685
uint32 Platform
Definition Shader.h:687
friend uint32 GetTypeHash(const FShaderKey &Id)
Definition Shader.h:664
RENDERCORE_API friend FArchive & operator<<(FArchive &Ar, FShaderKey &Ref)
friend bool operator==(const FShaderKey &X, const FShaderKey &Y)
Definition Shader.h:672
FShaderLooseParameterBufferInfo(uint16 InBufferIndex, uint16 InBufferSize)
Definition Shader.h:261
friend FArchive & operator<<(FArchive &Ar, FShaderLooseParameterBufferInfo &Info)
Definition Shader.h:268
bool operator<(const FShaderLooseParameterBufferInfo &Rhs) const
Definition Shader.h:283
LAYOUT_FIELD(uint16, BaseIndex)
FShaderLooseParameterBufferInfo()
Definition Shader.h:259
LAYOUT_FIELD(uint16, Size)
bool operator==(const FShaderLooseParameterBufferInfo &Rhs) const
Definition Shader.h:276
LAYOUT_FIELD(TMemoryImageArray< FShaderLooseParameterInfo >, Parameters)
LAYOUT_FIELD(uint16, BaseIndex)
FShaderLooseParameterInfo()=default
friend FArchive & operator<<(FArchive &Ar, FShaderLooseParameterInfo &Info)
Definition Shader.h:231
bool operator<(const FShaderLooseParameterInfo &Rhs) const
Definition Shader.h:244
bool operator==(const FShaderLooseParameterInfo &Rhs) const
Definition Shader.h:238
LAYOUT_FIELD(uint16, Size)
FShaderLooseParameterInfo(uint16 InBaseIndex, uint16 InSize)
Definition Shader.h:224
EShaderPermutationFlags GetPermutationFlags() const
Definition Shader.h:2511
FShaderMapResource * GetResourceChecked() const
Definition Shader.h:2483
RENDERCORE_API FString ToString() const
Definition ShaderMap.cpp:465
RENDERCORE_API void InitResource()
Definition ShaderMap.cpp:233
RENDERCORE_API void AssignContent(TMemoryImageObject< FShaderMapContent > InContent)
Definition ShaderMap.cpp:184
virtual RENDERCORE_API ~FShaderMapBase()
Definition ShaderMap.cpp:158
virtual void GetShaderPipelineList(TArray< FShaderPipelineRef > &OutShaderPipelines) const =0
const FShaderMapPointerTable & GetPointerTable() const
Definition Shader.h:2484
uint32 GetFrozenContentSize() const
Definition Shader.h:2503
virtual void GetShaderList(TMap< FHashedName, TShaderRef< FShader > > &OutShaders) const =0
EShaderPlatform GetShaderPlatform() const
Definition Shader.h:2502
FShaderMapContent * GetMutableContent()
Definition Shader.h:2486
RENDERCORE_API FShaderMapBase()
Definition ShaderMap.cpp:142
const FShaderMapContent * GetContent() const
Definition Shader.h:2485
RENDERCORE_API void DestroyContent()
Definition ShaderMap.cpp:487
virtual const FTypeLayoutDesc & GetContentTypeDesc() const =0
RENDERCORE_API FShaderMapResourceCode * GetResourceCode()
Definition ShaderMap.cpp:175
FShaderMapResource * GetResource() const
Definition Shader.h:2482
RENDERCORE_API void FinalizeContent()
Definition ShaderMap.cpp:245
virtual FShaderMapPointerTable * CreatePointerTable() const =0
RENDERCORE_API void UnfreezeContent()
Definition ShaderMap.cpp:264
RENDERCORE_API void AssignCopy(const FShaderMapBase &Source)
Definition ShaderMap.cpp:197
virtual void DumpShaderList(FShaderListReport &Out) const
Definition Shader.h:2496
virtual void PostFinalizeContent()
Definition Shader.h:2563
RENDERCORE_API void GetShaderList(const FShaderMapBase &InShaderMap, const FSHAHash &InMaterialShaderMapHash, TMap< FShaderId, TShaderRef< FShader > > &OutShaders) const
Definition ShaderMap.cpp:731
TArrayView< const TMemoryImagePtr< FShaderPipeline > > GetShaderPipelines() const
Definition Shader.h:2372
FShaderPipeline * GetShaderPipeline(const FShaderPipelineType *PipelineType) const
Definition Shader.h:2447
FShaderPipeline * GetShaderPipeline(const FHashedName &PipelineTypeName) const
Definition Shader.h:2441
bool HasShaderPipeline(const FShaderPipelineType *PipelineType) const
Definition Shader.h:2453
RENDERCORE_API void RemoveShaderPipelineType(const FShaderPipelineType *ShaderPipelineType)
Definition ShaderMap.cpp:645
RENDERCORE_API uint32 GetMaxNumInstructionsForShader(const FShaderMapBase &InShaderMap, FShaderType *ShaderType) const
Definition ShaderMap.cpp:911
RENDERCORE_API void UpdateHash(FSHA1 &Hasher) const
Definition ShaderMap.cpp:1017
TArrayView< const TMemoryImagePtr< FShader > > GetShaders() const
Definition Shader.h:2367
RENDERCORE_API void Validate(const FShaderMapBase &InShaderMap) const
Definition ShaderMap.cpp:805
void RemoveShaderTypePermutaion(const FShaderType *Type, int32 PermutationId)
Definition Shader.h:2391
bool HasShaderPipeline(const FHashedName &PipelineTypeName) const
Definition Shader.h:2452
ShaderType * GetShader(const typename ShaderType::FPermutationDomain &PermutationVector) const
Definition Shader.h:2341
RENDERCORE_API ~FShaderMapContent()
Definition ShaderMap.cpp:513
RENDERCORE_API FShaderPipeline * FindOrAddShaderPipeline(FShaderPipeline *Pipeline)
Definition ShaderMap.cpp:589
RENDERCORE_API void Empty()
Definition ShaderMap.cpp:1034
LAYOUT_FIELD(FMemoryImageHashTable, ShaderHash)
LAYOUT_FIELD(TMemoryImageArray< TMemoryImagePtr< FShader > >, Shaders)
RENDERCORE_API void GetShaderPipelineList(const FShaderMapBase &InShaderMap, TArray< FShaderPipelineRef > &OutShaderPipelines, FShaderPipeline::EFilter Filter) const
Definition ShaderMap.cpp:787
uint32 GetNumShaderPipelines() const
Definition Shader.h:2433
LAYOUT_FIELD(TMemoryImageArray< TMemoryImagePtr< FShaderPipeline > >, ShaderPipelines)
bool HasShader(const FShaderType *Type, int32 PermutationId) const
Definition Shader.h:2362
RENDERCORE_API void AddShaderPipeline(FShaderPipeline *Pipeline)
Definition ShaderMap.cpp:582
FShader * GetShader(const FShaderType *ShaderType, int32 PermutationId=0) const
Definition Shader.h:2347
RENDERCORE_API FShader * FindOrAddShader(const FHashedName &TypeName, int32 PermutationId, FShader *Shader)
Definition ShaderMap.cpp:559
RENDERCORE_API void EmptyShaderPipelines()
Definition ShaderMap.cpp:1048
LAYOUT_FIELD(TMemoryImageArray< int32 >, ShaderPermutations)
RENDERCORE_API void AddShader(const FHashedName &TypeName, int32 PermutationId, FShader *Shader)
Definition ShaderMap.cpp:545
RENDERCORE_API void DumpShaderList(const FShaderMapBase &InShaderMap, FShaderListReport &Out) const
Definition ShaderMap.cpp:672
RENDERCORE_API EShaderPlatform GetShaderPlatform() const
Definition ShaderMap.cpp:518
LAYOUT_FIELD(FMemoryImageName, ShaderPlatformName)
RENDERCORE_API void RemoveShaderTypePermutaion(const FHashedName &TypeName, int32 PermutationId)
Definition ShaderMap.cpp:610
bool HasShader(const FHashedName &TypeName, int32 PermutationId) const
Definition Shader.h:2356
RENDERCORE_API uint32 GetNumShaders() const
Definition ShaderMap.cpp:901
bool IsEmpty() const
Definition Shader.h:2424
ShaderType * GetShader(int32 PermutationId=0) const
Definition Shader.h:2332
LAYOUT_FIELD(TMemoryImageArray< FHashedName >, ShaderTypes)
TPtrTable< FShaderType > ShaderTypes
Definition Shader.h:647
virtual FShaderMapPointerTable * Clone() const
Definition Shader.h:642
TPtrTable< FVertexFactoryType > VFTypes
Definition Shader.h:648
virtual RENDERCORE_API void * GetIndexedPointer(const FTypeLayoutDesc &TypeDesc, uint32 i) const override
Definition Shader.cpp:641
virtual RENDERCORE_API void SaveToArchive(FArchive &Ar, const FPlatformTypeLayoutParameters &LayoutParams, const void *FrozenObject) const override
Definition Shader.cpp:649
virtual RENDERCORE_API int32 AddIndexedPointer(const FTypeLayoutDesc &TypeDesc, void *Ptr) override
Definition Shader.cpp:633
virtual RENDERCORE_API bool LoadFromArchive(FArchive &Ar, const FPlatformTypeLayoutParameters &LayoutParams, void *FrozenObject) override
Definition Shader.cpp:674
RENDERCORE_API ~FShaderMapResourceCode()
Definition ShaderResource.cpp:226
FShaderMapResourceCode()
Definition Shader.h:571
TArray< FSHAHash > ShaderHashes
Definition Shader.h:602
void AddShaderCompilerOutput(const FShaderCompilerOutput &Output, const FString &DebugName=FString(), FString DebugInfo=FString())
Definition Shader.h:585
RENDERCORE_API uint32 GetSizeBytes() const
Definition ShaderResource.cpp:245
TArray< FShaderCodeResource > ShaderCodeResources
Definition Shader.h:604
RENDERCORE_API void Finalize()
Definition ShaderResource.cpp:232
FSHAHash ResourceHash
Definition Shader.h:601
int32 FindShaderIndex(const FSHAHash &InHash) const
Definition ShaderResource.cpp:256
virtual RENDERCORE_API FRHIShader * CreateRHIShaderOrCrash(int32 ShaderIndex, bool bRequired) override
Definition ShaderResource.cpp:711
virtual RENDERCORE_API FSHAHash GetShaderHash(int32 ShaderIndex) override
Definition ShaderResource.cpp:706
TRefCountPtr< FShaderMapResourceCode > Code
Definition Shader.h:633
virtual uint32 GetSizeBytes() const override
Definition ShaderResource.cpp:788
virtual FString GetFriendlyName() const override
Definition Shader.h:628
virtual uint32 GetShaderSizeBytes(int32 ShaderIndex) const override
Definition ShaderResource.cpp:803
FShaderMapResource_InlineCode(EShaderPlatform InPlatform, FShaderMapResourceCode *InCode)
Definition Shader.h:620
RENDERCORE_API void BeginCreateAllShaders()
Definition ShaderResource.cpp:613
RENDERCORE_API void ReleaseShaders()
Definition ShaderResource.cpp:536
virtual FSHAHash GetShaderHash(int32 ShaderIndex)=0
virtual void PreloadShader(int32 ShaderIndex, FGraphEventArray &OutCompletionEvents)
Definition Shader.h:366
virtual FRHIShader * CreateRHIShaderOrCrash(int32 ShaderIndex, bool bRequired)=0
bool HasShader(int32 ShaderIndex) const
Definition Shader.h:359
virtual bool TryRelease()
Definition Shader.h:489
static RENDERCORE_API bool ArePlatformsCompatible(EShaderPlatform CurrentPlatform, EShaderPlatform TargetPlatform)
Definition ShaderResource.cpp:75
virtual int32 GetGroupIndexForShader(int32 ShaderIndex) const
Definition Shader.h:376
virtual RENDERCORE_API ~FShaderMapResource()
Definition ShaderResource.cpp:504
virtual void ReleasePreloadedShaderCode(int32 ShaderIndex)
Definition Shader.h:487
int32 GetNumRefs() const
Definition Shader.h:344
virtual uint32 GetShaderSizeBytes(int32 ShaderIndex) const
Definition ShaderResource.cpp:515
virtual RENDERCORE_API void ReleaseRHI() override
Definition ShaderResource.cpp:578
bool ContainsAtLeastOneRHIShaderCreated() const
Definition Shader.h:394
SIZE_T GetAllocatedSize() const
Definition Shader.h:474
virtual uint32 GetSizeBytes() const =0
RENDERCORE_API void Release()
Definition ShaderResource.cpp:521
EShaderPlatform GetPlatform() const
Definition Shader.h:340
virtual void PreloadShaderMap(FGraphEventArray &OutCompletionEvents)
Definition Shader.h:371
virtual int32 GetLibraryId() const
Definition Shader.h:382
FRHIShader * GetShader(int32 ShaderIndex, bool bRequired=true)
Definition Shader.h:399
virtual FSHAHash GetShaderMapHash() const
Definition Shader.h:416
RENDERCORE_API void AddRef()
Definition ShaderResource.cpp:510
virtual int32 GetLibraryShaderIndex(int32 ShaderIndex) const
Definition Shader.h:388
int32 GetNumShaders() const
Definition Shader.h:349
bool IsValidShaderIndex(int32 ShaderIndex) const
Definition Shader.h:354
LAYOUT_FIELD(TMemoryImageArray< FBindlessResourceParameter >, BindlessResourceParameters)
LAYOUT_FIELD(TMemoryImageArray< FResourceParameter >, ResourceParameters)
static constexpr uint16 kInvalidBufferIndex
Definition Shader.h:783
RENDERCORE_API void BindForLegacyShaderParameters(const FShader *Shader, int32 PermutationId, const FShaderParameterMap &ParameterMaps, const FShaderParametersMetadata &StructMetaData, bool bShouldBindEverything=false)
Definition ShaderParameterStruct.cpp:250
LAYOUT_FIELD_INITIALIZED(uint32, StructureLayoutHash, 0)
RENDERCORE_API void BindForRootShaderParameters(const FShader *Shader, int32 PermutationId, const FShaderParameterMap &ParameterMaps)
Definition ShaderParameterStruct.cpp:332
LAYOUT_FIELD(TMemoryImageArray< FParameterStructReference >, ParameterReferences)
LAYOUT_FIELD_INITIALIZED(uint16, RootParameterBufferIndex, FShaderParameterBindings::kInvalidBufferIndex)
DECLARE_EXPORTED_TYPE_LAYOUT(FShaderParameterBindings, RENDERCORE_API, NonVirtual)
LAYOUT_FIELD(TMemoryImageArray< FParameterStructReference >, GraphUniformBuffers)
LAYOUT_FIELD(TMemoryImageArray< FParameter >, Parameters)
LAYOUT_FIELD(TMemoryImageArray< FShaderLooseParameterBufferInfo >, LooseParameterBuffers)
friend FArchive & operator<<(FArchive &Ar, FShaderParameterMapInfo &Info)
Definition Shader.h:299
LAYOUT_FIELD(TMemoryImageArray< FShaderResourceParameterInfo >, TextureSamplers)
LAYOUT_FIELD(uint64, Hash)
LAYOUT_FIELD(TMemoryImageArray< FShaderUniformBufferParameterInfo >, UniformBuffers)
LAYOUT_FIELD(TMemoryImageArray< FShaderResourceParameterInfo >, SRVs)
bool operator==(const FShaderParameterMapInfo &Rhs) const
Definition Shader.h:309
Definition ShaderCore.h:323
FShaderPipeline * operator->() const
Definition Shader.h:2301
FShaderMapResource * GetResource() const
Definition Shader.h:2620
const FShaderMapPointerTable & GetPointerTable() const
Definition Shader.h:2614
bool IsNull() const
Definition Shader.h:2279
TArray< TShaderRef< FShader > > GetShaders() const
Definition Shader.h:2292
bool IsValid() const
Definition Shader.h:2278
TShaderRef< FShader > GetShader(EShaderFrequency Frequency) const
Definition Shader.h:2287
FShaderPipeline * GetPipeline() const
Definition Shader.h:2297
FShaderPipelineRef()
Definition Shader.h:2275
TShaderRef< ShaderType > GetShader() const
Definition Shader.h:2282
FShaderPipelineRef(FShaderPipeline *InPipeline, const FShaderMapBase &InShaderMap)
Definition Shader.h:2276
FShaderPipelineTypeDependency(const FShaderPipelineType *InShaderPipelineType, EShaderPlatform ShaderPlatform)
Definition Shader.h:2114
bool operator!=(const FShaderPipelineTypeDependency &Reference) const
Definition Shader.h:2141
bool operator==(const FShaderPipelineTypeDependency &Reference) const
Definition Shader.h:2136
RENDERCORE_API void RefreshCachedSourceHash(EShaderPlatform ShaderPlatform)
Definition Shader.cpp:1287
friend FArchive & operator<<(FArchive &Ar, class FShaderPipelineTypeDependency &Ref)
Definition Shader.h:2129
FShaderPipelineTypeDependency()
Definition Shader.h:2113
FSHAHash StagesSourceHash
Definition Shader.h:2127
FHashedName ShaderPipelineTypeName
Definition Shader.h:2124
const FShaderType * GetShader(EShaderFrequency Frequency) const
Definition Shader.h:1948
TArray< const FShaderType * > Stages
Definition Shader.h:2004
static RENDERCORE_API const FShaderPipelineType * GetShaderPipelineTypeByName(const FHashedName &Name)
Definition Shader.cpp:1224
bool IsGlobalTypePipeline() const
Definition Shader.h:1984
static RENDERCORE_API TArray< const FShaderPipelineType * > GetShaderPipelineTypesByFilenameFilter(const TFunction< bool(const TCHAR *)> &InFilenameFilter)
Definition Shader.cpp:1143
RENDERCORE_API bool ShouldOptimizeUnusedOutputs(EShaderPlatform Platform) const
Definition Shader.cpp:1230
const TCHAR *const Name
Definition Shader.h:1998
bool HasMeshShader() const
Definition Shader.h:1944
FName TypeName
Definition Shader.h:1999
bool bShouldOptimizeUnusedOutputs
Definition Shader.h:2011
friend uint32 GetTypeHash(const FShaderPipelineType *Ref)
Definition Shader.h:1981
FHashedName HashedName
Definition Shader.h:2000
TLinkedList< FShaderPipelineType * > GlobalListLink
Definition Shader.h:2008
static RENDERCORE_API const TArray< FShaderPipelineType * > & GetSortedTypes(FShaderType::EShaderTypeForDynamicCast Type)
Definition Shader.cpp:1115
static RENDERCORE_API bool bInitialized
Definition Shader.h:2013
FHashedName HashedPrimaryShaderFilename
Definition Shader.h:2001
const FHashedName & GetHashedPrimaryShaderFilename() const
Definition Shader.h:1957
friend uint32 GetTypeHash(FShaderPipelineType *Ref)
Definition Shader.h:1980
const FShaderType * AllStages[SF_NumFrequencies]
Definition Shader.h:2006
FName GetFName() const
Definition Shader.h:1954
static RENDERCORE_API void Initialize()
Definition Shader.cpp:1161
RENDERCORE_API bool ShouldCompilePermutation(const FShaderPermutationParameters &Parameters) const
Definition Shader.cpp:1245
bool HasGeometry() const
Definition Shader.h:1945
bool IsMeshMaterialTypePipeline() const
Definition Shader.h:1986
RENDERCORE_API friend FArchive & operator<<(FArchive &Ar, const FShaderPipelineType *&Ref)
Definition Shader.cpp:149
RENDERCORE_API ~FShaderPipelineType()
Definition Shader.cpp:1093
uint32 HashIndex
Definition Shader.h:2010
TCHAR const * GetName() const
Definition Shader.h:1955
RENDERCORE_API EShaderPermutationPrecacheRequest ShouldPrecachePermutation(const FShaderPermutationParameters &Parameters) const
Definition Shader.cpp:1257
static RENDERCORE_API TMap< FHashedName, FShaderPipelineType * > & GetNameToTypeMap()
Definition Shader.cpp:1104
static RENDERCORE_API TLinkedList< FShaderPipelineType * > *& GetTypeList()
Definition Shader.cpp:1110
const TArray< const FShaderType * > & GetStages() const
Definition Shader.h:1960
static RENDERCORE_API TArray< const FShaderPipelineType * > GetShaderPipelineTypesByFilename(const TCHAR *Filename, bool bSearchAsRegexFilter=false)
Definition Shader.cpp:1120
bool HasPixelShader() const
Definition Shader.h:1946
const FHashedName & GetHashedName() const
Definition Shader.h:1956
bool IsMaterialTypePipeline() const
Definition Shader.h:1985
RENDERCORE_API const FSHAHash & GetSourceHash(EShaderPlatform ShaderPlatform) const
Definition Shader.cpp:1235
EFilter
Definition Shader.h:2251
@ EAll
Definition Shader.h:2252
@ EOnlyShared
Definition Shader.h:2253
@ EOnlyUnique
Definition Shader.h:2254
RENDERCORE_API void Validate(const FShaderPipelineType *InPipelineType) const
Definition Shader.cpp:1397
RENDERCORE_API void AddShader(FShader *Shader, int32 PermutationId)
Definition Shader.cpp:1364
FShaderPipeline(const FShaderPipelineType *InType)
Definition Shader.h:2185
RENDERCORE_API FShader * FindOrAddShader(FShader *Shader, int32 PermutationId)
Definition Shader.cpp:1372
LAYOUT_ARRAY(int32, PermutationIds, SF_NumGraphicsFrequencies)
FShader * GetShader(EShaderFrequency Frequency)
Definition Shader.h:2221
const FShader * GetShader(EShaderFrequency Frequency) const
Definition Shader.h:2227
ShaderType * GetShader(const FShaderMapPointerTable &InPtrTable)
Definition Shader.h:2206
RENDERCORE_API ~FShaderPipeline()
Definition Shader.cpp:1388
TArray< TShaderRef< FShader > > GetShaders(const FShaderMapBase &InShaderMap) const
Definition Shader.h:2233
LAYOUT_ARRAY(TMemoryImagePtr< FShader >, Shaders, SF_NumGraphicsFrequencies)
uint32 GetNumShaders() const
Definition Shader.h:2191
LAYOUT_FIELD(FHashedName, TypeName)
LAYOUT_FIELD(uint16, BaseIndex)
LAYOUT_FIELD(uint8, BufferIndex)
FShaderResourceParameterInfo()=default
bool operator<(const FShaderResourceParameterInfo &Rhs) const
Definition Shader.h:209
friend FArchive & operator<<(FArchive &Ar, FShaderResourceParameterInfo &Info)
Definition Shader.h:194
bool operator==(const FShaderResourceParameterInfo &Rhs) const
Definition Shader.h:202
FShaderResourceParameterInfo(uint16 InBaseIndex, uint8 InBufferIndex, EShaderParameterType InType)
Definition Shader.h:186
LAYOUT_FIELD(EShaderParameterType, Type)
bool operator!=(const FShaderTypeDependency &Reference) const
Definition Shader.h:2078
RENDERCORE_API void RefreshCachedSourceHash(EShaderPlatform ShaderPlatform)
Definition Shader.cpp:1275
LAYOUT_FIELD(int32, PermutationId)
LAYOUT_FIELD(FSHAHash, SourceHash)
friend FArchive & operator<<(FArchive &Ar, class FShaderTypeDependency &Ref)
Definition Shader.h:2058
LAYOUT_FIELD(FHashedName, ShaderTypeName)
FShaderTypeDependency(FShaderType *InShaderType, EShaderPlatform ShaderPlatform)
Definition Shader.h:2048
FShaderTypeDependency()
Definition Shader.h:2044
bool operator==(const FShaderTypeDependency &Reference) const
Definition Shader.h:2073
FShaderTypeRegistration(TFunctionRef< FShaderType &()> LazyShaderTypeAccessor)
Definition Shader.h:1591
static RENDERCORE_API void CommitAll()
Definition Shader.cpp:327
static RENDERCORE_API bool AreShaderTypesInitialized()
Definition Shader.cpp:337
static RENDERCORE_API TArray< const FShaderTypeRegistration * > & GetInstances()
Definition Shader.cpp:318
virtual ~FParameters()
Definition Shader.h:1254
static RENDERCORE_API TArray< const FShaderType * > GetShaderTypesByFilename(const TCHAR *Filename, bool bSearchAsRegexFilter=false)
Definition Shader.cpp:362
static RENDERCORE_API TLinkedList< FShaderType * > *& GetTypeList()
Definition Shader.cpp:342
FGlobalShaderType * GetGlobalShaderType()
Definition Shader.h:1363
static RENDERCORE_API TMap< FHashedName, FShaderType * > & GetNameToTypeMap()
Definition Shader.cpp:399
const FShaderParametersMetadata * GetRootParametersMetadata() const
Definition Shader.h:1505
const FHashedName & GetHashedShaderFilename() const
Definition Shader.h:1480
EShaderTypeForDynamicCast GetTypeForDynamicCast() const
Definition Shader.h:1450
const FName & GetFName() const
Definition Shader.h:1468
EShaderFrequency GetFrequency() const
Definition Shader.h:1460
const TCHAR * GetName() const
Definition Shader.h:1464
const FMaterialShaderType * AsMaterialShaderType() const
Definition Shader.h:1426
RENDERCORE_API void DumpDebugInfo()
Definition ShaderParameters.cpp:485
const FOpenColorIOShaderType * GetOpenColorIOShaderType() const
Definition Shader.h:1395
static RENDERCORE_API TArray< const FShaderType * > GetShaderTypesByFilenameFilter(const TFunction< bool(const TCHAR *)> &InFilenameFilter)
Definition Shader.cpp:385
friend uint32 GetTypeHash(FShaderType *Ref)
Definition Shader.h:1357
static RENDERCORE_API const TArray< FShaderType * > & GetSortedTypes(EShaderTypeForDynamicCast Type)
Definition Shader.cpp:405
int32 GetPermutationCount() const
Definition Shader.h:1499
RENDERCORE_API const FSHAHash & GetSourceHash(EShaderPlatform ShaderPlatform) const
Definition Shader.cpp:586
const FTypeLayoutDesc & GetLayout() const
Definition Shader.h:1456
RENDERCORE_API const FShaderBindingLayout * GetShaderBindingLayout(const FShaderPermutationParameters &Parameters) const
Definition Shader.cpp:472
const FMeshMaterialShaderType * GetMeshMaterialShaderType() const
Definition Shader.h:1383
FMeshMaterialShaderType * GetMeshMaterialShaderType()
Definition Shader.h:1379
const FGlobalShaderType * AsGlobalShaderType() const
Definition Shader.h:1420
static RENDERCORE_API void Uninitialize()
const TCHAR * GetFunctionName() const
Definition Shader.h:1484
const FComputeKernelShaderType * GetComputeKernelShaderType() const
Definition Shader.h:1403
const FNiagaraShaderType * AsNiagaraShaderType() const
Definition Shader.h:1438
RENDERCORE_API FShader * ConstructForDeserialization() const
Definition Shader.cpp:442
bool(* ShouldCompilePermutationType)(const FShaderPermutationParameters &)
Definition Shader.h:1259
const FNiagaraShaderType * GetNiagaraShaderType() const
Definition Shader.h:1387
int32 GetNumShaders() const
Definition Shader.h:1493
FMaterialShaderType * GetMaterialShaderType()
Definition Shader.h:1371
const FShaderBindingLayout *(* GetShaderBindingLayoutType)(const FShaderPermutationParameters &)
Definition Shader.h:1262
virtual RENDERCORE_API ~FShaderType()
Definition Shader.cpp:305
RENDERCORE_API ERayTracingPayloadType GetRayTracingPayloadType(const int32 PermutationId) const
Definition Shader.cpp:577
FOpenColorIOShaderType * GetOpenColorIOShaderType()
Definition Shader.h:1399
class FShader *(* ConstructSerializedType)()
Definition Shader.h:1257
RENDERCORE_API bool ShouldCompilePermutation(const FShaderPermutationParameters &Parameters) const
Definition Shader.cpp:462
ERayTracingPayloadType(* GetRayTracingPayloadTypeType)(const int32 PermutationId)
Definition Shader.h:1261
RENDERCORE_API friend FArchive & operator<<(FArchive &Ar, FShaderType *&Ref)
Definition Shader.cpp:410
RENDERCORE_API FShader * ConstructCompiled(const FShader::CompiledShaderInitializerType &Initializer) const
Definition Shader.cpp:447
const FNNERuntimeIREEShaderType * GetNNERuntimeIREEShaderType() const
Definition Shader.h:1411
const FHashedName & GetHashedName() const
Definition Shader.h:1472
FNNERuntimeIREEShaderType * GetNNERuntimeIREEShaderType()
Definition Shader.h:1415
FShader *(* ConstructCompiledType)(const FShader::CompiledShaderInitializerType &Initializer)
Definition Shader.h:1258
const FOpenColorIOShaderType * AsOpenColorIOShaderType() const
Definition Shader.h:1444
EShaderPermutationPrecacheRequest(* ShouldPrecachePermutationType)(const FShaderPermutationParameters &)
Definition Shader.h:1260
friend void RENDERCORE_API DumpShaderStats(EShaderPlatform Platform, EShaderFrequency Frequency)
Definition Shader.cpp:1449
FNiagaraShaderType * GetNiagaraShaderType()
Definition Shader.h:1391
const FGlobalShaderType * GetGlobalShaderType() const
Definition Shader.h:1367
EShaderTypeForDynamicCast
Definition Shader.h:1242
const FMaterialShaderType * GetMaterialShaderType() const
Definition Shader.h:1375
const TCHAR * GetShaderFilename() const
Definition Shader.h:1476
uint32 GetTypeSize() const
Definition Shader.h:1488
FComputeKernelShaderType * GetComputeKernelShaderType()
Definition Shader.h:1407
static RENDERCORE_API FShaderType * GetShaderTypeByName(const TCHAR *Name)
Definition Shader.cpp:347
const FMeshMaterialShaderType * AsMeshMaterialShaderType() const
Definition Shader.h:1432
RENDERCORE_API EShaderPermutationPrecacheRequest ShouldPrecachePermutation(const FShaderPermutationParameters &Parameters) const
Definition Shader.cpp:467
uint32 GetCodeSize() const
Definition Shader.h:907
const FShaderUniformBufferParameter & GetUniformBufferParameter(const FHashedName SearchName) const
Definition Shader.h:928
EShaderPlatform GetShaderPlatform() const
Definition Shader.h:894
void SetNumInstructions(uint32 Value)
Definition Shader.h:908
LAYOUT_FIELD_EDITORONLY(FSHAHash, OutputHash)
FShaderType * GetTypeUnfrozen() const
Definition Shader.h:892
LAYOUT_FIELD(TMemoryImageArray< FHashedName >, UniformBufferParameterStructs)
static EShaderCompileJobPriority GetOverrideJobPriority()
Definition Shader.h:870
const FShaderTarget GetTarget() const
Definition Shader.h:896
static ERayTracingPayloadType GetRayTracingPayloadType(const int32 PermutationId)
Definition Shader.h:873
static void ModifyCompilationEnvironment(const FShaderPermutationParameters &, FShaderCompilerEnvironment &)
Definition Shader.h:854
uint32 GetNumTextureSamplers() const
Definition Shader.h:906
RENDERCORE_API FShader()
Definition Shader.cpp:737
FShaderType * GetType(const FPointerTableBase *InPointerTable) const
Definition Shader.h:889
static const FShaderParametersMetadata * GetRootParametersMetadata()
Definition Shader.h:965
FVertexFactoryType * GetVertexFactoryType(const FShaderMapPointerTable &InPointerTable) const
Definition Shader.h:890
RENDERCORE_API ~FShader()
Definition Shader.cpp:800
LAYOUT_FIELD_EDITORONLY(FSHAHash, SourceHash)
friend class FShaderType
Definition Shader.h:830
LAYOUT_FIELD(FShaderParameterBindings, Bindings)
uint32 GetSortKey() const
Definition Shader.h:883
LAYOUT_FIELD_EDITORONLY(FSHAHash, VFSourceHash)
static const FShaderBindingLayout * GetShaderBindingLayout(const FShaderPermutationParameters &)
Definition Shader.h:857
const TShaderUniformBufferParameter< UniformBufferStructType > & GetUniformBufferParameter() const
Definition Shader.h:913
LAYOUT_FIELD(TMemoryImageArray< FShaderUniformBufferParameter >, UniformBufferParameters)
RENDERCORE_API const FSHAHash & GetHash() const
Definition Shader.cpp:946
int32 GetResourceIndex() const
Definition Shader.h:893
EShaderFrequency GetFrequency() const
Definition Shader.h:895
const FShaderUniformBufferParameter & GetUniformBufferParameter(const FShaderParametersMetadata *SearchStruct) const
Definition Shader.h:920
RENDERCORE_API const FSHAHash & GetVertexFactoryHash() const
Definition Shader.cpp:955
static EShaderPermutationPrecacheRequest ShouldPrecachePermutation(const FShaderPermutationParameters &Parameters)
Definition Shader.h:863
RENDERCORE_API void DumpDebugInfo(const FShaderMapPointerTable &InPtrTable)
Definition Shader.cpp:985
FVertexFactoryType * GetVertexFactoryType(const FPointerTableBase *InPointerTable) const
Definition Shader.h:891
static bool ValidateCompiledResult(EShaderPlatform InPlatform, const FShaderParameterMap &InParameterMap, TArray< FString > &OutError)
Definition Shader.h:866
LAYOUT_FIELD(FShaderParameterMapInfo, ParameterMapInfo)
bool IsFrozen() const
Definition Shader.h:897
FShaderType * GetType(const FShaderMapPointerTable &InPointerTable) const
Definition Shader.h:888
RENDERCORE_API const FSHAHash & GetOutputHash() const
Definition Shader.cpp:937
uint32 GetNumInstructions() const
Definition Shader.h:905
RENDERCORE_API const FShaderParametersMetadata * FindAutomaticallyBoundUniformBufferStruct(int32 BaseIndex) const
Definition Shader.cpp:971
static bool ShouldCompilePermutation(const FShaderPermutationParameters &)
Definition Shader.h:860
Definition RefCounting.h:283
Definition VertexFactory.h:314
Definition ArrayView.h:139
bool operator()(const TShaderTypePermutation< MetaShaderType > &A, const TShaderTypePermutation< MetaShaderType > &B) const
Definition Shader.h:128
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition HashTable.h:467
Definition MemoryImage.h:1062
Definition UnrealString.h.inl:34
Definition MemoryImage.h:382
TOptionalShaderMapRef(const typename ShaderType::ShaderMapType *ShaderIndex)
Definition Shader.h:2651
Definition MemoryImage.h:1039
Definition RefCounting.h:454
TShaderMapRef(const typename ShaderType::ShaderMapType *ShaderIndex, const typename ShaderType::FPermutationDomain &PermutationVector)
Definition Shader.h:2639
TShaderMapRef(const typename ShaderType::ShaderMapType *ShaderIndex)
Definition Shader.h:2631
virtual const FTypeLayoutDesc & GetContentTypeDesc() const final override
Definition Shader.h:2596
const ContentType * GetContent() const
Definition Shader.h:2583
ContentType * GetMutableContent()
Definition Shader.h:2584
virtual FShaderMapPointerTable * CreatePointerTable() const final override
Definition Shader.h:2597
void FinalizeContent()
Definition Shader.h:2586
const PointerTableType & GetPointerTable() const
Definition Shader.h:2582
TShaderRefBase & operator=(const TShaderRefBase &)=default
friend bool operator==(const TShaderRefBase &Lhs, const TShaderRefBase< ShaderType1, PointerTableType > &Rhs)
Definition Shader.h:1201
FShaderType * GetType() const
Definition Shader.h:1060
const FShaderMapBase & GetShaderMapChecked() const
Definition Shader.h:1059
FShaderMapResource * GetResource() const
Definition Shader.h:2608
static TShaderRefBase< ShaderType, PointerTableType > ReinterpretCast(const TShaderRefBase< OtherShaderType, OtherPointerTableType > &Rhs)
Definition Shader.h:1047
TShaderRefBase()
Definition Shader.h:1023
const PointerTableType & GetPointerTable() const
Definition Shader.h:2601
FRHIVertexShader * GetVertexShader(bool bRequired=true) const
Definition Shader.h:1103
void Reset()
Definition Shader.h:1055
FRHIGraphicsShader * GetGraphicsShader(bool bRequired=true) const
Definition Shader.h:1085
FRHIGeometryShader * GetGeometryShader() const
Definition Shader.h:1123
FShaderMapResource & GetResourceChecked() const
Definition Shader.h:1062
FRHIPixelShader * GetPixelShader(bool bRequired=true) const
Definition Shader.h:1118
friend bool operator!=(const TShaderRefBase &Lhs, const TShaderRefBase< ShaderType1, PointerTableType > &Rhs)
Definition Shader.h:1212
TShaderRefBase & operator=(const TShaderRefBase< OtherShaderType, OtherPointerTableType > &Rhs)
Definition Shader.h:1033
ShaderType * GetShader() const
Definition Shader.h:1057
bool IsNull() const
Definition Shader.h:1053
static TShaderRefBase< ShaderType, PointerTableType > Cast(const TShaderRefBase< OtherShaderType, OtherPointerTableType > &Rhs)
Definition Shader.h:1041
const FShaderMapBase * GetShaderMap() const
Definition Shader.h:1058
bool IsValid() const
Definition Shader.h:1052
FRHIWorkGraphShader * GetWorkGraphShader() const
Definition Shader.h:1133
FRHIShader * GetRHIShaderBase(EShaderFrequency Frequency, bool bRequired=true) const
Definition Shader.h:1068
TShaderRefBase(const TShaderRefBase &)=default
TShaderRefBase(ShaderType *InShader, const FShaderMapBase &InShaderMap)
Definition Shader.h:1024
ShaderType * operator->() const
Definition Shader.h:1066
FRHIAmplificationShader * GetAmplificationShader() const
Definition Shader.h:1113
TShaderRefBase(const TShaderRefBase< OtherShaderType, OtherPointerTableType > &Rhs)
Definition Shader.h:1028
FRHIComputeShader * GetComputeShader() const
Definition Shader.h:1128
FVertexFactoryType * GetVertexFactoryType() const
Definition Shader.h:1061
FRHIMeshShader * GetMeshShader() const
Definition Shader.h:1108
Definition UniquePtr.h:107
auto BinarySearchBy(const RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
Definition BinarySearch.h:203
Definition FieldSystemNoiseAlgo.cpp:6
UE_NODEBUG void IntrinsicToString(const TArray< T, AllocatorType > &Object, const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams, FMemoryToStringContext &OutContext)
Definition Array.h:3983
U16 Index
Definition radfft.cpp:71
Definition NameTypes.h:558
Definition MemoryLayout.h:51
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131
FRegisterRayTracingPayloadTypeHelper(ERayTracingPayloadType PayloadType, uint32 PayloadSize, TRaytracingPayloadSizeFunction PayloadSizeFunction)
Definition Shader.h:324
CORE_API static const FGuid GUID
Definition RenderingObjectVersion.h:148
@ ShaderPermutationId
Definition RenderingObjectVersion.h:73
Definition ShaderCompilerJobTypes.h:308
TArray< FGenericShaderStat > ShaderStatistics
Definition Shader.h:1624
const FShaderType::FParameters * Parameters
Definition Shader.h:1612
FShaderTarget Target
Definition Shader.h:1613
FSHAHash MaterialShaderMapHash
Definition Shader.h:1617
uint32 NumTextureSamplers
Definition Shader.h:1621
uint32 NumInstructions
Definition Shader.h:1620
const FShaderParameterMap & ParameterMap
Definition Shader.h:1615
const FSHAHash & OutputHash
Definition Shader.h:1616
const FShaderPipelineType * ShaderPipeline
Definition Shader.h:1618
int32 PermutationId
Definition Shader.h:1623
uint32 CodeSize
Definition Shader.h:1622
TConstArrayView< uint8 > Code
Definition Shader.h:1614
const FVertexFactoryType * VertexFactoryType
Definition Shader.h:1619
const FShaderType * Type
Definition Shader.h:1611
Definition ShaderCore.h:544
Definition ShaderCompilerCore.h:491
FHashedName operator()(const FShaderPipeline *InShaderPipeline)
Definition Shader.h:2317
LAYOUT_FIELD(EUniformBufferBaseType, BaseType)
DECLARE_INLINE_TYPE_LAYOUT(FBindlessResourceParameter, NonVirtual)
LAYOUT_FIELD(uint16, ByteOffset)
LAYOUT_FIELD(uint16, GlobalConstantOffset)
LAYOUT_FIELD(uint16, ByteOffset)
DECLARE_INLINE_TYPE_LAYOUT(FParameterStructReference, NonVirtual)
LAYOUT_FIELD(uint16, BufferIndex)
LAYOUT_FIELD(uint16, ByteSize)
LAYOUT_FIELD(uint16, BufferIndex)
DECLARE_INLINE_TYPE_LAYOUT(FParameter, NonVirtual)
LAYOUT_FIELD(uint16, ByteOffset)
LAYOUT_FIELD(uint16, BaseIndex)
LAYOUT_FIELD(EUniformBufferBaseType, BaseType)
LAYOUT_FIELD(uint16, ByteOffset)
LAYOUT_FIELD(uint8, BaseIndex)
DECLARE_INLINE_TYPE_LAYOUT(FResourceParameter, NonVirtual)
Definition ShaderPermutation.h:27
Definition ShaderSerialization.h:26
Definition ShaderCore.h:186
Definition ShaderCodeLibrary.h:118
Definition MemoryLayout.h:108
static int32 Strlen(const CharType *String)
Definition CString.h:1047
static UE_FORCEINLINE_HINT int32 Strncmp(const CharType *String1, const CharType *String2, SIZE_T Count)
Definition CString.h:1024
Definition MemoryImage.h:71
uint32 FrozenSize
Definition MemoryImage.h:102
T * Object
Definition MemoryImage.h:101
Definition ShaderPermutation.h:229
bool operator==(const TShaderTypePermutation &Other) const
Definition Shader.h:103
TShaderTypePermutation(MetaShaderType *InType, int32 InPermutationId)
Definition Shader.h:97
friend uint32 GetTypeHash(const TShaderTypePermutation &Var)
Definition Shader.h:113
bool operator!=(const TShaderTypePermutation &Other) const
Definition Shader.h:108
MetaShaderType *const Type
Definition Shader.h:94
const int32 PermutationId
Definition Shader.h:95