shader: Fix memory corruption with matrix array shader inputs

Fixes #1788
This commit is contained in:
rdb 2025-12-22 15:59:06 +01:00
parent 04e5cbe706
commit f123cb142d
1 changed files with 1 additions and 1 deletions

View File

@ -742,7 +742,7 @@ cp_add_mat_spec(ShaderMatSpec &spec) {
spec._cache_offset[p] = offset + begin[p] * size;
}
if (spec._func == SMF_shader_input_ptr) {
_mat_scratch_size = std::max(_mat_scratch_size, spec._array_count);
_mat_scratch_size = std::max(_mat_scratch_size, spec._array_count * ((spec._num_components + 3) / 4));
// We specify SSD_frame because a PTA may be modified by the app from
// frame to frame, and we have no way to know. So, we must respecify a