Skip to content

Commit d3792ef

Browse files
committed
Prevent ternary expression with a sampler types in shaders
1 parent 5abed52 commit d3792ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

servers/rendering/shader_language.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ bool ShaderLanguage::_validate_operator(const BlockNode *p_block, const Function
20032003
DataType nb = p_op->arguments[1]->get_datatype();
20042004
DataType nc = p_op->arguments[2]->get_datatype();
20052005

2006-
valid = na == TYPE_BOOL && (nb == nc);
2006+
valid = na == TYPE_BOOL && (nb == nc) && !is_sampler_type(nb);
20072007
ret_type = nb;
20082008
ret_size = sa;
20092009
} break;

0 commit comments

Comments
 (0)