local_size_x, etc. in OpenGL compute shader
P.S. I can't remember who it was, but someone said to try making the max_iterations a #define or const int. I tried the #define route, and I didn't notice any speed increase. Is there a cross-platform way to tell the compiler to unroll the loops?
taby said:
P.S. I can't remember who it was, but someone said to try making the max_iterations a #define or const int. I tried the #define route, and I didn't notice any speed increase. Is there a cross-platform way to tell the compiler to unroll the loops?
It was me. Found this: https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GL_EXT_control_flow_attributes.txtโ
But not sure if that's WIP or if it finally works.
My point was to ensure the loop does not unroll. Unrolling can cause huge shaders and it often totally destroyed my performance. Usually it helps but if things go wrong they go very wrong.
However i don't think the compiler would unroll a loop that can terminate at any point like yours.
I'll try to download your project. If it's easy to compile i can take a look. I have Vega 56, though i have no GPU profiler installed actuallyโฆ.
โฆ. tried this: https://github.com/sjhalayka/julia4d3โโ But it does not contain project file for VS?
Yeah Microsoft does not recommend that you share SLN files or exe files. :(
You just have to create a new project and add the source (including the C and CPP files in the GLUI subdirectory).
Thanks again for your expertise JoeJ!
![](https://uploads.gamedev.net/forums/monthly_2020_04/f60eafb9b5c24366b716a2902f11eea2.image.png)
Can it be my gl.h stuff is that old? I have used GL compute shaders myself years ago.
C++ is fineโฆ until you try to compile someone elses project.
taby said:
Microsoft does not recommend that you share SLN files
Did not knew this. Can a sln file spread virueses?
@taby If you attempt to provide to max_iterations a non constant value, it is an error.
The compiler could fail to compile.
Or, knowing how tricky the compilers of shading languages are, i consider this -
The compiler ignores your erroneous max_iterations value and does what it has in mind. Takes a decision to unroll or not and how much to unroll, based on the amount of available memory for instructions code, based on the amount of free registers available and based on its own directives. Your erroneous max_iterations is ignored and you are not even being told.
taby said:
Microsoft does not recommend that you share โฆ exe files.
Really?
๐๐๐๐๐<โThe tone posse, ready for action.
taby said:
Yeah, when you download an exe, Windows 10 blocks it by default.
Sharing an exe and downloading an exe are 2 different things. You can put an exe in a 7z file and offer it as a download. Also a warning on dl of an exe isn't a recommendation to not share. Do you know how much current Windows software is only available as an exe download?
In any case you said that Microsoft, not Windows, does not recommend that you share exe files. I want proof.
๐๐๐๐๐<โThe tone posse, ready for action.