Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Store original semantic name.

Merged Nikolay Sivov requested to merge nsivov/vkd3d:semantic_name into master
1 unresolved thread

The issue here is that names like COLOR0 and COLOR are represented identically, and that's not going to work for effects, where original string is stored, and is used later for simple comparison lookups.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Nikolay Sivov added 2 commits

    added 2 commits

    • bcfcc215 - vkd3d-shader/hlsl: Store original semantic name.
    • 997a2004 - vkd3d-shader/fx: Use original full semantic name.

    Compare with previous version

    • Can we avoid storing both names, and instead just move the parsing later?

    • Author Developer

      Actually, I don't need it parsed at all for fx, and there should be logic involving name/index when compiling as fx. What will immediately work is checking target type in semantic rule directly. How bad is that?

    • I don't think I like that, no. I was hoping instead that we could do the parsing in e.g. hlsl_sm4_register_from_semantic(), probably using a helper.

      Unfortunately there is prepend_input_copy() et al. which interpret the index, so I suppose that's not going to work, and just storing both copies is better...

    • Author Developer

      Another option is to store original name, parsed index, and something like length of a name part after index was parsed. It is better in a sense that there is no duplication, but every place needs to handle that.

      Maybe less intrusive way is to store a flag to indicate that "index" is 0 from parsed string. This way I only need to handle that in fx writing, by appending index part.

    • Maybe less intrusive way is to store a flag to indicate that "index" is 0 from parsed string. This way I only need to handle that in fx writing, by appending index part.

      Maybe, but I suspect fx also wants to preserve the difference between e.g. COLOR1 and COLOR01.

    • Author Developer

      You're right. Not parsing it for fx makes sense, it's probably what I would do, but it's certainly not pretty, having parsed structure carry different meaning depending on profile is not great. Storing original string is unavoidable, the question remains if we need to store both or instead bother storing length of name part.

    • My inclination is probably to keep it like this patch has it.

    • Please register or sign in to reply
  • Elizabeth Figura approved this merge request

    approved this merge request

  • Henri Verbeet added 29 commits

    added 29 commits

    • 997a2004...47d077e5 - 27 commits from branch wine:master
    • 1124ea46 - vkd3d-shader/hlsl: Store original semantic name.
    • 72ddea60 - vkd3d-shader/fx: Use original full semantic name.

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

Please register or sign in to reply
Loading