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

I have found that the limit has indeed been raised to 128 SRVs, which is still not enough for my needs however.

Yes, when editing a Material Instance or a Material Layer Instance, you can check how many the material is using by looking at how many texture lookups the pixel shader is performing.
In laymans terms, here.
Screenshot 2022-07-15 205200

More accurately, it is how many texture lookups the material performs as opposed to how many textures you define.

For instance, this material would have an SRV count of 4, as we reference textures a total of 4 times in it.

Whereas this material would only have an SRV count of 2 as it references textures a total of 2 times.

As you can see, these two materials have identical results, but one has an SRV count 2x higher than the other. So as usual, when making materials make sure to make them as efficiently as possible!

Thats incorrect the amounts of lookups is incorrect, the engine will only reference the texture object the once no mater what outputs are used!

you as also split the RGB channels.

1 Like

Maybe do a little research before posting false info for people.

Shader resource views typically wrap textures in a format that the shaders can access them. An unordered access view provides similar functionality, but enables the reading and writing to the texture (or other resource) in any order.

The wrap only happens once per texture in a shader and this can happen in material functions also, once the wrap has happened that classes as 1 SRV if people want to reduce there SRVs ether use atlas textures or build masks out of gray scale textures to and use the RGB channels.

sorry to bump the thread, but the texture lookups doesn’t match the number of SRVs at all.

I mean you can have less than 15 lookups and hit the hard ceiling of 64 SRVs, even faster if you are using Virtual Textures…

This 64 texture limit is a problem for me too, please fix it epic. I need to use more than 64 for landscape shaders.

2 Likes

Enabling Raytracing seems to also increase SRV amount.

Has anyone found other fixes for this error on version 5.21??