You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't rewrite entrypoint in to borrow during ir lowering. (#9869)
If the user compile a shader via `findAndCheckEntrypoint` API on a
function that does not have a `[shader()]` attribute, we could be
generating invalid spirv code.
There is logic in lower-to-ir that silently changes the parameter
passing convention of entrypoint in to borrow in, which is fundamentally
conflicting with the compilation model. When we load a module, we
compile every function down to IR. If we want to lower entrypoint
differently, we must know some func is entrypoint during lower-to-ir of
a module. But since this info is not provided at `loadModule` time, we
fundamentally cannot do this kind of transform when lowering a module to
IR.
The right thing to do is to implement an IR pass that turns these in
parameters into borrow in once we know a function is entrypoint. This PR
deletes the special logic in lower-to-ir that does the problematic
rewrite, and use a dedicated pass derived from the existing
`transformParamsToConstRef` pass to do the rewrite after linking, where
entrypoints are always specified.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0 commit comments