Skip to content

Commit 723e82b

Browse files
committed
Merge pull request godotengine#108568 from beicause/RD-uniform_type-check
RenderingDevice: Add `uniform_type` check to avoid crash
2 parents 7498243 + 8ad3072 commit 723e82b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

servers/rendering/rendering_device.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,6 +3577,7 @@ RID RenderingDevice::uniform_set_create(const VectorView<RD::Uniform> &p_uniform
35773577

35783578
const Uniform &uniform = uniforms[uniform_idx];
35793579

3580+
ERR_FAIL_INDEX_V(uniform.uniform_type, RD::UNIFORM_TYPE_MAX, RID());
35803581
ERR_FAIL_COND_V_MSG(uniform.uniform_type != set_uniform.type, RID(),
35813582
"Mismatch uniform type for binding (" + itos(set_uniform.binding) + "), set (" + itos(p_shader_set) + "). Expected '" + SHADER_UNIFORM_NAMES[set_uniform.type] + "', supplied: '" + SHADER_UNIFORM_NAMES[uniform.uniform_type] + "'.");
35823583

0 commit comments

Comments
 (0)