Skip to content
Snippets Groups Projects

vkd3d-shader/ir: Validate signatures, part 1/N.

Merged Giovanni Mascellani requested to merge giomasce/vkd3d:vesuvio into master
1 unresolved thread

Merge request reports

Merge request pipeline #32989 skipped

Merge request pipeline skipped for bb0e4506

Merged by Henri VerbeetHenri Verbeet 6 months ago (Oct 9, 2024 11:19am 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
  • Giovanni Mascellani approved this merge request

    approved this merge request

    • +    switch (program->shader_version.type)
      +    {
      +        case VKD3D_SHADER_TYPE_HULL:
      +        case VKD3D_SHADER_TYPE_DOMAIN:
      +            break;
      +
      +        default:
      +            if (program->patch_constant_signature.element_count != 0)
      +                validator_error(&ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
      +                        "Patch constant signature is only valid for hull and domain shaders.");
      +    }

      In principle that's fine, but it probably means we should explicitly discard patch constants signatures for other shader types in the TPF and DXIL parsers. (And probably not parse them in the first place, but that's slightly harder with the way the code is currently structured.) We currently simply add these when the source DXBC has them.

    • In principle that's fine, but it probably means we should explicitly discard patch constants signatures for other shader types in the TPF and DXIL parsers. (And probably not parse them in the first place, but that's slightly harder with the way the code is currently structured.) We currently simply add these when the source DXBC has them.

      Fixed. BTW, I'm pretty sure there are a lot of validation checks that would easily fire when appropriately broken shaders are fed to vkd3d-shader. That shouldn't happen, of course, and in principle frontends should validate their input so that they only produce valid VSIR, but this goal is probably quite far away for the moment and I don't think it's a good idea to condition validation patch acceptance to the fact that the corresponding VSIR property is enforced by all frontends, mostly because that would execessively slow development. Of course it's not a problem to fix things either.

    • Please register or sign in to reply
  • added 6 commits

    • c54b474f - vkd3d-shader: Ignore the patch constant signature when it doesn't make sense.
    • e8105c98 - vkd3d-shader/ir: Allow a patch constant signature only for Hull and Domain Shaders.
    • 94494748 - vkd3d-shader/ir: Validate register counts in input signatures.
    • 58ac9f66 - vkd3d-shader/ir: Validate register counts in output signatures.
    • 5e9e1ffe - vkd3d-shader/ir: Validate register counts in patch constant signatures.
    • e6c0332a - vkd3d-shader/ir: Validate masks in shader signatures.

    Compare with previous version

  • Fixed. BTW, I'm pretty sure there are a lot of validation checks that would easily fire when appropriately broken shaders are fed to vkd3d-shader. That shouldn't happen, of course, and in principle frontends should validate their input so that they only produce valid VSIR, but this goal is probably quite far away for the moment and I don't think it's a good idea to condition validation patch acceptance to the fact that the corresponding VSIR property is enforced by all frontends, mostly because that would execessively slow development. Of course it's not a problem to fix things either.

    Sure; this one seemed easy enough though.

  • Henri Verbeet approved this merge request

    approved this merge request

  • Henri Verbeet added 22 commits

    added 22 commits

    • e6c0332a...cd74461d - 16 commits from branch wine:master
    • 16efb7c0 - vkd3d-shader: Ignore the patch constant signature when it doesn't make sense.
    • 7202e6e2 - vkd3d-shader/ir: Allow a patch constant signature only for Hull and Domain Shaders.
    • 118f494d - vkd3d-shader/ir: Validate register counts in input signatures.
    • a29270fa - vkd3d-shader/ir: Validate register counts in output signatures.
    • c3b31b96 - vkd3d-shader/ir: Validate register counts in patch constant signatures.
    • bb0e4506 - vkd3d-shader/ir: Validate masks in shader signatures.

    Compare with previous version

Please register or sign in to reply
Loading