Commit Graph

9990 Commits

Author SHA1 Message Date
Jiawei Shao 2a6cc4f8fb Optimize B2T and T2B copies with multiple array layers on Metal
This patch moves the computation of TextureBufferCopySplit outside of
the loop over each copy texture array layer so that we only need to do
the computation once for each B2T and T2B copy command.

BUG=dawn:453
TEST=dawn_end2end_tests

Change-Id: I1fcfc972504f845467af92a77bc37870ed7b52a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23720
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-25 00:00:18 +00:00
Brandon Jones 10e4a44ce6 Roll third_party/spirv-cross/ f9ae06512..2e7a56258 (1 commit)
f9ae06512e..2e7a562583

$ git log f9ae06512..2e7a56258 --date=short --no-merges --format='%ad
%ae %s'
2020-06-23 post HLSL: Workaround FXC bugs with degenerate switch blocks.

Created with:
    roll-dep third_party/spirv-cross

Bug: dawn:425
Change-Id: Ibc80512eeb55b46704daccfd7f4cc2d6c1ddedc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23760
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-06-23 20:14:15 +00:00
dan sinclair ec3e2d4abd [metal-writer] Add entry point support.
This CL adds preliminary entry point support to the Metal backend.

Bug: tint:8
Change-Id: I7b904621d706d4503d5054711de64872f79cf2fa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23708
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 18:22:28 +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
Ryan Harrison 9a452c11ae Fix BUILD.gn issues for TypeDeterminerTest
Change-Id: Iba35145fcba04ecaf2cb411c5e87d2e7f8ecea50
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23740
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-23 16:38:47 +00:00
Austin Eng 8ab3719fc4 Fix validation of multisampled BGL bindings
Bug: chromium:1097501, chromium:1097514
Change-Id: I18f03398488cc3b5adf6755989e787e117d8a004
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23640
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-06-23 00:22:24 +00:00
David Neto 1ca5382749 [spirv-reader] Simplify null composites
Use the shortcut for zero-values: a type constructor without
any parameters.  Scalars still use plain literals like false, 1u, 1.0.

Change-Id: Ie436f1af28cbab0b4c87a07b057deb04632eb534
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23680
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-22 23:15:52 +00:00
Ryan Harrison 4cf65bcab5 Rolling 4 dependencies
Roll third_party/glslang/ 00965b9fa..839704450 (14 commits)

00965b9fa9..8397044502

$ git log 00965b9fa..839704450 --date=short --no-merges --format='%ad %ae %s'
2020-06-22 gleese Update test expected files with new magic number
2020-06-22 gleese Update SPIR-V generator version
2020-06-05 gleese Update test results to expect OpFUnordNotEqual
2020-06-05 gleese Use OpFUnordNotEqual for floating-point !=
2020-06-22 johnkslang Update README.md
2020-06-19 bclayton Add kokoro configs for android-ndk and cmake
2020-06-19 bclayton Switch ndk_test from gnustl_static to c++_static
2020-06-17 ShabbyX Add -g0 command line argument
2020-06-16 cepheus Build: use better MSVC subfolder names for the previous build changes.
2020-06-16 cepheus Bump version numbers.
2020-06-16 bclayton Move hlsl/ source to glslang/HLSL/
2020-06-16 cepheus Bump version.
2020-06-15 bclayton CMake: Fold HLSL source into glslang
2020-06-10 bclayton C Interface: Split SPIR-V C interface to own file

Roll third_party/shaderc/ c2ac70797..caa519ca5 (2 commits)

c2ac70797a..caa519ca53

