Merge pull request #92073 from AThousandShips/shader_hint_fix_4_2

[4.2] [Rendering] Improve `(u)int` shader uniform hint
This commit is contained in:
Rémi Verschelde 2024-05-18 16:53:26 +02:00 committed by GitHub
commit 0c957c0d5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -4113,9 +4113,13 @@ PropertyInfo ShaderLanguage::uniform_to_property_info(const ShaderNode::Uniform
pi.type = Variant::PACKED_INT32_ARRAY;
} else {
pi.type = Variant::INT;
if (p_uniform.hint == ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) {
pi.hint = PROPERTY_HINT_RANGE;
if (p_uniform.hint == ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) {
pi.hint_string = rtos(p_uniform.hint_range[0]) + "," + rtos(p_uniform.hint_range[1]) + "," + rtos(p_uniform.hint_range[2]);
} else if (p_uniform.type == ShaderLanguage::TYPE_UINT) {
pi.hint_string = "0," + itos(UINT32_MAX);
} else {
pi.hint_string = itos(INT32_MIN) + "," + itos(INT32_MAX);
}
}
} break;