UE4.26 - Shader is using too many SRVs (only 64 supported)

Has anyone had issues with there landscape material SRV count? it seems a single landscape materials no longer can have over 64 textures? so setting texture samples to wrapped will fix your slot issue but you be hit with a SRV limitation now with 4.26, I had 77 textures working fine on 4.25 and below.


I Have the same issue after 4.26.:

gShaderCompilers: Warning: Failed to compile Material /Game//Materials/TEST.TEST (MI:/Game/Terrein:PersistentLevel.Landscape_14.LandscapeMaterialInstanceConstant_1328) for platform PCD3D_SM5, Default Material will be used in game.
LogShaderCompilers: Display: Shader is using too many SRVs: 66 (only 64 supported);

Actually, at the previous version, UE4.25 Wrapped samples worked fine.

i hope to fix this bug in the next version, otherwise i can only cut landscape and material to reduce texture samples.

I fixed mine by using atlas textures I combined 4 into 1 as the SRV from 4.26 wont likely change you will need to reduce the amount of textures used in your landscape material.

I removed the inspection, build the ShaderCompileWorker.exe from engine source code, then replace the installed engine ShaderCompileWorker files . The problem solved. :rolleyes:

honestly, sounds like a recipe for disaster…

Hey, sorry for the old reply but what are atlas textures? I have the same issue with a marketplace automaterial and I have no idea what to do

A atlas texture is when you combine 4 textures into a tile format so 4 textures become one, so your dropping 3 SRVs for each one you combine, you then call which part of the texture UV you want 1-4 to get the correct texture, this also saves on memory its worth doing.

Thank you for the response. Yeah ok, I just went in with a hammer and got rid of loads of textures in my material haha. I have no idea how to do that, is it easy? Are there any guides?

This happens in 5.0 too. Isn’t DirectX 11 limited to 128 SRV?

1 Like

The only problem is that the shader won’t compile if you’re using DX12 and more than 64 SRVs.
This code is bad, it should have a DX11/DX12 switch and run this code ONLY if the engine is running in DX12.

1 Like

What are SRVs?

Shader Resource View

1 Like

Hey :smile: …I saw you got no response on this so thought i try and help seeing Ive got the same problem as you. This link will show you how to pack the materials into a smaller material but still keeping the image quality Packing CR and NOH maps with GIMP - YouTube. PS. change the play speed the vid is fast. Then you follow this guys stuff Landscape Textures - Building Worlds In Unreal - Episode 3 - YouTube . He has a hole series of stuff showing you everything you need to know and easy to follow. Enjoy and good luck.

I know it’s been a long time since this post, but I found another solution to this issue.

  1. Go to Engine\Source\Runtime\D3D12RHI\Public\D3D12RHI.h
  2. Go to line 21, it should be #define MAX_SRVS 64 by default
  3. You may then change the 64 to whatever you wish. However, I would recommend 128 as it will be able to run on all hardware that can run DirectX 12. (Source)

Hope this helps someone


Thank you very much for the reply RYRY, good to know. I’m sure however it was set to 64 for some reason. Would want to avoid messing with the engine if at all possible!

I have been reading about this and after the 5.0 official release, this is still a thing.

The docs say that it should support up to 128 SRVs but the engine is strictly limited to 64. Has this something to do with any other engine subsystem? Is it safe to increase this to 128?

Also, something I would like to have. Is there a way to check how many SRVs is a material currently using? I would like to access that info so Artists can push as far as possible and they are aware of this limitation.

Just count the amount of textures your using this is what SRVs count as in unreal.

I’m not sure how you managed to get it working since a few lines below there is a static assert checking that MAX_SRVS is not bigger than what the srvSlotMask can hold. Which since it is stored in a uint64 cannot handle more than 64 SRVS.

Would love to get an opinion from epic though, since 64 SRVs is very easy to reach when using multilayer materials, and it limits a lot its potential.

The material can have plenty of textures, but this SRV error will only occur if a Landscape component is using more than 64 textures. If you see this error, use the Landscape view modes to check your Layer Usage. (You have to be in Landscape editing mode for these Visualizers to be available).
Here an artist had painted 13 layers into a single component, thus causing the error and displaying the default material on that component. By erasing a few layers that were barely visible in that component, I was able to get rid of the error.
The components with 10, 11, 12 layers were fine, but of course their rendering cost is still very high.