SPIRV-Tools/include/spirv-tools
Jaebaek Seo fb9a10cd48
spirv-opt: add pass to Spread Volatile semantics (#4667)
Add a pass to spread Volatile semantics to variables with SMIDNV,
WarpIDNV, SubgroupSize, SubgroupLocalInvocationId, SubgroupEqMask,
SubgroupGeMask, SubgroupGtMask, SubgroupLeMask, or SubgroupLtMask BuiltIn
decorations or OpLoad for them when the shader model is the ray
generation, closest hit, miss, intersection, or callable shaders. This
pass can be used for VUID-StandaloneSpirv-VulkanMemoryModel-04678 and
VUID-StandaloneSpirv-VulkanMemoryModel-04679 (See "Standalone SPIR-V
Validation" section of Vulkan spec "Appendix A: Vulkan Environment for
SPIR-V").

Handle variables used by multiple entry points:

1. Update error check to make it working regardless of the order of
   entry points.
2. For a variable, if it is used by two entry points E1 and E2 and
   it needs the Volatile semantics for E1 while it does not for E2
  - If VulkanMemoryModel capability is enabled, which means we have to
    set memory operation of load instructions for the variable, we
    update load instructions in E1, but do not update the ones in E2.
  - If VulkanMemoryModel capability is disabled, which means we have
    to add Volatile decoration for the variable, we report an error
    because E1 needs to add Volatile decoration for the variable while
    E2 does not.

For the simplicity of the implementation, we assume that all functions
other than entry point functions are inlined.
2022-01-25 13:14:36 -05:00
..
instrument.hpp Add kInstErrorMax to instrument.hpp (#4315) 2021-06-07 08:06:10 -04:00
libspirv.h Vulkan 1.3 (#4686) 2022-01-25 10:36:08 -05:00
libspirv.hpp Add a feature for allowing LocalSizeId (#4492) 2021-08-26 14:33:19 -04:00
linker.hpp Rewrite include guards (#1793) 2018-08-03 08:05:33 -04:00
linter.hpp spirv-lint: Add lint based on divergence analysis (#4488) 2021-08-27 14:43:23 -04:00
optimizer.hpp spirv-opt: add pass to Spread Volatile semantics (#4667) 2022-01-25 13:14:36 -05:00