[spv-out] Avoid generating duplicate OpTypeImage instructions.
Fixes #1305. Ensure that two `back::spv::LocalType::Image` values are sure to be equal (and hash equal) whenever they would generate the same `OpTypeImage` instruction, so that the usual duplicate removal via `Writer::lookup_type` works. Accomplish this by changing the contents of `LocalType::Image` to more closely match the operands of `OpTypeImage` instructions. Previously, `LocalType::Image` included a `ImageClass::Storage::access` value, which did not affect the `OpTypeImage` instruction generated. If two `LocalType::Image` values differered only in their `access`, then they would get separate entries in `Writer::lookup_type`, two identical `OpTypeImage` instructions would be generated, and SPIR-V validation would fail.
parent
5b1c2e59
Please register or sign in to comment