Jump to content
  • Advertisement
Sign in to follow this  

Array indexing in shader

This topic is 4434 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I'm trying to access an array of 11 structures in a fragment shader, in a for loop from i=0 to 10 (I literally specified the upperbound). Now, it won't compile, and keeps saying "error C5043: profile requires index expression to be compile-time constant". How can i not be a compile time constant? Does anyone know what might be my problem? For what it's worth, I'm using GLSL, and the array of structures is a member of a structure and its size is explicitly stated in the declaration. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Hmm... I had a break statement in the loop, and it didn't like that. I replaced it with a lot of flag checks to achieve the very same conditional execution, and it compiles now.

Bizarre. I guess the compilers aren't all that smart. lol

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!