shader-slang / slang

Making it easier to work with shaders
MIT License
1.78k stars 159 forks source link

Cache address-space-legalization of `kIROp_Store` #4480

Closed ArielG-NV closed 1 day ago

ArielG-NV commented 3 days ago

fixes: #4479

fixes the following tests (related to #4291):

  1. tests/language-feature/types/opaque/inout-param-opaque-type.slang.1 (mtl)
  2. tests/language-feature/types/opaque/out-param-opaque-type.slang.1 (mtl)

problem: Without caching a processed kIROp_Store will be re-processed multiple-times (or forever) which will cause an infinite-loop or crash.

solution: Cache kIROp_Store processed by address-space-legalization.

Note: Following tests now compile but still fail due to GFX backend issues (I don't have the ability to debug this to figure out what is happening):

  1. tests/language-feature/types/opaque/return-opaque-type-in-struct.slang.1 (mtl)
  2. tests/language-feature/types/opaque/inout-param-opaque-type-in-struct.slang.1 (mtl)
  3. tests/language-feature/types/opaque/out-param-opaque-type-in-struct.slang.1 (mtl)