-
Notifications
You must be signed in to change notification settings - Fork 23
RS Local texture parameters latency improvements #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: RS3.0-UE5.3
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,7 +74,8 @@ namespace { | |
|
|
||
| RenderStreamLink::RenderStreamLink() | ||
| { | ||
| loadExplicit(); | ||
| FString unused; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused ? Why do we need this ? |
||
| loadExplicit(unused); | ||
| } | ||
|
|
||
| RenderStreamLink::~RenderStreamLink() | ||
|
|
@@ -87,8 +88,9 @@ bool RenderStreamLink::isAvailable() | |
| return m_dll && m_loaded; | ||
| } | ||
|
|
||
| bool RenderStreamLink::loadExplicit() | ||
| bool RenderStreamLink::loadExplicit(FString& outError) | ||
| { | ||
| outError.Empty(); | ||
| if (isAvailable()) | ||
| return true; | ||
|
|
||
|
|
@@ -157,7 +159,7 @@ bool RenderStreamLink::loadExplicit() | |
| FString osMsg = e.message().c_str(); | ||
| UE_LOG(LogRenderStream, Error, TEXT("Failed to get function %s from DLL. %s (%i)"), fnName, *osMsg, e.value()); | ||
| m_loaded = false; | ||
| LogFatalIfNotInEditor("A function failed to load from the RenderStream DLL, this suggests an incompatible version is installed."); | ||
| outError = fnName; | ||
| return false; | ||
| } | ||
| return true; | ||
|
|
@@ -166,6 +168,8 @@ bool RenderStreamLink::loadExplicit() | |
| #define LOAD_FN(FUNC) \ | ||
| if (!loadFn(FUNC, TEXT(#FUNC))) \ | ||
| return false; | ||
|
|
||
|
|
||
|
|
||
| LOAD_FN(rs_initialise); | ||
| LOAD_FN(rs_initialiseGpGpuWithDX11Device); | ||
|
|
@@ -174,6 +178,10 @@ bool RenderStreamLink::loadExplicit() | |
| LOAD_FN(rs_initialiseGpGpuWithVulkanDevice); | ||
| LOAD_FN(rs_shutdown); | ||
|
|
||
| LOAD_FN(rs_logToD3); | ||
| LOAD_FN(rs_sendProfilingData); | ||
| LOAD_FN(rs_setNewStatusMessage); | ||
|
|
||
| LOAD_FN(rs_registerLoggingFunc); | ||
| LOAD_FN(rs_registerErrorLoggingFunc); | ||
| LOAD_FN(rs_registerVerboseLoggingFunc); | ||
|
|
@@ -182,6 +190,10 @@ bool RenderStreamLink::loadExplicit() | |
| LOAD_FN(rs_unregisterErrorLoggingFunc); | ||
| LOAD_FN(rs_unregisterVerboseLoggingFunc); | ||
|
|
||
| rs_registerLoggingFunc(&log_default); | ||
| rs_registerErrorLoggingFunc(&log_error); | ||
| rs_registerVerboseLoggingFunc(&log_verbose); | ||
|
|
||
| LOAD_FN(rs_useDX12SharedHeapFlag); | ||
|
|
||
| LOAD_FN(rs_setSchema); | ||
|
|
@@ -197,6 +209,8 @@ bool RenderStreamLink::loadExplicit() | |
| LOAD_FN(rs_getFrameParameters); | ||
| LOAD_FN(rs_getFrameImageData); | ||
| LOAD_FN(rs_getFrameImage2); | ||
| LOAD_FN(rs_registerTextureParams); | ||
|
|
||
| LOAD_FN(rs_getFrameText); | ||
|
|
||
| LOAD_FN(rs_getSkeletonLayout); | ||
|
|
@@ -208,15 +222,9 @@ bool RenderStreamLink::loadExplicit() | |
|
|
||
| LOAD_FN(rs_releaseImage2); | ||
|
|
||
| LOAD_FN(rs_logToD3); | ||
| LOAD_FN(rs_sendProfilingData); | ||
| LOAD_FN(rs_setNewStatusMessage); | ||
|
|
||
| m_loaded = true; | ||
|
|
||
| rs_registerLoggingFunc(&log_default); | ||
| rs_registerErrorLoggingFunc(&log_error); | ||
| rs_registerVerboseLoggingFunc(&log_verbose); | ||
|
|
||
| #endif | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| #include "ProfilingDebugging/RealtimeGPUProfiler.h" | ||
| #include <Kismet/KismetRenderingLibrary.h> | ||
| #include "OpenColorIOBlueprintLibrary.h" | ||
| #include "RenderingThread.h" | ||
|
|
||
| RenderStreamSceneSelector::~RenderStreamSceneSelector() | ||
| { | ||
|
|
@@ -526,6 +527,13 @@ void RenderStreamSceneSelector::ApplyParameters(uint32_t sceneId, const TArray<A | |
| UE_LOG(LogRenderStream, Error, TEXT("Unable to get float frame parameters - %d"), res); | ||
| return; | ||
| } | ||
| if (nImageParams > 0) | ||
| { | ||
| ENQUEUE_RENDER_COMMAND(RegisterTextureParams)([](FRHICommandListImmediate& RHICmdList) { | ||
| RenderStreamLink::instance().rs_registerTextureParams(); | ||
| }); | ||
| FlushRenderingCommands(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm worried about the performance impact of synchronizing the GPU and CPU threads with the flush. If we really need the flush, please check performance is not impacted too much.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might be right. Seems like with a heavier scene with 9 TPs the fps of the streams dropped by 2-3 frames |
||
| } | ||
| res = RenderStreamLink::instance().rs_getFrameImageData(params.hash, imageValues.data(), imageValues.size()); | ||
| if (res != RenderStreamLink::RS_ERROR_SUCCESS) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this will suffer from the same exit infinite loop issue as the one seen in the UE ghost process problem. Try this in an nDisplay session with 2 RXs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, both RXs in this case kill the UE process. All good