Commit Graph

2072 Commits

Author SHA1 Message Date
Ben Clayton c52f4214ad Replace Type::(Is|As)Pointer with Castable
Change-Id: Ic1b82f1ddc61355021a80d8e72f645f830363c62
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34269
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton d8457c15f1 Replace Type::(Is|As)Matrix with Castable
Change-Id: I861aed231604a8bfba1f4cf3659b4863556fc3c4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34268
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton 9857f81e94 Replace Type::(Is|As)I32 with Castable
Change-Id: Id130581f72e762bd398a4c1c509cdbe21739e750
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34267
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton 75f39be976 Replace Type::(Is|As)F32 with Castable
Change-Id: I75e5a34034360c1d4c96ae0ce293bc6cbfc1c33d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34266
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton f3639b787f Replace Type::(Is|As)Bool with Castable
Change-Id: I60ed33bd9a54b14bb9b35f3cd999a2604c2c4450
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34265
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton af37c4ae83 Replace Type::(Is|As)Array with Castable
Change-Id: I8d9b916f5977121380325d373c4e2f805b691fae
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34264
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton 67864267c2 Replace Type::(Is|As)Alias with Castable
Change-Id: I10f1d3d0757661a41b44517d55d6f159aced04ce
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34263
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton a8d87788da Replace Type::(Is|As)AccessControl with Castable
Change-Id: I833c92be270236fefd1e77a7a145dede757e93e9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34262
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton 69aabb51a9 Derive all ast::types from Castable
The hand-rolled `AsBlah()`, `IsBlah()` methods will be migrated in future changes.

Change-Id: I46a350a560f9eda8ca15f8ba8c95b17b9b6010b7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34261
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-11-30 23:30:58 +00:00
David Neto 21e9204e14 tests: Change name SampledImageCase -> ImageAccessCase
Bug: tint:109
Change-Id: I6f5b1d3cf73fa58ae9f4c37d155199649eb37518
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34423
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-11-30 23:17:05 +00:00
David Neto 2082beed0f spirv-reader: Add entry point declaration to handle test
Bug: tint:109
Change-Id: I25645944061b8b247eda442b61f4591a9359ec4f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34422
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-11-30 22:53:25 +00:00
Ben Clayton 95feb99a9d Add Castable template class
Implements `As<Blah>()` and `Is<Blah>()` automatically.

There are several benefits to using this over the pattern of hand-rolled `IsBlah()`, `AsBlah()` methods:
(1) We don't have to maintain a whole lot of hand written code.
(2) These allow us to cast from the base type to _any_ derived type in a single cast. The existing hand-rolled methods usually require a couple of intermediary casts to go from the base type to the leaf type.
(3) The use of a template parameter means these casts can be called from other template logic.

Note: Unlike the hand-rolled `AsBlah()` methods, it is safe to call `As<T>()` even if the type does not derive from `T`. If the object does not derive from `T` then  `As` will simply return `nullptr`. This allows the calling logic to replace the common pattern of:

```
if (obj.IsBlah()) {
   auto* b = obj.AsBlah();
   ...
}
```

with:

```
if (auto* b = obj.As<Blah>()) {
   ...
}
```

This halves the number of virtual method calls, and is one line shorter.

Change-Id: I4312e9831d7de6703a97184640864b8050a34177
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34260
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-11-30 22:50:25 +00:00
David Neto 386755b1ac spirv-reader: fix SPIR-V types in handle tests
Bug: tint:109
Change-Id: Icb4cbe12334c92a86d1c52a0b3569fb22a1cfc7c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34421
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-30 22:48:55 +00:00
dan sinclair eac3c5bf51 Add tricium config.
This CL adds a tricium config file for Tint.

Change-Id: I08409df9b6b79bdd3ffecf4f28867674435ae14a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34360
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-11-30 20:28:50 +00:00
David Neto aa212ee81f spirv-reader: sampling depth texture requires unsigned Lod
Fixed: tint:378
Change-Id: I835ee7e9fb63dc68db571091f28fd34287c209b0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34201
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-11-27 19:28:53 +00:00
David Neto 29e7e3b78e spirv-reader: Use better names in handle tests
Change-Id: I461cc6fd3b497e7b56b8004266580b4280c7dc42
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34200
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-27 18:14:53 +00:00
David Neto a8b6f87cca spirv-reader: test texture builtins over arrayed textures
Tested:
 - textureSample
 - textureSampleBias
 - textureSampleLevel
 - textureSampleGrad
 - textureSampleCompare

