Stephen White
0436d045ab
GLSL: ensure interface blocks have unique names.
...
Bug: tint:1260
Change-Id: I59aeb7272462c80bfb739c6f4759327d12145ac8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67440
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
2021-10-25 19:53:01 +00:00
James Price
91689fb6f0
Add support for matrix construction from scalars
...
Use a transform to convert these to the vector form for the MSL and
SPIR-V backends.
MSL only has the scalar form from version 2.0 onwards.
Fixed: tint:1123
Change-Id: I384abd9872d9eae52a10a37cbd6aa96004692e9c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67360
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-25 19:20:31 +00:00
Ben Clayton
c73b57f2c6
Address late review comments from 67064
...
Use spec-spelling of 'constructible'.
Add missing test file to 'test/BUILD.gn'
See https://dawn-review.googlesource.com/c/tint/+/67064
Change-Id: Ie39773617fd0a363d63cc6449bf3905c9eb6786d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67380
Auto-Submit: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-25 14:26:55 +00:00
Ben Clayton
33c13c6e28
writer/hlsl: Do not emit (void) call_expr;
...
Just emit `call_expr;` instead.
Fixed: tint:1259
Change-Id: I84a2976d82f891e9263f3e11e5774fcb01ea09bd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67381
Reviewed-by: Corentin Wallez <cwallez@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-25 11:00:44 +00:00
Ben Clayton
7b776f18b0
Deprecate Ignore()
...
It's been removed from the spec:
https://github.com/gpuweb/gpuweb/pull/2127
Fixed: tint:1213
Change-Id: I163fe807765bb1ac0580b398f4897daea555216a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67067
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-22 06:23:12 +00:00
Ben Clayton
cc7c4f309b
ProgramBuilder: Migrate away from using Ignore()
...
The `Ignore()` intrinsic is about to be deprecated, so don't use it for testing.
Bug: tint:1213
Change-Id: Ib5d5966da6d566a9f02940970ebd79d520b5e0e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67065
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-21 23:28:44 +00:00
James Price
a41694e9a3
validation: Allow interpolate(flat) on integral IO
...
Produce a warning if the attribute is missing for integral vertex
outputs or fragment inputs. This will become an error in the future,
as per the WGSL spec.
Add the attribute to E2E tests.
Bug: tint:1224
Change-Id: Ia1f353f36cb7db516cf9e8b4877423dec3b3e711
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67160
Auto-Submit: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2021-10-21 23:08:44 +00:00
Ben Clayton
1aa98e62c0
Implement phony assignment
...
Bug: tint:1213
Change-Id: Ib1ebc4947405c4ada7a9bdbc6bd5a36447bbd234
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67064
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-21 23:04:44 +00:00
Stephen White
092326894e
GLSL: emit UBO and SSBO interface blocks.
...
Do not emit block-decorated structs.
Combine them with the variable into a uniform or buffer interface block.
Bug: tint:1223
Change-Id: I16263ea449ecab705319dc440275b7d169021bc9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67243
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-21 21:24:14 +00:00
Stephen White
1e896001e6
GLSL: Don't use a typedef for array returns.
...
Covered by GlslGeneratorImplTest_Function.Emit_Function_WithArrayReturn
Bug: tint:1258
Change-Id: I181641ebe170ec359d9833e9022e6e70747fde9a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67240
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
2021-10-21 20:43:15 +00:00
Ben Clayton
f164a4a723
ast: Add TraverseExpressions()
...
An ast::Expression traversal helper extracted from Resolver.
Change-Id: I88754cbc86cc12cbf8348fb36a3f038904017f3d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67202
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2021-10-21 20:38:54 +00:00
Ben Clayton
72789de9f5
resolver: Remove rule that call statements to functions must return void
...
Fixed: tint:1256
Change-Id: Ibff78a1009d57afd7af8867952a9444daaf13a9c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67201
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
2021-10-21 20:36:04 +00:00
Stephen White
38ed53ce8f
GLSL: factor out the emission of struct members.
...
This will be needed for emitting UBO and SSBO interface
blocks.
Bug: tint:1223
Change-Id: I1cdc75b67a4fe612dcf8094a7d73b8bf1f85f40a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67242
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
2021-10-21 19:49:44 +00:00
Ben Clayton
8fca34546b
ast: Add PhonyExpression
...
Represents the `_` in a phony assignment `_ = <expr>`
Bug: tint:1213
Change-Id: Ifb070277b7872aa5ae405e467e28191e625c4c5a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67062
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-21 18:33:14 +00:00
Ben Clayton
8cab28c9f9
intrinsics: Add scalar overload of all() & any()
...
Fixed: tint:1253
Change-Id: I0bdc865a9df9e0171c09daa9918b25bba033ba3b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67061
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2021-10-21 09:39:13 +00:00
David Neto
347c74e671
wgsl: decimal float: point is optional; can use E for exponent
...
Also: Check for too-small non-zero magnitude on negative numbers too.
Fixes: tint:1255
Change-Id: I3c231ce197c56e1ec517708b8073d49a8ae67ccb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67100
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-10-20 22:07:43 +00:00
Ben Clayton
e81d7dc3c8
reader/wgsl: Lex underscore tokens
...
Bug: tint:1213
Change-Id: Ic5f2bfb2da0bf0f9511f029a93c7007266b2984c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67063
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-20 19:59:23 +00:00
Ben Clayton
7103f51603
writer/msl: Fix swizzling on packed vectors
...
Metal 1.x does not support swizzling on packed_vec types.
Use array-index for single element selection (permitted on LHS and RHS of assignment)
Cast the packed_vec to a vec for multiple element swizzles (not permitted as the LHS of an assignment).
Fixed: tint:1249
Change-Id: I70cbb0c22a935b06b3905d24484bdc2edfb95fc2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67060
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-20 16:12:33 +00:00
Ryan Harrison
8645953be2
Refactor Inspector fuzzing
...
It is always on now when using tint::CommonFuzzer, and runs before &
after the transform step.
This CL also adds missing API coverage to the Inspector fuzzing code.
Errors found with the Inspector are now reported as fuzzer failures
and should generate bug reports.
BUG=tint:1250,tint:1251,tint:1250
Change-Id: I1c1bcbddf81a35620f89c5b7a648c44e6a1f2952
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66980
Auto-Submit: Ryan Harrison <rharrison@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ryan Harrison <rharrison@chromium.org >
Reviewed-by: Alastair Donaldson <afdx@google.com >
2021-10-20 05:01:03 +00:00
Ben Clayton
8648120bbe
Make all ast and sem pointers const
...
And remove a whole load of const_cast hackery.
Semantic nodes may contain internally mutable fields (although only ever modified during resolving), so these are always passed by `const` pointer.
While all AST nodes are internally immutable, we have decided that pointers to AST nodes should also be marked `const`, for consistency.
There's still a collection of const_cast calls in the Resolver. These will be fixed up in a later change.
Bug: tint:745
Change-Id: I046309b8e586772605fc0fe6b2d27f28806d40ef
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66606
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Reviewed-by: David Neto <dneto@google.com >
2021-10-19 18:38:54 +00:00
Ryan Harrison
7d0fc07b20
Add knob for omitting certain storage classes in Robustness transform
...
BUG=tint:779
Change-Id: Ibcedb998671dd2bf189cc795299ea92846196ade
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66780
Auto-Submit: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-19 16:51:23 +00:00
Stephen White
540992ba90
Fix storage buffer structs, test output.
...
Bug: tint:1223
Change-Id: Idbf8f882f44a7bc3dc51bd046d48da3b78a609e2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66362
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-15 19:52:50 +00:00
David Neto
186618dfef
add test for tint::utils::ReplaceAll
...
The new test proves that the algorithm needs to advance 'pos'
past the replacement string.
Change-Id: Ia8fdf6b2c08d6af09e8e631c1d8661752edcb7ce
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66660
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-15 19:24:10 +00:00
Ben Clayton
8c9458271c
ast: Simplify SizeExprToString()
...
Clean up as recommended in review:
https://dawn-review.googlesource.com/c/tint/+/66380/6/src/ast/array.cc#34
Change-Id: I70d66ab552de4a4a4d869aedd2f3c3d9f59d2712
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66603
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Reviewed-by: James Price <jrprice@google.com >
2021-10-15 18:45:40 +00:00
Stephen White
9e631b1645
GLSL: add gl_ reserved words.
...
Bug: tint:1221
Change-Id: I13985c9a8807af625bc0801740294227f0d50b13
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66361
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
2021-10-15 18:44:20 +00:00
Ben Clayton
2bd1321133
ast: Remove pointless deleted copy constructors
...
ast::Node has a deleted copy constructor, so the derived classes cannot be implicitly copied.
Change-Id: I57f74a4ab35dd00b3290b964cb6492f4fa4505a5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66602
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-15 17:40:39 +00:00
Ben Clayton
4f3ff57c28
ast: Keep style consistent
...
Methods and functions are `CamelCase()`
Public fields are `snake_case` with no trailing `_`
Private fields are `snake_case` with a trailing `_`
Remove pointless getters on fully immutable fields.
They provide no value, and just add `()` noise on use.
Remove unused methods.
Bug: tint:1231
Change-Id: If32efd039df48938efd5bc2186d51fe4853e9840
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66600
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
2021-10-15 17:33:10 +00:00
James Price
b3e6c0d62c
validation: Reject nested shader IO structures
...
We previously rejected nested structures for entry point IO only if
there was an attribute on the member in the outer struct. This change
rejects all nested structures instead.
Change-Id: I0d30c8521141154a63915e6c6d8fa31bc23f310e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66520
Auto-Submit: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: James Price <jrprice@google.com >
2021-10-15 14:55:39 +00:00
Ben Clayton
5029e70b6e
ast: Remove helpers from ast::Type
...
These are legacy methods that were written before the semantic type nodes.
These methods do not consider aliases, and any use of these is likely to be broken for aliases.
Fix up uses of these methods to use the semantic types instead.
Change-Id: Ia66749b279eddff655d3d755fef54a6263643e69
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66601
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-15 14:17:31 +00:00
Ben Clayton
4dfa394a3c
ProgramID: Move hot code out of template function
...
This is causing code bloat. Move common code out to a single function that's implemented in the .cc file.
Saves about 25k from the all-features-enabled Release build of tint for x64.
Bug: tint:1226
Change-Id: Idc2fef1b9ca92a2f48dfc5e252a3853721d048aa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66447
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
2021-10-15 13:46:50 +00:00
Ben Clayton
c40d15d5da
resolver: Apply some missing explicit casts
...
These constructor parameters of StructMember take a uint32_t.
The compiler will normally warn / error about this, but there's some quirk of std::make_shared that makes the compiler silence this warning (possibly because the constructor call is in the STL?).
Was noticed when experimenting with BlockAllocator::Create() to reduce binary size.
Change-Id: I8cdf5078150927e5624752ee7374305c0a5982f0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66448
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-14 22:43:21 +00:00
David Neto
a6969c4359
wgsl-reader: Hex float exponents are optional
...
Fixed: tint:1210
Change-Id: I4256494e3ca3f98082f360e0447d0392964073bd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66040
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Antonio Maiorano <amaiorano@google.com >
2021-10-14 21:38:01 +00:00
Ben Clayton
a095b26d17
CloneContext: Move hot code out of template members
...
This is causing code bloat. Move common code out to a single method that's implemented in the .cc file.
Saves about 10k from the all-features-enabled Release build of tint for x64.
Bug: tint:1226
Change-Id: I80b76e69521c3cc890c74b4bc73a68f1c9bdd3df
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66446
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-14 21:27:39 +00:00
Ben Clayton
d1ee47a1cd
ast: Remove to_str() and type_name()
...
This is no longer used.
Fixed: tint:1225
Change-Id: I0cfe9955687a2b7ded3e645c573f3bffbc2f1f84
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66380
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-14 21:25:49 +00:00
Ben Clayton
a5b3f07ec7
reader/spirv: Test with WGSL writer intead of to_str()
...
This change replaces all the SPIR-V reader tests to their equivalent WGSL form.
Bug: tint:1225
Change-Id: Idf0e6050f49fad0a8223b50bac89014dbdcf9b2b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66444
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-14 21:22:19 +00:00
Ben Clayton
1364f202da
Remove more uses of AST to_str() and type_name()
...
These methods are going to be removed as they provide little benefit over the WGSL form, are a maintainance burden and they massively bloat our codebase.
This change introduces sem::CallTargetSignature, which can be used as a std::unordered_map key.
This is used in writer/spirv to replace a map that was keyed off ast::Function::type_name().
Bug: tint:1225
Change-Id: Ic220b3155011f21b14d49eecc8042001148e4ca5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66443
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-14 21:17:29 +00:00
Ben Clayton
11ed0db30d
resolver: Don't use ast to_str() methods
...
These return weird names that love the use of '__' and have little relation to WGSL.
Improve the duplicate case error message.
Clean up control_block_validation_test.cc by making used of the ProgramBuilder helpers.
Bug: tint:1225
Change-Id: I8c4cf3943145cf8372c00d33ae0166c0c0bcbb8b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66442
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-14 20:30:29 +00:00
Ben Clayton
262210f12b
utils: Add ReplaceAll() string helper
...
Helpful for template string substitutions in tests, to reduce string concat noise.
Change-Id: I612084e2c267d93d79c92cf3ac0231b6b904f0e3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66440
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
2021-10-14 20:24:50 +00:00
Stephen White
b281dd168d
GLSL: implement atan2.
...
GLSL has no atan2() instrinsic, but a 2-parameter overloaded atan()
instead.
Bug: tint:1222
Change-Id: I368b3989117cd329fea1020cd941daa0a69525cd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66360
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-14 16:17:38 +00:00
Stephen White
2f963aaf82
More GLSL fixes.
...
Remove register-and-space decoration.
Add "main" to GLSL keywords, to force renaming.
Output correct compute width decoration (not numthreads).
Remove static keyword.
Bug: tint:1218 tint:1219 tint:1220
Change-Id: I171f183690b6531c76218414e0d81f6ef5e22e6b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66340
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-14 16:16:19 +00:00
Stephen White
7cf3b28a87
GLSL writer: validate all entry points with glslang.
...
Generate and validate all entry points individually.
This is required since GLSL has separate shader files, and
can only have a single "main" entry point.
Bug: tint:1217
Change-Id: Ie5cb510aaef3b7c8a7573f5fa9446815284afecb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/61920
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-14 14:39:36 +00:00
Ben Clayton
f3f2d0a218
Resolver: Remove texture_storage read access
...
The intrinsics that did anything useful with this were deprecated
several releases ago.
Change-Id: I79e3c901b6a78583853a067ec46cfa98e346517c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66262
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-14 10:10:45 +00:00
Ben Clayton
14fc622161
ast: Rename CallExpression::params() to args()
...
Arguments are the values passed to a function.
Parameters receive arguments.
Fixed: tint:811
Change-Id: I82fe71aa795b8b365bc78981e84c86b419eb3eb2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66263
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Auto-Submit: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-10-14 09:51:14 +00:00
Ben Clayton
2aa6855914
intrinsics: Remove deprecated modf & frexp overloads
...
These have been deprecated for multiple chrome releases.
Change-Id: I4cc05a74ff8f085e6d13f93aefb93077480e52f5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66261
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-10-12 21:57:47 +00:00
Ben Clayton
d57a129810
reader/spirv: Remove stdout spam in tests
...
Change-Id: I06361ae5bb0f69b3ac66c3ddc22abb5988e4c4fe
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66260
Commit-Queue: Ben Clayton <bclayton@google.com >
Auto-Submit: Ben Clayton <bclayton@google.com >
Kokoro: Ben Clayton <bclayton@google.com >
Reviewed-by: David Neto <dneto@google.com >
2021-10-12 17:35:27 +00:00
Ryan Harrison
ce90ac52f4
Remove BoundArrayAccessors
...
BUG=tint:1212
Change-Id: I054bedb6f20ef18d70408087f774ef252403b49c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66100
Auto-Submit: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-07 21:55:21 +00:00
Stephen White
a9f8c7db81
Implement GLSL writer backend.
...
This is a modified version of the HLSL writer.
Basic types, arrays, entry points, reserved keywords, uniforms,
builtin uniforms, structs, some builtin functions, zero initialization
are implemented. Textures, SSBOs and storage textures in particular are
unimplemented. All the unit tests "pass", but the output is not correct
in many cases.
triangle.wgsl outputs correct vertex and fragment shaders that pass
GLSL validation via glslang. compute_boids.wgsl outputs a valid but not
correct compute shader.
Change-Id: I96c7aaf60cf2d4237e45d732e5f51b345aea0552
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57780
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Stephen White <senorblanco@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-06 18:55:10 +00:00
James Price
ceab140a8b
validation: Reject struct builtins on wrong stages
...
Change-Id: I047f28c5be6a7d878b9f7ad37b6accc842b4fe98
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65840
Auto-Submit: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-05 15:02:17 +00:00
Ryan Harrison
2271b9541c
Support reflecting uninitialized pipeline overrideable constants
...
Also adds testing for constants type reporting
BUG=tint:852
Change-Id: Ic644f3a4e6687446a552ce755951966743c8ee97
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65641
Auto-Submit: Ryan Harrison <rharrison@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-10-04 11:01:19 +00:00
Ben Clayton
5e35864c1b
writer/spirv: Fix abs() on unsigned integers
...
GLSLstd450SAbs expects a *signed* integer.
abs() of an unsigned number is now a no-op.
Fixes WebGPU CTS tests:
webgpu:shader,execution,robust_access_vertex:vertex_buffer_access:*
Bug: tint:1194
Change-Id: I65c5e9f2f03aac0b788b9ba88c383cbec136d7c6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65620
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Kokoro: Ben Clayton <bclayton@chromium.org >
Reviewed-by: David Neto <dneto@google.com >
2021-10-01 08:41:55 +00:00