mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
nir/inline_uniforms: fix oob access with nir_find_inlinable_uniforms
the array dimensionality needs to match nir_add_inlinable_uniforms even if
only the first member is used
Fixes: 0c0fb216dd ("nir/inline_uniforms: Allow possibility of more than one UBO")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25063>
This commit is contained in:
parent
94941de25b
commit
39fca243bb
1 changed files with 4 additions and 4 deletions
|
|
@ -366,19 +366,19 @@ void
|
|||
nir_find_inlinable_uniforms(nir_shader *shader)
|
||||
{
|
||||
uint32_t uni_offsets[MAX_INLINABLE_UNIFORMS];
|
||||
uint8_t num_offsets = 0;
|
||||
uint8_t num_offsets[MAX_NUM_BO] = {0};
|
||||
|
||||
nir_foreach_function_impl(impl, shader) {
|
||||
nir_metadata_require(impl, nir_metadata_loop_analysis,
|
||||
nir_var_all, false);
|
||||
|
||||
foreach_list_typed(nir_cf_node, node, node, &impl->body)
|
||||
process_node(node, NULL, uni_offsets, &num_offsets);
|
||||
process_node(node, NULL, uni_offsets, num_offsets);
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_offsets; i++)
|
||||
for (int i = 0; i < num_offsets[0]; i++)
|
||||
shader->info.inlinable_uniform_dw_offsets[i] = uni_offsets[i] / 4;
|
||||
shader->info.num_inlinable_uniforms = num_offsets;
|
||||
shader->info.num_inlinable_uniforms = num_offsets[0];
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue