Handle variable pointer in some optimizations (#2490)
* Check var pointer capability in ADCE. * Check var ptr capability for common uniform. * Check var ptr capability in access chain convert. Since we want this pass to run even if there are variable pointer on storage buffers, we had to remove asserts that assumed there were no variable pointers. The functions with the asserts will now work, it becomes the responsibility of the callers to deal with the output as appropriate. * Single block elimination and variable pointers. It seems like the code in local single block elimination is able to handle cases with variable pointers already. This is because the function `HasOnlySupportedRefs` ensures that variables that feed a variable pointer are not candidates. * Single store elimination and variable pointers. It seems like the code in local single stroe elimination is able to handle cases with variable pointers already. This is because the function `FindSingleStoreAndCheckUses` ensures that variables that feed a variable pointer are not candidates. * SSA rewriter and variable pointers. It seems like the code in the two passes that call the SSA rewriter are able to handle cases with variable pointers already. This is because the function `HasOnlySupportedRefs` ensures that variables that feed a variable pointer are not candidates. Fixes #2458.
Loading
Please register or sign in to comment