Duke4.net Forums: GLSL: Error C5025 - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

GLSL: Error C5025

User is offline   underTaker 

#1

Hello.

I thought perhaps some of you would know OpenGL API, and how to deal with this damn bastard. The error C5025: lvalue in assignment too complex.
I've already posted on OpenGL forums, but it seems nobody knows an answer. Here's the thread.

I'd be really greatful if somebody helped me, as this is the only error I really can't deal with.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#2

Quote

Error's name would suggest that the expression in index braces is too complex

No, "lvalue" refers to the subexpression to the left of the assignment operator, in your case "outFrag.LightDir_tan[i]". In looks that the GLSL language allows lvalues only up to a certain syntactic "complexity" and that's why the program is rejected to be translated. You may have success with splitting up the asssignment, like first caching the result of "normalize(lightDir)" into a variable, and then maybe assigning the individual components of that vector to the components of the LHS. In any case, only the GLSL specification can give an authorative answer.
0

User is offline   underTaker 

#3

The thing is, that when I do similar thing, for example outFrag.ShadowCoord[siOffset], which is generally exactly the same expression, and is few lines later the error doesn't occure.

I tried splitting it up, to manually assign x, y and z components, like you said, and still no success - the error is in every line.

The topic's case works only when I manually specify the index value - "i". That doesn't make sense to me.
0

User is offline   Helixhorned 

  • EDuke32 Developer

#4

Rereading that thread, it seems that what Brokenmind said may be the cause after all. Following the link to the OpenGL wiki, we find

Quote

The expression used to access the array must be a Dynamically Uniform Expression.

What's the context around that line, in particular, what is 'i'?
0

User is offline   underTaker 

#5

Variable "i" is simply changed in for's header. To be precise:

for (unsigned int i = 0; i < LightCount; i++)


Where LightCount is uniform variable. I also thought, changing the LightCount to a constant expression like MAX_LIGHTS, which is 30, would help, but no luck. I have tried changing MAX_LIGHTS to lower value, like 3 for example, but still with the same result.

Reading the OpenGL wiki, I found a sentence

Quote

Arrays can be accessed with arbitrary numeric expressions. They do not have to be compile-time constants (though there are a few exceptions to this rule; for example, the very next section).

...where the next section is for opaque types (while the outFrag.LightDir_tan is just an array of vec3). Source: Link


Lately, I have also discovered, if I had an error, in any of the shaders, that simply causes linking error, the shadow log also returns this error. This one is really weird. Let's say I add some bulshit in fragment shader, even like no semicolon at the end of the line, the error is still in vertex shader, on some different line (which also uses array index). This error is nightmare.

This post has been edited by underTaker: 09 March 2014 - 10:43 AM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options