Skip to content

How do you specify the [[loop]] attribute in shaders? #2810

Answered by Qix-
Qix- asked this question in Q&A
Discussion options

You must be logged in to vote

Ah okay! It's just GLSL that was having issues - at least, on all windows-supported shader variants. It might be required that special handling for Metal is also needed, but I'm not on a Mac at the moment to test.

#if BGFX_SHADER_LANGUAGE_GLSL
#	pragma unroll 1
#else
	[loop]
#endif
	for (...) {

Works great!

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@bkaradzic
Comment options

Answer selected by Qix-
Comment options

You must be logged in to vote
1 reply
@Qix-
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants