tree: f15f9f5e59046ec7f72d6febb751b7a63529f43a [path history] [tgz]
  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_indexing_oob_pass.cpp
  12. descriptor_indexing_oob_pass.h
  13. function_basic_block.cpp
  14. function_basic_block.h
  15. interface.h
  16. link.h
  17. log_error_pass.cpp
  18. log_error_pass.h
  19. mesh_shading_pass.cpp
  20. mesh_shading_pass.h
  21. module.cpp
  22. module.h
  23. pass.cpp
  24. pass.h
  25. post_process_descriptor_indexing_pass.cpp
  26. post_process_descriptor_indexing_pass.h
  27. ray_hit_object_pass.cpp
  28. ray_hit_object_pass.h
  29. ray_query_pass.cpp
  30. ray_query_pass.h
  31. README.md
  32. sanitizer_pass.cpp
  33. sanitizer_pass.h
  34. type_manager.cpp
  35. type_manager.h
  36. vertex_attribute_fetch_oob_pass.cpp
  37. 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.