Fixed: tint:349
Change-Id: Ibb45883b88c8eeec6ba40170f47d78613e150db7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34102
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-27 17:00:03 +00:00
David Neto e5aa390e15 spirv-reader: refactor image access tests
Bug: tint:349
Change-Id: I0cd3dc6d6704f5b636a14542993c39d3f6ea5f59
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34101
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-27 16:46:33 +00:00
David Neto 76e5f17313 spirv-reader: simplify tests
Change-Id: I69b4893d8693310f445bbf9667358d7b09f35728
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34100
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-27 16:43:13 +00:00
David Neto 3f305ac294 spirv-reader: split off last coordinate for arrayed texture access
Also ensure that the number of texture coordinates is exactly
the right number required for the given texture dimension.
I think SPIR-V is looser in this respect.

Assumes coordinates are floating point.

Bug: tint:349
Change-Id: I4512c333fada3647c66f13ef31897b2d73b46cf0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33982
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-27 16:17:03 +00:00
Corentin Wallez 456aad3bce Remove use of recent SPIRV-Tools functionality
reader/spirv/parser_impl.cc was using an overload of a function that's
recently added in SPIRV-Tools so rolling Tint would require rolling
SPIRV-Tools at the same time, which is not currently possible because of
a breaking change in spirv-headers.

Bug: chromium:1153258
Change-Id: I4e8cf87a3f11adbd8b6ef289260c6159faf9580c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34142
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-11-27 15:36:23 +00:00
Ben Clayton f32a3c1f35 Diagnostics: Add error code to the Diagnostic
Allows this to be formatted similarly to the severity.

Change-Id: I74cd863d8f1d94089ce753ab76a2c70784eb5553
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33938
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-26 17:49:22 +00:00
David Neto 61ec48b99e spirv-reader: refactor swizzle creation
Change-Id: I6a09756026b7cbc436d5f232be9331255615e8c3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34040
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
2020-11-26 17:45:52 +00:00
David Neto 3ec71a63aa spirv-reader: test textureSample with depth texture
Bug: tint:109
Change-Id: Ia13940b521229012a7c73fe0896e6ea75c4b1307
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34020
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-11-26 16:58:02 +00:00
Ben Clayton ba06db6e00 validator: Migrate to using diagnostics
Unlike error strings, diagnostics can:
* Describe more than one error
* Be printed with colors
* Highlight (`^^^`) the particular error on the line
* Can have separate severities

Change-Id: I4ead391ffbe190e55f79c5f23536a4524768478d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33820
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-26 16:50:02 +00:00
Ben Clayton b7b6a3f3f4 Fix linter errors about newlines in lists
Change-Id: I5c2eb4d9beed1e6cf9f0f410da116ae3958589b9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33939
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-26 16:47:32 +00:00
David Neto 77e3318b39 spirv-reader: Support depth-reference sampling
Bug: tint:109
Change-Id: I1e1dcd7c0724124a3a29e94e65856a07c54dd998
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34005
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-26 16:39:32 +00:00
David Neto ddaf59016b spirv-reader: Infer a handle type when needed
Fixed: tint:374
Change-Id: I4785a48d456a6b5ba1fa8c9950b4c72d00853fc9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33981
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-26 15:35:12 +00:00
Ben Clayton 83b32455c2 writer/msl: Emit texture builtin functions
Bug: tint:145
Change-Id: I8a2d10c2e7239c81a11933c009d9175d4f4d8577
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33782
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-26 15:07:52 +00:00
Ben Clayton f48d244252 writer/spirv: Use PackCoordAndArrayIndex()
As `PackCoordAndArrayIndex()` extracts the elements of vectors-in-vectors, the resulting SPIR-V is now more compact.

