Commit Graph

8535 Commits

Author SHA1 Message Date
dan sinclair 97744832bc [ir] Deduplicate constants
This CL updates the IR builder to deduplicate constants such that for a
given constant value only a single `ir::Constant` will be created.

Bug: tint:1935
Change-Id: Ia743cdb7782cf7ea9918b913dac70b0a3dde4499
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133241
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-05-18 14:51:54 +00:00
Peng Huang fe58d80871 d3d11: fix and enable ReadOnlyDepthStencilAttachmentTests
Bug: dawn:1705
Bug: dawn:1727
Change-Id: I28f20d2be10753f6a7e7bd727fa80d050cfb8694
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133360
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2023-05-18 14:26:24 +00:00
James Price 92151b238b [ir][spirv-writer] Emit load instructions
Bug: tint:1906
Change-Id: I86396d0eaa7886f010cf037c2b1253014146d37c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133225
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-05-18 12:06:19 +00:00
dan sinclair 84d750e982 [ir] Add function parameters.
This CL adds parameters to functions in the IR. Attributes will be
handled in a later CL.

Bug: tint:1915
Change-Id: I99f9342e95ef957e5117465bb396db0b3822ba7d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133401
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-18 08:50:34 +00:00
Loko Kung 9fb0eed227 Implements float32-filterable feature.
- Adds the feature and the major backend supports.
- Adds initial validation testing.

Bug: dawn:1664
Change-Id: I9918c3de8cce379319d3d1877e45c51acb388961
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133281
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Jones <bajones@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-05-18 07:21:11 +00:00
Austin Eng ba8587b6c8 Actually fix DawnWireServerFuzzer.cpp on Windows ASAN
Bug: dawn:302
Change-Id: I8af045c609d1552c491d6e6f48b13b172172c2ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133520
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-18 04:36:24 +00:00
James Price 97ab6a3a70 [ir][spirv-writer] Emit store instructions
Bug: tint:1906
Change-Id: I858e619fe2968ebe2708d0d47c12b0c17b20cc31
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133224
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-18 03:05:59 +00:00
James Price 75aaa49d77 [ir][spirv-writer] Emit function variables
Bug: tint:1906
Change-Id: I2e1f44acddb86bbb8d57b5ffc8e8ba2b1c35ffbe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133223
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-05-18 02:30:39 +00:00
Ben Clayton 6e40b1a9df [tint][ir][ToProgram] Begin emitting Switch statements
Like If, block arguments still needs implementing.

Bug: tint:1902
Change-Id: Ifd660760de13f8003b33aa562c706aed24743851
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133466
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-05-18 01:51:45 +00:00
Austin Eng b34f5f6789 Fix Dawn Windows ASAN fuzzer build
Bug: dawn:302
Change-Id: I91c9dd26456c7f7b8b72a24c332d1aae053fd73d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133365
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Austin Eng <enga@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-05-18 01:19:30 +00:00
Peng Huang 62d9b14b6f d3d11: enable OpArrayLengthTest
Bug: dawn:1705
Change-Id: Ie16b368bb371a379710f99f5a0569eff671e7b56
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133340
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-05-18 00:15:06 +00:00
Loko Kung 59f4cfb03f Moves cpp_headers into public_deps when depending on the dawn:cpp.
Bug: dawn:1822
Change-Id: Iaec2efe2349c48a0dbbd2bb4e043e0ff07795a60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133482
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-05-17 23:31:43 +00:00
shrekshao e121931563 Compat GL/GLES: blit a depth texture to a buffer using compute
Add compute blit emulation path for Depth16Unorm/Depth32Float
depth textures in OpenGL/OpenGLES backend.

Extend DepthCopyTests for better test coverage, especially for
testing Depth16Unorm compute emulation path.

Bug: dawn:1782, dawn:1291, dawn:1237
Change-Id: I02f6e10d13e8b0080b412a9f9a6d62b1e470ac9c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/130820
Auto-Submit: Shrek Shao <shrekshao@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2023-05-17 22:25:34 +00:00
Loko Kung 5ae7d10977 Fixes TSAN race by moving cleanup of platform into dtor.
- Before since it was in the TearDown, cleanup can be called before
  the device was gone which meant that async tasks could still be in
  flight.

