You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 60acc49b58f02e0001a0a996 #rb graham.wihlidal,Arciel.Rekman,Brandon.Schaefer,will.damon [CL 16446355 by Ola Olsson in ue5-main branch]
99 lines
2.6 KiB
Plaintext
99 lines
2.6 KiB
Plaintext
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
// Note: include at the end of vertex factories to provide default/dummy implementation of factory functions that are not supported OR that follow the standard pattern
|
|
// E.g., if the VF implements the three flavours of VertexFactoryGetViewIndex, it should define VF_IMPLEMENTED_GET_VIEW_INDEX
|
|
#ifndef VF_IMPLEMENTED_GET_VIEW_INDEX
|
|
#define VF_IMPLEMENTED_GET_VIEW_INDEX
|
|
|
|
uint VertexFactoryGetViewIndex(FVertexFactoryIntermediates Intermediates)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
return Intermediates.SceneData.ViewIndex;
|
|
#else
|
|
return 0U;
|
|
#endif
|
|
}
|
|
|
|
uint VertexFactoryGetInstanceIdLoadIndex(FVertexFactoryIntermediates Intermediates)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
return Intermediates.SceneData.InstanceIdLoadIndex;
|
|
#else
|
|
return 0U;
|
|
#endif
|
|
}
|
|
|
|
float4x4 VertexFactoryGetLocalToWorld(FVertexFactoryIntermediates Intermediates)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
return Intermediates.SceneData.InstanceData.LocalToWorld;
|
|
#else
|
|
return Primitive.LocalToWorld;
|
|
#endif
|
|
}
|
|
|
|
float4x4 VertexFactoryGetWorldToLocal(FVertexFactoryIntermediates Intermediates)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
return Intermediates.SceneData.InstanceData.WorldToLocal;
|
|
#else
|
|
return Primitive.WorldToLocal;
|
|
#endif
|
|
}
|
|
|
|
#if POSITION_ONLY
|
|
|
|
uint VertexFactoryGetViewIndex(FPositionOnlyVertexFactoryInput Input)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
FSceneDataIntermediates SceneData = GetSceneDataIntermediates(Input.InstanceIdOffset, Input.DrawInstanceId);
|
|
return SceneData.ViewIndex;
|
|
#else
|
|
return 0U;
|
|
#endif
|
|
}
|
|
|
|
uint VertexFactoryGetViewIndex(FPositionAndNormalOnlyVertexFactoryInput Input)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
FSceneDataIntermediates SceneData = GetSceneDataIntermediates(Input.InstanceIdOffset, Input.DrawInstanceId);
|
|
return SceneData.ViewIndex;
|
|
#else
|
|
return 0U;
|
|
#endif
|
|
}
|
|
|
|
uint VertexFactoryGetInstanceIdLoadIndex(FPositionOnlyVertexFactoryInput Input)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
FSceneDataIntermediates SceneData = GetSceneDataIntermediates(Input.InstanceIdOffset, Input.DrawInstanceId);
|
|
return SceneData.InstanceIdLoadIndex;
|
|
#else
|
|
return 0U;
|
|
#endif
|
|
}
|
|
|
|
uint VertexFactoryGetInstanceIdLoadIndex(FPositionAndNormalOnlyVertexFactoryInput Input)
|
|
{
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
FSceneDataIntermediates SceneData = GetSceneDataIntermediates(Input.InstanceIdOffset, Input.DrawInstanceId);
|
|
return SceneData.InstanceIdLoadIndex;
|
|
#else
|
|
return 0U;
|
|
#endif
|
|
}
|
|
|
|
#endif // POSITION_ONLY
|
|
|
|
#endif // VF_IMPLEMENTED_GET_VIEW_INDEX
|
|
|
|
|
|
#if VF_USE_PRIMITIVE_SCENE_DATA
|
|
|
|
FPrimitiveSceneData GetPrimitiveData(FVertexFactoryIntermediates Intermediates)
|
|
{
|
|
return Intermediates.SceneData.Primitive;
|
|
}
|
|
|
|
#endif // VF_USE_PRIMITIVE_SCENE_DATA
|