$ git log c2ac70797..caa519ca5 --date=short --no-merges --format='%ad %ae %s'
2020-06-17 rharrison Add support for different default/trunks in roll-deps (#1086)
2020-06-15 rharrison Rolling 5 dependencies (#1085)

Roll third_party/spirv-cross/ 9e3df69d4..f9ae06512 (12 commits)

9e3df69d4e..f9ae06512e

$ git log 9e3df69d4..f9ae06512 --date=short --no-merges --format='%ad %ae %s'
2020-06-22 dsinclair Roll deps and update tests.
2020-06-22 post MSL: Remove the old VertexAttr API.
2020-06-19 cwallez Fix placement of SPIRV_CROSS_DEPRECATED.
2020-06-19 post Fix duplicated initialization for loop variables with initializers.
2020-06-18 post MSL: Add test case for constructing struct with non-value-type array.
2020-06-18 post MSL: Deal with loading non-value-type arrays.
2020-06-18 post MSL: Add tests for array copies in and out of buffers.
2020-06-18 post MSL: Improve handling of array types in buffer objects.
2020-06-18 post Clean up some deprecation warnings when building with Makefile.
2020-06-18 post Remove unused member in MSLShaderInput.
2020-06-13 cdavis MSL: Fix up input variables' vector lengths in all stages.
2020-06-16 post HLSL: Fix texProj in legacy HLSL.

Roll third_party/tint/ b8f493005..0c647a889 (15 commits)

https://dawn.googlesource.com/tint/+log/b8f4930055df..0c647a8896d1

$ git log b8f493005..0c647a889 --date=short --no-merges --format='%ad %ae %s'
2020-06-22 dneto sample: handle SPIR-V assembly input
2020-06-19 dj2 [spirv-writer] Emit logical and and logical or
2020-06-18 dneto [spirv-reader] Remove orphaned TODOs
2020-06-18 dsinclair Add support for sclamp and uclamp GLSL methods.
2020-06-18 dsinclair [spirv-writer] Add as casts.
2020-06-18 dneto [spirv-reader] Add ConvertFToU, ConvertFToS
2020-06-18 dsinclair [wgsl-reader] Fixup off by 1 bug.
2020-06-17 dneto [spirv-reader] Add mixed scalar/vector/matrix multiply
2020-06-17 dneto [spirv-reader] Add ConvertSToF, ConvertUToF
2020-06-17 dj2 Add GLSL MatrixInverse type determination.
2020-06-17 dneto [spirv-reader] Add vector shuffle
2020-06-17 dj2 Add type determination for GLSL determinant.
2020-06-17 dneto [spirv-reader] Add OpCopyObject
2020-06-17 dj2 [spirv-writer] Only extract composites for non-const constructors.
2020-06-16 dneto [spirv-reader] Add ArrayStride

Change-Id: I74d332c0972b2e6e0f4b6cc349d54ea5887b051c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23661
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-06-22 20:54:53 +00:00
dan sinclair 13d2a3b96c [spirv-writer] Only add used variables to entry point.
This Cl updates the entry point code to only output Input/Output
variabes which are referenced by the function instead of all
Input/Output variables.

Bug: tint:28
Change-Id: Idc429e02cac8dac7fc7b609cbd7f88039695829e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23623
Reviewed-by: David Neto <dneto@google.com>
2020-06-22 20:52:24 +00:00
David Neto 194e0cca3b [spirv-reader] Support OpNop
An OpNop maps to nothing

Bug: tint:3
Change-Id: Id73601d481971954dd4de706202b5229dcf39871
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23561
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-22 20:49:34 +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
David Neto cb8e0bae00 [spirv-reader] Use type aliases pervasively
When a type alias is created, map the SPIR-V type ID to the
type alias, not the underlying type. Only unpack the alias as
needed when inspecting the content structure to make values.

Bug: tint:3
Change-Id: I11011ddd190d89c81d3323f684a5e13f17dde09d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23582
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-22 20:45:43 +00:00
dan sinclair 5b853eebc6 Support the zero initializer syntax.
This Cl updates the system to allow zero initializers. This allows:

```
var a : vec3<f32> = vec3<f32>();
```

Bug: tint:34
Change-Id: I84d6b431914c4ddf112ed375fae028d912f4a080
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23660
Reviewed-by: David Neto <dneto@google.com>
2020-06-22 20:44:27 +00:00
David Neto 9c88ea5988 type determine accessor on aliased array
Change-Id: I8084bf6c30649acb2d6d7639fa6bf78cdd0a4a6a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23581
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-22 20:33:12 +00:00
David Neto 32a4f957b4 Add type alias unwrapping methods
Change-Id: I8dbd3bba48ae95d76f75a5eba3e97ed4e091ed01
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23580
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-22 20:30:33 +00:00
dan sinclair e87ba1fd37 [spirv-writer] Add Operand and Instruction list aliases.
This CL adds OperandList and InstructionList aliases.

Bug: tint:5
Change-Id: I74263e937ed6007bb44c8d502b122d55af4c7b21
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23622
Reviewed-by: David Neto <dneto@google.com>
2020-06-22 20:18:26 +00:00
dan sinclair 011aed9b82 [spirv-writer] Add function calls
This CL adds calls to functions to the SPIR-V writer.

Bug: tint:5
Change-Id: Id6f3e41deba937edb85fa6ec2f2db8d1f4241944
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23621
Reviewed-by: David Neto <dneto@google.com>
2020-06-22 20:18:17 +00:00
dan sinclair 7fe4d02ca1 [spirv-writer] Generate function parameters.
This CL adds generation of OpFunctionParameter entries for function
parameters.

Bug: tint:5
Change-Id: I7af6cb756e20674f32737f2ef362fda12c9d2ef2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23620
Reviewed-by: David Neto <dneto@google.com>
2020-06-22 20:09:23 +00:00
David Neto 0c647a8896 sample: handle SPIR-V assembly input
Change-Id: Ic9f5263cdb398a2853dc49cfef3956cb9c8de0dc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23583
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-22 14:36:34 +00:00
Jiawei Shao 92379bff49 Support copying multiple array layers in one B2T and T2B copy command
This patch adds the support of copying with multiple texture array
layers in one buffer-to-texture and texture-to-buffer copy command.

BUG=dawn:453
TEST=dawn_end2end_tests

Change-Id: If009dbb29f2b0ef0667715eed0d66053b1491fd4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23248
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-06-21 09:33:44 +00:00
Austin Eng 250f26229b Use TypedInteger for BindGroupIndex
Bug: dawn:442
Change-Id: I889a943cbaf2d349c31a15fdf126d66964bdd0a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23247
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-06-20 01:30:32 +00:00
Jiawei Shao e5d94c31a0 Fix a bug in ComputeTextureCopyBufferSize with empty copySize
This patch fixes a bug in buffer-to-texture and texture-to-buffer copies
when copySize.height == 0 or copySize.depth == 0. Previously we miss the
checks if either copySize.height or copySize.depth is 0 before doing
(copySize.height / blockHeight - 1) and (copySize.depth - 1) thus we
will get incorrect results because of arithmetic overflows.

This patch fixes this bug by adding the missed check and adds the
related regression tests in dawn_unittests

BUG=dawn:453
TEST=dawn_unittests

Change-Id: I970e420c0fa7f0b61c656365bef079c123a59e6a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23520
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-06-19 22:39:53 +00:00
Idan Raiter f434fdc6ed Add minimum buffer size validation
Bug: dawn:459
Change-Id: I755cc0ada7be7b1cb71724cb410ab0c3a88cea24
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22421
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-19 21:39:23 +00:00
dan sinclair be66f9faf9 [spirv-writer] Emit logical and and logical or
This CL adds support for the &&  and || operators to the SPIR-V backend.

Bug: tint:5
Change-Id: I63b23d9904b5b8027e189034d24949df71cbbe42
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23501
Reviewed-by: David Neto <dneto@google.com>
2020-06-19 19:44:38 +00:00
Austin Eng b75075ac7b Protect against huge buffer allocations on macOS 10.12, 10.13
|MTLDevice maxBufferLength| is not available until 10.14, so on
lower versions of macOS, try using |recommendedMaxWorkingSetSize|

Bug: dawn:450
Change-Id: I52dc4211cf3d7014771d580a9af9c72abe92a375
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23263
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-06-19 18:47:33 +00:00
Austin Eng 0e9e5ee8aa Skip Buffer OOM tests when using ASAN
ASAN throws when hitting OOM conditions which these tests intentionally
try to create.

Bug: dawn:450
Change-Id: I635480ae329cd5ace55287d77e2b79e663174f49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23246
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-19 17:35:33 +00:00
Corentin Wallez 90abd47a28 dawn_wire: Factor the common command serialization pattern.
Bug: dawn:445

Change-Id: I15a99a126c0494fd06dd727ff5c9008cde675d76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23560
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-19 16:49:43 +00:00
Austin Eng 8f9523eb38 Add support for multisampled sampling
This CL adds support for multisampled sampling on the D3D12 backend.
This was already working on other backends. It also adds tests that all
of the sample locations are correct.

Bug: dawn:431
Change-Id: I6849e5e2d708ad4824e6db2665d668d43a4ef5ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23245
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-19 16:21:33 +00:00
Corentin Wallez 4e4ebe87ad Vulkan: Simplify PNextChainBuilder
Change mTailPtr to mCurrent that's a VkBaseOutStructure*.

Bug: dawn:464
Change-Id: Ic10a0abc95e279e1537786601d006cf18305687a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23540
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-19 16:08:43 +00:00
Corentin Wallez be637db589 Vulkan: Correctly request 16bit shader features.
All the querying of extensions was correctly handled for the WebGPU
ShaderFloat16 extensions, except that we forgot to request it when
creating the VkDevice.

In practice this doesn't crash as most drivers won't check if the
extension is enabled, and just compile the shader code correctly.
However the Vulkan Validation Layers complain. This CL fixes it by
requesting the features on device creation.

Bug: dawn:426
Change-Id: Id7307bb4f1d08a10bec9fc7bf0500c5761f96ff7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23203
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-06-19 14:41:23 +00:00
Austin Eng 693e88ae85 Vulkan: consider VK_ERROR_OUT_OF_HOST_MEMORY an OOM error
Bug: dawn:450
Change-Id: I89095a23a5bf7e17553b6945f79347ba31d732c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23480
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-19 07:30:13 +00:00
David Neto 6b6e6a16ea [spirv-reader] Remove orphaned TODOs
TODOs in the test file are or were in the function_arithmetic_test.cc

Change-Id: I679dbf0019e12e26488ccc310dfb03a535628e0b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23462
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-18 19:42:24 +00:00
dan sinclair e9598d697a Add support for sclamp and uclamp GLSL methods.
This CL adds support for type determination of the SClamp and UClamp
GLSL methods.

Change-Id: I974e80127f0e256285f126136270ac5131334a92
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23500
Reviewed-by: David Neto <dneto@google.com>
2020-06-18 18:03:00 +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
David Neto d7868e34c2 [spirv-reader] Add ConvertFToU, ConvertFToS
Bug: tint:3
Change-Id: I9f3188e0aac64e98da785c4df2e8b2aa42b71cf8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23402
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-18 17:57:23 +00:00
dan sinclair 206d7401ae [wgsl-reader] Fixup off by 1 bug.
When parsing the `u` in `1024u` we were not advancing the lexer to the
next token which would give parse errors.

Change-Id: I8473b55992ff01d24f9d961878afa6b54d855e68
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23460
Reviewed-by: David Neto <dneto@google.com>
2020-06-18 14:10:58 +00:00
Corentin Wallez 581c407cd2 Fix TypedInteger hash compilation failure with stdlibc++
TypedInteger.h didn't include <functional> which made the reference to
std::hash cause a compilation failure. Fix this by moving TypedInteger
hashing to HashUtils.h so that TypedInteger doesn't include <functional>
in all of its users.

Bug: dawn:442
Change-Id: I5a0271bb187682616eb5ef3a13bb7f6271203453
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-18 09:00:48 +00:00
Ryan Harrison a84ab48150 Add support for different default branches in roll-shader-deps
tint has moved to using origin/main, and shaderc is soon to migrate

Change-Id: I578e4df91330351e10513874b2ca2728e4227803
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-06-17 23:52:19 +00:00
David Neto e12c5ff42e [spirv-reader] Add mixed scalar/vector/matrix multiply
Bug: tint:3
Change-Id: I5875bf453b05c5d5c96f90122206da04f6799976
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23401
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-17 23:33:35 +00:00
Austin Eng 7a4685f448 Add TypedInteger
This CL adds a TypedInteger helper which provides additional type
safety in Dawn. It is a compile-time restriction that prevents integers
of different types from being used interchangably in Debug builds.

It also adds ityp::{array,bitset,span} as helper classes to wrap std::
versions (not span). These accept a template paramter as the Index type
so that typed integers, or enum classes, may be used as a type-safe
index.

For now, bind group layout binding indices use TypedInteger. Future
CLs will convert other indices to be type-safe as well.

Bug: dawn:442
Change-Id: I5b63b1e4f6154322db0227a7788a4e9b8303410e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19902
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-06-17 22:35:19 +00:00
David Neto b961e0069b [spirv-reader] Add ConvertSToF, ConvertUToF
Bug: tint:3
Change-Id: I28bcc109a207ef6f5225b9ea707bff11b1b6fd50
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23420
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-17 20:48:56 +00:00
dan sinclair 3238eaa3b1 Add GLSL MatrixInverse type determination.
This CL adds type determination for the MatrixInverse GLSL method call.

Change-Id: I976beb00bb5c869407a0c9f522789112ff22bf6a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23400
Reviewed-by: David Neto <dneto@google.com>
2020-06-17 20:22:08 +00:00
David Neto 7df946d7aa [spirv-reader] Add vector shuffle
Use composite-construct from decomposed singly-named operands.

Bug: tint:3
Change-Id: I8536c5f8e87de312460c3d5c6164e090d79bb4a9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23380
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-17 20:07:49 +00:00