Commit Graph

17 Commits

Author SHA1 Message Date
Ben Clayton 0a68b365eb Implement textureNumSamples()
SPIR-V reader TODO

Bug: tint:140
Bug: tint:437
Change-Id: Id95855660680b12e3ff49b6340ef966dfa49f8e4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37848
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2021-01-14 18:11:17 +00:00
Ben Clayton d97132028a Implement textureNumLevels()
SPIR-V reader TODO

Bug: tint:140
Bug: tint:437
Change-Id: Icd41b2ef84e62b304e446589eb2e37c38279af35
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37846
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-01-14 18:06:57 +00:00
Ben Clayton c21f1f92a2 Implement textureNumLayers()
SPIR-V reader TODO

Bug: tint:140
Bug: tint:437
Change-Id: Id397f5f07a2f18f365dc9c2d588e619cea8f89dc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37844
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-01-14 16:50:07 +00:00
dan sinclair 1c200cffd0 Remove outerProduct.
The community decided to remove outerProduct from WGSL. This Cl removes
the pieces from Tint.

Change-Id: Ib1735867e4a7ca852a72549fc8c9bd86e8de22b0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37600
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-01-12 22:00:58 +00:00
Ben Clayton 4a0b9f77ef Implement textureDimensions()
SPIR-V reader TODO.

Bug: tint:140
Bug: tint:437
Change-Id: Ia3a6cb0b36142142d3dc8662281e1860c609c82b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/36980
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2021-01-11 21:07:32 +00:00
Ben Clayton 591268db48 Implement textureWrite()
Bug: tint:368
Bug: tint:140
Bug: tint:143
Bug: tint:144
Bug: tint:145
Bug: tint:146
Bug: tint:147
Change-Id: I1b6943d8663fbac8fbaa77a4804afb5a20fdb5e6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35320
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-10 18:39:41 +00:00
Ben Clayton 03ae9a397f Cleanup: Remove unnecessary namespace prefixes
No need to prefix with `ast::` when you're in the ast namespace already.

Change-Id: Iac6cd3a215c05a80ee2035d582500f1d6c882a06
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34320
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-30 23:30:58 +00:00
Ben Clayton 3ea3c997b5 Implement textureSample builtins
Handle wsgl parsing and spirv writing of:
  textureSample(), textureSampleBias(), textureSampleLevel(),
  textureSampleGrad(), textureSampleCompare()

Handle the different signature for array texture types.
Includes offset overloads.

Change-Id: I6802d97cd9a7083f12439b32725b9a4b666b8c63
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32985
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-18 21:19:22 +00:00
David Neto f16dfeb015 ast: intrinsic spelling matches the spec
Update the comments around the stream output method for ast::Intrinsic.

Change-Id: I06a3082927c83eb9172357c34a0587aac5f80465
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32360
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-11-11 14:30:25 +00:00
dan sinclair 007dc42cbb [type-determiner][spirv-writer] Add arrayLength support
This CL adds support for retrieving the array length of a Runtime Array
in the SPIR-V backend.

Bug: tint:252
Change-Id: Ic13c4a99da5760738d57702c45f52c6a194a172d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29220
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-10-08 17:01:55 +00:00
Sarah Mashayekhi 095f5f71b5 fix clang error
Change-Id: I7e68da53821b143d7ec55ef323822982b8f0b336
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29042
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-09-26 02:00:53 +00:00
dan sinclair b4fee2f824 Update builtin methods.
This CL removes the import mechanism, the identifier paths and updates
all of the standard library methods to be builtins.

Bug: tint:242
Change-Id: If09b98a155ae49ced3986ba2c9b517a060693006
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28720
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-22 19:42:13 +00:00
Tomek Ponitka 4e2d2484f8 [ast] Change intrinsic function names to camel case
Change-Id: I227eade96ccf84a4ed006cc5e98ac9e47f44129a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28163
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
2020-09-08 16:30:29 +00:00
Tomek Ponitka 1a61fc4dc7 [type-determination] Adding builtin texture operations
That includes texture_load, texture_sample, texture_sample_level,
texture_sample_bias, texture_sample_compare. Also determining the
result type.

Change-Id: I9e6fb19964fa171ee9b0594633b2dfe95e3e38b1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/27360
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-08-31 15:24:54 +00:00
dan sinclair 16a2ea11d3 Add type determination for the select intrinsic.
This CL adds type determination for a `select` intrinsic.

Bug: tint:106
Change-Id: Ie5c051cb42c72ae732579e3064561a4544a90473
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25380
Reviewed-by: David Neto <dneto@google.com>
2020-07-21 17:44:44 +00:00
dan sinclair 36471fe3eb [spirv-writer] Add support for derivatives.
This CL adds support for generating the various dpdx, dpdy and fwidth
instructions.

Bug: tint:5
Change-Id: I6d12c738b93931d1e740659d9c1871892b801f71
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22625
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:14:43 +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