Commit Graph

502 Commits

Author SHA1 Message Date
dan sinclair 3739a23f24 [hlsl-writer] Emit cast expressions.
This CL adds support for cast expressions to the HLSL backend.

Bug: tint:7
Change-Id: Ie7e180dc89abf137ab7d9b8790cc4206b3d5a672
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26926
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-08-19 19:14:44 +00:00
dan sinclair 10585f0ac3 [hlsl-writer] Add tests for entry point data.
This CL adds the missing tests for emission of Entry Point Data
structures.

Bug: tint:7
Change-Id: If21071b07584780243ccd0629a92efa653640251
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26925
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-08-19 19:04:54 +00:00
dan sinclair 6fdc77a966 [hlsl-writer] Emit module constants.
This CL adds emission of module constants to the HLSL backend.

Bug: tint:7
Change-Id: Iff07b0c0de7351f400dc35ca2ac07b44b22f8499
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26924
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-08-19 19:03:24 +00:00
dan sinclair 7df4a845d9 [hlsl-writer] Add CallExpression.
This Cl adds support for call expressions into the HLSL backend.

Bug: tint:7
Change-Id: Id07e3d95e745aa016a658c3ec5d099f74f21a80e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26781
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-08-19 17:44:45 +00:00
dan sinclair be89a06b03 [hlsl-writer] Add function handling.
This CL adds the beginning of function handling to the HLSL generator.

Bug: tint:7
Change-Id: Id40109c342e7a128b1fe79a0c50967e1dbd125eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26662
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
2020-08-19 17:32:25 +00:00
Sarah Mashayekhi f16250b8ac [validation] Validates functions return statement
This CL adds a disabled test for validation rule v-0002: functions must
end with a return statement

Bug: Tint: 6
Change-Id: I127aa1bd7d236ff353fd89024b274c9f9b463f15
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26680
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-08-12 19:31:42 +00:00
Idan Raiter 63551e3b2f Add vertex pulling transform
Adds a first-pass version of vertex pulling. This is missing several important things such as buffer offsets, support for more types, and clamping.

Bug: dawn:480, tint:206
Change-Id: Ia8a3abc446bca4c5a40e064f85fb59de1c3f5af9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26260
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-08-12 17:23:58 +00:00
Ryan Harrison f18d737b4e Rolling 7 dependencies and fix BUILD.gn
Roll build/ 9b01e295f..6c915ac2a (140 commits)

9b01e295f8..6c915ac2af

$ git log 9b01e295f..6c915ac2a --date=short --no-merges --format='%ad %ae %s'
2020-08-04 chromium-autoroll Roll Fuchsia SDK from 0.20200803.3.1 to 0.20200804.1.1
2020-08-04 chromium-autoroll Roll Fuchsia SDK from 0.20200803.2.1 to 0.20200803.3.1
2020-08-04 brucedawson Fix gn gen after vcvarsall.bat
2020-08-03 hypan Revert "Reland "emulator: Disable the feature GLDMA.""
2020-08-03 chromium-autoroll Roll Fuchsia SDK from 0.20200803.1.1 to 0.20200803.2.1
2020-08-03 bpastene chromeos: Don't swallow test args when '--' is present.
2020-08-03 hans [build] Disable call-graph-profile-sort by default
2020-08-03 chromium-autoroll Roll Fuchsia SDK from 0.20200803.0.1 to 0.20200803.1.1
2020-08-03 chromium-autoroll Roll Fuchsia SDK from 0.20200802.3.1 to 0.20200803.0.1
2020-08-02 chromium-autoroll Roll Fuchsia SDK from 0.20200802.1.1 to 0.20200802.3.1
2020-08-02 chromium-autoroll Roll Fuchsia SDK from 0.20200802.0.1 to 0.20200802.1.1
2020-08-02 chromium-autoroll Roll Fuchsia SDK from 0.20200801.3.1 to 0.20200802.0.1
2020-08-02 chromium-autoroll Roll Fuchsia SDK from 0.20200801.2.1 to 0.20200801.3.1
2020-08-01 chromium-autoroll Roll Fuchsia SDK from 0.20200801.1.1 to 0.20200801.2.1
2020-08-01 chromium-autoroll Roll Fuchsia SDK from 0.20200731.4.1 to 0.20200801.1.1
2020-08-01 chromium-autoroll Roll Fuchsia SDK from 0.20200731.2.1 to 0.20200731.4.1
2020-08-01 steveroe Log system statistics at beginning and end of emulator session.
2020-08-01 steveroe Fix fuchsia test runner_logs.py directory creation and error format bugs.
2020-07-31 avi Finish conversion to OS_MAC/OS_APPLE
2020-07-31 liaoyuke [lacros] Further increase timeout waiting for ash-chrome
2020-07-31 chromium-autoroll Roll Fuchsia SDK from 0.20200731.1.1 to 0.20200731.2.1
2020-07-31 hypan emulator: Add ram_size to avd.proto
2020-07-31 hans Build with -Wl,--no-call-graph-profile-sort on Android
2020-07-31 chromium-autoroll Roll Fuchsia SDK from 0.20200730.3.1 to 0.20200731.1.1
2020-07-31 smcallis Rewrite is_linux flag for base and build components.
2020-07-31 chromium-autoroll Roll Fuchsia SDK from 0.20200730.2.1 to 0.20200730.3.1
2020-07-31 hypan emulator: Add advanced_features to avd.proto
2020-07-31 ntfschr Permit bundletool to emit stderr
2020-07-30 chouinard Remove unneccessary UnusedResources suppressions
2020-07-30 liaoyuke [lacros] Increase timeout waiting for ash-chrome
2020-07-30 chromium-autoroll Roll Fuchsia SDK from 0.20200730.1.1 to 0.20200730.2.1
2020-07-30 wnwen Android: Removing baseline.xml regenerates it
2020-07-30 torne Remove obsolete build constant.
2020-07-30 bjoyce Fix Jacoco Report exclusion variable.
2020-07-30 agrieve android: Make treat_warnings_as_errors=false work for enable_jdk_library_desugaring
2020-07-30 chromium-autoroll Roll Fuchsia SDK from 0.20200730.0.1 to 0.20200730.1.1
2020-07-30 chromium-autoroll Roll Fuchsia SDK from 0.20200729.3.1 to 0.20200730.0.1
2020-07-29 chromium-autoroll Roll Fuchsia SDK from 0.20200729.1.1 to 0.20200729.3.1
2020-07-29 steveroe Fix typo in comment.
2020-07-29 agrieve Android: Make manifest expectations a bit more diff-friendly
2020-07-29 hans Roll clang n359864-04b9a46c-1 : n361601-7e8d5a90-1.
2020-07-29 avi Migrate to OS_MAC and OS_APPLE in build
2020-07-29 liaoyuke [lacros] Run Lacros test targets with ash_chrome if needed
2020-07-29 wnwen Android: Use a unified lint target
2020-07-29 chromium-autoroll Roll Fuchsia SDK from 0.20200729.0.1 to 0.20200729.1.1
2020-07-29 chromium-autoroll Roll Fuchsia SDK from 0.20200728.3.1 to 0.20200729.0.1
2020-07-29 huangdarwin ChromeOS: Expand build flag comment.
2020-07-29 chromium-autoroll Roll Fuchsia SDK from 0.20200728.1.1 to 0.20200728.3.1
2020-07-28 mheikal Allow material design to be pulled from outside of android_deps
2020-07-28 bjoyce Run host and device code coverage separately.
(...)
2020-07-22 liaoyuke [lacros] Run tests with ash-chrome
2020-07-22 sokcevic Add missing commit change footer
2020-07-22 wnwen Android: Add comments for lint
2020-07-22 chromium-autoroll Roll Fuchsia SDK from 0.20200721.3.1 to 0.20200722.0.1
2020-07-22 chromium-autoroll Roll Fuchsia SDK from 0.20200721.2.1 to 0.20200721.3.1
2020-07-22 hypan android: Update the css/javascript for test_results_presentation.py
2020-07-22 bjoyce Only use device__jacoco_source files.
2020-07-22 liaoyuke [lacros] Download and isolate ash-chrome on bots
2020-07-21 ntfschr [AW][Dev-UI] fix lint issues
2020-07-21 ntfschr Android: expose CommandLine java methods
2020-07-21 agrieve Allow anyone to modify //build/android/lint/baseline.xml
2020-07-21 wfh Allow CFG guards to be generated with gn config.
2020-07-21 ntfschr AW docs: update references to go/clank-webview
2020-07-21 sebmarchand Few fixes for PGO on Linux
2020-07-21 chromium-autoroll Roll Fuchsia SDK from 0.20200721.1.1 to 0.20200721.2.1
2020-07-21 agrieve Reland #2 of "Android: Updates to warnings-as-errors when building"
2020-07-21 tmartino Revert #2 of "Android: Updates to warnings-as-errors when building"
2020-07-21 brucedawson Fix vs_toolchain.py for Python 3
2020-07-21 mheikal Fix build issues with creating R.java in java_library targets (Reland)
2020-07-21 agrieve Reland "Android: Updates to warnings-as-errors when building"
2020-07-21 chromium-autoroll Roll Fuchsia SDK from 0.20200720.3.1 to 0.20200721.1.1
2020-07-21 andruud Revert "Android: Updates to warnings-as-errors when building"
2020-07-21 chromium-autoroll Roll Fuchsia SDK from 0.20200720.2.2 to 0.20200720.3.1
2020-07-21 agrieve Android: Updates to warnings-as-errors when building
2020-07-21 wnwen Android: Fix lint and add baseline
2020-07-20 etiennep Reland "[Clank SSM]: Enable stack sampling in android browsertests."
2020-07-20 Richard.Townsend Fix MIDL cross-compilation for ARM64 Win32 targets
2020-07-20 chromium-autoroll Roll Fuchsia SDK from 0.20200720.1.1 to 0.20200720.2.2
2020-07-20 torne Try to fix ProcessSkiaGoldRenderTestResults.
2020-07-20 bpastene chromeos: Flash the right type of DUT image based on chrome-branding.
2020-07-20 wnwen Android: Add direct deps for chrome/browser
2020-07-20 treib Remove various references to third_party/cacheinvalidation
2020-07-20 agrieve Silence build logs about d8's desugaring
2020-07-20 agrieve Android: Suppress unused resource warning for *_expand_*
2020-07-20 chromium-autoroll Roll Fuchsia SDK from 0.20200719.3.1 to 0.20200720.1.1
2020-07-20 chromium-autoroll Roll Fuchsia SDK from 0.20200718.1.1 to 0.20200719.3.1
2020-07-19 chromium-autoroll Roll Fuchsia SDK from 0.20200717.3.1 to 0.20200718.1.1
2020-07-18 chromium-autoroll Roll Fuchsia SDK from 0.20200717.2.1 to 0.20200717.3.1
2020-07-18 liaoyuke [lacros] Make test runner differentiate different test targets
2020-07-18 mheikal Revert "Fix build issues with creating R.java in java_library targets"
2020-07-17 mheikal Fix build issues with creating R.java in java_library targets
2020-07-17 bjoyce Run jacoco on host jar files.
2020-07-17 chromium-autoroll Roll Fuchsia SDK from 0.20200717.1.1 to 0.20200717.2.1
2020-07-17 bpastene Reland "Simplify Simple Chrome's gclient and GN conditionals."
2020-07-17 chouinard Remove unnecessary UnusedResources suppressions
2020-07-17 liaoyuke [lacros] Remove unused ash-chrome versions
2020-07-17 wfh Re-enable CFG loader config in component builds.
2020-07-17 oysteine Revert "[Clank SSM]: Enable stack sampling in android browsertests."
2020-07-17 etiennep [Clank SSM]: Enable stack sampling in android browsertests.
2020-07-17 sdefresne [ios] Assert that Xcode version is recent enough

Roll buildtools/ eb3987ec7..613921787 (3 commits)

eb3987ec70..6139217878

$ git log eb3987ec7..613921787 --date=short --no-merges --format='%ad %ae %s'
2020-08-03 tikuta sort buildtools/.gitignore
2020-07-31 smcallis Rewrite is_linux flag for base and build components.
2020-07-20 sdefresne Roll GN from d585128c..3028c6a4

Roll testing/ cadd4e1eb..dc9b1969e (124 commits)

cadd4e1eb3..dc9b1969e7

