Metal: GLSL shader compatibility 4th pass
MSL follows C++ standard convention, and such variable declarations within switch statements must have their scope localised within each case. Adding braces in all cases ensures correct behaviour and avoids 'case ... bypass initialization of local variable' compilation error. struct initialisation to follow C++ rules for Metal. Implicit constructors replaced with either explicit constructors or list-initialization where appropriate. Ref T96261 Authored by Apple: Michael Parkin-White Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14451
This commit is contained in:
@@ -40,6 +40,15 @@ struct OcclusionData {
|
||||
vec4 horizons;
|
||||
/* Custom large scale occlusion. */
|
||||
float custom_occlusion;
|
||||
|
||||
#ifdef GPU_METAL
|
||||
/* Constructors required for OcclusionData(..) syntax. */
|
||||
inline OcclusionData() = default;
|
||||
inline OcclusionData(vec4 in_horizons, float in_custom_occlusion)
|
||||
: horizons(in_horizons), custom_occlusion(in_custom_occlusion)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
vec4 pack_occlusion_data(OcclusionData data)
|
||||
|
||||
Reference in New Issue
Block a user