Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Assert failure when creating new material node

Steps to reproduce.

  1. Create a third person C++ project. All defaults.

  2. Select ThirdPersonCharacter in the World Outliner tab.

  3. Double click the Skeletal Mesh icon to bring up the material editor.

  4. Click the + icon next to Material Slots to add a material slot.

  5. On the dropdown on the new Material, select Material under Create New Asset.

  6. Click save. Location doesn't matter.

  7. Double click the new material icon to get into the node editor.

  8. Add a TextureSampleParamater2D node.

  9. Watch it crash.

The problem is that the Render Thread is trying to finish up some shader compilation when it creates an FCanvas. This FCanvas tries to access this shader resource, but there are asserts around all shader resource access to ensure that only the game thread can access shader resources.

Here is a stack trace:

 UE4Editor-ShaderCore-Win64-Debug.dll!FShaderResource::FindShaderResourceById(const FShaderResourceId & Id) Line 551    C++
  UE4Editor-ShaderCore-Win64-Debug.dll!FShaderResource::FindOrCreateShaderResource(const FShaderCompilerOutput & Output, FShaderType * SpecificType) Line 560    C++
  UE4Editor-Engine-Win64-Debug.dll!FMeshMaterialShaderType::FinishCompileShader(const FUniformExpressionSet & UniformExpressionSet, const FSHAHash & MaterialShaderMapHash, const FShaderCompileJob & CurrentJob, const FShaderPipelineType * ShaderPipelineType, const FString & InDebugDescription) Line 127    C++
  UE4Editor-Engine-Win64-Debug.dll!FMaterialShaderMap::ProcessCompilationResultsForSingleJob(FShaderCompileJob * SingleJob, const FShaderPipelineType * ShaderPipeline, const FSHAHash & MaterialShaderMapHash) Line 1447    C++
  UE4Editor-Engine-Win64-Debug.dll!FMaterialShaderMap::ProcessCompilationResults(const TArray<FShaderCommonCompileJob *,FDefaultAllocator> & InCompilationResults, int & InOutJobIndex, float & TimeBudget, TMap<FVertexFactoryType const *,TArray<FShaderPipelineType const *,FDefaultAllocator>,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FVertexFactoryType const *,TArray<FShaderPipelineType const *,FDefaultAllocator>,0> > & SharedPipelines) Line 1487    C++
  UE4Editor-Engine-Win64-Debug.dll!FShaderCompilingManager::ProcessCompiledShaderMaps(TMap<int,FShaderMapFinalizeResults,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<int,FShaderMapFinalizeResults,0> > & CompiledShaderMaps, float TimeBudget) Line 1766    C++
  UE4Editor-Engine-Win64-Debug.dll!FShaderCompilingManager::ProcessAsyncResults(bool bLimitExecutionTime, bool bBlockOnGlobalShaderCompletion) Line 2369    C++
  UE4Editor-Engine-Win64-Debug.dll!FCanvas::Construct() Line 271    C++
  UE4Editor-Engine-Win64-Debug.dll!FCanvas::FCanvas(FRenderTarget * InRenderTarget, FHitProxyConsumer * InHitProxyConsumer, float InRealTime, float InWorldTime, float InWorldDeltaTime, ERHIFeatureLevel::Type InFeatureLevel) Line 260    C++
  UE4Editor-GraphEditor-Win64-Debug.dll!FPreviewElement::DrawRenderThread(FRHICommandListImmediate & RHICmdList, const void * InWindowBackBuffer) Line 239    C++
  UE4Editor-SlateRHIRenderer-Win64-Debug.dll!FSlateRHIRenderingPolicy::DrawElements(FRHICommandListImmediate & RHICmdList, FSlateBackBuffer & BackBuffer, const FMatrix & ViewProjectionMatrix, const TArray<FSlateRenderBatch,FDefaultAllocator> & RenderBatches, bool bAllowSwitchVerticalAxis) Line 707    C++
  UE4Editor-SlateRHIRenderer-Win64-Debug.dll!FSlateRHIRenderer::DrawWindow_RenderThread(FRHICommandListImmediate & RHICmdList, FSlateRHIRenderer::FViewportInfo & ViewportInfo, FSlateWindowElementList & WindowElementList, bool bLockToVsync, bool bClear) Line 766    C++
  UE4Editor-SlateRHIRenderer-Win64-Debug.dll!FSlateRHIRenderer::DrawWindows_Private::__l35::<lambda>(FRHICommandListImmediate & RHICmdList) Line 1052    C++
  UE4Editor-SlateRHIRenderer-Win64-Debug.dll!TGraphTask<TEnqueueUniqueRenderCommandType<`FSlateRHIRenderer::DrawWindows_Private'::`35'::SlateDrawWindowsCommandName,void <lambda>(FRHICommandListImmediate &) > >::ExecuteTask(TArray<FBaseGraphTask *,FDefaultAllocator> & NewTasks, ENamedThreads::Type CurrentThread) Line 885    C++
  UE4Editor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 954    C++
  UE4Editor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 701    C++
  UE4Editor-Core-Win64-Debug.dll!FTaskGraphImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type CurrentThread) Line 1759    C++
  UE4Editor-RenderCore-Win64-Debug.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 327    C++
  UE4Editor-RenderCore-Win64-Debug.dll!FRenderingThread::Run() Line 461    C++
  UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::Run() Line 74    C++
  UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::GuardedRun() Line 25    C++
  UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::_ThreadProc(void * pThis) Line 78    C++
  [External Code]    

The assert is in this assert in Shader.cpp

 FShaderResource* FShaderResource::FindShaderResourceById(const FShaderResourceId& Id)
     FShaderResource* Result = ShaderResourceIdMap.FindRef(Id);
     return Result;

The current thread is ActualRenderThread IIRC.

Product Version: UE 4.16
more ▼

asked May 30 '17 at 06:02 AM in C++ Programming

avatar image

1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question