20template<
typename ShaderType,
typename Po
interTableType>
class TShaderRefBase;
23template<
class ParameterType>
27 ,
const ParameterType&
Value
43 Parameter.GetBufferIndex(),
50template<
class ParameterType>
54 ,
const ParameterType* Values
69 Parameter.GetBufferIndex(),
79 if (Parameter.IsBound())
81#if PLATFORM_SUPPORTS_BINDLESS_RENDERING
96 if (Parameter.IsBound())
98#if PLATFORM_SUPPORTS_BINDLESS_RENDERING
130 if (TextureParameter.
IsBound())
141 if (Parameter.IsBound())
143#if PLATFORM_SUPPORTS_BINDLESS_RENDERING
158 if (Parameter.IsBound())
160#if PLATFORM_SUPPORTS_BINDLESS_RENDERING
175 if (Parameter.IsBound())
177#if PLATFORM_SUPPORTS_BINDLESS_RENDERING
192 if (Parameter.IsBound())
194#if PLATFORM_SUPPORTS_BINDLESS_RENDERING
212 checkSlow(!Parameter.IsBound() || UniformBufferRHI);
213 if (Parameter.IsBound())
215 BatchedParameters.SetShaderUniformBuffer(Parameter.GetBaseIndex(), UniformBufferRHI);
219template<
typename TBufferStruct>
226 if (Parameter.IsBound())
232template<
typename TBufferStruct>
239 if (Parameter.IsBound())
245template<
typename TBufferStruct>
250 if (Parameter.IsBound())
258template<
typename TRHICmdList,
typename TShaderTypeRHI,
class ParameterType>
263 ,
const ParameterType&
Value
278 const typename TShaderType::FParameters& Parameters,
294 const typename TShaderType::FParameters& Parameters,
398template<
typename TRHICmdList,
typename TShaderType>
401 if (RHICmdList.NeedsShaderUnbinds())
410template<
typename TRHICmdList,
typename TShaderType>
413 if (RHICmdList.NeedsShaderUnbinds())
422#define GUARD_SETSHADERVALUE(_TYPE) \
423template<typename ShaderRHIParamRef, typename TRHICmdList> \
424void SetShaderValue( TRHICmdList& RHICmdList, const ShaderRHIParamRef& Shader, const FShaderParameter& Parameter, \
425 const _TYPE##d& Value, uint32 ElementIndex = 0) { static_assert(sizeof(ShaderRHIParamRef) == 0, "Passing unsupported "#_TYPE"d. Requires "#_TYPE"f"); } \
426template<typename ShaderRHIParamRef> \
427void SetShaderValueOnContext(IRHICommandContext& RHICmdListContext, const ShaderRHIParamRef& Shader, const FShaderParameter& Parameter, \
428 const _TYPE##d& Value, uint32 ElementIndex = 0) { static_assert(sizeof(ShaderRHIParamRef) == 0, "Passing unsupported "#_TYPE"d. Requires "#_TYPE"f"); } \
429template<typename ShaderRHIParamRef, typename TRHICmdList> \
430void SetShaderValueArray(TRHICmdList& RHICmdList, const ShaderRHIParamRef& Shader, const FShaderParameter& Parameter, \
431 const _TYPE##d* Values, uint32 NumElements, uint32 BaseElementIndex = 0) { static_assert(sizeof(ShaderRHIParamRef) == 0, "Passing unsupported "#_TYPE"d*. Requires "#_TYPE"f*"); } \
447template<
typename TRHIShader,
typename TRHICmdList>
#define checkSlow(expr)
Definition AssertionMacros.h:332
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FUniformBufferRHIRef RHICreateUniformBuffer(const void *Contents, const FRHIUniformBufferLayout *Layout, EUniformBufferUsage Usage, EUniformBufferValidation Validation=EUniformBufferValidation::ValidateResources)
Definition DynamicRHI.h:1231
bool IsValidRef(const FVertexBufferAndSRV &Buffer)
Definition GPUSkinVertexFactory.h:92
@ UniformBuffer_SingleDraw
Definition RHIDefinitions.h:538
#define SHADER_PARAMETER_ARRAY_ELEMENT_ALIGNMENT
Definition RHIDefinitions.h:28
void SetShaderParameters(FRHIBatchedShaderParameters &BatchedParameters, const FShaderParameterBindings &Bindings, const FShaderParametersMetadata *ParametersMetadata, const void *InParametersData)
Definition ShaderParameterStruct.cpp:883
void UnsetUAVParameter(FRHIBatchedShaderUnbinds &BatchedUnbinds, const FShaderResourceParameter &Parameter)
Definition ShaderParameterUtils.h:190
void SetShaderParametersMixed(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TShaderTypeRHI *InShaderRHI, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for a shader. Requires the shader type to impleme...
Definition ShaderParameterUtils.h:290
void SetShaderParametersLegacyCS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TArguments &&... InArguments)
Utility to set all legacy parameters for a Compute shader. Requires the shader type to implement SetP...
Definition ShaderParameterUtils.h:392
void SetSingleShaderValue(TRHICmdList &RHICmdList, TShaderTypeRHI *InShaderRHI, const FShaderParameter &Parameter, const ParameterType &Value)
Definition ShaderParameterUtils.h:259
void SetShaderParametersMixedVS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for a Vertex shader. Requires the shader type to ...
Definition ShaderParameterUtils.h:304
void SetShaderParametersMixedGS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for a Geometry shader. Requires the shader type t...
Definition ShaderParameterUtils.h:332
void SetUAVParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderResourceParameter &Parameter, FRHIUnorderedAccessView *UAV)
Definition ShaderParameterUtils.h:156
void SetShaderParametersMixedMS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for a Mesh shader. Requires the shader type to im...
Definition ShaderParameterUtils.h:311
void SetShaderParametersMixedAS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for an Amplification shader. Requires the shader ...
Definition ShaderParameterUtils.h:318
void SetTextureParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderResourceParameter &Parameter, FRHITexture *TextureRHI)
Definition ShaderParameterUtils.h:77
void SetUniformBufferParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderUniformBufferParameter &Parameter, FRHIUniformBuffer *UniformBufferRHI)
Definition ShaderParameterUtils.h:207
void SetShaderValue(FRHIBatchedShaderParameters &BatchedParameters, const FShaderParameter &Parameter, const ParameterType &Value, uint32 ElementIndex=0)
Definition ShaderParameterUtils.h:24
void SetShaderValueArray(FRHIBatchedShaderParameters &BatchedParameters, const FShaderParameter &Parameter, const ParameterType *Values, uint32 NumElements, uint32 ElementIndex=0)
Definition ShaderParameterUtils.h:51
void SetShaderParametersMixedPS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for a Pixel shader. Requires the shader type to i...
Definition ShaderParameterUtils.h:325
void SetShaderParametersLegacyMS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TArguments &&... InArguments)
Utility to set all legacy parameters for a Mesh shader. Requires the shader type to implement SetPara...
Definition ShaderParameterUtils.h:364
void SetShaderParametersLegacyVS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TArguments &&... InArguments)
Utility to set all legacy parameters for a Vertex shader. Requires the shader type to implement SetPa...
Definition ShaderParameterUtils.h:357
#define GUARD_SETSHADERVALUE(_TYPE)
Definition ShaderParameterUtils.h:422
void UnsetShaderParametersLegacyCS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader)
Utility to unset all legacy parameters for a Compute shader. Requires the shader type to implement Un...
Definition ShaderParameterUtils.h:411
void SetShaderParametersMixedCS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for a Compute shader. Requires the shader type to...
Definition ShaderParameterUtils.h:339
void UnsetShaderParametersLegacyPS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader)
Utility to unset all legacy parameters for a Pixel shader. Requires the shader type to implement Unse...
Definition ShaderParameterUtils.h:399
void SetSRVParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderResourceParameter &Parameter, FRHIShaderResourceView *SRV)
Definition ShaderParameterUtils.h:139
void SetSamplerParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderResourceParameter &Parameter, FRHISamplerState *SamplerStateRHI)
Definition ShaderParameterUtils.h:94
void SetShaderParametersLegacy(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TShaderTypeRHI *InShaderRHI, TArguments &&... InArguments)
Utility to set all legacy parameters for a shader. Requires the shader type to implement SetParameter...
Definition ShaderParameterUtils.h:348
void UnsetSRVParameter(FRHIBatchedShaderUnbinds &BatchedUnbinds, const FShaderResourceParameter &Parameter)
Definition ShaderParameterUtils.h:173
void SetShaderParametersLegacyPS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TArguments &&... InArguments)
Utility to set all legacy parameters for a Pixel shader. Requires the shader type to implement SetPar...
Definition ShaderParameterUtils.h:378
void SetShaderParametersLegacyAS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TArguments &&... InArguments)
Utility to set all legacy parameters for an Amplification shader. Requires the shader type to impleme...
Definition ShaderParameterUtils.h:371
void SetShaderParametersLegacyGS(TRHICmdList &RHICmdList, const TShaderRef< TShaderType > &InShader, TArguments &&... InArguments)
Utility to set all legacy parameters for a Geometry shader. Requires the shader type to implement Set...
Definition ShaderParameterUtils.h:385
void SetBatchedShaderParametersMixed(FRHIBatchedShaderParameters &BatchedParameters, const TShaderRef< TShaderType > &InShader, const typename TShaderType::FParameters &Parameters, TArguments &&... InArguments)
Utility to set all legacy and non-legacy parameters for a shader. Requires the shader type to impleme...
Definition ShaderParameterUtils.h:275
void SetUniformBufferParameterImmediate(FRHIBatchedShaderParameters &BatchedParameters, const TShaderUniformBufferParameter< TBufferStruct > &Parameter, const TBufferStruct &UniformBufferValue)
Definition ShaderParameterUtils.h:246
static FORCEINLINE double GetCurrentTime()
Definition App.h:602
Definition RHIResources.h:671
Definition RHIResources.h:3304
Definition RHIResources.h:2153
Definition RHIResources.h:3294
Definition ShaderParameters.h:56
Definition ShaderParameters.h:87
bool IsBound() const
Definition ShaderParameters.h:95
Definition RenderResource.h:354
Definition RHIShaderParameters.h:241
Definition RHIShaderParameters.h:374
Definition IsPointer.h:12