mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +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> (cherry picked from commit39fca243bb)
This commit is contained in:
parent
cbfb7e930d
commit
b5ccb6901c
2 changed files with 5 additions and 5 deletions
|
|
@ -31,7 +31,7 @@
|
|||
"description": "nir/inline_uniforms: fix oob access with nir_find_inlinable_uniforms",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "0c0fb216dd6d9d194593178eb0493d31b4b977af"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ 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(function, shader) {
|
||||
if (function->impl) {
|
||||
|
|
@ -380,13 +380,13 @@ nir_find_inlinable_uniforms(nir_shader *shader)
|
|||
nir_var_all, false);
|
||||
|
||||
foreach_list_typed(nir_cf_node, node, node, &function->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