Bug: dawn:1374
Change-Id: I4cd5a4e096a3fe13e230197a6a4d4d57daea31c8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133480
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-05-17 22:03:16 +00:00
dan sinclair 43b110ce53 [ir] Only show type on lhs
This CL updates the IR to only show types on the LHS of an assignment.
The RHS does not show the types anymore. This removes a lot of clutter
from the output.

Bug: tint:1718
Change-Id: I5e9cff2ae5cd727a7a8cb256d08b417233a197d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133240
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2023-05-17 21:56:43 +00:00
Austin Eng 3f18fc9a05 Suppress tests failing on Apple GPUs
Bug: dawn:1828, dawn:1829, dawn:1830
Change-Id: If6f6b107b58822b46c286cf84075ca7981c3edc7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133441
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2023-05-17 20:27:23 +00:00
James Price c42014805a [tint][ir] Guard transform source sets in GN build
These sources cannot build without the IR being explicitly enabled, as
they depend on code in headers that would be `#ifdef`'d out.

Change-Id: Id542f41679c3e6e6f210ca632e85ca796e61a746
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133402
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-05-17 20:04:56 +00:00
James Price 54d1d714ce [ir][spirv-writer] Move code to `ir` subdirectory
Also add `_ir` to the names of test files.This makes it less likely to
confuse IR code with non-IR code.

Bug: tint:1906
Change-Id: I2db85440c815c2834d7bab1899afa0fafc89ce6a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133222
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 19:51:42 +00:00
James Price 90b8cc1e93 [ir] Add load instruction
When converting an AST expression to IR, check for a sem::Load node
and emit a load instruction if present.

Update conversion of compound assignment and increment/decrement to
load from the LHS.

Convert load instructions to inline variable references when going
back to the AST.

Bug: tint:1718
Change-Id: Ib2b850efb304a71eff95aadac825f015623b6eb3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133220
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-05-17 18:41:27 +00:00
Austin Eng 2731b76ded Namespace dawn/common/ and dawn/utils/ in dawn::
Only Constants.h remains in no namespace; but it may be addressed
in the future as well.

Bug: dawn:302
Change-Id: Ib9b9ab4b974ad1de1bb9f2302f4d24d8216f55e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132841
Kokoro: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2023-05-17 18:41:02 +00:00
James Price 0bb1bb3067 [ir] Remove references, indirection and address-of
Change the type of a `var` to a pointer. Fold away address-of and
indirection.

Fixed: tint:1912
Change-Id: Ib1f07538c63df9349c5b6171062b6f79750c1439
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133400
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-05-17 18:34:39 +00:00
Loko Kung 7511bf6334 Removes remaining SetPlatform APIs from being exposed in native.
Bug: dawn:1374
Change-Id: I252c1e686d6ba31fbf81c6ea990e553222907d47
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132269
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 18:25:28 +00:00
James Price 82db91ac96 [ir][spirv-writer] Emit `If` flow nodes
Adds support for both `If` and `Block` flow nodes as branch
targets. Also support a nullptr branch target by emitting
OpUnreachable.

Bug: tint:1906
Change-Id: I1adea83ce6c7c85c6a2e2dae9327499cb7f850bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132861
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-05-17 18:17:34 +00:00
James Price 7ac28d3c6e [ir] Add AddEmptyEntryPoint transform
Use it in the SPIR-V writer.

Bug: tint:1718, tint:1906
Change-Id: If8f29300712c457a02ddc9eb2fd76e0b49ee8fea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132682
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 17:04:52 +00:00
James Price 95b06129f0 [ir] Add base `ir::transform::Transform` class
Enable the transform manager to run a pipeline that mixes AST and IR
transforms, automatically converting the current program as necessary.

Bug: tint:1718
Change-Id: I8df76db61edd94e0b1d7c2aaabc18b394db3d8de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132502
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: James Price <jrprice@google.com>
2023-05-17 15:52:05 +00:00
James Price db5ad9f357 [tint] Materialize compound assignment RHS
The RHS of a compound assignment statement may need to be
materialized. This was showing up when converting things like `i += 1`
to IR, as abstract types were creeping into the IR.

