Advertisement

local_size_x, etc. in OpenGL compute shader

Started by April 21, 2020 08:09 PM
69 comments, last by NikiTo 4ย years, 9ย months ago

https://vallentin.dev/2015/02/23/debugging-opengl

๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚<โ†The tone posse, ready for action.

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?

Advertisement

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!

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.

Advertisement

taby said:
Microsoft does not recommend that you share โ€ฆ exe files.

Really?

๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚<โ†The tone posse, ready for action.

Yeah, when you download an exe, Windows 10 blocks it by default.

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.

Well, the other problem is that I must assume that my machine is hacked, and it's infectiousโ€ฆ

This topic is closed to new replies.

Advertisement