Jump to content

[SOLVED] Macro redefinition in 2.6.1 shaders


photo

Recommended Posts

Our shader compilers are complaining about redefinitions of SCALE_UV and DEPTH_RESOLUTION_ZERO when we run on GPUS other than NVIDIA (for which the GLSL compilers are notoriously slack).
I doubt this line will be working the way it was intended in ssr.frag or ssrtgi.frag:

#ifndef SCALE_UV || DEPTH_RESOLUTION_ZERO
Link to comment

Hi Greg,

To remove this warning you will need slightly patch the #ifndef SCALE_UV || DEPTH_RESOLUTION_ZERO define, so it will look more like this:

#ifndef SCALE_UV || DEPTH_RESOLUTION_ZERO
	#undef SCALE_UV // add this line
	#undef DEPTH_RESOLUTION_ZERO // add this line
	#define SCALE_UV 1.0f
	#define DEPTH_RESOLUTION_ZERO 0
#endif

Thanks for the report!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • silent changed the title to [SOLVED] Macro redefinition in 2.6.1 shaders

Yes, doing the #undefs will prevent the warnings. But have you tested that the code actually does what you intend it to? I expect it's ignoring everything after SCALE_UV because an #ifdef can only apply to a single token. And even if _your_ compiler is broken enough to do what you want here, other compilers are likely to behave differently or refuse to compile it.

Link to comment
×
×
  • Create New...