Change-Id: Idf9b1523d1751e26c28a795af07769ca85a65f14
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133221
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-05-17 14:49:26 +00:00
dan sinclair 11ee6b6cc6 [ir] Handle phony assignment.
This CL adds phony assignment to the IR. The assignment part is ignored
and the RHS of the expression is generated. This creates a result value
which is then never used.

Bug: tint:1918
Change-Id: Ic87fdcb387cb4d9783c4dbbe26ebc76f67a3cdd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133260
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 13:52:41 +00:00
dan sinclair bbaa456b18 [ir] Remove instruction allocator.
The Instructions are now inheriting from Value so they can use the value
block allocator. Remove the instruction allocator.

Bug: tint:1718
Change-Id: Ia8f3b8b106d03883b3c72ebead392ae972a86c4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133164
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: dan sinclair <dsinclair@google.com>
2023-05-17 13:51:50 +00:00
dan sinclair 0531610e99 [ir] Add basic block arguments.
This CL adds the ability to add parameters to blocks and emits the
params as needed in the disassembly.

The ShortCircuit is updated to use block arguments instead of creating
a return value.

Bug: tint:1909
Change-Id: I92afa6cf8ff4e01bfa3de46e76c26c465f0d6062
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133200
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-05-17 13:28:47 +00:00
dan sinclair 9fc46dc3c1 [ir] Drop address space and access from ir::Var.
The address space and access mode both exist on the type of the Var,
storing the information into Var is redundant. This CL removes them from
var in favour of the type fields.

Bug: tint:1718
Change-Id: I0198a8794d6359834592562251b2788e8a0347ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133163
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 13:26:40 +00:00
Ben Clayton 25ae3114b3 [tint][ir][ToProgram] Emit returns with values
And implement functions with return values.

Bug: tint:1902
Change-Id: Id4015aa83bf75de2a0f3dfdbfe19f728c05226c8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133142
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2023-05-17 10:46:48 +00:00
Ben Clayton a6e7cfc1d0 [tint][ir][ToProgram] Emit returns without values
Returns with values requires fleshing out of functions, which comes next

Bug: tint:1902
Change-Id: I5f956805441b99038f2d48758d1bd767ea4e1a1d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133141
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
2023-05-17 10:45:26 +00:00
Ben Clayton 6ab77f16f0 [tint][ir][ToProgram] Emit 'else if' instead of 'else { if'
Bug: tint:1902
Change-Id: If49a7fd71d72cd562fc49957a5715ea7eefc8b4d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133140
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-05-17 10:43:46 +00:00
Ben Clayton 1ea1e1a375 [tint][ir][ToProgram] Begin flow node traversal
Traverse the block nodes, and if statements.

Bug: tint:1902
Change-Id: Ie5533acdc65378bfea91b46a62090c4d3216b303
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133100
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-05-17 10:40:41 +00:00
Ben Clayton 0b9cb101bf [tint][ir][ToProgram] Implement var expressions
Bug: tint:1902
Change-Id: I97c026adc113b4a8834b9b5e978b4084d777328a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133060
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2023-05-17 10:38:36 +00:00
dan sinclair f55d13b754 [ir] Add increment and decrement statements.
This CL adds increment and decrement statement support into the IR.

Bug: tint:1718
Change-Id: Ieba2ab7a4c9232dc9d76a8605637cd5ea46b0e08
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133162
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-05-17 02:04:55 +00:00
Brandon Jones 112b7fd856 Allow device lost callback to be passed at creation
This change updates the Device descriptor to allow a device lost
callback to be passed in at device creation time. This will be
important for allowing the API to return devices which have
already been lost in a future CL, which is the behavior required
by the spec.

This change does not yet deprecate the old method for setting the
callback, as there's still some tricky scenarios that will need to
be worked around to enable that and this CL is already fairly
large. (The uses in question pass the device or a value created
from the device as the userdata.)

Bug: chromium:1234617
Change-Id: I1adea5ceffdfdcfedff9fff4960f12303abba29c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121041
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2023-05-17 01:52:30 +00:00
James Price 0e6534e44d [tint] Make Transform base class
This will allow for both AST transforms and IR transforms to be used
in the same transform manager.

The transform manager is no longer a Tranform subclass.

Bug: tint:1718

