error X4509: maximum texture register index exceed

  • Tojkar
  • Topic Author
More
5 years 9 months ago #1 by Tojkar error X4509: maximum texture register index exceed was created by Tojkar
Is there a way to search through the shaders to look up which shaders are using textures and how many? It's too much of a chore to start enabling one shader at a time to see when the error happens. Or is that the only way?

Please Log in or Create an account to join the conversation.

  • Uncle Crassius
More
5 years 9 months ago #2 by Uncle Crassius Replied by Uncle Crassius on topic error X4509: maximum texture register index exceed
Maybe we can sort it out collectively. Which shaders are you using?

Please Log in or Create an account to join the conversation.

  • Tojkar
  • Topic Author
More
5 years 9 months ago #3 by Tojkar Replied by Tojkar on topic error X4509: maximum texture register index exceed
Here's the list. The shaders are in no particular order, just copied it from the ini. The reason for such a long list is that it's easier to copy the whole folder to a game rather than one shader at a time to achieve what I want. Also, I use a lot of different shaders and confings even for just a single game and I change between them with hot keys. That's why there are some seemingly useless shaders too.

Warning: Spoiler!

www.dropbox.com/s/2asdu0m47qqauqm/shaders.jpg?dl=0

Just occurred to me that the list contains the names of the techniques. The link contains screenshot of the actual shader files.

Here's what I know so far:
- AmbientLight.fx: Contains a lot of texture registers and most of my problems would go away just by deleting this one. However, I like this effect a lot and would like to keep it, if possible.
- VHSPro.fx: The same as above.
- All of the CRT and VHS shaders: I love combining different lo-fi shaders together and with color correction, all set with very weird setting values to create a look that's far from what the shader writers originally intended.

Other than that, I have no idea where to look for problematic shaders.

Please Log in or Create an account to join the conversation.

  • TreyM
More
5 years 8 months ago #4 by TreyM Replied by TreyM on topic error X4509: maximum texture register index exceed
Uh... this is a necro thread but... dude. You Have 70 shaders enabled. 70...

Please Log in or Create an account to join the conversation.

  • Tojkar
  • Topic Author
More
5 years 8 months ago #5 by Tojkar Replied by Tojkar on topic error X4509: maximum texture register index exceed
I never had them all enabled at once. Loaded, yes, but not enabled. I keep only one unified shader folder for most of my games and that causes it to bloat a little. And that's perfectly valid reason to ask help to find problematic shaders.

Please Log in or Create an account to join the conversation.

  • TreyM
More
5 years 8 months ago #6 by TreyM Replied by TreyM on topic error X4509: maximum texture register index exceed
But they're not "problematic" though... You're simply running into the hard limit of what the graphics API allows.

Please Log in or Create an account to join the conversation.

  • Tojkar
  • Topic Author
More
5 years 8 months ago - 5 years 8 months ago #7 by Tojkar Replied by Tojkar on topic error X4509: maximum texture register index exceed

TreyM wrote: But they're not "problematic" though... You're simply running into the hard limit of what the graphics API allows.

If you can help me, please do so, but do not come here hijacking this thread over semantics. You do, like everybody else, know that by problematic I do NOT mean that the shaders are broken but rather the shaders that use more recources than are available and thus causes problems.

The question remains open...
Last edit: 5 years 8 months ago by Tojkar.

Please Log in or Create an account to join the conversation.

  • TreyM
More
5 years 8 months ago - 5 years 8 months ago #8 by TreyM Replied by TreyM on topic error X4509: maximum texture register index exceed
I'm trying to educate you. I already told you what the "problem" is, but if you want to accuse me of "hijacking" your thread, then, by all means, have at it. I'll not attempt to help you further.

The solution to your "problem" is to not have 70 shaders loaded... lol
Last edit: 5 years 8 months ago by TreyM.

Please Log in or Create an account to join the conversation.

  • Tojkar
  • Topic Author
More
5 years 8 months ago - 5 years 8 months ago #9 by Tojkar Replied by Tojkar on topic error X4509: maximum texture register index exceed
Well, you're not much educating. Not all shaders use texture registers(or what ever is the correct term to use here), so what I'm asking here is how can I see which shaders use them and thus causes my problems so I can start deleting those. I could have million shaders without any problems as long as they don't use/bind any texture registers. The amount of shaders is NOT the problem. The amount of WHAT shaders use the texture register are the problem.

I am already very strict on the shaders, the list contains exactly zero shaders that are not used anywhere in my games, believe it or not.
Last edit: 5 years 8 months ago by Tojkar.

Please Log in or Create an account to join the conversation.

  • TreyM
More
5 years 8 months ago #10 by TreyM Replied by TreyM on topic error X4509: maximum texture register index exceed
FACEPALM

Please Log in or Create an account to join the conversation.

  • Daodan
More
5 years 8 months ago - 5 years 8 months ago #11 by Daodan Replied by Daodan on topic error X4509: maximum texture register index exceed
As far as i know the only way to see how many textures a shader declares is to to have look at the shader's source code.
If you have an extensive text-editor installed (like Visual Studio Code) you could open the folder where your shaders are stored and let the editor automatically search through all the files for "texture2D". That should then give you a good idea about how many textures each shader uses.

(edit) searching for "{ Width = " could be more reliable
Last edit: 5 years 8 months ago by Daodan.

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
5 years 8 months ago - 5 years 8 months ago #12 by Marty McFly Replied by Marty McFly on topic error X4509: maximum texture register index exceed
I'm not sure since I don't have any OGL game but I think even the regular backbuffer and depth textures which is used by every shader counts as a register slot, so 10 shaders (with no additional resources) might count as 20 register indices. So, in general, assume that every shader uses at least 2 slots and don't use so many. You can search each shader for "texture" or "texture2D" and check the amount of entries, and add 2 to it (since all shaders load ReShade.fxh and that one declares both depth and color).
In any case, no one ever will require that many shaders. If the list, as you put it, contains exactly zero shaders that you don't need, there's nothing you can do.

Either remove a few shaders, or don't use any (because all of them together don't work at all). The choice should be evident.
Last edit: 5 years 8 months ago by Marty McFly.

Please Log in or Create an account to join the conversation.

  • Tojkar
  • Topic Author
More
5 years 8 months ago #13 by Tojkar Replied by Tojkar on topic error X4509: maximum texture register index exceed
Thanks a lot Martin and Daodan. I'll start working with that info.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.