PDA

View Full Version : I must be massively misunderstanding it!



Obli
06-19-2006, 10:11 AM
Today I wanted to put a loop in fragment shader.
Nothing fancy: loop's guard is a uniform int. Compilation is smooth but linking bails out.

GL info log:

Fragment info
-------------
(39) : error C5043: profile requires index expression to be compile-time constant
<stdlib>(311) : error C5043: profile requires index expression to be compile-time constant
(45) : error C5043: profile requires index expression to be compile-time constant
(47) : error C5043: profile requires index expression to be compile-time constant
(53) : error C5043: profile requires index expression to be compile-time constantSorry, I'm confident it's have been discussed but the search function is broken so here we go.

As soon as I understand it, NV4x is fully PS3.0, with dynamic branching and looping.
I am looping on a uniform, so this must be PS2.x: I'm also pretty sure I've read something on index looping on NV_fragment_program? ('?' is wildcard here) documentation. Having the index to be a compile-time constant would be pretty much useless.

I went to NV website and downloaded the lastest drivers. The error remains. I'm out of ideas. What do you suggest me?

dorbie
06-19-2006, 10:22 AM
What's the code on the stated line numbers?!

Relic
06-19-2006, 10:40 AM
And what's your hardware?
The loop itself might work, but you seem to use it as an index into some array and that would need an address register which is only available in vertex shaders so far.

One discussion on that was here:
http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=11;t=001107#000001

Obli
06-19-2006, 12:01 PM
Originally posted by Relic:
you seem to use it as an index into some array and that would need an address register which is only available in vertex shaders so far.

One discussion on that was here:
http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=11;t=001107#000001 Yes, it's exactly the same problem.
So, it turns out that VS3.0 is still functionality different from PS3.0. I was indexing in an array and it didn't work.
That's quite poor.

Thank you both for your quick reply. Although I read the PS3.0 docs, I overlooked this feature thinking the compiler would have dealed with it.

Maybe putting this thing in the wiki would be a good idea.

In the meanwhile, I'll send all the constants in a texture. This will work for sure!

Note to forum admins: since the 'Search' thing does not work as it should, at least provide a way to get to older pages. Requiring to change the forum settings is definetly bogus (and counter-intuitive as well, since no older pages are listed here)!