Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some missing ops to the SPIR-V Transpiler #26336

Closed
wants to merge 27 commits into from

Conversation

clocksmith
Copy link
Contributor

@clocksmith clocksmith commented May 21, 2021

diffbase: #25480

Add some missing ops to the spirv transpiler:

  • Ignore all ops that don't affect semantic output.

  • Add OpTypeInt, OpConstantTrue, and OpConstantFalse.

  • Update out.write to use string interpolation only for consistency.

Related issues:
flutter/flutter#58361
flutter/flutter#30763

Note: End to End tests (which included testing all functionalities of the transpiler) will be added in a future that PR that includes the public API for Fragment Shader.

Pre-launch Checklist
[x ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
[x ] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
[x ] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
[ x] I listed at least one issue that this PR fixes in the description above.
[x ] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
writing and running engine tests.
[ x] I updated/added relevant documentation (doc comments with ///).
[ x] I signed the [CLA].
[ x] All existing and new tests are passing.
[ x] The reviewer has submitted any presubmit flakes in this PR using the [engine presubmit flakes form] before re-triggering the failure.

chriscraws and others added 27 commits April 6, 2021 19:55
This is the first step in implementing flutter.dev/go/shaders.

Code changes originate from https://github.com/chriscraws/engine/tree/shader-cc,
which has a working end-to-end draft implementation.

This change includes a dart library intended to be included as an
internal dependency (`dart:_spirv`) for `dart:ui`.

Dart has been chosen over C++ for the following reasons:

- Simpler to include with the HTML renderer.
- Code will be tree-shaken for applications that don't use it.
- AOT Dart performance is comparable to performance of C++
implementation.
- Easier to read.

Golden shader files are tested manually, but will be tested fully
by Flutter engine unit tests as the library is included by `dart:ui`.

Most of the files included in this change are tests and test-data.
Better support Load/Store as well.
This is the first step in implementing flutter.dev/go/shaders.

Code changes originate from https://github.com/chriscraws/engine/tree/shader-cc,
which has a working end-to-end draft implementation.

This change includes a dart library intended to be included as an
internal dependency (`dart:_spirv`) for `dart:ui`.

Dart has been chosen over C++ for the following reasons:

- Simpler to include with the HTML renderer.
- Code will be tree-shaken for applications that don't use it.
- AOT Dart performance is comparable to performance of C++
implementation.
- Easier to read.

Golden shader files are tested manually, but will be tested fully
by Flutter engine unit tests as the library is included by `dart:ui`.

Most of the files included in this change are tests and test-data.
Better support Load/Store as well.
- update copyright headers to use 2013
- add spirv library to ci/analyze.sh
- resolve merge conflicts with main branch
- remove unused depedencies and constants
@clocksmith clocksmith added the Work in progress (WIP) Not ready (yet) for review! label May 21, 2021
@google-cla
Copy link

google-cla bot commented May 21, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: no Work in progress (WIP) Not ready (yet) for review!
Projects
None yet
2 participants