GSystemTextures.InitializeTextures never called in client game mode

Since version 4.18 there is an exception in “Client game mode” only. Not in Editor mode.

template< typename ShaderRHIParamRef, typename TRHICmdList >
void FSceneTextureShaderParameters::Set(
	TRHICmdList& RHICmdList,
	const ShaderRHIParamRef& ShaderRHI,
	const FSceneView& View,
	const EDeferredParamStrictness ParamStrictness,
	ESceneRenderTargetsMode::Type TextureMode,
	ESamplerFilter ColorFilter ) const
{
	FTextureRHIParamRef BlackDefault2D = GSystemTextures.BlackDummy->GetRenderTargetItem().ShaderResourceTexture;
	FTextureRHIParamRef DepthDefault = GSystemTextures.DepthDummy->GetRenderTargetItem().ShaderResourceTexture;

Since BlackDummy and DepthDummy are null an exception occurred.

I think you should test if null to avoid exception.

I modified the code to initialize the system textures to avoid this exception.

template< typename ShaderRHIParamRef, typename TRHICmdList >
void FSceneTextureShaderParameters::Set(
	TRHICmdList& RHICmdList,
	const ShaderRHIParamRef& ShaderRHI,
	const FSceneView& View,
	const EDeferredParamStrictness ParamStrictness,
	ESceneRenderTargetsMode::Type TextureMode,
	ESamplerFilter ColorFilter ) const
{
/** @remark:
 *	Since in client game mode the function to initialize system texture is never called
 *  The members BlackDummy and DepthDummy are null, check texture to avoid exception.
 */
FTextureRHIParamRef BlackDefault2D = (GSystemTextures.BlackDummy != nullptr) ? GSystemTextures.BlackDummy->GetRenderTargetItem().ShaderResourceTexture : nullptr;
FTextureRHIParamRef DepthDefault = (GSystemTextures.DepthDummy != nullptr) ? GSystemTextures.DepthDummy->GetRenderTargetItem().ShaderResourceTexture : nullptr;
/** @remark: end of modification */

Now I don’t know why the system textures are not initialized in “client mode” and not in “editor mode”.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Thanks

Ok thank you.
I fill a bug report.

The problem seems to be linked to the fact the default game map is not loaded at client startup.

see: link text