vkd3d-shader/ir: Validate signatures, part 1/N.
Merge request reports
Activity
+ 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.
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.
Toggle commit listFixed. 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.
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.
Toggle commit list-
e6c0332a...cd74461d - 16 commits from branch