$ git log cadd4e1eb..dc9b1969e --date=short --no-merges --format='%ad %ae %s'
2020-08-04 sinhak Revert "Bring parity between mac coverage and non-coverage build"
2020-08-04 mcdermottm Enable MediaApp in fieldtrial_testing_config.json.
2020-08-03 drubery Add fieldtrial_testing_config for CSD vision model
2020-08-03 pasthana Bring parity between mac coverage and non-coverage build
2020-08-03 svenzheng [lacros] LUCI config for linux-lacros-builder-rel and linux-lacros-tester-rel
2020-08-03 skare Remove "DesktopStudy" suffix from QRCodeGenerator study to match gcl.
2020-08-03 bpastene chromeos: Don't swallow test args when '--' is present.
2020-08-03 mohsen Remove stale field trial testing configs
2020-08-03 dtrainor Add support for reengagement notification
2020-08-03 rmcilroy [Perf] Move android-pixel2-perf bot to 64-bits.
2020-08-03 martiniss Remove production freeze
2020-08-03 seblalancette [iOS] Cleanup Bling QR Code Generation Flag
2020-08-03 ianstruiksma Add target to blink_web_tests for Win10 x64 1909 builder
2020-08-03 talp Create field trial testing config for Per-agent Scheduling experiment.
2020-07-31 mpdenton Add CertVerifierService to field trial testing config.
2020-07-31 isamsonov Remove mac10.13_retina-blink-rel's configurations.
2020-07-31 behdadb Removed Experimental tag from representaives
2020-07-31 liviutinta Enable Field Trial for Browser Verified Mouse User Activation Trigger
2020-07-31 mattm Reland: Add CertVerifierBuiltin fieldtrial_testing_config for mac.
2020-07-31 liviutinta Enable Field Trial for Browser Verified Keyboard User Activation Trigger
2020-07-30 lindsayw [ios] Add missing 2nd generation identifier
2020-07-30 smcallis Rewrite is_linux flag for sandbox, servicse, ski and testing directories.
2020-07-30 jdeblasio [MIX-DL] Update field testing config for M84 stable launch.
2020-07-30 wenbinzhang [benchmarking] stop running ref build for android-pixel2
2020-07-30 lindsayw [ios] Update the iPad Pro naming to include 2nd gen.
2020-07-30 lindsayw [mac]Roll osxbeta to macOS 11.0
2020-07-30 skare Add field trial testing config for desktop QR code generator.
2020-07-30 justincohen Revert "[iOS] Add fieldtrial config for IOSRequestDesktopByDefault"
2020-07-30 collinbaker Include in-product help in DesktopTabGroups default field trial
2020-07-29 svenzheng [lacros] LUCI config for linux-ash-chromium-builder-fyi-rel
2020-07-29 pbos Add UseTextForUpdateButton to fieldtrial test config
2020-07-29 zhaoyangli [iOS][infra] Roll iOS13 builders & tests to Xcode 11e708
2020-07-29 hypan emulator: Disable flaky tests in weblayer_browsertests on MM
2020-07-29 ynovikov Shard SwANGLE angle_deqp_egl_tests
2020-07-29 avi Migrate to OS_MAC and OS_APPLE in testing
2020-07-29 svenzheng [lacros] LUCI rename fyi linux-lacros-builder-rel and linux-lacros-tester-rel
2020-07-29 michaeldo Revert "Roll bots to Xcode 12 beta 3"
2020-07-29 rmhasan weblayer, skew tests: Put Weblayer job configurations in variants.pyl
2020-07-29 mvanouwerkerk Remove Shared Clipboard WebRTC from testing config.
2020-07-29 liaoyuke [lacros] Run Lacros test targets with ash_chrome if needed
2020-07-29 bpastene Revert "Remove telemetry_unittests from the CrOS VM CQ bot."
2020-07-29 asanka [privacy_budget] Enable study for waterfall testing.
2020-07-29 wez [base] Add DisableOffSequenceTaskCancelation fieldtrial test config.
2020-07-29 gambard [iOS] Add fieldtrial config for IOSRequestDesktopByDefault
2020-07-29 alanlxl Add fieldtrial config for SmartDimNewMlAgent
2020-07-29 rushans Add SyncReuploadBookmarkFullTitles experiment to field trial testing config.
2020-07-29 jwata Revert "[mac-rel-swarming] add arm-64 Mac to the target bots"
2020-07-29 kimstephanie Remove chrome_public_test_apk temporarily from android-pie-arm64-rel
2020-07-28 jwata [mac-rel-swarming] add arm-64 Mac to the target bots
2020-07-28 dproy tools/perf: Add system_health.common benchmark with TBMv3 to FYI bots
(...)
2020-07-27 jonross Disable angle_white_box_tests on Linux FYI Release (AMD R7 240) This test suite has been failing consistently for 11 days.
2020-07-27 sdefresne [apple] Add a `is_apple` gn variable and use it
2020-07-27 rsorokin [Sheriff] Disable */PlatformKeysServicePerUnavailableTokenBrowserTest.GenerateRsa/0
2020-07-26 liaoyuke Add xvfb.py as a data deps
2020-07-26 gangwu add field trial config for Omnibox tab switch suggestions
2020-07-25 svenzheng Disable BookmarkBubbleViewBrowserTest.InvokeUi_bookmark_details_signed_in
2020-07-25 gbeaty Revert "Remove GPU's Linux tests from the CQ."
2020-07-25 thestig Add SaveEditedPDFForm experiment to field trial testing config.
2020-07-25 behdadb Failure invalidation of rep_perf tests should show green status
2020-07-24 gbeaty Revert "Remove gl_tests_passthrough and gl_tests_validating from the Linux builders"
2020-07-23 hypan Remove gl_tests_passthrough and gl_tests_validating from the Linux builders
2020-07-23 jonross Revert "Re-add field trial testing config for DisableLatencyRecoveryDesktop"
2020-07-23 hypan Remove GPU's Linux tests from the CQ.
2020-07-23 fdoray [blink scheduler] Enable intensive wake up throttling in testing config.
2020-07-23 hypan android: Add test configs for android-nougat-arm64-rel
2020-07-23 kelvinjiang Revert "Add CertVerifierBuiltin fieldtrial_testing_config for mac."
2020-07-22 ianstruiksma Add luci and test configurations for Win10 x64 Tests 1909.
2020-07-22 gab [base] Enable PM_QS_ALLEVENTS in ProcessPumpReplacementMessage by default
2020-07-22 wylieb Update fieldtrial testing config for Assistant voice search
2020-07-22 ynovikov Revert "Explicitly name webgl/2 conformance tests on Windows"
2020-07-22 mattm Add CertVerifierBuiltin fieldtrial_testing_config for mac.
2020-07-22 jonahr Explicitly name webgl/2 conformance tests on Windows
2020-07-22 bpastene Move perf-fyi's CrOS tester to standard test pool.
2020-07-22 bttk ADCP: Add Field Trial config
2020-07-22 jdapena GCC: in perf result reporter, fix kInvalidCharacters initialization.
2020-07-22 pkotwicz Add compile target for errorprone plugin tests
2020-07-22 jds Adding a field trial config for the context menu performance hints experiment.
2020-07-22 natlee Add --use-gpu-in-tests flag to webgpu blink web tests.
2020-07-22 bpastene Move all CrOS HW tests to standard test pools.
2020-07-22 chriscycheng Adding 'android_lollipop_marshmallow_coverage_gtests'
2020-07-22 liaoyuke [lacros] Download and isolate ash-chrome on bots
2020-07-21 gbeaty Temporarily disable chrome_public_test_apk on android-pie-arm64-rel.
2020-07-21 gatong Infra: Moving mac-arm64 builder from FYI to being part of mac waterfall
2020-07-21 mohsen Re-add field trial testing config for DisableLatencyRecoveryDesktop
2020-07-21 wfh Allow CFG guards to be generated with gn config.
2020-07-21 svenzheng Mark some test suites as experimental
2020-07-21 sreejakshetty Filter out new content_browsertest failure with BackForwardCache
2020-07-21 ewannpv PageInfoRefactoring to Field Trial Testing Configuration
2020-07-21 rakina Check for bfcache flags on places where we check for Proactive BI swap
2020-07-21 hypan emulator: Have the android-marshmallow-x86-rel run on 4-cores GCE bots
2020-07-20 bpastene Enable pre-test flashing for all CrOS HW tests.
2020-07-20 mthiesse Migrate Omnibox native java unittests to batched Instrumentation tests
2020-07-20 bpastene Decrease primary task slice expiration from 10m to 5m for CrOS HW tests.
2020-07-20 alcooper Reland "Update vr_pixeltests exceptions"
2020-07-20 aboxhall Revert "Update vr_pixeltests exceptions"
2020-07-20 xiaochengh Enable FontPreloadingDelaysRendering by default on trunk
2020-07-18 liaoyuke [lacros] Make linux-lacros-tester-rel Run all targets
2020-07-17 alcooper Update vr_pixeltests exceptions
2020-07-17 liaoyuke Fix win coverage config - part 3
2020-07-17 wanderview Update CacheStorageSequenceChromeOS fieldtrial testing config.

Roll third_party/googletest/ a781fe29b..e6e2d3b76 (5 commits)

a781fe29bc..e6e2d3b761

$ git log a781fe29b..e6e2d3b76 --date=short --no-merges --format='%ad %ae %s'
2020-07-28 absl-team Googletest export
2020-07-28 absl-team Googletest export
2020-07-26 ofats Googletest export
2020-07-19 jasjuang fix clang tidy modernize-use-equals-default warnings
2020-07-02 siliconearth Fix test failing when simple regex is used

Roll third_party/spirv-headers/ 308bd0742..3fdabd0da (6 commits)

308bd07424..3fdabd0da2

