Hi !
Is there a special way of declaring a “global” array in a shader ?
My shader fails to load ingame with builds > 3.7.1248 saying the key is already existing (cf https://github.com/MonoGame/MonoGame/issues/6184)
As no one has bumped on this issue, I’m just wondering what’s wrong since 3.7.1248+
When I do
#if OPENGL
#define SV_POSITION POSITION
#define VS_SHADERMODEL vs_3_0
#define PS_SHADERMODEL ps_3_0
#else
#define VS_SHADERMODEL vs_5_0
#define PS_SHADERMODEL ps_5_0
#endif
//21 values
//Breaklines are here for purpose, but removing them gives the same result: exception
float weights[] = { 0.051f, 0.1f, 0.15f, 0.28f, 0.5f,
0.7f, 0.8f, 0.9f, 1.0f, 1.0f,
1.0f, 1.0f, 1.0f, 0.9f, 0.8f,
0.7f, 0.5f, 0.28f, 0.15f, 0.1f,
0.051f }; //uniform, or const changes nothing
...
gives this Exception… Putting static instead of uniform allows to load the effect, but effectparameters are null and when setting value, the game throws a nullexception !
I was wondering if it is a true bug of MG, or if I missed something in an update, changing the way of declaring an array ?
Thanks for any clue on this.
Thanks I like to get to the bottom of things when I don’t understand something or have a problem. I’m not the kind of “it just does not work”
When I have time I’ll continue to debug and give feedback about why there are null (if I find something interesting), or test your PRs if any
Sorry to hear that. I hope you’ll all recover soon.
I’ve not been able to investigate a lot, I lost my internet connection due to gust
I’ll continue in a few hours as it is back now.