commit | 50414807150bdac9f41817fea7bdf939425768be | [log] [tgz] |
---|---|---|

author | Ben Clayton <bclayton@google.com> | Fri Jun 24 08:06:19 2022 +0000 |

committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jun 24 08:06:19 2022 +0000 |

tree | 4637941977725c886e6f0aa11dc3b00c6290ea41 | |

parent | 18b966321bca9ed2a7787c0adbbb18d013fac43e [diff] |

tint/writer: Clean up EmitConstant() methods Aside from more SPIR-V using OpConstantNull, this is a no-op change. By refactoring these methods, they're easier to read, and contain less lambda-heavy code. Change-Id: I89c26b2b9f1cd0785d86fb3293f7cfda550bef2e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94331 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>

- src/tint/writer/glsl/generator_impl.cc[diff]
- src/tint/writer/glsl/generator_impl.h[diff]
- src/tint/writer/hlsl/generator_impl.cc[diff]
- src/tint/writer/hlsl/generator_impl.h[diff]
- src/tint/writer/msl/generator_impl.cc[diff]
- src/tint/writer/msl/generator_impl.h[diff]
- src/tint/writer/spirv/builder.cc[diff]
- src/tint/writer/spirv/builder.h[diff]
- src/tint/writer/spirv/builder_accessor_expression_test.cc[diff]
- src/tint/writer/spirv/builder_binary_expression_test.cc[diff]
- src/tint/writer/spirv/builder_builtin_texture_test.cc[diff]
- src/tint/writer/spirv/builder_constructor_expression_test.cc[diff]
- test/tint/bug/dawn/947.wgsl.expected.spvasm[diff]
- test/tint/bug/tint/1046.wgsl.expected.spvasm[diff]
- test/tint/bug/tint/1118.wgsl.expected.spvasm[diff]
- test/tint/bug/tint/824.wgsl.expected.spvasm[diff]
- test/tint/bug/tint/913.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/bit-and/vec3-vec3/bool.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_constant/scalar-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_constant/scalar-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_constant/scalar-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_constant/vec3-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_constant/vec3-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_constant/vec3-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_expression/scalar-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_expression/scalar-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_expression/scalar-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_expression/vec3-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_expression/vec3-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_expression/vec3-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_identifier/scalar-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_identifier/scalar-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_identifier/scalar-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_identifier/vec3-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_identifier/vec3-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/div_by_zero/by_identifier/vec3-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_constant/scalar-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_constant/scalar-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_constant/vec3-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_constant/vec3-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_constant/vec3-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_expression/scalar-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_expression/scalar-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_expression/vec3-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_expression/vec3-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_expression/vec3-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_identifier/scalar-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-vec3/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-vec3/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/binary/mod_by_zero/by_identifier/vec3-vec3/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x2/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/explicit/bool.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/explicit/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/explicit/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/inferred/bool.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec2/inferred/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/explicit/bool.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/explicit/u32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.spvasm[diff]
- test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.spvasm[diff]
- test/tint/samples/triangle.wgsl.expected.spvasm[diff]
- test/tint/types/function_scope_var_conversions.wgsl.expected.spvasm[diff]
- test/tint/types/module_scope_var_conversions.wgsl.expected.spvasm[diff]

138 files changed

tree: 4637941977725c886e6f0aa11dc3b00c6290ea41

- .vscode/
- build_overrides/
- docs/
- generator/
- include/
- infra/
- scripts/
- src/
- test/
- third_party/
- tools/
- webgpu-cts/
- .clang-format
- .clang-tidy
- .gitattributes
- .gitignore
- .gn
- AUTHORS
- BUILD.gn
- CMakeLists.txt
- CMakeSettings.json
- CODE_OF_CONDUCT.md
- codereview.settings
- CONTRIBUTING.md
- CPPLINT.cfg
- dawn.json
- dawn_wire.json
- DEPS
- DIR_METADATA
- Doxyfile
- go.mod
- go.sum
- LICENSE
- OWNERS
- PRESUBMIT.py
- README.chromium
- README.md
- tint_overrides_with_defaults.gni

README.md

Dawn is an open-source and cross-platform implementation of the work-in-progress WebGPU standard. More precisely it implements `webgpu.h`

that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.

Dawn provides several WebGPU building blocks:

**WebGPU C/C++ headers**that applications and other building blocks use.- The
`webgpu.h`

version that Dawn implements. - A C++ wrapper for the
`webgpu.h`

.

- The
**A “native” implementation of WebGPU**using platforms' GPU APIs:**D3D12**on Windows 10**Metal**on macOS and iOS**Vulkan**on Windows, Linux, ChromeOS, Android and Fuchsia- OpenGL as best effort where available

**A client-server implementation of WebGPU**for applications that are in a sandbox without access to native drivers**Tint**is a compiler for the WebGPU Shader Language (WGSL).

Helpful links:

- Dawn bug tracker if you find issues with Dawn.
- Tint bug tracker if you find issues with Tint.
- Dawn's mailing list for other discussions related to Dawn.
- Dawn's source code
- Dawn's Matrix chatroom for live discussion around contributing or using Dawn.
- WebGPU's Matrix chatroom
- Tint mirror for standalone usage.

Developer documentation:

- Dawn overview
- Building
- Contributing
- Code of Conduct
- Testing Dawn
- Debugging Dawn
- Dawn's infrastructure
- Dawn errors
- Tint experimental extensions

User documentation: (TODO, figure out what overlaps with the webgpu.h docs)

(TODO)

Apache 2.0 Public License, please see LICENSE.

This is not an officially supported Google product.