tree: 67f05ca40871bd7802fd60ba31c2f57028dadcc3
  1. buffer_device_address_pass.cpp
  2. buffer_device_address_pass.h
  3. CMakeLists.txt
  4. cooperative_matrix.h
  5. debug_printf_pass.cpp
  6. debug_printf_pass.h
  7. descriptor_class_general_buffer_pass.cpp
  8. descriptor_class_general_buffer_pass.h
  9. descriptor_class_texel_buffer_pass.cpp
  10. descriptor_class_texel_buffer_pass.h
  11. descriptor_heap_pass.cpp
  12. descriptor_heap_pass.h
  13. descriptor_indexing_oob_pass.cpp
  14. descriptor_indexing_oob_pass.h
  15. function_basic_block.cpp
  16. function_basic_block.h
  17. instrumentation_status.h
  18. interface.h
  19. link.h
  20. log_error_pass.cpp
  21. log_error_pass.h
  22. mesh_shading_pass.cpp
  23. mesh_shading_pass.h
  24. module.cpp
  25. module.h
  26. pass.cpp
  27. pass.h
  28. post_process_descriptor_indexing_pass.cpp
  29. post_process_descriptor_indexing_pass.h
  30. README.md
  31. sanitizer_pass.cpp
  32. sanitizer_pass.h
  33. shared_memory_data_race_pass.cpp
  34. shared_memory_data_race_pass.h
  35. spec_constant.cpp
  36. trace_ray_pass.cpp
  37. trace_ray_pass.h
  38. type_manager.cpp
  39. type_manager.h
  40. vertex_attribute_fetch_oob_pass.cpp
  41. vertex_attribute_fetch_oob_pass.h
layers/gpuav/spirv/README.md

Passes

Each pass has a Run that starts the pass, from here there are 3 stages to every pass

Step 1 - Analyze if we need to add check

Each pass does logic needed to know if the current instruction needs have check before it.

Step 2 - Inject a function call

Functions are added via Pass::InjectFunctionCheck, but there are cases were we want to make sure we don't call the invalid instructions. For this we add an if-else control flow logic in SPIR-V (all handled by the Pass::InjectConditionalFunctionCheck) to inject the function. This will create the various blocks and resolve any ID updates

Step 3 - Create the OpFunctionCall

Each pass will have its own unique signature to the function in the GLSL code being linked later, so the virtual Pass::CreateFunctionCall function is then called and the pass needs to create the OpFunctionCall instruction. This is where the pass can provide any arguments needed, likely data saved while doing the analyze phase.