tree: cf4cf5b57293fc9f97758b003acb280a796f0259 [path history] [tgz]
  1. attributes.h
  2. construct.cc
  3. construct.h
  4. entry_point_info.cc
  5. entry_point_info.h
  6. enum_converter.cc
  7. enum_converter.h
  8. enum_converter_test.cc
  9. fail_stream.h
  10. fail_stream_test.cc
  11. function.cc
  12. function.h
  13. function_arithmetic_test.cc
  14. function_bit_test.cc
  15. function_call_test.cc
  16. function_cfg_test.cc
  17. function_composite_test.cc
  18. function_conversion_test.cc
  19. function_decl_test.cc
  20. function_glsl_std_450_test.cc
  21. function_logical_test.cc
  22. function_memory_test.cc
  23. function_misc_test.cc
  24. function_var_test.cc
  25. namer.cc
  26. namer.h
  27. namer_test.cc
  28. parser.cc
  29. parser.h
  30. parser_impl.cc
  31. parser_impl.h
  32. parser_impl_barrier_test.cc
  33. parser_impl_constant_test.cc
  34. parser_impl_convert_member_decoration_test.cc
  35. parser_impl_convert_type_test.cc
  36. parser_impl_function_decl_test.cc
  37. parser_impl_get_decorations_test.cc
  38. parser_impl_handle_test.cc
  39. parser_impl_import_test.cc
  40. parser_impl_module_var_test.cc
  41. parser_impl_named_types_test.cc
  42. parser_impl_test.cc
  43. parser_impl_test_helper.cc
  44. parser_impl_test_helper.h
  45. parser_impl_user_name_test.cc
  46. parser_test.cc
  47. parser_type.cc
  48. parser_type.h
  49. parser_type_test.cc
  50. README.md
  51. spirv_tools_helpers_test.cc
  52. spirv_tools_helpers_test.h
  53. usage.cc
  54. usage.h
  55. usage_test.cc
src/tint/lang/spirv/reader/README.md

SPIR-V Reader

This component translates SPIR-V written for Vulkan into the Tint AST.

The SPIR-V reader entry point is tint::reader::spirv::Parser, which implements the Reader interface in tint::reader::Reader.

It's usable from the Tint command line:

# Translate SPIR-V into WGSL.
tint --format wgsl a.spv

Supported dialects

The SPIR-V module must pass validation for the Vulkan 1.1 environment in SPIRV-Tools. In particular, SPIR-V 1.4 and later are not supported.

For example, the equivalent of the following must pass:

spirv-val --target-env vulkan1.1 a.spv

Additionally, the reader imposes additional constraints based on:

  • The features supported by WGSL. Some Vulkan features might not be supportable because WebGPU must be portable to other graphics APIs.
  • Limitations of the reader itself. These might be relaxed in the future with extra engineering work.

Feedback

Please file issues at https://crbug.com/tint, and apply label SpirvReader.

Outstanding issues can be found by using the SpirvReader label in the Chromium project's bug tracker: https://bugs.chromium.org/p/tint/issues/list?q=label:SpirvReader