Change-Id: I59bd87806090fa365ce4b575710c5ffcfc657bd8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132501
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 01:21:45 +00:00
James Price a6d8e81371 [ir][spirv-writer] Implement binary subtract
Bug: tint:1906
Change-Id: Ie57fecbafd4823de78c0b8d3322865253eb4c39b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132743
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 00:17:31 +00:00
Ben Clayton 9940c7bdcc [tint][ir][ToProgram] Stub ToProgram()
This is the first commit to implementing an IR -> AST conversion path.

Not much currently implemented, but enough to start building upon.

Started implementing AST -> IR -> AST roundtrip tests.

Bug: tint:1902
Change-Id: I17fa9f3bc609b48ecb916ab47ae61bfa36821b44
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131180
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-05-16 22:07:39 +00:00
Peng Huang 34832fe82f d3d11: enable CopyTextureForBrowserTests
Bug: dawn:1705
Change-Id: I13dda162ed1b9a7714ffbe729d691bcbde6abdab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133120
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-16 21:47:58 +00:00
dan sinclair 0df7f8bccd [ir] Update disassembly output.
This CL updates the disassembly output to make it clearer when
instructions are flow node traversals, and when they're actual
instructions in a block.

Bug: tint:1718
Change-Id: I95e103a5672b5579081b73e9633bf07b31e51187
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133161
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-05-16 21:21:21 +00:00
Peng Huang 7ddaaf23cf d3d11: enable CopyExternalTextureForBrowserTests
Bug: dawn:1705
Change-Id: I9963d446b6bfb71e4bb70a5b9174a631a5229a8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133121
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-05-16 20:29:09 +00:00
dan sinclair 11bd8a012f [ir] Fix scope stack for loops.
The scope stack for a loop is slightly different from other constructs
as the block for the body and the block for the continuing need to share
the scope. This CL fixes the loop conversion to special case the scope
stack for the loop body so the continuing block can see the variables.

Bug: tint:1718
Change-Id: I2e4898b36f1541b48a4e349955833b155332947a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133160
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-05-16 17:46:52 +00:00
James Price 055de27441 [ir][spirv-writer] Emit vector constants
Switch the constant map key to constant::Value.

Bug: tint:1906
Change-Id: I71743cc8b47a5c703f6333371ed686cf70900f74
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132742
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-05-16 15:24:19 +00:00
James Price 2f324c59ff [ir] Remove list of entry points from module
This is unneeded, as we can now determine if a function is an entry
point by checking its pipeline stage.

Bug: tint:1718
Change-Id: Icb09b39b7a63cf9a9a36ccad5e144eceec1dfdeb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131521
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-05-16 14:59:30 +00:00
dan sinclair f59547fb7f [ir] Add optional CreateFunction parameters.
This CL adds the pipeline stage and workgroup_size as optional
parameters when creating a function in the IR.

Bug: tint:1718

Change-Id: Iae65dcb9557a644a17ec67fc5269d0c2db3f8aba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133001
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-05-16 14:43:45 +00:00
dan sinclair 69b5900c88 [ir] Use the branch helper in the spirv tests.
This CL updates the SPIRV IR generator tests to use the `Branch` method
of the builder.

Bug: tint:1718
Change-Id: I16961382b797dc90277529f706ee240be282d623
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133000
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: James Price <jrprice@google.com>
2023-05-16 14:42:29 +00:00
Ben Clayton 34c794e2e9 [tint][ir] Shuffle and refactor from_program.cc
Change-Id: Ibbeceb2410e7b3598fd9a92f3871603ee26b69b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132961
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-05-16 12:31:46 +00:00
Ben Clayton 8d98977a30 [tint][ir] Make the ir::BuilderImpl PIMPL
Black-box the BuilderImpl by putting the BuilderImpl into the
from_program.cc file.

Why:

* It means there's only a single definition of all the methods that need
  to be maintained, instead of pointlessly splitting code between two
  files (.cc / .h).
* It removes all the implementation details from the header.
* It removes a whole bunch of transitive includes, slowing compiles.
* It prevents the temptation for future #includes to
  private-implementation details.
* It reduces the amount of symbols declared outside of anonymous
  namespaces, reducing symbol polution and the amount of work on the
  linker.

Bug: tint:1718
Change-Id: I82838089f784ab003dae4ef06545bba1ca2401cc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132321
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-05-16 12:30:06 +00:00