Welcome, Guest.
Username: Password: Remember me

TOPIC: error X4509: maximum texture register index exceed

error X4509: maximum texture register index exceed 2 months 2 weeks ago #1

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?
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 2 months 2 weeks ago #2

Maybe we can sort it out collectively. Which shaders are you using?
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 2 months 1 week ago #3

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! [ Click to expand ]

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.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 2 weeks ago #4

Uh... this is a necro thread but... dude. You Have 70 shaders enabled. 70...
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 2 weeks ago #5

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.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 2 weeks ago #6

But they're not "problematic" though... You're simply running into the hard limit of what the graphics API allows.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 2 weeks ago #7

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: 1 month 2 weeks ago by Tojkar.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 1 week ago #8

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: 1 month 1 week ago by TreyM.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 1 week ago #9

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: 1 month 1 week ago by Tojkar.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 1 week ago #10

FACEPALM
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 1 week ago #11

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: 1 month 1 week ago by Daodan.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 1 week ago #12

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: 1 month 1 week ago by Marty McFly.
The administrator has disabled public write access.

error X4509: maximum texture register index exceed 1 month 1 week ago #13

Thanks a lot Martin and Daodan. I'll start working with that info.
The administrator has disabled public write access.