Limitations on array sizes in shader

Monogame won’t start if my array size is too large (in my Shader .fx file)

float data[200]; will start
float data[300]; will not start.

Instead it will cast an error "System.IndexOutOfRangeException: ‘Index was outside the bounds of the array.’ " when loading the effect.

Is this intentional? A buffer size of 300 is really small and larger values are needed for a lot of applications.

It’s a bug.

I also have a PR up to fix it but it didn’t get much love.

1 Like

I checked out your commit out and found it raised the limit a bit, but not as much as expected, see comments in the PR.

Unrelated problem:

I also noticed that strangely after updating to your commit and rebasing on top of the newest monogame, Depth Prepass does not seem to work any more.

Before that it would give me a decent performance boost, while now it roughly halfs my framerate with enough geometry in place.
This would indicate to me that something about the depth buffer handling has changed. Hmm.

Unrelated problem #2:
The default sponza.obj scene won’t build any more because of tangent problems

Maybe check if that happens in develop as well, because my PR doesn’t touch the runtime except for how effects are read in.

Same for this one

yes as i said unrelated problems because i rebased on top of the newest develop, shouldn’t have spammed this thread with these.

Not really relevant, shouldn’t have written about these.

Right, if you have any information on these problems, please open an issue.