You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
#rb integration [CL 5387703 by Ryan Vance in Dev-VR branch]
This commit is contained in:
@@ -350,8 +350,7 @@ void FDebugViewModeMeshProcessor::AddMeshBatch(const FMeshBatch& RESTRICT MeshBa
|
||||
// Shadermap can be null while shaders are compiling.
|
||||
if (DebugViewModeInterface->bNeedsInstructionCount && BatchMaterial->GetRenderingThreadShaderMap())
|
||||
{
|
||||
ShaderElementData.NumVSInstructions = BatchMaterial->GetShader<TBasePassVS<TUniformLightMapPolicy<LMP_NO_LIGHTMAP>, false>>(VertexFactoryType)->GetNumInstructions();
|
||||
ShaderElementData.NumPSInstructions = BatchMaterial->GetShader<TBasePassPS<TUniformLightMapPolicy<LMP_NO_LIGHTMAP>, false>>(VertexFactoryType)->GetNumInstructions();
|
||||
UpdateInstructionCount(ShaderElementData, BatchMaterial, VertexFactoryType);
|
||||
}
|
||||
|
||||
ShaderElementData.InitializeMeshMaterialData(ViewIfDynamicMeshCommand, PrimitiveSceneProxy, MeshBatch, StaticMeshId, true);
|
||||
@@ -373,6 +372,35 @@ void FDebugViewModeMeshProcessor::AddMeshBatch(const FMeshBatch& RESTRICT MeshBa
|
||||
ShaderElementData);
|
||||
}
|
||||
|
||||
void FDebugViewModeMeshProcessor::UpdateInstructionCount(FDebugViewModeShaderElementData& OutShaderElementData, const FMaterial* InBatchMaterial, FVertexFactoryType* InVertexFactoryType)
|
||||
{
|
||||
check(InBatchMaterial && InVertexFactoryType);
|
||||
|
||||
const bool bDeferred = !IsAnyForwardShadingEnabled(GetFeatureLevelShaderPlatform(InBatchMaterial->GetFeatureLevel()));
|
||||
const bool bLit = InBatchMaterial->GetShadingModel() != MSM_Unlit;
|
||||
|
||||
OutShaderElementData.NumVSInstructions = InBatchMaterial->GetShader<TBasePassVS<TUniformLightMapPolicy<LMP_NO_LIGHTMAP>, false>>(InVertexFactoryType)->GetNumInstructions();
|
||||
OutShaderElementData.NumPSInstructions = InBatchMaterial->GetShader<TBasePassPS<TUniformLightMapPolicy<LMP_NO_LIGHTMAP>, false>>(InVertexFactoryType)->GetNumInstructions();
|
||||
|
||||
// Those numbers are taken from a simple material where common inputs are bound to vector parameters (to prevent constant optimizations).
|
||||
if (bDeferred)
|
||||
{
|
||||
OutShaderElementData.NumVSInstructions -= 41;
|
||||
OutShaderElementData.NumPSInstructions -= bLit ? 111 : 33;
|
||||
}
|
||||
else
|
||||
{
|
||||
OutShaderElementData.NumVSInstructions -= 134;
|
||||
OutShaderElementData.NumPSInstructions -= bLit ? 635 : 47;
|
||||
}
|
||||
|
||||
// Ensure a minimum instruction count so that overdraw accumulates.
|
||||
const int32 MinInstructionCount = IsTranslucentBlendMode(InBatchMaterial->GetBlendMode()) ? 20 : 0;
|
||||
|
||||
OutShaderElementData.NumVSInstructions = FMath::Max<int32>(MinInstructionCount, OutShaderElementData.NumVSInstructions);
|
||||
OutShaderElementData.NumPSInstructions = FMath::Max<int32>(MinInstructionCount, OutShaderElementData.NumPSInstructions);
|
||||
}
|
||||
|
||||
FMeshPassProcessor* CreateDebugViewModePassProcessor(const FScene* Scene, const FSceneView* InViewIfDynamicMeshCommand, FMeshPassDrawListContext* InDrawListContext)
|
||||
{
|
||||
const ERHIFeatureLevel::Type FeatureLevel = Scene ? Scene->GetFeatureLevel() : (InViewIfDynamicMeshCommand ? InViewIfDynamicMeshCommand->GetFeatureLevel() : GMaxRHIFeatureLevel);
|
||||
|
||||
Reference in New Issue
Block a user