Skip to content

Commit

Permalink
radv: correctly skip vertex loads with packed formats
Browse files Browse the repository at this point in the history
This is supposed to check whether any channels of the element is used, but
skipped_start is always 0 for packed formats.

Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timur Kristóf <[email protected]>
Fixes: a46acdb ("radv: Lower non-dynamic VS inputs in NIR.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9062
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23370>
(cherry picked from commit b9c1d74)
  • Loading branch information
pendingchaos authored and 1ace committed Jun 7, 2023
1 parent 09b915b commit 4224ef0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pick_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@
"description": "radv: correctly skip vertex loads with packed formats",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "a46acdbc3ff46080179f40155fa8a74340b938f5"
},
Expand Down
2 changes: 1 addition & 1 deletion src/amd/vulkan/nir/radv_nir_lower_vs_inputs.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ lower_load_vs_input(nir_builder *b, nir_intrinsic_instr *intrin, lower_vs_inputs
first_used_swizzled_channel(f, dest_use_mask, true) + 1;
const unsigned max_loaded_channels = MIN2(first_trailing_unused_channel, f->nr_channels);
const unsigned fetch_num_channels =
skipped_start >= max_loaded_channels ? 0 : max_loaded_channels - skipped_start;
first_used_channel >= max_loaded_channels ? 0 : max_loaded_channels - skipped_start;

/* Load VS inputs from VRAM.
*
Expand Down

0 comments on commit 4224ef0

Please sign in to comment.