$ git log 308bd0742..3fdabd0da --date=short --no-merges --format='%ad %ae %s'
2020-08-03 44190824+mmerecki Reserve SPIR-V token range for upcoming Intel extensions. (#165)
2020-07-29 alanbaker Update BUILD.bazel and BUILD.gn (#166)
2020-07-29 alanbaker Publish the headers for the clspv embedded reflection non-semantic extended instruction set (#164)
2020-07-29 johnkslang Update the registry in spir-v.xml to modernize and split out opcodes. (#156)
2020-07-21 alanbaker Support SPV_KHR_terminate_invocation (#163)
2020-07-19 vkushwaha Add changes for SPV_EXT_shader_atomic_float

Roll third_party/spirv-tools/ 717e7877c..d9c73ebd9 (52 commits)

717e7877ca..d9c73ebd9e

$ git log 717e7877c..d9c73ebd9 --date=short --no-merges --format='%ad %ae %s'
2020-08-04 vasniktel spirv-fuzz: Handle capabilities during module donation (#3651)
2020-08-04 vasniktel spirv-fuzz: Refactor boilerplate in TransformationAddParameter (#3625)
2020-08-03 vasniktel spirv-fuzz: TransformationMoveInstructionDown (#3477)
2020-07-31 jaebaek Remove DebugDeclare only for target variables in ssa-rewrite (#3511)
2020-07-31 vasniktel Fix typo in ASAN CI build (#3623)
2020-07-30 stefanomil spirv-fuzz: Transformation to add loop preheader (#3599)
2020-07-30 stefanomil spirv-fuzz: Pass to replace int operands with ints of opposite signedness (#3612)
2020-07-30 jaebaek Debug info preservation in loop-unroll pass (#3548)
2020-07-30 alanbaker Validator support for non-semantic clspv reflection (#3618)
2020-07-30 vasniktel spirv-fuzz: Fix memory bugs (#3622)
2020-07-29 andreperezmaselco.developer spirv-fuzz: Implement the OpOuterProduct linear algebra case (#3617)
2020-07-30 vasniktel spirv-fuzz: Compute corollary facts from OpBitcast (#3538)
2020-07-29 dj2 Update some language usage. (#3611)
2020-07-29 vasniktel spirv-fuzz: Relax type constraints in DataSynonym facts (#3602)
2020-07-29 vasniktel spirv-fuzz: Remove non-deterministic behaviour (#3608)
2020-07-29 afdx Avoid use of 'sanity' and 'sanity check' in the code base (#3585)
2020-07-27 andreperezmaselco.developer spirv-fuzz: Add condition to make functions livesafe (#3587)
2020-07-27 rharrison Rolling 4 dependencies (#3601)
2020-07-27 andreperezmaselco.developer spirv-fuzz: Implement the OpTranspose linear algebra case (#3589)
2020-07-27 rdb Fix SyntaxWarning in Python 3.8 (#3388)
2020-07-27 bclayton CMake: Enable building with BUILD_SHARED_LIBS=1 (#3490)
2020-07-27 dneto Avoid operand type range checks (#3379)
2020-07-27 jaebaek Preserve debug info in scalar replacement pass (#3461)
2020-07-27 pierremoreau Update OpenCL capabilities validation (#3149)
2020-07-27 stevenperron build(deps): bump lodash from 4.17.15 to 4.17.19 in /tools/sva (#3596)
2020-07-27 antonikarp spirv-fuzz: adds TransformationReplaceLoadStoreWithCopyMemory (#3586)
2020-07-27 jaebaek Preserve OpenCL.DebugInfo.100 through private-to-local pass (#3571)
2020-07-27 stefanomil spirv-fuzz: Relax type checking for int contants (#3573)
2020-07-27 stefanomil spirv-fuzz: Generalise transformation access chain (#3546)
2020-07-27 stefanomil spirv-fuzz: Split blocks starting with OpPhi before trying to outline (#3581)
2020-07-27 afdx spirv-fuzz: Set message consumer in replayer when shrinking (#3591)
2020-07-24 vasniktel spirv-fuzz: Don't use default parameters (#3583)
2020-07-23 rharrison Change DEPS rolling script to point at external/ (#3584)
2020-07-23 vasniktel spirv-fuzz: Create a helper in fuzzerutil to reuse function type (#3572)
2020-07-23 vasniktel spirv-fuzz: Test usages of IdIsIrrelevant fact (#3578)
2020-07-23 antonikarp spirv-fuzz: adds TransformationReplaceCopyMemoryWithLoadStore (#3575)
2020-07-23 antonikarp spirv-fuzz: adds TransformationReplaceCopyObjectWithStoreLoad (#3567)
2020-07-22 stevenperron Start SPIRV-Tools v2020.5
2020-07-22 stevenperron Finalize SPIRV-Tools v2020.4
2020-07-22 vasniktel spirv-fuzz: Fix usages of irrelevant constants (#3566)
2020-07-22 stevenperron Update CHANGES
2020-07-22 alanbaker Support SPV_KHR_terminate_invocation (#3568)
2020-07-22 stevenperron Sink pointer instructions in merge return (#3569)
2020-07-21 greg Preserve OpenCL.DebugInfo.100 through elim-dead-code-aggressive (#3542)
2020-07-21 vasniktel spirv-fuzz: TransformationReplaceParamsWithStruct (#3455)
2020-07-21 38144211+vkushwaha-nv Add changes for SPV_EXT_shader_atomic_float (#3562)
2020-07-21 vasniktel spirv-fuzz: Use irrelevant constants (#3565)
2020-07-21 stefanomil spirv-fuzz: Extend TransformationRecordSynonymousConstants to allow composite constants (#3537)
2020-07-21 vasniktel spirv-fuzz: Add is_irrelevant parameter (#3563)
2020-07-20 vasniktel spirv-fuzz: Add IdIsIrrelevant fact (#3561)
2020-07-20 stefanomil spirv-fuzz: refactor to use RemoveAtRandomIndex (#3560)
2020-07-20 antonikarp spirv-fuzz: add TransformationAddRelaxedDecoration (#3545)

Roll tools/clang/ 6412135b3..1078c4141 (5 commits)

6412135b39..1078c4141a

$ git log 6412135b3..1078c4141 --date=short --no-merges --format='%ad %ae %s'
2020-08-02 thakis Roll clang n361601-7e8d5a90-1 : n362116-1bd7046e-2.
2020-08-01 lukasza Skip `ExprWithCleanup` AST node via `ignoringImplicit` AST matcher.
2020-07-29 hans Roll clang n359864-04b9a46c-1 : n361601-7e8d5a90-1.
2020-07-22 aeubanks Clang build.py: Open instrumented temp file as binary
2020-07-22 aeubanks Allow building Clang with ThinLTO

Created with:
  roll-dep build buildtools testing third_party/googletest third_party/gpuweb-cts third_party/spirv-headers third_party/spirv-tools tools/clang

Change-Id: I841ccb15000269ca48d09ac550bc36a06c2b354a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26280
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-08-04 17:56:27 +00:00
dan sinclair 3125a8d73f [ast] Add texture types to the AST.
This CL adds the texture types into the AST.

Bug: tint:141
Change-Id: I8e95aa23849af737e63d9cacc8c57f23aedec73d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26123
Reviewed-by: David Neto <dneto@google.com>
2020-07-30 23:26:28 +00:00
dan sinclair fe8c59ace9 Add SamplerType to AST.
This CL adds the sampler type into the AST.

Bug: tint:141
Change-Id: Id2f7678a2df677cb7dae47f05543c1e0a1999eed
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26080
Reviewed-by: David Neto <dneto@google.com>
2020-07-30 22:27:25 +00:00
dan sinclair 8278f2c6f0 [hlsl-writer] Add loop support.
This CL adds support for the LoopStatement emission in HLSL.

Bug: tint:7
Change-Id: Ie42b24abff3a69c9cbfe3d3c8ab6fb9b1823e61d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25849
Reviewed-by: David Neto <dneto@google.com>
2020-07-30 22:27:09 +00:00
dan sinclair 97bc4ad8d6 [hlsl-writer] Add if/else statements.
This CL adds if/else statement emission to the HLSL writer.

Bug: tint:7
Change-Id: Idd6e6d8c329ed270676fa0276474a68c715dd9eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25847
Reviewed-by: David Neto <dneto@google.com>
2020-07-30 22:26:55 +00:00
dan sinclair cbe0668f9b [hlsl-writer] Emit variable declarations.
This CL adds variable declarations to the HLSL backend.

Bug: tint:7
Change-Id: I5c1e42ca26029f1595bf4f23b3b867a492ddacc1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25846
Reviewed-by: David Neto <dneto@google.com>
2020-07-30 22:26:46 +00:00
Ryan Harrison b07cb63896 Add SPIR-V Reader Fuzzer
Also clean up the mess I made of the build rules, so they actually work.

BUG=tint:57

Change-Id: I9c92d043a7be8f51ed7885a29eb153f078cc66d9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26125
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-30 21:24:29 +00:00
Ryan Harrison 26479f19c7 Remove _exe suffix from sample program
BUG=tint:196

Change-Id: I4fb8fb8f00173743792914eff4427c5725bc9266
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26122
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-30 18:44:14 +00:00
Ryan Harrison 1a50cb9064 Simplify fuzzer targets to ease adding additional targets
BUG=tint:199

Change-Id: Ic42c8e5ea03f012e2be8e9bdbf46490bdc0048a9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26120
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-30 18:43:48 +00:00
dan sinclair f961850988 [hlsl-writer] Add member accessor emission.
This CL adds emitting MemberAccessorExpressions to the HLSL backend.

Bug: tint:7
Change-Id: Ic6c99232e98322c8145700d5f1a3a8314cf60feb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25844
Reviewed-by: David Neto <dneto@google.com>
2020-07-29 19:12:19 +00:00
dan sinclair 7cf1979667 [hlsl-writer] Add AsExpression to the HLSL backend.
This CL adds as casts to the HLSL backend.

Bug: tint:7
Change-Id: I599527d665a3ec1ab6cf80b4f550f7aee8fdf294
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25843
Reviewed-by: David Neto <dneto@google.com>
2020-07-29 19:11:15 +00:00
dan sinclair d450a920d5 [hlsl-writer] Add BlockStatement support.
This CL adds support for BlockStatement to the HLSL backend.

Bug: tint:7
Change-Id: I953a1b85a05cd84e8e296d677204ae9b5a3ae669
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25860
Reviewed-by: David Neto <dneto@google.com>
2020-07-29 19:06:46 +00:00
dan sinclair cda5af0fa2 [hlsl-writer] Emit discard.
This CL adds the discard statement to the HLSL writer.

Bug: tint:7, tint:166
Change-Id: I292e9b97a1246c9b79a9660ec229ff7855aeb2a9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25842
Reviewed-by: David Neto <dneto@google.com>
2020-07-29 18:56:50 +00:00
dan sinclair ec007b98c7 [hlsl-writer] Emit array accessors.
This CL adds array accessor expressions to the HLSL backend.

Bug: tint:7
Change-Id: I46d60f5d8ef74fee2a2f4da48c2d792969bfa365
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25820
Reviewed-by: David Neto <dneto@google.com>
2020-07-29 18:56:35 +00:00
dan sinclair 0e48082549 [hlsl-writer] Add alias type support.
This CL adds support for emitting type aliases to the HLSL backend.

Bug: tint:7
Change-Id: Ibd2c2d3bbe6c9a86033e379b4e1cb494259b4df2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25800
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-07-29 18:56:25 +00:00
dan sinclair 4a11b5600d [hlsl-writer] Add constructor emission.
This CL adds scalar and type constructor emission to the HLSL backend.

Bug: tint:7
Change-Id: I2b402b7eb66f266c3a111c9b07502ef17cc1a679
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25726
Reviewed-by: David Neto <dneto@google.com>
2020-07-29 18:50:18 +00:00
dan sinclair 4551a31050 Add hlsl writer tests to BUILD.gn
The check to add the HLSL tests if needed into the BUILD.gn test list
was missing. This CL adds it.

Bug: tint:7
Change-Id: I662bc49fb4f88543cfb9b3b315deb5a678d169b4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26001
Reviewed-by: Ryan Harrison <rharrison@google.com>
2020-07-29 18:50:06 +00:00
dan sinclair 8cce7cece8 [hlsl-writer] Add type emission.
This Cl adds the start of type emission to the HLSL backend.

Bug: tint:7
Change-Id: I403635080841c63382afe162ac80ae2be30b4faa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25780
Reviewed-by: David Neto <dneto@google.com>
2020-07-29 18:30:44 +00:00
Ryan Harrison 88f0ae369f Get 'gn gen --check' passing
BUG=tint:123

Change-Id: I0b13be1e0ecd4a4fa5a20160276cb9af47495410
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25862
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-28 15:59:17 +00:00
Idan Raiter e018cefdce Fix Tint ninja build
Rebasing I saw chromium style issue with auto pointers and a missing BUILD.gn file.

Change-Id: I7666595664b5eb95f681b3d2edd1d84df7d6fe63
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25848
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-28 15:04:07 +00:00
dan sinclair 0975dd5663 [spirv-writer] Add BlockStatement emission.
This CL adds BlockStatement support to the spirv-writer. The type
determiner is also updated as needed.

Bug: tint:134
Change-Id: I91e08c3acafd67401a010fff21abde7feec46e8e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25609
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-07-27 15:25:00 +00:00
dan sinclair cd182b137e [msl-writer] Emit BlockStatement.
This CL adds BlockStatement emission to the MSL backend.

Bug: tint:132
Change-Id: Ie64c02b81760787f6d8aa8833b9756ede3deddf9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25608
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-07-27 15:25:00 +00:00
dan sinclair 21f8e253a0 [wgsl-writer] Add emission of BlockStatement.
This CL adds BlockStatement writting to the WGSL writer.

Bug: tint:131
Change-Id: I6d1d286134311cea13e19c7381ed344da8205199
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25607
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-07-27 15:25:00 +00:00
dan sinclair 775cb51794 [ast] Add BlockStatement
This CL adds a BlockStatement to wrap the statements in a given block.

Bug: tint:130
Change-Id: Idc2389e001d9d87ef7f45dcd8aa90bbd27ff7dce
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25606
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-07-27 15:25:00 +00:00
dan sinclair 99ad0e8c94 [msl-writer] Emit intrinsics.
This CL adds intrinsics to the MSL backend.

Bug: tint:8, tint:159
Change-Id: I03e3c4bdf234ec4ca437ab1b1a0d4835e3342b0c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25500
Reviewed-by: David Neto <dneto@google.com>
2020-07-25 14:39:23 +00:00
dan sinclair 8f3c6356d4 Remove KillStatement
This CL removes the KillStatement from the AST and replaces all test
usage with DiscardStatement.

Bug: tint:169
Change-Id: Ie68dd3cdd54056f144d10506f05cc1f6903d1cda
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25605
Reviewed-by: David Neto <dneto@google.com>
2020-07-25 14:33:50 +00:00
dan sinclair d81bebcfcc [wgsl-writer] Add DiscardStatement support
This CL adds the DiscardStatement to the WGSL writer.

Bug: tint:165
Change-Id: I012bc030482e097fd9a957ed96f15d8360f621a5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25603
Reviewed-by: David Neto <dneto@google.com>
2020-07-25 14:33:04 +00:00
dan sinclair a9696b511f [msl-writer] Emit DiscardStatement.
This CL adds the DiscardStatement to the MSL backend.

Bug: tint:164
Change-Id: I1e201d3b6a167690af7bb799e1c93e48232f4a0a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25602
Reviewed-by: David Neto <dneto@google.com>
2020-07-25 14:32:54 +00:00
dan sinclair 6a61d4127e [spirv-writer] Add DiscardStatement support.
This CL updates the spirv-writer to emit the DiscardStatement as an
OpKill.

Bug: tint:163
Change-Id: Ic2514ee8a4ef7ef0220fc2e1145f8df0c3d32069
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25641
Reviewed-by: David Neto <dneto@google.com>
2020-07-25 14:32:44 +00:00
Ryan Harrison 433670b576 Add usage of main from chromium when part of a chromium build
BUG=tint:123

Change-Id: Ic7a8694cefd0dbee2a1855e84f4ffaaf75ad6e7a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25520
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-07-22 17:36:39 +00:00
Sarah Mashayekhi fbf4506356 [validation] Add a disabled test for assignment statement.
Bug: tint:6
Change-Id: I37fe9f69917a007b9e3325de324e719637b192e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25420
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-07-22 12:59:19 +00:00
dan sinclair a0b73e8aca [hlsl-writer] Add assignment statement.
This CL adds the assign statement emission to the HLSL backend.

Bug: tint:7
Change-Id: I3e46ac09170ea1af7444ae89267a82e1d1c42c52
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25224
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 15:58:56 +00:00
dan sinclair 41aa1a1ed8 [hlsl-writer] Add switch statement support
This CL adds emission of switch statements to the HLSL backend.

Bug: tint:7
Change-Id: Ie6f41031878a1f5a945f9310429d28fb0e4a98c8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25223
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 15:58:50 +00:00
dan sinclair 557a0f8e63 [hlsl-writer] Emit case statements.
This CL adds emission of case statements to the HLSL backend.

Bug: tint:7
Change-Id: I5d0dd7ecfe4ef032a03777c29f3d0d00e584a93a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25222
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 15:58:43 +00:00
dan sinclair 6dab73b5c6 [hlsl-writer] Emit unary operators.
This CL emits unary operators from the HLSL backend.

Bug: tint:7
Change-Id: I997d89d62d279fc7440ba6045c56e290ec7601c1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25221
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 15:58:36 +00:00
dan sinclair abfdd22acc [hlsl-writer] Emit break, return and continue.
This CL updates the HLSL writer to emit break, return and continue
statements.

Bug: tint:7
Change-Id: I03eafc343e57e9e8d1efaf930023099d6f85fc57
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25220
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 15:58:29 +00:00
dan sinclair dee9136c20 [hlsl-writer] Add binary operator emission.
Emits the binary operators.

Bug: tint:7
Change-Id: I6f4fce3b6fb646b8340e39538b041715a676ac28
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25164
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 15:58:20 +00:00
dan sinclair fbbc617888 Parse void function call.
This CL updates the WGSL parser to handle a void function call.

Fixes: tint:45
Change-Id: If5b2a4b9e62f0b10e0f2e2e10c0ca2586c5268e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25322
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-07-21 15:13:36 +00:00
dan sinclair e5228407f4 [hlsl-writer] Add emission of identifiers
This CL adds identifier emission and an HLSL namer to guard against
names using reserved words.

Bug: tint:7
Change-Id: Id3d73ff683048c26ac99451d21c3dd7ef3c620a3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25001
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 14:51:33 +00:00
dan sinclair 2e40491467 Add a call ast statement.
This CL adds CallStatement to the AST to allow wrapping a CallExpression
into a statement.

Bug: tint:45
Change-Id: I5a9525514344fcc2cf9900eb2cd78c1fb94ca2ef
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25320
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 13:42:05 +00:00
David Neto c29bad28ad [spirv-reader] Support function calls, except returning void
Functions returning void are blocked on https://crbug.com/tint/45

Change-Id: I15ec9cf0e267571bbfab921c678a59e25d0e3619
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25280
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-20 22:19:01 +00:00
dan sinclair feffa9d887 [hlsl-writer] Scaffold the HLSL backend.
This CL adds the scaffolding for the HLSL backend.

Bug: tint:7
Change-Id: Iaf9f5159bc409f3ac71fcec281229258bdfa021b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25000
Reviewed-by: David Neto <dneto@google.com>
2020-07-20 22:13:37 +00:00
dan sinclair 26c8a216e8 [msl-writer] Add import emission.
This CL adds emission of import function calls to the MSL backend.

Bug: tint:8
Change-Id: Ib8b8638b11caee2ff3557d551447b215ef2a4c69
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25262
Reviewed-by: David Neto <dneto@google.com>
2020-07-20 22:13:00 +00:00
Ryan Harrison c8af502c01 Fix issues with BUILD.gn
Couple of little style issues, and a path to a file that was incorrect.

Change-Id: I21d1a4ca41bc36163602378086989ac712f54469
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25265
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-20 19:54:23 +00:00
Ryan Harrison 31cfdb111e Clean up how deps are defined in BUILD.gn
gn gen --check is failing in chromium due to how includes are propagated
out of deps. Re-organizing them to resolve this.

Change-Id: I3c21bbb0cb8b5bc5bdad4ab97d557d718a3cdc33
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25120
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-16 20:13:16 +00:00
dan sinclair 4264af9d3d [msl-writer] Emitting of program constants.
This CL adds code to emit program constants in the MSL backend.

Bug: tint:8
Change-Id: I63e40983253349d2e293904fbe9b6f543b885b34
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24940
Reviewed-by: David Neto <dneto@google.com>
2020-07-16 17:54:26 +00:00
dan sinclair c5a5f9666f [msl-writer] Handle emitting user function calls.
This CL adds support for calling user defined functions from the MSL
backend. Intrinsics and imports are not handled yet.

Bug: tint:8
Change-Id: I45c3078d014ab89cc0eec76dd626759077e1a890
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24763
Reviewed-by: David Neto <dneto@google.com>
2020-07-14 20:37:38 +00:00
dan sinclair a2eb8c52b2 [msl-writer] Generate input/output structs
This CL adds generation of the input/output structures for entry points.

Bug: tint:8
Change-Id: I93942496bcea0a2eea944e5e1cd0baf383530f5e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24721
Reviewed-by: David Neto <dneto@google.com>
2020-07-14 20:37:20 +00:00
dan sinclair 45101598a1 [msl-writer] Add variable declarations.
This CL adds variable declarations to the MSL backend.

Bug: tint:7
Change-Id: Icf63ad44a217213e5036eb76429e25a3031822eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24540
Reviewed-by: David Neto <dneto@google.com>
2020-07-08 20:52:46 +00:00
Ryan Harrison 7b819aa162 Multiple fixes to get BUILD.gn builds working again
Change-Id: I00c8050d85e25c4e926c06b4df1381434de92f34
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24460
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-07-07 19:11:07 +00:00
dan sinclair 6002a3345f [msl-writer] Add namer class.
This CL adds a namer class to prevent collisions with builtin names in
MSL. The MSL generator has been updated to use the namer anywhere that
names are emitted.

Bug: tint:8
Change-Id: I820f226a7286be1d5b0d613bd0fa41b68cb9f8ba
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24184
Reviewed-by: David Neto <dneto@google.com>
2020-07-02 20:53:45 +00:00
dan sinclair 53b3283c6a [msl-writer] Emit switch statements.
This CL adds support for switch and case statements into the MSL writer.

Bug: tint:8
Change-Id: Ib51f943e8476c0ecfd45e9131404f96934c6e21f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24180
Reviewed-by: David Neto <dneto@google.com>
2020-06-30 21:33:20 +00:00
dan sinclair e88c0f6f8a [msl-writer] Emit loop statements.
This CL adds the code to convert a loop/continuing statement into MSL.

Bug: tint:8
Change-Id: I9fa595908c6d834d9543b583c8baf8c19f8cae6c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24122
Reviewed-by: David Neto <dneto@google.com>
2020-06-30 17:40:28 +00:00
dan sinclair 57b3b1d117 [msl-writer] Add break and continue emission.
This CL adds writting of break and continue statements to the MSL
backend.

Bug: tint:8
Change-Id: If2443c036fa82f54708d209d924192ee7a159e76
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24121
Reviewed-by: David Neto <dneto@google.com>
2020-06-29 21:17:54 +00:00
dan sinclair fa1659a3ef [msl-writer] Emit member accessors.
This CL adds emission of member accessor expressions to the MSL writer.

Bug: tint:8
Change-Id: I21d8564880c44d719c89dca2a10cd97ccb1e2cd7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24120
Reviewed-by: David Neto <dneto@google.com>
2020-06-29 21:17:44 +00:00
dan sinclair d4eafb631d [msl-writer] Emit alias types.
This CL adds emission of alias types to the MSL writer. They are output
as `typedef`s.

Bug: tint:8
Change-Id: I18b839ed0238c4636e3975f35f5d88badd412fe4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24001
Reviewed-by: David Neto <dneto@google.com>
2020-06-26 21:27:59 +00:00
dan sinclair dc841f1bf2 [msl-writer] Add array accessors.
This CL adds the code to emit array accessors from the MSL backend..

Bug: tint:8
Change-Id: Ia6b49c11602d39aa559feac31fcfd592ab54928c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24000
Reviewed-by: David Neto <dneto@google.com>
2020-06-26 21:27:59 +00:00
dan sinclair d1bf87b9d8 [msl-writer] Add unary op emission.
This CL adds emission of the unary `-` and `!` operators.

Bug: tint:8
Change-Id: I9dda066111cc8f115b593127cf070c6ca37bdc66
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23842
Reviewed-by: David Neto <dneto@google.com>
2020-06-26 21:27:59 +00:00
dan sinclair 24a46e8e69 [msl-writer] Emit kill statement.
This Cl adds emission of the Kill statement as `discard_fragment`. This
may need to be revised when the semantics of Kill are agreed upon.

Bug: tint:8
Change-Id: I2d09f09143b2acd0139d876e873e3c70abbc84a3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23841
Reviewed-by: David Neto <dneto@google.com>
2020-06-26 21:27:59 +00:00
dan sinclair 28d4a94bee [msl-writer] Add emission of if statements.
This Cl adds emission of `if`, `else if` and `else` statements to the
MSL backend.

Bug: tint:8
Change-Id: I8c22d70f2afa0a1d86cf475f5c98127504a6dc0e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23840
Reviewed-by: David Neto <dneto@google.com>
2020-06-26 21:27:59 +00:00
dan sinclair b1de84316c [msl-writer] Add cast conversion.
This CL adds conversion of casts to MSL.

Bug: tint:8
Change-Id: Iecfb9a5b413b1d10372b4d2fec31c0956b1475a0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23822
Reviewed-by: David Neto <dneto@google.com>
2020-06-26 21:27:59 +00:00
dan sinclair 3dbc8378fa [msl-writer] Add generation of as casts.
This CL adds the MSL conversion of as casts to `as_cast`.

Bug: tint:8
Change-Id: Iaa8ee1fa3077e4471bbead9d24fcf1e2d68998b0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23821
Reviewed-by: David Neto <dneto@google.com>
2020-06-26 21:27:59 +00:00
dan sinclair 6366f68121 [metal-writer] Emit constructors.
This Cl adds the code to emit scalar and type constructors from the
Metal backend.

Bug: tint:8
Change-Id: I95c713568ae3a73b82f8c9e10119e29e3469893e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23707
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 18:22:21 +00:00
dan sinclair 7f269e5bcb [metal-writer] Emit binary operations.
This CL adds emission of binary operations to the Metal backend.

Bug: tint:8
Change-Id: I797daadd238b718b081842b63ccefab3294bc20c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23706
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 18:22:05 +00:00
dan sinclair 70c605fc47 [metal-writer] Emit assignment statements.
This CL adds assignment statements to the Metal backend.

Bug: tint:8
Change-Id: Iaf4faa62124948fd0e785d5bebd20aae778ba050
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23705
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 17:54:33 +00:00
dan sinclair e66d6a6745 [metal-writer] Emit functions
This Cl adds the code to emit functions from the metal writer. Note,
this does not handle entry points yet.

Bug: tint:8
Change-Id: Ie665771169261f6839de5eb1b66dc511bf47616a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23704
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 17:54:25 +00:00
dan sinclair 646fb23c1f [metal-writer] Add identifier expression.
This CL adds the start of identifier expressions to the Metal backend.
Identifiers with paths are currently not supported.

Bug: tint:8
Change-Id: I4df8b6a3c32251d454d3dae5fa8933dad36094f8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23703
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 17:49:08 +00:00
dan sinclair 8cd87513b3 [metal-writer] Add return generation.
This CL adds generation of the return statement.

Bug: tint:8
Change-Id: Iffee600e77a485649b987d39aab47742968e438e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23702
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 17:49:00 +00:00
dan sinclair 5dd37b2e6c [metal-writer] Add basic type emission.
This CL adds the start of type emission for the Metal backend. A few
types like pointers and structs aren't complete yet.

Bug: tint:8
Change-Id: I648e9275ef1b9dc6fa63b6ab328fe018a5f620ea
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23701
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 17:48:53 +00:00
dan sinclair 2a59901483 [metal-writer] Stub out the Metal Shading Language backend.
This CL adds the basis of the Metal Shading Language backend.

Bug: tint:8
Change-Id: I85976250eb41ac12203a5db116444e993c3d09d4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23700
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 17:48:40 +00:00
David Neto fd3700c0a7 [spirv-reader] Support Undef, mapping to null
Bug: tint:3
Change-Id: I1549f0445c92312b0d20292ff9d60736300d5378
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23600
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-22 20:48:59 +00:00
dan sinclair 8b48b26f73 [spirv-writer] Add as casts.
This CL adds the conversion of `as<f32>(b)` to SPIR-V.

Bug: tint:5
Change-Id: If1e04db2fe5520940527f4dcf52a89628b11b518
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23461
Reviewed-by: David Neto <dneto@google.com>
2020-06-18 18:02:46 +00:00
Ryan Harrison b8f4930055 Make #define values public in BUILD.gn
This is needed to allow users to actually use tint/tint.h

BUG=tint:87

Change-Id: I70c9397a0497feca88ccf8879a3d0e8a03ab8471
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23260
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-16 17:26:59 +00:00
David Neto c7d1ac3361 [spirv-reader] Add OpCompositeConstruct
Bug: tint:3
Change-Id: Ibb1a4124e7e7b7a5b95bdd4e7c7e7f1c570e641c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23127
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-12 15:09:56 +00:00
David Neto 0335adbc9a [spirv-reader] First GLSL.std.450 instructions
This supports the extended instructions used by the compute_boids
example.

Bug: tint:3
Change-Id: I364c343217139e489377dd2a9330058114023caa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23126
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-12 15:09:14 +00:00
Ryan Harrison be45ff5081 Create tint.h for external users
tint.h selectively includes headers depending on what features are enabled. It
is based off of the original sample code, so should give users access to all of
the functionality demonstrated in there.

This is located in include/tint/, so that users can have a pretty include of
tint/tint.h.

BUG=tint:87

Change-Id: I8659c789c154349e4e8e7730dc334da4fb6eba70
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23124
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-11 19:35:20 +00:00
Ryan Harrison 3f3483be14 Fix BUILD.gn based builds
Change-Id: Iec5c7ee8d6f614f7a7301c023703650d4c4068d3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23061
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-10 19:45:00 +00:00
dan sinclair 3e7dc82b35 [spirv-writer] Generate any intrinsic
This CL adds the necessary code to generate an OpAny instruction.

Bug: tint:5
Change-Id: I558b2cbf4bade3b4ab17997d24dcffddc32e2b41
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22620
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:05:35 +00:00
dan sinclair 2b23e4bd70 Remove unless_stmt
The `unless` statement was removed from the WGSL grammar so remove it
from Tint.

Change-Id: I31a185f5c5e3e88b667caea1c9a88aee80c0b810
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22581
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-06-03 16:11:37 +00:00
dan sinclair 6bd7061a2e Remove conditional break/continue.
This CL removes the conditional forms of the break and continue
statements as they are no longer in the WGSL spec.

Change-Id: I46224d6cb5ce706cfc95d35ab0a4eea46abf62a9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22580
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-06-03 16:11:28 +00:00
dan sinclair e009c2058d Add IntLiteral parent for Sint and Uint literals.
This CL adds a parent class for the type types of interger literals for
the cases where we can have either.

Change-Id: I61b540bedd49a6cf5a899e6864e2ea6f140cd2be
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22541
Reviewed-by: David Neto <dneto@google.com>
2020-06-02 20:11:54 +00:00
dan sinclair c6f2947ceb Rename the IntLiteral to SintLiteral.
This Cl clarifies that IntLiteral is a signed value, which matches with
the usage of UintLiteral.

Change-Id: Ic8f0e2382cb66eb6b09daed096886dcc55e6b0f0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22540
Reviewed-by: David Neto <dneto@google.com>
2020-06-02 20:11:44 +00:00
dan sinclair 916b408111 [spirv-writer] Add switch support
This CL adds switch support to the SPIR-V writer.

Bug: tint:5
Change-Id: I8a6ad40cb2d344c87abdf842194b60afb1b4c96e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22165
Reviewed-by: David Neto <dneto@google.com>
2020-06-01 18:56:34 +00:00
dan sinclair 59fc026bcf [spirv-writer] Generate kill statements.
This Cl adds preliminary support for generating Kill commands. This may
change in the future if the semantics of kill are set in WGSL to not
match OpKill.

Bug: tint:5
Change-Id: Id466a1b26b37867a26373b93f56d627a0491f47f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22240
Reviewed-by: David Neto <dneto@google.com>
2020-06-01 13:44:43 +00:00
dan sinclair 46e959da39 Update intrinsics in the grammar.
The intrinsic methods were removed from the WGSL grammar and are treated
as builtin functions. This Cl updates Tint to match.

Bug: tint:41
Change-Id: I3f9ff6c17f1ca57ad159d883fd5a966657caeb4f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22301
Reviewed-by: David Neto <dneto@google.com>
2020-06-01 13:43:22 +00:00
dan sinclair 1d2ad81eb9 Update WGSL grammar builtins to match spec.
This CL removes the builtin_decoration from the parser in favour of
using IDENT tokens for builtins. We still convert to an enum in the
parser and validate the value provided.

Bug: tint:41
Change-Id: If5dc3844e3325c75951e7b320c123cf66cb8e106
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22300
Reviewed-by: David Neto <dneto@google.com>
2020-06-01 13:43:11 +00:00
dan sinclair 5370390096 Remove NOP.
The NOP command was added for complete SPIR-V bijectivity which is no
longer a goal of WGSL. The NOP command has been removed from the spec,
so remove from Tint.

Change-Id: Ic640d9d3b987a19668dc169ff549444921c5bbb8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22160
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-05-26 15:05:54 +00:00
Ryan Harrison 4484fe128d Add include path to public config for BUILD.gn
Needed for Dawn integration

Change-Id: I0d9958b583b26afdbd258e34a7dd1fdf788f3eeb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/21720
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-05-14 14:47:51 +00:00
Ryan Harrison 1f1f08f94a Add spvtools deps to top-level targets
Dawn has issues with building tint targets without these specified. Putting them
in public_deps doesn't resolve the linking issue.

Change-Id: Ib99f2d4a74cbb3a33c0aa9e47e5eb788ef01a7e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/21280
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-05-07 17:17:15 +00:00
dan sinclair 2287f33424 [spirv-writer] Add null initializers where needed.
The WGSL spec requires initializers for Output, Private and Function
variables. This CL adds initializers where needed.

Bug: tint:75
Change-Id: Id97f85a67ead2ffc41d6bdd1b71bf7034b04502a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20980
Reviewed-by: David Neto <dneto@google.com>
2020-05-05 14:21:19 +00:00
dan sinclair abd472e45a [spirv-writer] Add start of cast support.
This CL starts support for the cast expression. It adds the i32 to f32
conversion path.

Bug: tint:5
Change-Id: Id1eafc38592060c4b5b91964302d79a847e2edaf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20628
Reviewed-by: David Neto <dneto@google.com>
2020-05-01 19:05:55 +00:00
David Neto a92c114c1a [spirv-reader] Label control flow constructs
Label basic blocks with:
- their nearest enclosing structured control flow constructs.
- their nearest enclosing continue construct, if any
- their nearest enclosing loop construct, if any

A construct consists of a span of blocks in the computed block order.
It knows its parent construct, if any, and its nesting depth.

Bug: tint:3
Change-Id: Ia945706e8ea2435d6c40fb4e36dc2daeeb9780d0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20421
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-27 20:14:08 +00:00
Ryan Harrison d34b210e73 Add fuzzing target to BUILD.gn
TEST=Built fuzzer in local checkout of Chromium with tint integrated.
BUG=dawn:14

Change-Id: I84aacd41f893070c3af40f5e640361e177689f9e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20343
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-27 15:31:27 +00:00
dan sinclair 20077b7b87 [spirv-writer] Start accessor chain additions.
This Cl adds the code for the ArrayAccessor generation. Some of the
MemberAccessor code is included, but tests are coming in a later Cl.

Bug: tint:5
Change-Id: Id7d006ab4a82c1d31d8036d141c83d0d61f9bea5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20180
Reviewed-by: David Neto <dneto@google.com>
2020-04-22 14:07:05 +00:00
dan sinclair c9308dcb75 [spirv-writer] Generate Unary Op expression.
This CL adds the code to generate the negation and not operators.

Bug: tint:5
Change-Id: Ibb4d374586e1415a2a678e375c64ba69bbc20367
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20143
Reviewed-by: David Neto <dneto@google.com>
2020-04-22 00:24:11 +00:00
dan sinclair 21244880f8 Expression results should not be aliases.
This CL updates the expression class to set the alias value instead of
an alias as the result type.

Change-Id: If19ae394a09ba0dc76380514e53a488bbb5a7292
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20140
Reviewed-by: David Neto <dneto@google.com>
2020-04-22 00:23:49 +00:00
David Neto 9cba3e1850 [spirv-reader] Split arithmetic, bit tests
Separate them into different test files, to match SPIR-V spec sections

Bug: tint:3
Change-Id: I89fe76230740da060d57ac23870069a5483b2d7d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20043
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-21 17:44:44 +00:00
David Neto 571eea5a1a [spirv-reader] Compute basic block order
Test non-nested sequences and selections.

Bug: tint:3
Change-Id: Ibbbcd428d701d9e7d4da1682f94c2bdbef00121b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19920
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-21 17:44:44 +00:00
David Neto 89af8a23cc [spirv-reader] Add OpBitcast
Bug: tint:3
Change-Id: I51f4521edeacf9e7c4d8dbf4a1832295b1705550
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19886
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-20 21:06:43 +00:00
dan sinclair fd5d4ca16c [spirv-writer] Add preliminary support for GLSL methods
This CL adds the type determination and builder code to support
outputting the GLSL Round call.

Bug: tint:5
Change-Id: I84dadebaf19aee3361fb13b5f32ce1a9f1b0c421
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19923
Reviewed-by: David Neto <dneto@google.com>
2020-04-20 15:46:18 +00:00
dan sinclair 6866cb7677 [spirv-writer] Add initial loop support.
This CL adds the initial generation of a loop construct into the
spirv-writer. This does not support break or continue yet.

Bug: tint:5
Change-Id: I41f5d9b634a1a4120f880c4143feacc7e58e2147
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19620
Reviewed-by: David Neto <dneto@google.com>
2020-04-20 14:07:29 +00:00
Ryan Harrison 0a196c13c8 Adding support for testing BUILD.gn
BUG=tint:50

Change-Id: Ie19a1af6a97a49a67dcc7474991c960b986ddebe
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19782
Reviewed-by: David Neto <dneto@google.com>
2020-04-17 13:18:20 +00:00
Ryan Harrison 460345d993 Add support for WGSL writing to BUILD.gn
BUG=tint:49

Change-Id: I4473176d4177a719b7b2659f765b6b467ac43c84
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19682
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-15 20:54:10 +00:00
Ryan Harrison 0caab67e6e Add support for WGSL reading to BUILD.gn
BUG=tint:47

Change-Id: Ic50421f4dc712c614cf5783027ba273b53b2bd83
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19681
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-15 20:47:55 +00:00
Ryan Harrison 2b45a52cdf Add support for SPIRV writing to BUILD.gn
BUG=tint:48

Change-Id: I6b92bb372b783ad4498fdc4817d0893851b0bb90
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19680
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-15 20:37:02 +00:00
Ryan Harrison d1cf8a8ba5 Add support for SPIRV reading to BUILD.gn
BUG=dawn:16

Change-Id: I1da30fed82a310007674801e3b1e853b25d5b573
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19640
Reviewed-by: dan sinclair <dsinclair@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-04-15 20:35:38 +00:00
Corentin Wallez 797fa62b91 Remove temporary GN proxy groups.
It also changes remaining deps for internal targets
from libdawn_proc to dawn_proc.

Bug: chromium:1064305
Change-Id: I36df2b5d7793be9d6c878b6a1f2ec238603a8205
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19289
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-14 17:36:44 +00:00
dan sinclair efb5d4e10f Remove regardless.
This CL removes the regardless statement and turns `regardless` into a
reserved word.

Change-Id: I50c521111b90dbadddaeb36674e8c40205186076
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19361
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-04-14 14:46:51 +00:00
Corentin Wallez 8c8d16a1c5 BUILD.gn: Move dawn_end2end_tests to its final location
Bug: chromium:1064305
Change-Id: Ie51377301117a8ffbc6c21dc4c58349871bcf232
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19285
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-13 21:23:46 +00:00
Corentin Wallez b31015b836 Split examples, test and utils in their own BUILD.gn
The basic change was to copy-paste targets in the new BUILD.gn files and
fixup paths / add includes. There's a couple more changes that had to be
done at the same time:

 - Multiple files need to know if GLFW is supported so the variable was
moved to dawn_features.gni.
 - The gtest_and_gmock target used to abstract between Dawn's copy of
GTest/GMock is only needed by tests and was moved in src/tests/BUILD.gn.
 - A leftover dawn_end2end_tests target is left in the main BUILD.gn
file that is an exact copy of the on in src/tests/BUILD.gn. This is
because the GN path is hardcoded in Chromium's isolate_map.pyl that also
can't support GN groups. The only way to move a target I could figure
out was to duplicate it temporarily.

Bug: chromium:1064305
Change-Id: I96820e9d6510b8c9b9112c3e6cd8df2413f04287
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19201
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-10 08:20:10 +00:00
Brandon Jones ab2c84ffd2 Residency 6: Enable D3D12 Residency and Add Tests
Toggles on D3D12 residency management by default. Adds basic residency
tests.

Bug: dawn:193
Change-Id: Idafa4a6d0f8f4052fb3428ac3d5f6be018db68cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16385
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
2020-04-09 23:31:02 +00:00
Ryan Harrison 4d32be4f1b Remove suppressing [chromium-style] errors
Lots of little style nits needed to be fixed for this work.

BUG=tint:44

Change-Id: Ibb45d9e3f6795ee0c09f5eca994bb28e20979d97
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19221
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-09 18:52:06 +00:00
Corentin Wallez 0074b6e710 Remove temporary GN groups after Chromium fix
Bug: chromium:1064305
Change-Id: I8e169de411500c4b618c0a91bb0d8fd0ffb490d5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19180
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-09 17:27:40 +00:00
Ryan Harrison 2962888b8c Add in basic BUILD.gn and additional DEPS
This is a minimal config that gets us building the tint binary from samples/

BUG=tint:2

Change-Id: Ifafa903e99a34f1c47177eb954df69ecbe70cb36
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19106
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-08 20:40:25 +00:00
Corentin Wallez 7dbfc91d30 Fix Dawn's proxy groups to use public_deps instead of deps
To do perfect forwarding of GN targets, the proper method is to make a
group with public_deps. For example in the following:

 - Config C
 - Target T with a public_deps including C
 - Group G that proxies B
 - Target T2 that depends on G

If G uses deps = [ T ] then T2 won't see C, whereas if G uses
public_deps = [ T ] then T2 will dep on T, which will make it dep on C.

Bug: chromium:1064305
Change-Id: Iae236150c119b1a4003b957dcacf42e7759a936c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18965
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-07 16:16:37 +00:00
Corentin Wallez 2d10e954ce BUILD.gn: rename libdawn_native/wire to dawn_native/wire
This helps take advantage of the GN feature where when a directory is
used as a target name, like //foo/bar/baz, the //foo/bar/baz:baz target
is used automatically.

Bug: chromium:1064305
Change-Id: I2e2d9f308fda1b811482026962ab0770ac45e988
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18862
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-04-07 07:44:00 +00:00
Corentin Wallez 5c2d2e7ff8 Split dawn_(native|wire|platform) to their own BUILD.gn files
This will help external projects that want to use Dawn, like Skia, refer
to GN targets without GN discovering Dawn's main BUILD.gn file that
causes all the tests and third_party dependencies to be discovered.

This CL just splits off chunks of BUILD.gn into separate file, adds
necessary includes and fixes up GN paths. It also introduces temporary
groups for targets that are used in Chromium so that the paths can be
fixed in a 3-way patch.

Bug: chromium:1064305

Change-Id: Ib4b73bd8d3121ef67d4ecee2e54ec158875f2117
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-04-07 07:29:45 +00:00
Bryan Bernhart cb859a2037 Reland "D3D12: Stage BindGroups on CPU descriptor heaps."
This reverts commit c7f454c241
and relands commit 2479860e4b.

> D3D12: Stage BindGroups on CPU descriptor heaps.
>
> Instead of directly populating GPU heaps, pre-encoded
> BindGroups are staged on CPU heaps then copied over
> to the GPU. Non-shader visible allocators are stored
> on the BGL, which hands out fixed-size chunks to
> simplify memory managment. To enable memory re-use,
> CPU allocations are tied to the lifetime of BindGroup
> objects.

Reason for revert: We can reland this CL now that the CTS suppression merged.

Note: Adds validation to ensure binding size > 0.

Bug: dawn:155
Bug: dawn:375
Change-Id: I75b9773bbb7c70bcea803a7ad8b6480d21ea90f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18904
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-04-06 22:07:42 +00:00
Corentin Wallez c7f454c241 Revert "D3D12: Stage BindGroups on CPU descriptor heaps."
This reverts commit 2479860e4b.

Reason for revert: Causes WebGPU CTS failures

Original change's description:
> D3D12: Stage BindGroups on CPU descriptor heaps.
> 
> Instead of directly populating GPU heaps, pre-encoded
> BindGroups are staged on CPU heaps then copied over
> to the GPU. Non-shader visible allocators are stored
> on the BGL, which hands out fixed-size chunks to
> simplify memory managment. To enable memory re-use,
> CPU allocations are tied to the lifetime of BindGroup
> objects.
> 
> BUG=dawn:155
> 
> Change-Id: I402e6686c96f7450a077c627c8499600979e426c
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18100
> Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,enga@chromium.org,rafael.cintron@microsoft.com,bryan.bernhart@intel.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:155
Change-Id: I3dfae3e15e2bc21de692513725c9cf3ca38110b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18860
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-06 08:16:31 +00:00
Austin Eng 76a8d0b92f Support chained extension structs on the wire
This CL also adds a couple of dummy extensions in dawn.json so that
the serialization/deserialization in the wire can be tested.

Bug: dawn:369
Change-Id: I5ec3853c286f45d9b04e8bf9d04ebd9176dc917b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18520
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-04-03 17:37:48 +00:00
Bryan Bernhart 2479860e4b D3D12: Stage BindGroups on CPU descriptor heaps.
Instead of directly populating GPU heaps, pre-encoded
BindGroups are staged on CPU heaps then copied over
to the GPU. Non-shader visible allocators are stored
on the BGL, which hands out fixed-size chunks to
simplify memory managment. To enable memory re-use,
CPU allocations are tied to the lifetime of BindGroup
objects.

BUG=dawn:155

Change-Id: I402e6686c96f7450a077c627c8499600979e426c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18100
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-04-03 16:52:28 +00:00
Austin Eng 06508118eb Merge BindGroupLayout and ShaderModule BindingInfos
This moves BindGroupLayoutBase::BindingInfo into the dawn_native
namespace and changes ShaderModule::BindingInfo to extend it with
SPIR-V ids.

Bug: dawn:354
Change-Id: I6a2187e94c0200bee729cf8290f74e4f8c648334
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17920
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-27 18:54:03 +00:00
Yunchao He 3665d28e6e Add validation tests for resource usage tracking
This change mainly does a code refactoring. It moves resource tracking
tests from CommandBufferValidationTests.cpp to a separate test file.

It also adds a few tests, like copy dst/src doesn't impact resources
used in render/compute pass.

More tests about resource usage tracking will be added into this
separate test file.

Bug: dawn:359

Change-Id: I29d9b87b8de9a07b39ee1087e9f6a53ad10fe8fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2020-03-27 15:52:50 +00:00
Corentin Wallez 11652ff8f8 Implement the webgpu.h swapchains on Metal
The webgpu.h surface-based swapchains are implement on Metal which
required adding the present mode to NewSwapChainBase.

Additional automated tests are added which require getting the Instance
so a new getter is added to DawnTest. Additional some the state tracking
of swapchains is performed in the backend, so the
SwapChainValidationTests are turned into regular DawnTests so they can
check backends do the correct state tracking. To not lose coverage of
the Null backend, a NullBackend() DawnTestParam factory is added.

Finally swapchains cannot be entirely tested in an automated fashion, so
a new example is added called "ManualSwapChainTests" that allows
manually checking a number of properties. Documentation of the controls
and a manual test plan is in a comment at the top of the example's
source.

Bug: dawn:269

Change-Id: If62fffc29a6cefdbec62747d01c523e2a5475715
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17181
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-20 17:07:20 +00:00
Brandon Jones 1f0596818d Residency 4: Add Facilities For Budgeting Device Memory
Use D3D12's QueryDeviceVideoMemoryInfo to get the OS-determined process
budget. Also introduces an export for reserving some amount of process
memory - which keeps Dawn from using the entire process's budget.

Bug: dawn:193
Change-Id: I6c17bd703d7cb24759bcee89c03add46944fec8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16383
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-17 13:47:57 +00:00
Jiawei Shao 971a6233c2 Validate the declaration of storage texture format in shader
This patch adds the validation on the storage texture format declared in
shaders when we create a rendering or compute pipeline with read-only or
write-only storage textures.

This patch also fixes a typo in the TextureValidationTest.

BUG=dawn:267
TEST=dawn_unittests

Change-Id: Id302b4b7803d7e03b57c61de1290cc71ba940e2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16940
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-17 10:28:07 +00:00
Jiawei Shao 1a56ce54e0 Validate creating bind group layout with storage textures
This patch adds the validation on the creation of the bind group
layout with read-only storage texture, write-only storage texture
and read-write storage texture. Currently read-write storage textures
are not supported in any shader stages.

This patch also fixes chromium:1061156.

BUG=chromium:1061156, dawn:267
TEST=dawn_unittests, dawn_end2end_tests

Change-Id: Ib42678719df48565a46e39f21c34ec640960dcdc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-16 10:53:36 +00:00
Austin Eng 463c394905 Slab-allocate OpenGL bind groups
Now that all backends use slab-allocated bind groups, this patch also
moves the BindGroup implementation with owned-data into the Null backend.

Bug: dawn:340
Change-Id: I08a952075b382008fb82f1fbab3f779cc05bc2a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16747
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-03-13 23:51:50 +00:00
Austin Eng 459c2f930f Slab-allocate Metal bind groups
Bug: dawn:340
Change-Id: I6185e41d9c71c49953a4de91e5f3042968679fd6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15862
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-03-13 22:50:00 +00:00
Jiawei Shao 421684f943 Support Storage Textures as Valid Binding Types
This patch adds the basic validation of read-only storage texture,
write-only storage texture and read-write storage texture as new
binding types with no bind group layout provided in the creation of
pipeline state objects.

- Read-only storage textures can be used in vertex, fragment and
  compute shaders.
- Write-only storage textures can only be used in compute shaders
  due to the limitation on Metal.
- Read-write storage textures are not allowed now and they are
  reserved to be supported as an extension in the future.

BUG=dawn:267
TEST=dawn_unittests

Change-Id: Iffc432f29a855b85d59451cb3c50269e03b84627
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16661
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-03-11 01:28:48 +00:00
Brandon Jones 2de34c1791 Residency 1: Add Chromium's LinkedList to /common/
A Chromium's LinkedList class to Dawn. Implementation and header are
a direct copy/paste. This is to be used to implement an LRU Cache
for the ResidencyManager class.

Bug: dawn:193
Change-Id: I7cb02649590be4db0fe54c9d80557ac49efc34de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16380
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-03-05 09:54:06 +00:00
Austin Eng e5534c4419 Add SlabAllocator and tests
Bug: dawn:340
Change-Id: I6fa1948261e8e6f91324464dade3e9954bd833e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15861
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-03-04 17:48:24 +00:00
Bryan Bernhart 0363c3e46d D3D12: Allocate GPU bind groups at draw/dispatch.
Instead of counting descriptors to be allocated for the entire command
buffer in a pre-pass, the bindgroup state tracker is used to allocate
only dirty bindgroups upon recording draw/dispatch. If the heap has no
more room and must be changed, bindgroups will be re-created according
to the BGL.

A future change will address the CPU descriptors and removal of the
pre-pass.

BUG=dawn:256,dawn:307

Change-Id: I6603de17cfda713bd4512c46e1c93618ca01bb7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13400
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-02-27 01:14:22 +00:00
Brian Ho f949a10e51 Reland "Create VulkanImageWrappingTests for dma-buf images"
This relands commit 0bbfec1f7f which
was reverted in 21e5074dcd.

The original CL broke the Chromium roll because drm/drm_fourcc.h
could not be found. Still not sure why this is the case since it
seems to be present on all of my CrOS test machines, but at the end
of the day, I realized that I don't even need this header in the
first place.

This CL removes the header and relands the rest of the original CL.

Bug: chromium:996470
Change-Id: I77d6b1692094b7798f3c5d9c2b50219e674c8a8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16060
Commit-Queue: Brian Ho <hob@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-02-20 19:19:13 +00:00
Corentin Wallez 21e5074dcd Revert "Create VulkanImageWrappingTests for dma-buf images"
This reverts commit 0bbfec1f7f.

Reason for revert: Makes the roll into Chromium fail with the following:

    [314/21578] CXX obj/third_party/dawn/dawn_white_box_tests_sources/VulkanImageWrappingTestsDmaBuf.o
    FAILED: obj/third_party/dawn/dawn_white_box_tests_sources/VulkanImageWrappingTestsDmaBuf.o
    ../../build/toolchain/clang_code_coverage_wrapper.py --target-os=chromeos --files-to-instrument=../....(too long)
    ../../third_party/dawn/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp:28:10: fatal error: 'drm/drm_fourcc.h' file not found
    #include <drm/drm_fourcc.h>
    ^~~~~~~~~~~~~~~~~~
    1 error generated.

Original change's description:
> Create VulkanImageWrappingTests for dma-buf images
> 
> This CL branches the existing VulkanImageWrappingTests to separate
> tests for OpaqueFD-backed amd DmaBuf-backed external images. On
> Chrome OS of Dawn, we no longer interop using opaque FDs, so these
> tests were failing in the end2end test suite.
> 
> The new VulkanImageWrappingTestsDmaBuf tests are essentially 1:1
> mappings of their counterparts in the Opaque FD version. The only
> difference is that we allocate memory directly on the device using
> GBM instead of creating a VkImage (which will likely call some GBM
> methods under the hood) and then extracting the FD using a Vulkan
> extension. We then communicate this to Dawn via the DmaBuf
> ExternalImageDescriptor.
> 
> Also, this fixes VulkanImageWrappingUsageTests::LargeImage on AMD
> devices (assuming the extension is implemented) as we can now
> specify DRM modifiers.
> 
> Bug: chromium:996470
> Change-Id: I2b3c57d7f5ff14131d415e99a09d32d2f16b3e54
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15800
> Commit-Queue: Brian Ho <hob@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>

TBR=cwallez@chromium.org,enga@chromium.org,hob@chromium.org

Change-Id: Idb45586c608ce20432142834a4f14d42c76d3b3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:996470
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16001
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-19 12:35:51 +00:00
Brian Ho 0bbfec1f7f Create VulkanImageWrappingTests for dma-buf images
This CL branches the existing VulkanImageWrappingTests to separate
tests for OpaqueFD-backed amd DmaBuf-backed external images. On
Chrome OS of Dawn, we no longer interop using opaque FDs, so these
tests were failing in the end2end test suite.

The new VulkanImageWrappingTestsDmaBuf tests are essentially 1:1
mappings of their counterparts in the Opaque FD version. The only
difference is that we allocate memory directly on the device using
GBM instead of creating a VkImage (which will likely call some GBM
methods under the hood) and then extracting the FD using a Vulkan
extension. We then communicate this to Dawn via the DmaBuf
ExternalImageDescriptor.

Also, this fixes VulkanImageWrappingUsageTests::LargeImage on AMD
devices (assuming the extension is implemented) as we can now
specify DRM modifiers.

Bug: chromium:996470
Change-Id: I2b3c57d7f5ff14131d415e99a09d32d2f16b3e54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15800
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-02-18 20:57:36 +00:00
Kai Ninomiya 47b15048a1 Revert "Use libshaderc_spvc as a source_set, so complete_static_lib applies properly"
This reverts commit 97c3be2699.

Reason for revert: Breaks linking on MSVC

Original change's description:
> Use libshaderc_spvc as a source_set, so complete_static_lib applies properly
> 
> Brings the list of dependencies for a standalone Dawn app down from:
> 
>   obj/libdawn_native.a
>   obj/libdawn_utils.a
>   obj/src/dawn/libdawn_proc.a
>   obj/third_party/shaderc/libshaderc_spvc/spvc.o
>   obj/third_party/shaderc/libshaderc_spvc/spvc_private.o
>   obj/third_party/shaderc/libshaderc_spvc/spvcir_pass.o
>   obj/third_party/SPIRV-Tools/libspvtools_opt.a
> 
> to
> 
>   obj/libdawn_native.a
>   obj/src/dawn/libdawn_proc.a
> 
> Bug: dawn:327
> Change-Id: I74654b304a9cb5f2aff19e72aa6a8bf1eb708c15
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15481
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
> Commit-Queue: Kai Ninomiya <kainino@chromium.org>

TBR=kainino@chromium.org,rharrison@chromium.org

Change-Id: Ib6d17eccebf371b71e74f1857b50bb3cfd67595a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:327
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15722
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-02-04 02:48:43 +00:00
Kai Ninomiya 97c3be2699 Use libshaderc_spvc as a source_set, so complete_static_lib applies properly
Brings the list of dependencies for a standalone Dawn app down from:

  obj/libdawn_native.a
  obj/libdawn_utils.a
  obj/src/dawn/libdawn_proc.a
  obj/third_party/shaderc/libshaderc_spvc/spvc.o
  obj/third_party/shaderc/libshaderc_spvc/spvc_private.o
  obj/third_party/shaderc/libshaderc_spvc/spvcir_pass.o
  obj/third_party/SPIRV-Tools/libspvtools_opt.a

to

  obj/libdawn_native.a
  obj/src/dawn/libdawn_proc.a

Bug: dawn:327
Change-Id: I74654b304a9cb5f2aff19e72aa6a8bf1eb708c15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15481
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-02-03 18:55:44 +00:00
Corentin Wallez d87e676845 Add the webgpu.h swapchain creation path
This commit changes wgpu::Device::CreateSwapChain to take an additional
wgpu::Surface argument. Passing nullptr is enough to stay on the
previous swapchain implementation, until the new one is ready.

In order to support both the "old" implementation-based swapchains and
the "new" surface-based swapchains. SwapChainBase is now split into
three abstract classes:

 - SwapChainBase that has a virtual method for each of the
wgpu::SwapChain methods.
 - OldSwapChainBase that corresponds to the implementation-based
swapchains.
 - NewSwapChainBase that will contain the surface-based swapchain
implementation and will eventually just be renamed to SwapChainBase.

The interaction of the surface-based swapchains with the Surface objects
aren't implemented yet, neither are the swapchain methods. Only creation
works.

Validation tests for surface-based swapchain creation are added in the
end2end test target because they need to create OS windows.

Bug: dawn:269

Change-Id: I7e07d6c666479867b9a16d7b1b8c181d5dbd69a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15281
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-01-23 17:20:38 +00:00
Austin Eng 636e6cee4f Directly load Swiftshader if no Vulkan driver is available
This may be a short term solution before linking our own version
of the Vulkan Loader.

Bug: dawn:283
Change-Id: Ifeddeaa5170bccc912c61059071a83c2b5fd9524
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15121
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-16 00:34:30 +00:00
Natasha Lee 0ecc48ecb7 Handle DeviceLost error
Handle DeviceLostCallback once DeviceLost error occurs.
Disallow any other commands or actions on device to happen after device
has been lost.

Bug: dawn:68
Change-Id: Icbbbadf278cae5e6213050d00439118789c863dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12801
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-01-15 19:02:13 +00:00
Austin Eng 0c66bcd13a Reland "Metal: Add CommandRecordingContext"
This is a reland of 2b3975f808

The previous CL failed to retain autoreleased ObjC objects which
should live longer than the autoreleasepool block. This reland fixes
the issue and adds tests for it.

Original change's description:
> Metal: Add CommandRecordingContext
>
> Introduces the idea of a CommandRecordingContext to the Metal backend,
> similar to other backends. This is a class to track which Metal encoder
> is open on the device-global pending MTLCommandBuffer.
> It will be needed to open/close encoders for lazy clearing.
>
> Bug: dawn:145
> Change-Id: Ief6b71a079d73943677d2b61382d1c36b88a4f87
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14780
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

Bug: dawn:145
Change-Id: I67494b35225ce8f6443a3fa9787d054522e5d422
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15042
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-01-15 18:22:53 +00:00
Corentin Wallez 3a1746e71c Introduce wgpu::Surface and implement it for HWND, X11 and Metal
This is another step to implement webgpu.h swapchains, Surface is
essentially a union type of all the types of windows that can be used to
create swapchains.

Changes to allow implementing wgpu::Surface and test its creation are:

 - Add GLFWUtils.cpp/.h/_metal.mm  that contains helpers used to use
WebGPU with GLFW. This deprecates BackendBinding.h that will be removed
when the NXT swapchain is removed.
 - Add a `dawn_use_x11` GN variable to factor all the places in BUILD.gn
where we checked whether we should use X11.
 - Add a `supports_glfw_for_windowing` GN variable in the main BUILD.gn
file to control which configuration tests and samples using GLFW can be
built.
 - Add a ObjCUtils.h to contain some ObjC functionality that we'd need
in files that otherwise would be C++ (so that they can be compiled on
all platforms).

Bug: dawn:269

Change-Id: I25548142a1d1d1f05b0f4d71aa3bdc4698d19622
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15081
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-01-15 13:14:12 +00:00
Corentin Wallez 15c442e941 Revert "Metal: Add CommandRecordingContext"
This reverts commit 2b3975f808.

Reason for revert: causes the failure in crbug.com/1041358

Original change's description:
> Metal: Add CommandRecordingContext
>
> Introduces the idea of a CommandRecordingContext to the Metal backend,
> similar to other backends. This is a class to track which Metal encoder
> is open on the device-global pending MTLCommandBuffer.
> It will be needed to open/close encoders for lazy clearing.
>
> Bug: dawn:145
> Change-Id: Ief6b71a079d73943677d2b61382d1c36b88a4f87
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14780
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:145
Bug: chromium:1041358
Change-Id: I05c76cd96f723230d05cff65127dc8513d5e03c5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15060
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-01-13 13:47:01 +00:00
Rafael Cintron 69c68d01b2 Improve Memory Management of Result class
The way in which the Result class is used in Dawn can be fragile
with respect to memory management because the caller of AcquireError
must know they need to delete the returned pointer or a memory leak
will occur. We've had a couple of instances where developers have
accidentally left out the delete call and managed to get past code
review.

This CL changes the Result class so that it assumes the error is
allocated on the heap and forces the caller to use unique_ptr when
calling AcquireError.

Bug:dawn:320
Change-Id: I13ec953b0c37eaafbd6ce93c2f719b4743676acb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14960
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
2020-01-10 17:58:28 +00:00
Austin Eng 2b3975f808 Metal: Add CommandRecordingContext
Introduces the idea of a CommandRecordingContext to the Metal backend,
similar to other backends. This is a class to track which Metal encoder
is open on the device-global pending MTLCommandBuffer.
It will be needed to open/close encoders for lazy clearing.

Bug: dawn:145
Change-Id: Ief6b71a079d73943677d2b61382d1c36b88a4f87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14780
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-08 17:01:07 +00:00
Austin Eng 470921fe46 Reland "fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer"
This is a reland of f58f69f66b

The whitebox dawn_end2end_tests are updated to link statically against
libdawn_native. This is required because the test link against and use
libdawn_native as sources. It is an error with MSVC to both import and
export symbols from libdawn_native.

Original change's description:
> fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer
>
> This option will be used by backends that support error injection so
> that errors can be injected into a "clean" corpus to generate a seed
> corpus with good examples of injected error conditions.
>
> Bug: dawn:295
> Change-Id: I837acdde6dd4274adb56edf8e4307427f8d6333b
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14681
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

Bug: dawn:295
Change-Id: Ifa092d28aa7ac57cfb197aa4daeb8408f8036d4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14820
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-06 19:56:17 +00:00
Austin Eng 2cb76ab598 perf_tests: Manually serialize JSON and remove dependency on jsoncpp
jsoncpp causes some flaky failures because of inconsistencies in nested
DEPS. We barely use it for JSON serialization so the simplest solution
is to just manually write the serialization for perf test tracing data.

Bug: dawn:208
Change-Id: Ie5e4b5436e2c9e32e6817d64c6e95c774cb8751f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-12-20 19:39:10 +00:00
Austin Eng 6ea362cae0 fuzzing: Add error injection macros to the Vulkan backend
This will enable fuzzing the Vulkan backend with randomly injected
errors to help ensure the backend properly handles all errors. It also
redefines VkResult in the dawn_native::vulkan namespace such that a
VkResult cannot be used unless it is explicitly wrapped.

Bug: dawn:295
Change-Id: I3ab2f98702a67a61afe06315658a9ab76ed4ccc3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14520
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-12-17 00:47:40 +00:00
Sarah Mashayekhi af094e6a88 Adding SPVC fuzzers
Change-Id: I9dc598f7d929595d674b5a5916e5b00e46e85559
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14502
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
2019-12-11 19:03:01 +00:00
Corentin Wallez 280b96ea8d Re-enable -Wunguarded-availability in Dawn standalone builds
By bumping the min macOS SDK version for standalone Dawn builds we are
able to re-introduce -Wunguarded-availability, which will help prevent
usage of Metal APIs without correctly checking for their availability.

BUG=

Change-Id: Iebf2f64e9f68e2a7a90fc6f3f208967f952f3487
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11400
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-12-11 16:54:51 +00:00
Ryan Harrison be5c135672 Refactor code to have rudimentary support for using SPVC
This is the first step for having a fully operational SPVC usage
path. This version of SPVC integration uses SPVC for setting up the
options to the compiler, but a lot of the actual interaction with
spirv-cross is done in Dawn, just via SPVC's compiler object.

Future CLs will migrate more of the spirv-cross interaction to using
the SPVC API, eventually removing the need for Dawn to know about
spirv-cross.

BUG=dawn:288

Change-Id: I68e0773f910d7fe967235b6987b3debe1d13883f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14143
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-12-03 20:25:13 +00:00
Ryan Harrison 0625ae2167 Add runtime toggle for using SPVC
This will be used in the future to choose between Dawn directly
accessing spirv-cross, and using spvc to mediate that interation.

This also adds in the spvc library as a dependency. This is what cause
the rollback last time, but that issue should be resolved.

BUG=dawn:281

Change-Id: Ic0b02d136ca05e2fa71844ebc85586b8866d5712
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14122
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-28 18:12:35 +00:00
Ryan Harrison 22e73a5b28 Use spvc's rules for spirv-cross
Switch over to using the rule for building spirv-cross from spvc. This
allows GN to avoid double symbol issues in future patches.

Roll third_party/shaderc/ 1d6155d86..30f0559dd (2 commits)

1d6155d867..30f0559dd2

$ git log 1d6155d86..30f0559dd --date=short --no-merges --format='%ad %ae %s'
2019-11-27 rharrison Remove spvc's dependency on shaderc's util library (#914)
2019-11-27 rharrison Clean up how include dirs are propegated for spirv_cross (#912)

Created with:
  roll-dep third_party/shaderc

BUG=dawn:281

Change-Id: I49cf237dcab884e84180f83cbbb21acfa549fe61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14121
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-28 17:14:55 +00:00
Ryan Harrison 00b1e38f3b Re-enable spirv-cross fuzzers
Roll third_party/shaderc/ 24536bdd3..1d6155d86 (1 commit)

24536bdd3c..1d6155d867

$ git log 24536bdd3..1d6155d86 --date=short --no-merges --format='%ad %ae %s'
2019-11-27 rharrison Moving spirv-cross dep from Dawn into shaderc (#911)

Created with:
  roll-dep third_party/shaderc

BUG=dawn:285

Change-Id: I47d202166f9e34c88e7aad75d6a3c8aa9a7d6499
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14120
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-27 20:56:14 +00:00
Corentin Wallez 74cebd6879 Allow using swiftshader with the Vulkan backend
This adds swiftshader as a dependency of Dawn, and when it is present
dawn_use_swiftshader=true will force usage of it. (due to a Vulkan
loader limitation we can't have both regular drivers and swiftshader in
the same VkInstance).

BUG=dawn:283

Change-Id: Ib94f4dcca652eb380e994f007cdcfb145b1a5102
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13440
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-11-26 18:21:51 +00:00
Ryan Harrison 80d71ecd12 Remove build rules for spvc support & spirv-cross fuzzers
Disabling this while refactoring how dependencies are set up to avoid
breaking various builds and rolls.

BUG=dawn:285

Change-Id: Iaca2614fb73277a1ea850f90a487693cd4c54fcb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14040
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-26 17:42:51 +00:00
Austin Eng f6eb890f4c Implement getBindGroupLayout
This patch makes the |layout| member of the Render|ComputePipelineDescriptor
optional. If it is not provided, a default layout is created from the
ShaderModules provided and used to replace the layout in the descriptor.

Then, pipeline.GetBindGroupLayout may be called to get the existing, or
the computed bind group layout. If no bind group layout exists at the
provided index, an empty bind group layout is returned.

Bug: dawn:276
Change-Id: I276ed0296a2f1f2d8131fa906a4aefe85d75b3a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13741
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
2019-11-22 17:02:22 +00:00
Ryan Harrison 48bf745b96 Revert "Convert spvc build flag to a runtime toggle"
This reverts commit 1954436fe2.

Reason for revert:
The shaderc side of this multi-patch brings in a dependency on glslang, which uses a static initializer, which chromium doesn't like.

Original change's description:
> Convert spvc build flag to a runtime toggle
> 
> Also moves some of the spirv_cross code into the main library that was
> feature guarded, since spvc requires it.
> 
> BUG=dawn:281
> 
> Change-Id: I482d1d5a5c851956d3815bad90665c52a1ea15bb
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13860
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,rharrison@chromium.org

Change-Id: Ia9a025fb4440c96874d1b45776a9f97023ca591d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:281
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13941
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-21 20:31:05 +00:00
Ryan Harrison 1954436fe2 Convert spvc build flag to a runtime toggle
Also moves some of the spirv_cross code into the main library that was
feature guarded, since spvc requires it.

BUG=dawn:281

Change-Id: I482d1d5a5c851956d3815bad90665c52a1ea15bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13860
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-21 18:08:15 +00:00
Brian Ho 899c17090f Implement a dma-buf MemoryService
This CL implements the MemoryService for importing memory and
creating VkImages from a dma-buf handle. Under the hood, it uses the
VK_EXT_external_memory_dma_buf and
VK_EXT_image_drm_format_modifier extensions to find a memory type
that supports dma-buf import. In addition, the extensions are also
used to properly specify the stride and tiling of the dma-buf to
vkAllocateMemory and vkCreateImage.

BUG=chromium:996470

Change-Id: Ie72d73117a4cbafcb40468aab0952b783351d499
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13785
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-21 16:02:10 +00:00
Ryan Harrison 8f3dc5836b Add in flag for using spvc instead of direct spriv-cross access
Currently does nothing interesting, future CLs will flesh out the
functionality.

BUG=dawn:281

Change-Id: I89750a45ff5a42a13e1494cafd433bb7ef719b10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13841
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-20 18:10:11 +00:00
Corentin Wallez 54e5072f5b BUILD.gn: Only build dawn_bindings in standalone
The BackendBinding that implement correct interactions between Dawn and
GLFW windows is only needed when compiling the Dawn samples. This only
happen in standalone so move the dawn_bindings there.

This fixes an issue where the ChromeOS build would discover the Dawn
BUILD.gn file and try to build dawn_bindings that depended on a fake
GLFW target, making the GLFW #includes fail.

With dawn_binding moved in dawn_standalone, all targets discoverable by
a Chromium build that use GLFW do so behind the dawn_enable_opengl flag,
which is always false on ChromeOS.

Also reverts https://dawn-review.googlesource.com/c/dawn/+/13620 because
we want to allow building dawn_end2end_tests on ChromeOS even if the
browser doesn't use_dawn.

BUG=1025326

Change-Id: I8ab965c5da68ca422912b21f87f65e32e789ee8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13820
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brian Ho <hob@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-11-19 18:58:50 +00:00
Yunchao He 612a63abe1 Add memory synchronization tests - storage to uniform sync
This CL adds end2end tests for memory synchronization tests for buffer.
It adds a few tests that write into storage buffer in compute pass,
then read via uniform binding from the same buffer in render pass.

BUG=dawn:275

Change-Id: Ic98a10aab4cdcddecd60662438d4b8bdd34fafbc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13580
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-18 04:28:24 +00:00
Elly Fong-Jones 9b67273de9 build: assert use_dawn
This will help flush out future errors where targets depend on this
target in configs where it won't build or isn't used.

Bug: None
Change-Id: Iebfc6b9afbd9b4fd9616d87bcaf8cd83a2163777
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13620
Commit-Queue: Elly Fong-Jones <ellyjones@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-14 17:07:05 +00:00
Brandon Jones 700cfe7664 Implement D3D12 Native Render Passes
Uses D3D12 native render pass API when possible. On pre-RS5 builds of
Windows, Dawn will fall back to a software emulated render pass. A
toggle was added to provide test coverage to the emulated render pass
implementation and used in tests that test render pass functionality in
particular.

Bug: dawn:36
Change-Id: I297a3ec7655b68d28204db2d3ab78cb82bb4e7a5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13082
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
2019-11-12 18:14:21 +00:00
Kai Ninomiya ae1f25fee8 Update naming for vertex state
- VertexInputDescriptor -> VertexStateDescriptor
- VertexBufferDescriptor -> VertexBufferLayoutDescriptor
- VertexBufferDescriptor.stride -> .arrayStride
- VertexAttributeDescriptor.offset no longer optional

gpuweb PR: https://github.com/gpuweb/gpuweb/pull/469

Bug: dawn:22
Change-Id: I5431df4ba22cfbdb1bc81e6709e562cd736892a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13100
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-07 22:23:29 +00:00
Li, Hao 0e1bef3251 Add Vulkan validation layers on Windows
Deploy self-built Vulkan validation layers instead of system installed
one. And it will reuse third_party/angle's Vulkan validation layers if
building with chromium.

Bug: dawn:150
Change-Id: I94e26f7a152fb2a1c39bcb102d60024f4d65eee6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11120
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-07 12:13:27 +00:00
Bryan Bernhart 2cdf132c0f Support for small resource placement.
Enables use of 4KB resource alignments where permitted.
This saves heap memory (4KB vs 64KB per allocation) and improves re-use.

BUG=dawn:27

Change-Id: I7a0a30252f480db2d0fa7f5d949207a56e3aa2e9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12900
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-05 19:34:45 +00:00
Corentin Wallez 0558f99119 Vulkan: Reuse descriptor pools
This changes puts descriptor pools in the BindGroupLayout so that they
can be reused between descriptors with the same layout.

This makes the DrawCallPerf.Run/Vulkan_NoReuseBindGroups benchmark go
from 1400ns to 800ns per run.

BUG=dawn::256

Change-Id: Ia9baf7f998d9ff4d552e255c80069b67c6a9ac40
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-11-05 15:44:05 +00:00
Austin Eng 64a3bb93dc Add DrawCallPerf tests
These tests draw a simple triangle with many ways of encoding commands,
binding, and uploading data to the GPU. This tests the performance of Dawn's
validation, command recording, and submission by switching buffer
bindings, bind groups, and pipelines. Some test instantiations upload
per-draw data to test efficiency of resource transitions or pre-record
commands in a render bundle.

Change-Id: I9994cd96ef5988cca410462418792f28161c0526
Bug: dawn:208
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12460
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-31 03:20:31 +00:00
Austin Eng 84bcf44fae Only mark objects as cached right before inserting into the cache
This fixes bugs where we try to uncache objects that fail creation.

Bug: dawn:249
Change-Id: Ic60b3ce702dfdda18baa6d263911885a43d3cda7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12820
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-10-30 00:20:03 +00:00
Corentin Wallez 45b51f5df7 Make unittests and fuzzers use webgpu.h
BUG=dawn:22

Change-Id: Iff5465ad7a9456f9c6b2ee380af748b3afc129b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12741
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-28 22:15:47 +00:00
Corentin Wallez 04863c42be Make examples and utils use webgpu.h
BUG=dawn:22

Change-Id: I602d6a3422b493d199f3fded61ff1666bc2d9d7d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12702
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-25 11:36:47 +00:00
Corentin Wallez 1fdcb16b69 Make dawn_wire use the webgpu.h header
BUG=dawn:22

Change-Id: I4963aa27322086e74947a1a6265c921e2c7d3d85
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12700
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-24 22:27:27 +00:00
Corentin Wallez ca35435716 Preliminary changes to Vulkan memory suballocation
This mostly makes the MemoryAllocator not owned by the
BuddyResourceAllocator so that we don't need an extra class for the
dependency injection in the Vulkan backend. (the container for the
BuddyMemoryAllocator can be it's MemoryAllocator at the same time).

Also renames methods of MemoryAllocator to be more explicit.

Also renames the constructor parameter of BuddyMemoryAllocator to be
(subjectively) closer to what the represent.

BUG=dawn:27

Change-Id: I37355ad5b3cded143956f0adc4742fa1b717e9bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12661
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-24 21:28:16 +00:00
Corentin Wallez 60a04dd18c Vulkan: Use the ResourceMemoryAllocator for all resources
This removes the duplication of the memory allocators in preparation for
using sub-allocation in the Vulkan backend too.

Also renames ResourceMemory to ResourceHeap and MemoryResourceAllocator
to ResourceMemoryAllocator, and fixes a number of unused includes.

BUG=dawn:27

Change-Id: I1a9e7d41e5efafa5192bda1d89dc06455fa2af40
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12660
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-24 21:24:27 +00:00
Pawel Pluciennik 20b416235a Move ldflags (Metal dependency) to libdawn_native.
Bug: chromium:1003381
Change-Id: I1cb0f0404dde9936f4fb8f64588535a84e50c957
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12600
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Nico Weber <thakis@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-24 09:44:13 +00:00
Corentin Wallez 1f6c8c4d54 Make dawn_native use the webgpu.h header
BUG=dawn:22

Change-Id: I66e2d998f5e09030e40ec88813cd65c492018fd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12541
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-23 11:57:41 +00:00
Bryan Bernhart c833c0c592 D3D12: Enable sub-allocation for MSAA and non-MSAA textures.
Updates TextureD3D to use the allocation handle and
defaults to using MSAA heaps.

BUG=dawn:27

Change-Id: I2318bb8d068df86364cb2ebc433f4737e9e121aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12580
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-22 21:01:11 +00:00
Austin Eng 7b3cc35cb6 D3D12/Vulkan: Insert storage buffer barriers between compute pass dipatches
This patch extends the BindGroupTracker in the D3D12 and Vulkan backends to
track bound storage buffers. We insert barriers between dispatches to properly
synchronize writes to storage buffers.

Bug: dawn:236
Change-Id: Iab3f964c345b64755557ab206e05a2ff7b0a3a1f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-10-22 17:28:20 +00:00
Pawel Pluciennik 3c79cf2ab9 Metal.framework must be optional instead of hard requirement.
It's required to execute binary on Mac 10.10.

Problem has been revealed after integrating 1002023.
It's not visible by default,
because clang under the hood changes hard requirement to optional.

See:
- https://chromium-review.googlesource.com/c/chromium/src/+/1792702
- https://bugs.chromium.org/p/chromium/issues/detail?id=1003381 discussion.

Bug: chromium:1003381
Change-Id: I46e8da1092748256985ca4c2b90244f2ac5d422c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-21 11:35:49 +00:00
Jiawei Shao 5c2f5f3961 Implement serialization/deserialization of DawnDeviceProperties
This patch implements the serialization and deserialization of
DawnDeviceProperties in dawn_wire for the use of serializing this type
of object in Chromium.

BUG=chromium:996713
TEST=dawn_unittests

Change-Id: I1678627a017079540689d8529a1a7e1c975aae61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12240
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-20 03:01:56 +00:00
Austin Eng 92a011a253 Record and dump trace events in the perf tests
Trace data can be used to build additional metrics which measure
validation costs, GPU time, etc. It will also be helpful to store in
the test output for later analysis.

This CL also adds jsoncpp as a DEP so we can dump trace file json
output.

Bug: dawn:208
Change-Id: Ia6c05ca90aecae308ee6a4fd11e5f43bb03b1dc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12080
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-17 19:00:32 +00:00
Bryan Bernhart 154badfe2f Resource Management 8: placed resource sub-allocation.
- Adds d3d allocators (placed resource + heap).
- Support for heap tier 1 but only buffers.
- Suballocation optimization is enabled for allocations under 4MB.

BUG=dawn:27

Change-Id: I79177830670d1f322bbadf45f797415a3e9208d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-17 17:25:28 +00:00
Austin Eng cc071e45bb Split generation of dawncpp headers from libdawncpp
libdawn_native also requires the dawncpp headers. When we separated
libdawn_cpp from the dawn_headers, libdawn_native lost the cpp headers
and caused a compile failure. This patch separates the dawncpp headers
as a separate target so both libdawncpp and libdawn_native can depend
on them.

Bug: dawn:22
Change-Id: I4172f1654377afac8c4314123ee8b5b81dc7c928
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12300
Reviewed-by: David Turner <digit@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-16 10:26:01 +00:00
Natasha Lee f3d50baf85 D3D12 replace ASSERT_SUCCESS with better error handling
Added D3D12Error to check HRESULTS and return error messages
with the correct error names.

Remove ASSERT_SUCCESS from D3D12 backend and use
MaybeError and ResultError instead to handle errors.


Bug: dawn:19
Change-Id: Idf2f1987725e7e658bd29a9b13653125ab43c564
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12000
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-16 09:26:54 +00:00
Corentin Wallez c57b180208 Add dawnGetProcAddress.
This will become wgpuGetProcAddress that is part of the webgpu.h and the
last gap in functionality for dawn.h to match webgpu.h.

BUG=dawn:22

Change-Id: I0dcb3b5e6bd99cb10db273fc101d3ec0161b7da0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12120
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-15 12:08:48 +00:00
Corentin Wallez 96496828a0 Split the libdawn target in components with a single purpose.
The functionality of the dawn_headers and libdawn targets are split into
the following targets:

 - dawn_headers: the new version only exposes the "dawn.h" C API and no
   longer includes the C++ API.
 - dawncpp: the header and implementation of the C++ API that wraps the
   C API. This is unbundled from the rest so the C++ API can be used
   with libdawn_proc or other libraries implementing the C API.
 - libdawn_proc: A DawnProcTable-backend implementation of the C API.

This is needed because in follow-up commit there will be three libraries
implementing the C API: libdawn_proc that trampolines where we want, and
libdawn_native/wire that don't have trampolines for better perf.

BUG=dawn:22

Change-Id: I5d941f0d98e5a4b633e14d67eb5269f7924f0647
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12160
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-10-15 11:44:38 +00:00
Rafael Cintron 8bde031abe Add CommandRecordingContext to D3D12
This change refactors D3D12 backend to have CommandRecordingContext
CommandRecordingContext allows us to, in a future, add additional
data to the context such as textures that need to be acquired and
released before command lists are executed.

The Device's pending command list and the command list which resides
in the Queue object were converted to use CommandRecordingContext.

Bug=dawn:234

Change-Id: Ic13a229fc1f15895ef71117ce638c942de224743
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11940
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-10 18:06:58 +00:00
Bryan Bernhart e16a901fb8 D3D12: Move resource into allocation handle.
Allows buffer/texture direct access to underlying resource rather than indirectly with a opaque memory type.

BUG=dawn:27

Change-Id: I2eb69f4e30c96c431dbc96094d671be1e0a29869
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-09 16:50:42 +00:00
Bryan Bernhart 21dfc91954 Resource Management 7: Device memory sub-allocation using buddy allocator.
Uses a large buddy system to allocate binary sized heaps on-demand.

BUG=dawn:27

Change-Id: I72e425c23e601da6ee53827423bef7ff13be049c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10880
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-03 18:17:31 +00:00
Bryan Bernhart 0da52f2d92 D3D12: Move resource allocators from device into manager.
Encapsulates resource allocation using a manager class.

BUG=dawn:27

Change-Id: I7a496261dcede647d32e44d96ed27237bf418fb2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11742
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-02 21:45:09 +00:00