Open NuLL3rr0r opened 5 years ago
I cannot get this to work. It crashes when I hit play. In your code I noticed that at some point you have one ERHIFeatureLevel: flag set to SM5 and one to ES3_1. I set both to ES3_1 .
I get the following issue:
Assertion failed: Resource [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Windows/D3D11RHI/Private/D3D11UniformBuffer.cpp] [Line: 265] Invalid resource entry creating uniform buffer, FLocalVertexFactoryUniformShaderParameters.Resources[0], ResourceType 0x6.
I only got some Oculus errors in the log, but don't think that's related (I didn't install SteamVR on this machine):
[2019.12.08-23.38.24:891][ 0]LogWindows: Failed to load 'OVRPlugin.dll' (GetLastError=126) [2019.12.08-23.38.24:891][ 0]LogWindows: File 'OVRPlugin.dll' does not exist [2019.12.08-23.38.24:942][ 0]LogEngine: Initializing Engine... [2019.12.08-23.38.24:943][ 0]LogHMD: Failed to initialize OpenVR with code 110
Yes, I noticed that inconsistency with SM5 and ES3_1. I created another branch at https://github.com/NuLL3rr0r/ImsvGraphVis/commits/migration and tried to do it version by version. Unfortunately, I am not that much familiar with shaders. The code does not crash on 4.20 but is not working as expected either. So, I gave up on it.
Hi, @NuLL3rr0r,
I have also tried with Vulkan (on a Win10 platform) and I get the same error. But I think the problem may be due to the shaders themselves, as in the Vulkan documentation it is specified that:
For Vulkan, you can write in GLSL (with Vulkan extensions) and use an offline toolchain headed by glslangValidator to translate that to SPIR-V (standard Vulkan only accepts SPIR-V)
In addition, in the UE4 docs, it is specified that there is a cross-compiler for transforming HLSL into GLSL:
My suspicion is that this does not work correctly for Vulkan, as the error is on line 56 in the SplineComputeShaderCommon.usf file, which is:
StructuredBuffer<FSplineControlPointData> InSplineControlPointData : register(t0);
It does not like the : symbol before the register keyword. This is standard HLSL syntax, and UE4 seems to be unable to resolve it for VULKAN.
I would try with pure OpenGL if you are using Linux. When I try to launch with DirectX on Windows I do get further, but there is still a crash later on (so the shader compiled successfully). It occurs when I hit the Play button:
Assertion failed: Resource [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Windows/D3D11RHI/Private/D3D11UniformBuffer.cpp] [Line: 265] Invalid resource entry creating uniform buffer, FLocalVertexFactoryUniformShaderParameters.Resources[0], ResourceType 0x6.
UE4Editor_Core!FWindowsErrorOutputDevice::Serialize() [d:\build\++ue4\sync\engine\source\runtime\core\private\windows\windowserroroutputdevice.cpp:79]
UE4Editor_Core!FOutputDevice::LogfImpl() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:71]
UE4Editor_Core!AssertFailedImplV() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:101]
UE4Editor_Core!FDebug::CheckVerifyFailedImpl() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:445]
UE4Editor_D3D11RHI!DispatchCheckVerify<void,<lambda_b465dfd7fffd52cddfe1e408ec4dd82c> >() [d:\build\++ue4\sync\engine\source\runtime\core\public\misc\assertionmacros.h:164]
UE4Editor_D3D11RHI!FD3D11DynamicRHI::RHICreateUniformBuffer() [d:\build\++ue4\sync\engine\source\runtime\windows\d3d11rhi\private\d3d11uniformbuffer.cpp:265]
UE4Editor_Engine!CreateLocalVFUniformBuffer() [d:\build\++ue4\sync\engine\source\runtime\engine\private\localvertexfactory.cpp:90]
UE4Editor_Engine!FLocalVertexFactory::InitRHI() [d:\build\++ue4\sync\engine\source\runtime\engine\private\localvertexfactory.cpp:373]
UE4Editor_RenderCore!FRenderResource::InitResource() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderresource.cpp:96]
UE4Editor_RenderCore!TGraphTask<TEnqueueUniqueRenderCommandType<`BeginInitResource'::`2'::InitCommandName,<lambda_dbf6d24f3ae5f85cb6ed2474bd81805b> > >::ExecuteTask() [d:\build\++ue4\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:847]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:686]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4\sync\engine\source\runtime\core\private\async\taskgraph.cpp:583]
UE4Editor_RenderCore!RenderingThreadMain() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:340]
UE4Editor_RenderCore!FRenderingThread::Run() [d:\build\++ue4\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:471]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:96]
The code that fails in that file is:
// Allow null SRV's in uniform buffers for feature levels that don't support SRV's in shaders
if (!(GMaxRHIFeatureLevel <= ERHIFeatureLevel::ES3_1
&& (Layout.Resources[i].MemberType == UBMT_SRV || Layout.Resources[i].MemberType == UBMT_RDG_TEXTURE_SRV || Layout.Resources[i].MemberType == UBMT_RDG_BUFFER_SRV))
&& Validation == EUniformBufferValidation::ValidateResources)
{
checkf(Resource, TEXT("Invalid resource entry creating uniform buffer, %s.Resources[%u], ResourceType 0x%x."), *Layout.GetDebugName().ToString(), i, Layout.Resources[i].MemberType);
}
When debugging I can see that it fails when processing a Layout with Name: FMobileReflectionCaptureShaderParameters
And two resources:
| Name | Value | Type
-- | -- | -- | --
▶ | [0] | {MemberOffset=16 MemberType=UBMT_TEXTURE (5 '\x5') } | TArray<FRHIUniformBufferLayout::FResourceParameter,TSizedDefaultAllocator<32>>::ElementType
▶ | [1] | {MemberOffset=24 MemberType=UBMT_SAMPLER (8 '\b') } | TArray<FRHIUniformBufferLayout::FResourceParameter,TSizedDefaultAllocator<32>>::ElementType
It fails with index i = 0, so the resource was UBMT_TEXTURE.
In addition I can get the nodes of the graph to display - it only crashes if I enable the edges (so I think that finding a solution for this crash would make the whole project work again).
For example, commenting out the contents of: void UIGVEdgeMeshComponent::Update() will skip the crash (but along with edge mesh rendering, of course)
So far, I was not able to fix this last crash and make the edge rendering work. I suspect that it should be possible to disable FMobileReflectionCaptureShaderParameters or bypass it, but I haven't found out how.
@avrdan thank you so much for the progress and detailed information. If I recall correctly, I already did try to run it on pure OpenGL on Linux. Unfortunately, Epic did deprecated OpenGL in favor of Vulkan on Linux. Basically, we Linux users are stuck to Vulkan and it is not possible to run the engine on OpenGL in newer versions of the engine anymore.
First of all, thank you so much for such a great project.
Second, I tried to port ImsvGraphVis over to the Unreal Engine 4.23 and figured out all the build issues due to UE4 API changes since 4.17 in a couple of hours. So, I decided to create this pull request.
Although, there is a runtime crash that I was not able to figure out since I am not much familiar with HLSL and shaders in general. When I run the project, I get the following error:
I am running Unreal Engine under Gentoo/Vulkan with NVIDIA drivers on 1070M and run it with -vulkan flag.
By the way, here is the full log if it helps: