Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Public/ShaderParameterStructDeclaration.h
marc audy a61593568e Fix PVS warnings - V591: Non-void function should return a value.
Add return values for static_assert cases to placate PVS
Fix copy operators not returning this
Fix a handful of other cases

[CL 28955609 by marc audy in ue5-main branch]
2023-10-20 01:28:06 -04:00

26 lines
903 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include <type_traits>
#include "HAL/Platform.h"
class FShaderParametersMetadata;
#define DECLARE_UNIFORM_BUFFER_STRUCT(StructTypeName, PrefixKeywords) \
class StructTypeName; \
PrefixKeywords const FShaderParametersMetadata* GetForwardDeclaredShaderParametersStructMetadata(const StructTypeName* DummyPtr);
/** Retrieves the metadata for a shader parameter struct type without having a definition of the type.
* This is the default overload in case there is no exact non-template overload (prevents implicit casting).
*/
template<typename T>
const FShaderParametersMetadata* GetForwardDeclaredShaderParametersStructMetadata(const T*)
{
static_assert(!std::is_same<T, T>::value /* true */,
TEXT("Partial uniform buffer struct declaration. Use `DECLARE_UNIFORM_BUFFER_STRUCT()` instead of `class T;`.")
);
return nullptr;
}