Add new plugins, refactor exp, introduce stat forge to replace GAS
This commit is contained in:
25
Plugins/PSOFunctionLibrary/PSOFunctions.uplugin
Normal file
25
Plugins/PSOFunctionLibrary/PSOFunctions.uplugin
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"FileVersion": 3,
|
||||
"Version": 1,
|
||||
"VersionName": "1.0",
|
||||
"FriendlyName": "PSOFunctions",
|
||||
"Description": "Esposes ShaderPipelineCache functions to Blueprint project",
|
||||
"Category": "Other",
|
||||
"CreatedBy": "Danielel",
|
||||
"CreatedByURL": "",
|
||||
"DocsURL": "https://www.dropbox.com/scl/fi/bjhz5wmklikkojlukz92g/PSOFunctions-Plugin-Documentation.pdf?rlkey=hfowk5im2gnnc58xwrsbfxvjr&st=82lih7p5&dl=0",
|
||||
"MarketplaceURL": "",
|
||||
"SupportURL": "",
|
||||
"CanContainContent": true,
|
||||
"Installed": true,
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "PSOFunctions",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "Default",
|
||||
"PlatformAllowList": [
|
||||
"Win64"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
Plugins/PSOFunctionLibrary/Resources/Icon128.png
LFS
Normal file
BIN
Plugins/PSOFunctionLibrary/Resources/Icon128.png
LFS
Normal file
Binary file not shown.
@@ -0,0 +1,55 @@
|
||||
// Copyright (c) 2025 Danielel. All rights reserved.
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class PSOFunctions : ModuleRules
|
||||
{
|
||||
public PSOFunctions(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicIncludePaths.AddRange(
|
||||
new string[] {
|
||||
// ... add public include paths required here ...
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] {
|
||||
// ... add other private include paths required here ...
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
// ... add other public dependencies that you statically link with here ...
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"RenderCore"
|
||||
// ... add private dependencies that you statically link with here ...
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
DynamicallyLoadedModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
// ... add any modules that your module loads dynamically here ...
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2025 Danielel. All rights reserved.
|
||||
|
||||
#include "PSOFunctions.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FPSOFunctionsModule"
|
||||
|
||||
void FPSOFunctionsModule::StartupModule()
|
||||
{
|
||||
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
|
||||
}
|
||||
|
||||
void FPSOFunctionsModule::ShutdownModule()
|
||||
{
|
||||
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
|
||||
// we call this function before unloading the module.
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
|
||||
IMPLEMENT_MODULE(FPSOFunctionsModule, PSOFunctions)
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2025 Danielel. All rights reserved.
|
||||
|
||||
#include "ShaderPipeline.h"
|
||||
#include "ShaderPipelineCache.h"
|
||||
#include "RenderResource.h"
|
||||
|
||||
|
||||
void UShaderPipeline::SetBatchModeFast()
|
||||
{
|
||||
FShaderPipelineCache::SetBatchMode(FShaderPipelineCache::BatchMode::Fast);
|
||||
}
|
||||
|
||||
void UShaderPipeline::SetBatchModeBackground()
|
||||
{
|
||||
FShaderPipelineCache::SetBatchMode(FShaderPipelineCache::BatchMode::Background);
|
||||
}
|
||||
|
||||
void UShaderPipeline::SetBatchModePrecompile()
|
||||
{
|
||||
FShaderPipelineCache::SetBatchMode(FShaderPipelineCache::BatchMode::Precompile);
|
||||
}
|
||||
|
||||
void UShaderPipeline::PauseBatching()
|
||||
{
|
||||
FShaderPipelineCache::PauseBatching();
|
||||
}
|
||||
|
||||
void UShaderPipeline::ResumeBatching()
|
||||
{
|
||||
FShaderPipelineCache::ResumeBatching();
|
||||
}
|
||||
|
||||
bool UShaderPipeline::IsPrecompiling()
|
||||
{
|
||||
return FShaderPipelineCache::IsPrecompiling();
|
||||
}
|
||||
|
||||
int UShaderPipeline::NumPrecompilesRemaining()
|
||||
{
|
||||
return FShaderPipelineCache::NumPrecompilesRemaining();
|
||||
}
|
||||
|
||||
bool UShaderPipeline::IsBatchingPaused()
|
||||
{
|
||||
return FShaderPipelineCache::IsBatchingPaused();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2025 Danielel. All rights reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
class FPSOFunctionsModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
// Copyright (c) 2025 Danielel. All rights reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "ShaderPipelineCache.h"
|
||||
|
||||
#include "ShaderPipeline.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class PSOFUNCTIONS_API UShaderPipeline : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", meta = (ToolTip = "Sets the precompilation batching mode to Fast"))
|
||||
static void SetBatchModeFast();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", meta = (ToolTip = "Sets the precompilation batching mode to Background"))
|
||||
static void SetBatchModeBackground();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", meta = (ToolTip = "Sets the precompilation batching mode to Precompile"))
|
||||
static void SetBatchModePrecompile();
|
||||
|
||||
/** Pauses precompilation batching. */
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", meta = (ToolTip = "Pauses precompilation batching"))
|
||||
static void PauseBatching();
|
||||
|
||||
/** Resumes precompilation batching. */
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", meta = (ToolTip = "Resumes precompilation batching"))
|
||||
static void ResumeBatching();
|
||||
|
||||
/** true if pipeline cache(s) are precompiling. */
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", BlueprintPure, meta = (ToolTip = "True if pipeline cache(s) are precompiling"))
|
||||
static bool IsPrecompiling();
|
||||
|
||||
/** Returns the number of pipelines waiting for precompilation of the current PSOFC task.
|
||||
if there are multiple PSOFCs pending this will return a minimum value of 1. It may increase as subsequent caches are processed.*/
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", BlueprintPure, meta = (ToolTip = "Returns the number of pipelines waiting for precompilation of the current PSOFC task. If there are multiple PSOFCs pending this will return a minimum value of 1. It may increase as subsequent caches are processed."))
|
||||
static int NumPrecompilesRemaining();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "PSO precompile", BlueprintPure, meta = (ToolTip = "Returns if the precompilation batching is paused"))
|
||||
static bool IsBatchingPaused();
|
||||
};
|
||||
Reference in New Issue
Block a user