When GLSL sources were first included in Blender they were treated as data (like blend files) and had no license header. Since then GLSL has been used for more sophisticated features (EEVEE & real-time compositing) where it makes sense to include licensing information. Add SPDX copyright headers to *.glsl files, matching headers used for C/C++, also include GLSL files in the license checking script. As leading C-comments are now stripped, added binary size of comments is no longer a concern. Ref !111247
19 lines
509 B
GLSL
19 lines
509 B
GLSL
/* SPDX-FileCopyrightText: 2019-2020 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
void clamp_value(float value, float min, float max, out float result)
|
|
{
|
|
result = clamp(value, min, max);
|
|
}
|
|
|
|
void clamp_minmax(float value, float min_allowed, float max_allowed, out float result)
|
|
{
|
|
result = min(max(value, min_allowed), max_allowed);
|
|
}
|
|
|
|
void clamp_range(float value, float min, float max, out float result)
|
|
{
|
|
result = (max > min) ? clamp(value, min, max) : clamp(value, max, min);
|
|
}
|