Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Stop using hlsl_type_get_regset().

Merged Francisco Casas requested to merge fcasas/vkd3d:regset_improvements into master

As has been pointed out a couple of times, mainly by @zfigura, hlsl_type_get_regset() is not defined for structs. So it is responsibility of the programmer to ensure that the data type in question belongs to a single regset before calling that function.

Turns out that when we call this function we either have to handle the possibility of the type spanning across multiple regsets, or we want the regset of a single component or vector, so this MR replaces the calls to hlsl_type_get_regset() with either a for loop that goes through all the pertaining regsets, hlsl_type_get_component_offset(), or hlsl_deref_get_regset().

hlsl_type_get_regset() is still needed in the implementation of these functions, so it is downgraded to a static function for hlsl.c instead of being completely removed.

The tests in 3/5 (structs with multiple register reservations) are to explain why it makes sense to iterate over the regsets in 4/5 even if we don't have a proper implementation for register reservations on structs that span across mutiple regsets yet.

Edited by Francisco Casas

Merge request reports

Merge request pipeline #16134 skipped

Merge request pipeline skipped for 4ab6572b

Merged by Alexandre JulliardAlexandre Julliard 1 year ago (Oct 5, 2023 8:36pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading