tree: a55ef873a48378cdcc89c41f9d626ac55a291425 [path history] [tgz]
  1. buffer_device_address_pass.cpp
  2. buffer_device_address_pass.h
  3. CMakeLists.txt
  4. debug_printf_pass.cpp
  5. debug_printf_pass.h
  6. descriptor_class_general_buffer_pass.cpp
  7. descriptor_class_general_buffer_pass.h
  8. descriptor_class_texel_buffer_pass.cpp
  9. descriptor_class_texel_buffer_pass.h
  10. descriptor_indexing_oob_pass.cpp
  11. descriptor_indexing_oob_pass.h
  12. function_basic_block.cpp
  13. function_basic_block.h
  14. inject_conditional_function_pass.cpp
  15. inject_conditional_function_pass.h
  16. inject_function_pass.cpp
  17. inject_function_pass.h
  18. instruction.cpp
  19. instruction.h
  20. interface.h
  21. link.h
  22. module.cpp
  23. module.h
  24. pass.cpp
  25. pass.h
  26. post_process_descriptor_indexing.cpp
  27. post_process_descriptor_indexing.h
  28. ray_query_pass.cpp
  29. ray_query_pass.h
  30. README.md
  31. type_manager.cpp
  32. type_manager.h
layers/gpu/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.