You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
There was a crash that could happen when a view had ray tracing disallowed and then forcing all ray tracing effects. This was happening because part of the code thought there were not supposed to be any RT passes and would not add a given shader, but then when the effect was prepared and didn't have an associated view to query its RT allowance then it would later assert when looking for the associated shader. #rb juan.canada #jira UE-143796 #preflight 62181cc819758119df40e485 #ROBOMERGE-AUTHOR: alejandro.arango #ROBOMERGE-SOURCE: CL 19149250 in //UE5/Release-5.0/... via CL 19149827 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845) [CL 19160966 by alejandro arango in ue5-main branch]
163 lines
4.5 KiB
C++
163 lines
4.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
RaytracingOptions.h declares ray tracing options for use in rendering
|
|
=============================================================================*/
|
|
|
|
#pragma once
|
|
|
|
#include "RHIDefinitions.h"
|
|
|
|
class FSkyLightSceneProxy;
|
|
class FViewInfo;
|
|
class FLightSceneInfoCompact;
|
|
class FLightSceneInfo;
|
|
|
|
// be sure to also update the definition in the `RayTracingPrimaryRays.usf`
|
|
enum class ERayTracingPrimaryRaysFlag: uint32
|
|
{
|
|
None = 0,
|
|
UseGBufferForMaxDistance = 1 << 0,
|
|
ConsiderSurfaceScatter = 1 << 1,
|
|
AllowSkipSkySample = 1 << 2,
|
|
};
|
|
|
|
ENUM_CLASS_FLAGS(ERayTracingPrimaryRaysFlag);
|
|
|
|
struct FRayTracingPrimaryRaysOptions
|
|
{
|
|
bool bEnabled;
|
|
int32 SamplerPerPixel;
|
|
int32 ApplyHeightFog;
|
|
float PrimaryRayBias;
|
|
float MaxRoughness;
|
|
int32 MaxRefractionRays;
|
|
int32 EnableEmmissiveAndIndirectLighting;
|
|
int32 EnableDirectLighting;
|
|
int32 EnableShadows;
|
|
float MinRayDistance;
|
|
float MaxRayDistance;
|
|
int32 EnableRefraction;
|
|
};
|
|
|
|
enum class ERayTracingPipelineCompatibilityFlags
|
|
{
|
|
// Rendering feature can use the full ray tracing pipeline, with raygen, hit and miss shaders.
|
|
FullPipeline = 1 << 0,
|
|
|
|
// Rendering feature can use inline ray tracing
|
|
Inline = 1 << 1,
|
|
};
|
|
ENUM_CLASS_FLAGS(ERayTracingPipelineCompatibilityFlags);
|
|
|
|
|
|
#if RHI_RAYTRACING
|
|
|
|
// Whether a particular effect should be used, taking into account debug override
|
|
extern bool ShouldRenderRayTracingEffect(bool bEffectEnabled, ERayTracingPipelineCompatibilityFlags CompatibilityFlags, const FSceneView* View);
|
|
|
|
extern bool AnyRayTracingPassEnabled(const FScene* Scene, const FViewInfo& View);
|
|
extern bool AnyInlineRayTracingPassEnabled(const FScene* Scene, const FViewInfo& View);
|
|
extern FRayTracingPrimaryRaysOptions GetRayTracingTranslucencyOptions(const FViewInfo& View);
|
|
|
|
extern bool ShouldRenderRayTracingSkyLight(const FSkyLightSceneProxy* SkyLightSceneProxy);
|
|
extern bool ShouldRenderRayTracingAmbientOcclusion(const FViewInfo& View);
|
|
extern bool ShouldRenderRayTracingReflections(const FViewInfo& View);
|
|
extern bool ShouldRenderRayTracingGlobalIllumination(const FViewInfo& View);
|
|
extern bool ShouldRenderRayTracingTranslucency(const FViewInfo& View);
|
|
extern bool ShouldRenderRayTracingShadows();
|
|
extern bool ShouldRenderRayTracingShadowsForLight(const FLightSceneProxy& LightProxy);
|
|
extern bool ShouldRenderRayTracingShadowsForLight(const FLightSceneInfoCompact& LightInfo);
|
|
extern bool ShouldRenderPluginRayTracingGlobalIllumination(const FViewInfo& View);
|
|
extern bool HasRayTracedOverlay(const FSceneViewFamily& ViewFamily);
|
|
|
|
extern bool EnableRayTracingShadowTwoSidedGeometry();
|
|
extern float GetRaytracingMaxNormalBias();
|
|
extern int32 GetRayTracingCulling();
|
|
extern float GetRayTracingCullingRadius();
|
|
|
|
extern bool CanUseRayTracingAMDHitToken();
|
|
|
|
#else // RHI_RAYTRACING
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingEffect(bool bEffectEnabled, ERayTracingPipelineCompatibilityFlags CompatibilityFlags, const FSceneView* View)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool AnyRayTracingPassEnabled(const FScene* Scene, const FViewInfo& View)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingSkyLight(const FSkyLightSceneProxy* SkyLightSceneProxy)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingAmbientOcclusion(const FViewInfo& View)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingReflections(const FViewInfo& View)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingGlobalIllumination(const FViewInfo& View)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingTranslucency(const FViewInfo& View)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingShadows()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingShadowsForLight(const FLightSceneProxy& LightProxy)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingShadowsForLight(const FLightSceneInfoCompact& LightInfo)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool ShouldRenderPluginRayTracingGlobalIllumination(const FViewInfo& View)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE bool HasRayTracedOverlay(const FSceneViewFamily& ViewFamily)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
FORCEINLINE int32 GetRayTracingCulling()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
FORCEINLINE float GetRayTracingCullingRadius()
|
|
{
|
|
return 0.0;
|
|
}
|
|
|
|
FORCEINLINE bool CanUseRayTracingAMDHitToken()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
#endif // RHI_RAYTRACING
|
|
|
|
FORCEINLINE bool ShouldRenderRayTracingEffect(ERayTracingPipelineCompatibilityFlags CompatibilityFlags)
|
|
{
|
|
return ShouldRenderRayTracingEffect(true, CompatibilityFlags, nullptr);
|
|
} |