Change-Id: I3e35546efc89531b9f70d4c44c23c179e76b15d8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33781
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-26 14:18:12 +00:00
Ben Clayton 41c8cd3e68 writer/hlsl: Move the coord/arrayidx packing to utility function
So we can also use this for the `spirv` backend

Bug: tint:146
Change-Id: I26f70125a5015946d2428a6e669da32bdea23bcd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33780
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2020-11-26 13:57:32 +00:00
David Neto 8ad2c91c60 spirv-writer: Add SampledCubeArray cap when needed
Fixed: tint:371
Change-Id: I13f568725370f446f154af26c326edfd4abec3c8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34003
Auto-Submit: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-11-26 13:37:32 +00:00
David Neto b496611165 spirv-writer: avoid dup OpCapability instructions
Change-Id: Iaf53d2addadd8efbb912e4f97ff426fd4182c9f3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34002
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-26 13:32:12 +00:00
David Neto 66794eada3 Roll dependencies; spirv-reader: avoid spurious OpLine
Roll third_party/gpuweb-cts/ 2a53a9bd3..abe6e1dd2 (51 commits)

2a53a9bd3d..abe6e1dd26

$ git log 2a53a9bd3..abe6e1dd2 --date=short --no-merges --format='%ad %ae %s'
2020-11-25 corentin Port the robust vertex access tests from GLSL to WGSL (#379)
2020-11-25 corentin Port createRenderPipeline validation tests from GLSL to WGSL (#372)
2020-11-23 kainino iterateCollapsedQueries: don't yield files with no tests (#383)
2020-11-20 kainino Clean trailing whitespace inside shader strings (#382)
2020-11-20 yunchao.he Memory sync test for buffer (#302)
2020-11-20 corentin Port verteState validation tests from GLSL to WGSL (#376)
2020-11-20 corentin Port the setVertexBuffer validation tests from GLSL to WGSL (#375)
2020-11-20 corentin Port the render pass validation tests from GLSL to WGSL (#374)
2020-11-20 corentin Port the validation index access tests from GLSL to WGSL (#373)
2020-11-20 corentin Group and update the dynamic state validation tests. (#307)
2020-11-20 corentin Port the primitive topology tests from GLSL to WGSL (#371)
2020-11-20 corentin Port culling tests from GLSL to WGSL (#370)
2020-11-20 corentin Cleanups in webgpu/api/operation/command_buffer (#369)
2020-11-20 kainino From HackMD plan, part 2: some more validation tests (#368)
2020-11-19 kainino Fix cross-device fence signal tests (cherry-pick) (#366)
2020-11-19 kainino From HackMD plan: manual, stress, web_platform, documentation, and some validation (#364)
2020-11-18 corentin Port basic command_buffer tests from the GLSL branch (#350)
2020-11-17 kainino add src/webgpu as a separate folder in the workspace
2020-11-17 kainino Replace grunt tasks with shell tasks
2020-11-17 kainino Check directory names match validQueryPart
2020-11-17 kainino rename web-platform to web_platform
2020-11-17 2154796+austinEng Remove TexelDataRepresentationImpl.isGPULittleEndian (#357)
2020-11-17 2154796+austinEng Implement texelData for rgb9e5ufloat and add texelData unit tests (#352)
2020-11-17 2154796+austinEng Refactor texture zero init tests and use WGSL (#353)
2020-11-17 corentin Port the renderPass resolve tests from GLSL to WGSL (#351)
2020-11-13 mehmetoguzderin Make comments optional (#348)
2020-11-12 corentin Add gen_wpt_cts_html as an NPM script (#347)
2020-11-11 9856269+sarahM0 [wgsl] Update tests to match spec update: Relaxing void return requirement (#330)
2020-11-11 mehmetoguzderin Check PRs to glsl-dependent (#341)
2020-11-10 kainino Remove travis config from main branch (#336)
2020-11-10 kainino Remove AsyncMutex
2020-11-09 kainino Simplify WPT runtime
2020-11-10 mehmetoguzderin Fix Actions on CI (#334)
2020-11-10 corentin Roll webgpu-types. (#329)
2020-11-10 mehmetoguzderin Add CI on Actions (#331)
2020-11-05 natashalee add create sampler validation test (#327)
2020-11-04 kainino wpt: Don't return promise from async_test
2020-11-04 kainino Allow marking tests as explicitly unimplemented (#319)
2020-11-04 kainino standalone: Don't generate DOM when test finishes (#323)
2020-11-04 kainino standalone: Show only the full query string for a test, and aligned (#324)
2020-11-03 kainino standalone: Replace results JSON textarea with copy button (#322)
2020-11-02 kainino standalone: Lazily-generate DOM subtrees (#321)
2020-10-27 enrico.galli Add API validation tests for compute pass (#308)
2020-10-26 kainino Optimize device pool lookup (#295)
2020-10-23 kainino Remove unneeded @babel/plugin-proposal-class-properties (#313)
2020-10-23 kainino Remove non-test dependence on WebGPU ambient constants (#318)
2020-10-20 kainino Loop to exhaust eventualExpectations (#309)
2020-10-20 dsinclair Update WGSL to new struct syntax. (#316)
2020-10-19 kainino Add support for logical assignment operators (&&= ||=) (#311)
2020-10-19 kainino Update npm dependencies (#310)
2020-10-20 corentin Add validation tests for mapAsync. (#301)

Created with:
  roll-dep third_party/gpuweb-cts

Change-Id: Ibed486c6e02d8df9db7a66c00c4546c46df0c1fc

Roll third_party/spirv-tools/ 7e1825a59..2c458414c (62 commits)

7e1825a596..2c458414c0

$ git log 7e1825a59..2c458414c --date=short --no-merges --format='%ad %ae %s'
2020-11-25 dneto BuildModule: optionally avoid adding new OpLine instructions (#4033)
2020-11-25 dneto Remove prototype for unimplemented method (#4031)
2020-11-25 afdx spirv-fuzz: Fix facts arising from CompositeConstruct (#4034)
2020-11-24 afdx spirv-fuzz: Do not flatten conditionals that create synonyms (#4030)
2020-11-23 dneto Update MeshShadingNV dependencies (and land Ray tracing updates) (#4028)
2020-11-18 greg Fix buffer oob instrumentation for matrix refs (#4025)
2020-11-13 afdx spirv-opt: Set parent when adding basic block (#4021)
2020-11-13 jaebaek spirv-opt: properly preserve DebugValue indexes operand (#4022)
2020-11-11 dneto Use less stack space when validating Vulkan builtins (#4019)
2020-11-05 46493288+sfricke-samsung spirv-val: Fix SPV_KHR_fragment_shading_rate VUID label (#4014)
2020-11-05 46493288+sfricke-samsung spirv-val: Label Layer and ViewportIndex VUIDs (#4013)
2020-11-05 alanbaker Add dead function elimination to -O (#4015)
2020-11-04 jaebaek Add DebugValue for invisible store in single_store_elim (#4002)
2020-11-04 dnovillo Fix SSA re-writing in the presence of variable pointers. (#4010)
2020-11-04 afdx spirv-fuzz: Fixes to pass management (#4011)
2020-11-03 afdx spirv-fuzz: Add support for reining in rogue fuzzer passes (#3987)
2020-11-03 vasniktel spirv-fuzz: Fix assertion failure in FuzzerPassAddCompositeExtract (#3995)
2020-11-03 vasniktel spirv-fuzz: Fix invalid equation facts (#4009)
2020-11-03 vasniktel spirv-fuzz: Fix bugs in TransformationFlattenConditionalBranch (#4006)
2020-11-03 andreperezmaselco.developer spirv-fuzz: Fix bug related to transformation applicability (#3990)
2020-10-30 jaebaek Temporarily add EmptyPass to prevent glslang from failing (#4004)
2020-10-30 Junda.Liu spirv-opt: Add support to prevent functions from being inlined if they have DontInline flag (#3858)
2020-10-29 jaebaek Propagate OpLine to all applied instructions in spirv-opt (#3951)
2020-10-29 bclayton CMake: Add SPIRV_TOOLS_BUILD_STATIC flag (#3910)
2020-10-29 dneto Avoid copying a ref in a loop (#4000)
2020-10-28 justsid spirv-val: Allow the ViewportIndex and Layer built-ins on SPIR-V 1.5 (#3986)
2020-10-28 dnovillo Simplify logic to decide whether CCP modified the IR (#3997)
2020-10-27 jaebaek Add DebugValue for DebugDecl invisible to value assignment (#3973)
2020-10-26 greg Fix bounds check instrumentation to handle 16-bit values (#3983)
2020-10-23 andreperezmaselco.developer spirv-fuzz: Add expand vector reduction transformation (#3869)
2020-10-23 vasniktel spirv-fuzz: Don't replace irrelevant indices in OpAccessChain (#3988)
2020-10-23 vasniktel spirv-fuzz: Add FuzzerPassAddCompositeExtract (#3904)
2020-10-22 afdx spirv-fuzz: Fix mismatch with shrinker step limit (#3985)
2020-10-22 afdx spirv-fuzz: Fix off-by-one error in replayer (#3982)
2020-10-22 afdx spirv-fuzz: Get order right for OpSelect arguments (#3974)
2020-10-22 afdx spirv-fuzz: Do not add synonym-creating loops in dead blocks (#3975)
2020-10-22 afdx spirv-fuzz: Skip OpTypeSampledImage when propagating up (#3976)
2020-10-22 afdx spirv-fuzz: Pass OpUndef in function call if needed (#3978)
2020-10-22 afdx spirv-fuzz: Fix off-by-one in TransformationCompositeConstruct (#3979)
2020-10-22 afdx spirv-fuzz: Tolerate absent ids in data synonym fact management (#3966)
2020-10-21 afdx spirv-fuzz: Fix to id availability (#3971)
2020-10-21 afdx spirv-fuzz: Fix operand types (#3962)
2020-10-21 8729214+jonahryandavis Update SPIRV-Headers revision in DEPS file (#3961)
2020-10-21 afdx spirv-fuzz: Don't flatten conditional if condition is irrelevant (#3944)
2020-10-21 afdx spirv-fuzz: Do not produce OpPhis of type OpTypeSampledImage (#3964)
2020-10-21 afdx spirv-fuzz: Restrict fuzzer pass to reachable blocks (#3970)
2020-10-21 afdx spirv-fuzz: Handle more types when extending OpPhi instructions (#3969)
2020-10-21 afdx spirv-fuzz: Skip early terminator wrappers when merging returns (#3968)
2020-10-21 afdx spirv-fuzz: Avoid irrelevant constants in synonym-creating loops (#3967)
2020-10-21 afdx spirv-fuzz: Skip dead blocks in FuzzerPassAddOpPhiSynonyms (#3965)
2020-10-21 afdx spirv-fuzz: Avoid the type manager when looking for struct types (#3963)
2020-10-20 afdx spirv-fuzz: Fix to TransformationDuplicateRegionWithSelection (#3941)
2020-10-20 afdx spirv-fuzz: Skip OpFunction when replacing irrelevant ids (#3932)
2020-10-20 afdx spirv-fuzz: Use component-wise selectors when flattening conditional branches (#3921)
2020-10-20 TobyHector Add SPV_EXT_shader_image_int64 (#3852)
2020-10-20 TobyHector Support SPV_KHR_fragment_shading_rate (#3943)
2020-10-19 afdx spirv-val: Fix validation of OpPhi instructions (#3919)
2020-10-19 afdx spirv-fuzz: Avoid void struct member when outlining functions (#3936)
2020-10-19 afdx spirv-fuzz: Do not allow Block-decorated structs when adding parameters (#3931)
2020-10-19 afdx spirv-fuzz: Fix to operand id type (#3937)
2020-10-19 afdx spirv-fuzz: Handle dead blocks in TransformationEquationInstruction (#3933)
2020-10-19 afdx spirv-fuzz: Do not allow sampled image load when flattening conditionals (#3930)

Created with:
  roll-dep third_party/spirv-tools

Change-Id: Ic75967a4b775dfae8b53a679f48bcc8b3f162217

Roll third_party/spirv-headers/ c43a43c7c..104ecc356 (9 commits)

c43a43c7cc..104ecc356c

$ git log c43a43c7c..104ecc356 --date=short --no-merges --format='%ad %ae %s'
2020-11-12 dneto MeshShadingNV enables builtins PrimitiveId, Layer, and ViewportIndex
2020-10-16 dkoch de-alias/reassign OpIgnoreIntersectionKHR/OpTerminateRayKHR
2020-06-29 alele Raytracing and Rayquery updates for final
2020-06-15 alele Updated headers for new trace/executeCallable and acceleration structure cast.
2020-11-04 michael.kinsner Reserve additional loop control bit for Intel extension (NoFusionINTEL) (#175)
2020-11-02 4464295+XAMPPRocky Add EmbarkStudios/rust-gpu to vendor list. (#174)
2020-10-23 john Bump revision to 4, for SPIR-V 1.5.
2020-10-19 TobyHector Add SPV_EXT_shader_image_int64 (#170)
2020-10-19 TobyHector Added SPV_KHR_fragment_shading_rate (#172)

Created with:
  roll-dep third_party/spirv-headers

Change-Id: Ib43e5574d9fc1d2cffdd3a6cf66cbc3a88db2051

Roll third_party/googletest/ 3c95bf552..b1fbd33c0 (30 commits)

3c95bf5524..b1fbd33c06

$ git log 3c95bf552..b1fbd33c0 --date=short --no-merges --format='%ad %ae %s'
2020-11-23 absl-team Googletest export
2020-11-19 absl-team Googletest export
2020-11-13 vlee Initialize TestInfo member is_in_another_shard_ in constructor.
2020-11-12 absl-team Googletest export
2020-11-12 absl-team Googletest export
2020-11-12 absl-team Googletest export
2020-11-11 dmauro Googletest export
2020-11-11 dmauro Googletest export
2020-11-11 dmauro Googletest export
2020-11-11 absl-team Googletest export
2020-11-11 marius.brehler Refactor finding python
2020-11-06 absl-team Googletest export
2020-11-06 absl-team Googletest export
2020-10-29 knut Only save original working directory if death tests are enabled
2020-11-08 hyuk.myeong fix typos
2020-11-06 absl-team Googletest export
2020-11-05 ofats Googletest export
2020-10-27 absl-team Googletest export
2020-10-27 elliott.brossard Add instructions for sanitizer integration
2020-10-26 absl-team Googletest export
2020-10-20 sonzogniarthur Fix typo "definedin in" => "defined in"
2020-10-15 absl-team Googletest export
2020-10-15 absl-team Googletest export
2020-10-07 manavrion Improve FilePath::Normalize method
2020-09-16 hyuk.myeong Remove spaces between Google Test and Google Mock
2020-09-15 hyuk.myeong Add follow-up patch for more natural reading
2020-09-15 hyuk.myeong Apply the reviewed comment
2020-09-15 hyuk.myeong Remove a space
2020-09-15 hyuk.myeong Improve the tutorial that may be confusing
2020-02-17 krystian.kuzniarek remove a duplicated include

Created with:
  roll-dep third_party/googletest

Change-Id: I62335cb23a96218f62c1842e786777d7e8dfe4f2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34007
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-25 21:13:17 +00:00
David Neto d0bb9b3c02 roll-all: Fix args for GNU find(1)
Change-Id: I004581a42df5bd719819da36f8222b3cd0de8e7f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34006
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-11-25 21:08:37 +00:00
David Neto eb913d3829 spirv-reader: Start emitting sampled image builtins
- Emit (non-depth) sampler variables
- Emit sampled texture variables

- Test emission of textureSample, textureBias, textureLevel

TODO: convert unsigned offset parameter to signed. crbug.com/tint/348
TODO: support arrayed access, where we have to split out the array index
into a separate operand. crbug.com/tint/349
TODO: for explicit-lod sampling, we may have to convert coordinates to
floating point. crbug.com/tint/346

Bug: tint:109
Change-Id: I12558f99473ca234ce0d09a87fc0c2f4730497bc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33342
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: David Neto <dneto@google.com>
2020-11-25 19:23:17 +00:00
Corentin Wallez 4e91325bf0 writer/spirv: Emit Image1D and Sampled1D capabilities when needed
Fixes: tint:363
Change-Id: Ia0f09e3173f54abaf15aa8f772b097835d451bcb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33920
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-11-25 17:02:37 +00:00
Corentin Wallez d49841ca9f writer/spirv: Emit NonRead/Writable decoration of storage texture vars
Fixes: tint:366
Change-Id: I03e1312841d5b86d1192382bf4cdf0ad1bcfc43d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33921
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-25 13:59:27 +00:00
Corentin Wallez bed7a32b3b type_determiner: use f32 as the subtype for u/norm storage texture.
Fixes: tint:367
Change-Id: I311f5b9524d6251c88ae774dc8dc80f6d52e457d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33922
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-11-25 13:58:47 +00:00
Ben Clayton 12ed862c7e Add fuzzer instrumentation when building fuzzers
Without this the fuzzing is unguided and takes exponentially more time to find interesting corpus cases.

Change-Id: I1b66de153bc41a829a5276a02a729f4e6bb50ef0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33722
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2020-11-24 15:28:06 +00:00
David Neto 1b543c6778 spirv-reader: Add a disassembler helper
This helped me debug a problem.

Change-Id: I665aaa482c6f20d24966f0990bfe4e15cdd82915
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33800
Commit-Queue: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
2020-11-24 15:17:46 +00:00
Ben Clayton 1e87fe5517 reader/wgsl: Abort after raising too many errors
Change-Id: I641ee8c2e34e059a02742d06c24f96acecb39cd3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33720
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2020-11-24 15:15:36 +00:00
Ben Clayton c489875ff0 ast/module: Additional documentation for type methods
Bug: tint:337
Change-Id: I60dae81baba3c5c85efa277e772f4a1f12589e11
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33786
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-24 15:11:06 +00:00
Ben Clayton 8282262304 writer/spriv: Add an assert that functions_ is not empty
... before attempting to push instructions to `functions_.back()`

If this fires, we're in an invalid state anyway. At least make the explosion less head scratching.

Change-Id: I7b4a002043de4b55a12d9aba80a0393c630140c2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33664
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-23 22:32:55 +00:00
Ben Clayton 1ed92b2a9d fuzzers: Add dictionary
Helps speed up fuzzing

Change-Id: I19c0476fbb1b6fd497716e2537093c27c69e3007
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33721
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-23 21:12:45 +00:00
Ben Clayton fecf10664a Improve error message when suffixing float with f
Fixes: tint:277
Change-Id: I7ec3bb758c7d80c95c6ecd51eebf4144b696bec5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33668
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-23 20:07:15 +00:00
Ben Clayton 7e4ffa0064 Add create<T>() method to Module for types
Migrate all uses to use this and the new `unique_type<T>()` and `types()` methods.

Remove the `type_mgr()` accessor. `TypeManager` is now an implementation detail of the module, allowing us to unify the allocation of types and nodes (if we so wish).

Fixes: tint:337
Bug: tint:307
Change-Id: I233fa9dc73d60515dd721f02ea7ba089ef7d374f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33667
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-23 19:58:55 +00:00
Ben Clayton 0fb5168fc7 Move TypeManager from tint::Context to ast::Module
Bug: tint:307
Bug: tint:337
Change-Id: I726cdf89182813ba6f468f8ac35e5d44b22e1e1f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33666
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-23 19:50:55 +00:00
Ben Clayton 3e67c5dba6 Move type_manager to the ast dir/namespace
First step to moving this to the `ast::Module`.

Also remove a bunch of redundant includes to `type_manager.h` as this is already included in `context.h`

Bug: tint:307
Bug: tint:337
Change-Id: Ic4baffa7b76ddefa29f56f758c25b1003ef40888
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33665
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-23 19:30:55 +00:00
David Neto 4c32dd9735 spirv-writer: Fix phi for short-circuiting operators
The Phi in the merge block was taking the value of the RHS
from the wrong basic block ID. Instead of taking it from
the first block of the expression for the RHS, take it from
the last block of the expression for the RHS.

Bug: tint:355
Change-Id: I1b79a1b107459fd420e39963ad7ab2e89bc4494f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33640
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-23 17:17:35 +00:00