Commit Graph

2098 Commits

Author SHA1 Message Date
Kai Ninomiya 3d80b5c378 lint_clang_format.sh: Un-skip tests and examples
These were previously skipped because clang-format was messing up our
builder-pattern code. But we got rid of the builder pattern long ago.

The actual files will be autoformatted in the next CL.

Bug: none
Change-Id: Ia01a2cabc2daa9d94a15bf44687bc2e5801b49bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24621
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-10 19:41:38 +00:00
Kai Ninomiya 6328356129 Autoformat everything except tests/examples
Done by:
- Appending an extra newline at the end of src/**/*.{cpp,h,mm,gn}
  except src/tests/*
- Running git cl format --full to format the full contents of every
  changed file

Bug: none
Change-Id: Id88fc5ed0c5efbbc93b2c6a305c2f98465fe646d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24641
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-10 18:19:38 +00:00
Kai Ninomiya d82ef86b79 Use buildtools clang-format
Previously, buildtools' copy of clang-format was stuck at 6.0, so we
used a custom built of 7.0. Now, buildtools' version is 11.0.

Bug: none
Change-Id: I8964bcfbea2d40284249427395c8d417fc77b18d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24640
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-10 17:49:18 +00:00
Kai Ninomiya 479689912e Reorder minBufferBindingSize to match upstream webgpu.h
Bug: dawn:22
Change-Id: I409a2de9f1704613d1cdbda976c3ab50eff48d46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24603
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-09 20:49:43 +00:00
Enrico Galli c9fc175bba D3D12: Empty CPU written range in Unmap calls on READBACK heaps
In order to remove a warning in the D3D debug layer, this patch passes
an empty range CPU written range to calls of Unmap on READBACK
buffers.

Bug: dawn:419
Change-Id: Ic4dcbf31beb3a257c3d88896f4bb97e19caf0cc6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24301
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-09 20:40:53 +00:00
Tomek Ponitka c98988de11 Added validation tests for copying to 2d-array textures
Added validation tests for CommandEncoder::CopyB2T, CommandEncoder::CopyT2B and
Queue::WriteTexture which involve copying or writing to multiple layers
of a 2d-array texture.

Bug: dawn:483
Change-Id: I23f580dff86cd2512a94b41c9c0ce795122a045e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24443
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-07-09 17:33:13 +00:00
Jiawei Shao dab10eae8a Implement buffer lazy initialization before CopyBufferToBuffer
This patch implements buffer lazy initialization before
CopyBufferToBuffer() behind the toggle LazyClearBufferOnFirstUse.
- If the source buffer is not initialized, it will be cleared to 0
  before CopyBufferToBuffer().
- If the destination buffer is not initialized and the copy doesn't
  overwrite the whole buffer, it will be cleared to 0 before
  CopyBufferToBuffer(), otherwise the buffer shouldn't be cleared.

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: I3d0512c6376a1ed8928e86f8e56fefebc16910fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24360
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-09 09:15:22 +00:00
Corentin Wallez d3bf2188aa Remove usage of the UNIT_TEST macro.
It is breaking the roll of Dawn in Chromium because on ChromeOS the
macro is defined on the command-line, causing the compilation to fail
because of a macro redefinition.

Bug: None
TBR=enga@chromium.org
Change-Id: I13eebb9b40f2a5f7c1eed4e3572de3eda2db8bb6

Change-Id: I4797211f4d9ff122d992d78aeac83fd4f0585ff6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24580
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-09 07:00:32 +00:00
Corentin Wallez 1318c603d9 Don't rely on null::Queue::Submit resolving mapping operations.
In the validation tests, we relied on Queue.Submit(0, nullptr) to
resolve mapping operations. This is fragile so we replace it with a
FlushMappingOperations() function that uses device.Tick() instead.

This allows removing the mapSerial argument from
Buffer::MapRead/WriteAsyncImpl (which was the actual goal of this CL).

Bug: dawn:445
Change-Id: Id98822287370c371bebb83afb8e290e17f3c1b55
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24381
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-09 06:12:04 +00:00
Austin Eng d761d5a575 Add Chromium's StackVector base class and ityp::stack_vec
In order to lift Dawn's restriction on the number of bindings
per bind group, static sized arays need to be converted to
dynamically sized vectors. This CL adds Chromium's StackVector
class which behaves like std::vector but provides a stack allocator
to allocate small vectors on the stack. Dawn can use this to avoid
making separate heap allocations for a smaller, realistic binding
counts.

The CL also adds an ityp::stack_vec class to support using
a StackVector with TypedInteger indices.

Bug: dawn:442, dawn:443
Change-Id: I7604c02b3ea52cd63990a2e8b45ed238a5d52232
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23681
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-07-08 20:27:30 +00:00
Corentin Wallez 8a9919980f Don't leak buffers if MapAtCreation fails.
This required changing DeviceBase::CreateBufferImpl to return
ResultOrError<Ref<BufferBase>>

Bug: chromium:1103154
Change-Id: I1a5811d293333b6ef29c988a08f2f1f84ac65702
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24500
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-07-08 19:45:40 +00:00
Corentin Wallez 519edd5890 Fix MSVC compilation.
- Fix a struct vs. class in forward declaration of std::hash
 - Fix an unsigned vs. signed compare in BitSetIterator
 - Fix the assumption that std::array::[const_]iterator is a pointer.
 - Fix for reinterpret_cast from uint64_t to uint64_t not being allowed
   for vulkan_platform.h
 - Fix for a 32bit shift being expanded to 64bit.

Bug: None
Change-Id: I5f2bf8745aa1ef1eba9916fcf6ff7801b48f61cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24501
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-08 18:50:30 +00:00
Tomek Ponitka a9c7d64aad Adding Queue::WriteTexture
Added Queue::WriteTexture with validation but no actual
implementation. Tests were mostly taken from validation tests
for copying buffer to texture. Validation tests for CopyB2T
and WriteTexture do not cover 2d-array textures yet.

Bug: dawn:483
Change-Id: I9027eb615c02fe2265cde912f6ba17a235b94728
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-07-08 18:42:30 +00:00
Enrico Galli 83fe1bc34d D3D12: Added default optimized clear color to resource creation
Adding zero as the optimized clear value to silence a warning in
the D3D12 debug layer. Warning will still occur under non-zero
clears.

Bug: dawn:418
Change-Id: Idada948950f28130618834d966b237dcc39460c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24300
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-08 07:39:56 +00:00
Bryan Bernhart 7622be0544 D3D12: Avoid re-binding sampler tables.
Skip re-binding samplers since sampler heap
allocations are cached and the pipeline would
redundantly get set every draw. This is
particularly important for draw heavy scenarios.

After the change:
+3% in RendererPerfTest/1.* via SkiaDawn
+100% for Forest Demo FPS (55ms vs 28ms)

BUG=dawn:479

Change-Id: I93cbca4e365d6ff89ec86fc15eaccf70b49ea916
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24161
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2020-07-07 23:32:52 +00:00
Ryan Harrison a0b4571546 Roll 6 dependencies
Roll third_party/glslang/ 839704450..29c9135d0 (34 commits)

8397044502..29c9135d06

$ git log 839704450..29c9135d0 --date=short --no-merges --format='%ad %ae %s'
2020-07-07 rharrison Make sure glslang_angle has a definition in BUILD.gn
2020-07-07 bclayton Remove GLSLANG_BUILD_PIC flag
2020-07-07 bclayton Add new static targets to VS solution folders
2020-07-07 bclayton Add new rules to .gitignore
2020-07-03 marcin.slusarz Add --quiet option.
2020-07-05 ShabbyX gn: Fix dawn tests in Chromium
2020-07-05 ShabbyX gn: Fix `gn gen --check` by adding missing dependency
2020-07-03 bclayton Add GLSLANG_BUILD_PIC CMake flag
2020-07-03 ShabbyX gn: Optionally disable optimizations and HLSL
2020-07-03 bclayton Don't use add_link_options() on old CMake versions
2020-07-03 bclayton License headers: s/Google/The Khronos Group
2020-07-03 bclayton Kokoro: Correct the `build_file' path to build.sh
2020-07-02 bclayton Add config for license-checker and Kokoro scripts.
2020-07-02 bclayton Fix GLSLANG_IS_SHARED_LIBRARY define
2020-07-01 bclayton Add missing copyright headers
2020-07-02 cepheus Bump revision.
2020-07-01 cepheus SPIRV-Tools and tests: Update to location-validation in SPIRV-Tools.
2020-07-01 cepheus Tests: More broadly use automapping binding/location.
2020-07-01 bclayton Add additional licenses in use to LICENSE.txt
2020-07-01 cepheus HLSL: Catch error cases earlier, preventing a later assert.
2020-06-29 bclayton glslang: Only export public interface for SOs
2020-06-29 bclayton CMake: break up glslang into smaller static libs
2020-06-30 cepheus SPV: RelaxedPrecision: use the result precision for texture sampling.
2020-06-30 cepheus SPV: RelaxedPrecision: Generalize fix #2293 to cover more operations.
2020-06-24 e.proydakov Fixed GCC -Wunused-parameter in hlslParseables.cpp.
2020-06-29 bclayton CMake: Compile with -fPIC when building SOs
2020-06-29 bclayton CMake: Error on unresolved symbols
2020-06-29 bclayton Remove root kokoro/linux-*-cmake configs
2020-06-26 cepheus SPV: Fix #2293: keep relaxed precision on arg passed to relaxed param
2020-06-26 cepheus SPV: Partially address #2293: correct "const in" precision matching.
2020-06-25 lriki.net Add pack_matrix test
2020-06-12 lriki.net HLSL: Fix #pragma pack_matrix(row_major) not work on global uniforms
2020-06-24 bclayton Kokoro: Split linux cmake cfgs into static/shared
2020-06-23 e.proydakov Fixed msvc 2019 nmake compiler warnings with RTTI. By default cmake generates cxx_flags with `/GR` parameter. I updated CMAKE_CXX_FLAGS string and replaced `/GR` -> `/GR-`

Created with:
  roll-dep third_party/glslang

Roll third_party/shaderc/ f4025c1cd..1402ed576 (3 commits)

f4025c1cd5..1402ed5765

$ git log f4025c1cd..1402ed576 --date=short --no-merges --format='%ad %ae %s'
2020-07-07 rharrison Roll 6 dependencies and update expectations. (#1097)
2020-07-06 dneto glslc and spvc understand -h as the same as --help (#1089)
2020-07-03 dneto Glslang third party build needs -fPIC (#1093)

Created with:
  roll-dep third_party/shaderc

Roll third_party/spirv-cross/ 2e7a56258..559b21c6c (13 commits)

2e7a562583..559b21c6c9

$ git log 2e7a56258..559b21c6c --date=short --no-merges --format='%ad %ae %s'
2020-07-06 dsinclair Roll deps.
2020-07-01 post MSL: Do not emit swizzled writes in packing fixups.
2020-07-01 post MSL: Workaround broken vector -> scalar access chain in MSL.
2020-07-06 post MSL: Use input attachment index directly for resource index fallback.
2020-07-06 post GLSL: Support I/O flattening with arrays as final type.
2020-07-03 post GLSL: Support multi-level struct flattening for I/O.
2020-07-01 post Run format_all.sh.
2020-07-01 post test: Use --hlsl-dx9-compatible when attempting to compile SM 3.0 shaders.
2020-06-30 post GLSL: Fix nested legacy switch workarounds.
2020-06-29 post GLSL: Implement switch on ESSL 1.0.
2020-06-29 post GLSL: Use for-loop fallback instead of do/while for legacy ESSL.
2020-06-29 post Implement context-sensitive expression read tracking.
2020-06-29 post Fix bug with control dependent expression tracking.

Created with:
  roll-dep third_party/spirv-cross

Roll third_party/spirv-headers/ 11d7637e7..308bd0742 (1 commit)

11d7637e7a..308bd07424

$ git log 11d7637e7..308bd0742 --date=short --no-merges --format='%ad %ae %s'
2020-06-26 dj2 Register the Tint compiler

Created with:
  roll-dep third_party/spirv-headers

Roll third_party/SPIRV-Tools/ 52a5f074e..2fbeb04b6 (29 commits)

52a5f074e9..2fbeb04b6e

$ git log 52a5f074e..2fbeb04b6 --date=short --no-merges --format='%ad %ae %s'
2020-07-07 andreperezmaselco.developer spirv-fuzz: Implement the OpVectorTimesMatrix linear algebra case (#3489)
2020-07-07 vasniktel spirv-fuzz: fuzzerutil::MaybeGetConstant* #3487
2020-07-06 jaebaek Debug info preservation in copy-prop-array pass (#3444)
2020-07-03 vasniktel spirv-fuzz: TransformationInvertComparisonOperator (#3475)
2020-07-02 vasniktel Fix regression (#3481)
2020-07-02 vasniktel spirv-fuzz: Add fuzzerutil::FindOrCreate* (#3479)
2020-06-30 vasniktel spirv-fuzz: Add FuzzerPassAddCopyMemoryInstructions (#3391)
2020-06-30 vasniktel spirv-fuzz: Add one parameter at a time (#3469)
2020-06-29 jaebaek Fix ADCE pass bug for mulitple entries (#3470)
2020-06-26 ehsannas Add gl_BaseInstance to the name mapper. (#3462)
2020-06-26 andreperezmaselco.developer Implement the OpMatrixTimesScalar linear algebra case (#3450)
2020-06-25 jaebaek Clear debug information for kill and replacement (#3459)
2020-06-25 alanbaker Validate location assignments (#3308)
2020-06-23 ehsannas Support OpCompositeExtract pattern in desc_sroa (#3456)
2020-06-23 vasniktel spirv-fuzz: Implement FuzzerPassAddParameters (#3399)
2020-06-23 vasniktel spirv-fuzz: Add GetParameters (#3454)
2020-06-23 vasniktel spirv-fuzz: Permute OpPhi instruction operands (#3421)
2020-06-22 rharrison Add support for different default/trunks in roll-deps (#3442)
2020-06-19 jaebaek [spirv-opt] debug info preservation in ssa-rewrite (#3356)
2020-06-19 ehsannas Updated desc_sroa to support flattening structures (#3448)
2020-06-19 vasniktel spirv-fuzz: Refactor variable creation (#3414)
2020-06-19 vasniktel spirv-fuzz: Swap operands in OpBranchConditional (#3423)
2020-06-18 stevenperron Use structured order to unroll loops. (#3443)
2020-06-18 jaebaek Debug info preservation in dead branch elimination (#3425)
2020-06-17 vasniktel Add RemoveParameter method (#3437)
2020-06-17 vasniktel Fix return type (#3435)
2020-06-16 ehsannas Eliminate branches with condition of OpConstantNull (#3438)
2020-06-16 andreperezmaselco.developer spirv-fuzz: Implement vector shuffle fuzzer pass (#3412)
2020-06-16 andreperezmaselco.developer spirv-fuzz: Add replace linear algebra instruction transformation (#3402)

Created with:
  roll-dep third_party/SPIRV-Tools

Roll third_party/tint/ 0c647a889..7b819aa16 (49 commits)

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

$ git log 0c647a889..7b819aa16 --date=short --no-merges --format='%ad %ae %s'
2020-07-07 rharrison Multiple fixes to get BUILD.gn builds working again
2020-07-07 dneto [spirv-reader] Even better hoisted variables
2020-07-06 dsinclair Use Tint Generator Number.
2020-07-06 dneto [spirv-reader] Improve placement of hoisted vars
2020-07-06 dneto [spirv-reader] Allow multi-block continue construct being the entire loop
2020-07-06 dneto [spirv-reader] Support OpPhi
2020-07-06 dsinclair Rolling 7 dependencies
2020-07-06 dneto Error out for unrecognized option, more than one file
2020-07-02 dj2 [msl-writer] Always add the metal_stdlib include.
2020-07-02 dj2 [msl-writer] Add namer class.
2020-06-30 dsinclair [msl-writer] Emit switch statements.
2020-06-30 dneto [spirv-reader] Refactor bookkeeping for localy defined values
2020-06-30 dsinclair [msl-writer] Emit loop statements.
2020-06-30 dneto [spirv-reader] Hoist definitions as needed
2020-06-30 dneto [spirv-reader] Don't move combinatorial values across control flow
2020-06-29 dsinclair [msl-writer] Add break and continue emission.
2020-06-29 dsinclair [msl-writer] Emit member accessors.
2020-06-29 dsinclair [spirv-writer] Allow casting of vectors along with scalars.
2020-06-26 dneto Enable Tint as part of a larger CMake project
2020-06-26 dj2 [msl-writer] Emit alias types.
2020-06-26 dj2 [msl-writer] Add array accessors.
2020-06-26 dj2 [msl-writer] Add unary op emission.
2020-06-26 dj2 [msl-writer] Emit kill statement.
2020-06-26 dj2 [msl-writer] Add emission of if statements.
2020-06-26 dj2 [msl-writer] Add cast conversion.
2020-06-26 dj2 [msl-writer] Add generation of as casts.
2020-06-26 dneto [spirv-reader] Weaken input validation to Vulkan 1.0
2020-06-25 rharrison Add configs for CQ
2020-06-23 dsinclair [metal-writer] Add entry point support.
2020-06-23 dsinclair [metal-writer] Emit constructors.
2020-06-23 dsinclair [metal-writer] Emit binary operations.
2020-06-23 dsinclair [metal-writer] Emit assignment statements.
2020-06-23 dsinclair [metal-writer] Emit functions
2020-06-23 dsinclair [metal-writer] Add identifier expression.
2020-06-23 dsinclair [metal-writer] Add return generation.
2020-06-23 dsinclair [metal-writer] Add basic type emission.
2020-06-23 dsinclair [metal-writer] Stub out the Metal Shading Language backend.
2020-06-23 rharrison Fix BUILD.gn issues for TypeDeterminerTest
2020-06-22 dneto [spirv-reader] Simplify null composites
2020-06-22 dj2 [spirv-writer] Only add used variables to entry point.
2020-06-22 dneto [spirv-reader] Support OpNop
2020-06-22 dneto [spirv-reader] Support Undef, mapping to null
2020-06-22 dneto [spirv-reader] Use type aliases pervasively
2020-06-22 dj2 Support the zero initializer syntax.
2020-06-22 dneto type determine accessor on aliased array
2020-06-22 dneto Add type alias unwrapping methods
2020-06-22 dj2 [spirv-writer] Add Operand and Instruction list aliases.
2020-06-22 dj2 [spirv-writer] Add function calls
2020-06-22 dj2 [spirv-writer] Generate function parameters.

Created with:
  roll-dep third_party/tint

Change-Id: I33626195f373dde01e8e6ce26195578db372d949
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24461
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-07-07 20:45:02 +00:00
Corentin Wallez b72434f3d3 Rolling 2 dependencies
Roll third_party/vulkan-headers/ 09531f279..4c079bf40 (7 commits)

09531f2793..4c079bf40c

$ git log 09531f279..4c079bf40 --date=short --no-merges --format='%ad %ae %s'
2020-07-07 oddhack Updates from @mark-lunarg
2020-07-05 oddhack Enumerate originating repository for all files in this repo.
2020-07-04 oddhack Update for Vulkan-Docs 1.2.146
2020-06-21 oddhack Update for Vulkan-Docs 1.2.145
2020-06-15 oddhack Update for Vulkan-Docs 1.2.144
2020-06-08 oddhack Update for Vulkan-Docs 1.2.143
2020-06-01 oddhack Update for Vulkan-Docs 1.2.142

Roll third_party/vulkan-validation-layers/ 31bdb2d43..e8b96e86f (144 commits)

31bdb2d437..e8b96e86fe

$ git log 31bdb2d43..e8b96e86f --date=short --no-merges --format='%ad %ae %s'
2020-03-31 sam.walls tests: Add test for Arm perfdoc check 23
2020-03-31 sam.walls practices: Add passing implementation of Arm perfdoc check 23
2020-06-10 tony gpu: Check for enabled features
2020-07-01 tony layers: Use helper to pick spirv env
2020-06-30 s.fricke tests: Fix AHB Test not covering 02251
2020-06-27 s.fricke layers: Fix YCbCr Format VUIDs
2020-06-30 tony gpu: Remove incorrect descriptor set requirement
2020-06-22 tony layers: Add more custom border color checks
2020-06-22 tony gpu: Handle destroyed pipeline layout
2020-06-23 s.fricke tests: Add VUID 00995
2020-06-23 s.fricke layers: Add VUID 00995
2020-06-21 s.fricke tests: Add External Import handleType VUIDs
2020-06-21 s.fricke layers: Add External Import handleType VUIDs
2020-06-20 s.fricke tests: Add maxExtent VUIDs
2020-06-20 s.fricke layers: Add maxExtent VUIDs
2020-06-22 szilard.papp practices: Adding test for robustBufferAccess
2020-06-22 szilard.papp practices: Adding check for robustBufferAccess
2020-06-20 s.fricke layers: Label VUID 02251
2020-06-27 s.fricke tests: Add VK_EXT_astc_decode_mode
2020-06-27 s.fricke layers: Add VK_EXT_astc_decode_mode
2020-05-25 s.fricke layers: Add HDR ASTC formats
2020-06-25 tony tests: Fix unexpected custom border color error
2020-06-29 mark chassis: Fix inadvertant StateTracker VO state-sharing
2020-06-24 rgarcia corechecks: Use all locations for samplerYcbcrConversion
2020-06-29 dev docs Add reference to the --dir option
2020-06-29 dev docs: Fix CMake update_deps/build instructions
2020-06-24 rgarcia Use conversion format in some Ycbcr conversion VUs
2020-06-25 jeremyk layers: Fix vkCmdTraceRaysKHR VUID Mixup
2020-06-22 mark docs: Update CONTRIBUTING.md with some new details
2020-06-01 mark docs: Added message limit to layer settings file
2020-06-18 mark tests: Add duplicate message limit test
2020-06-01 mark chassis: Add config steps for reading dup msg limits
2020-06-01 mark layers: Add duplicate message limit infrastructure
2020-06-23 mark corechecks: Prevent null ptr access for GetSwapchainImages
2020-06-22 lionel.g.landwerlin layers: Fix image creation checks with DRM modifiers
2020-06-18 s.fricke tests: Add RP potentialFormatFeature VUID
2020-06-14 s.fricke layers: Add RP potentialFormatFeature VUID
2020-06-23 shannon build: Change removed VUIDs to UNASSIGNED
2020-06-19 shannon build: Fix more VUID changes for 144 header update
2020-06-19 shannon build: Fix more mem barrier VUID inconsistencies
2020-06-19 shannon build: Address memory barrier VUID inconsistancies
2020-06-18 shannon build: Propogate genvk changes to `lvl_genvky.py`
2020-06-18 shannon build: Address graphics pipeline VUID changes
2020-06-15 shannon build: Address memory barrier VUID changes
2020-06-12 shannon build: Clean up VUID consistency checks
2020-06-15 shannon build: Update known-good files for 1.2.145 header
2020-06-23 mark tests: Skip DRM image format modifier test on Mock ICD
2020-06-22 szilard.papp practices: Adding test for DethBias usage
2020-06-22 szilard.papp practices: Adding check for DethBias usage
2020-06-22 szilard.papp practices: Adding test for Presentation mode
(...)
2020-06-10 jzulauf layers: Allow EXTERNAL release acquire in same CB
2020-06-10 souravp tests:for BuildGeometryInfoKHR
2020-06-09 souravp layers:Add missing KHR build info tracker
2020-06-09 brucedawson layers: Adjust shared_mutex usage
2020-06-09 mark chassis: Add layer settings file info to layer status message
2020-06-09 mark layers: Add collection of info for layer settings file
2020-06-10 dsinclair scripts: Use named params for generator options
2020-06-10 mark tests: Remove vk_layer_settings.txt file
2020-06-06 s.fricke tests: Add VUID 01946
2020-06-06 s.fricke layers: Add VUID 01946
2020-06-07 souravp tests:Handles new rayTracing VUID
2020-06-07 souravp layers:Misc RayTracing VUID
2020-06-06 s.fricke tests: Add VUID 00336
2020-06-06 s.fricke layers: Add VUID 00336
2020-05-14 marcin.slusarz build: detect missing SPIRV_HEADERS_INSTALL_DIR at cmake time
2020-05-14 marcin.slusarz build: SPIRV-Tools and glsllang are 2 separate projects
2020-06-01 s.fricke tests: Validate VK_KHR_multiview features
2020-05-29 s.fricke layers: Validate VK_KHR_multiview features
2020-05-21 tony gpu: Record destroy of buffers and devices
2020-06-03 mark tests: Leave handle wrapping enabled at all times
2020-05-30 s.fricke layers: Label VUID 01386 and fix log messages
2020-06-03 s.fricke tests: Add YCbCr BufferImageCopy VUID
2020-05-28 s.fricke layers: Add YCbCr BufferImageCopy VUID
2020-06-02 tony tests: Test push descriptor image layout validation
2020-05-28 tony layers: Allow validation of push descriptors
2020-05-30 s.fricke layers: Label and fix Maintenance1 VUs
2020-06-03 mark practices: Avoid null pApplicationInfo deref
2020-06-02 christophe docs: Fix link to LAYER_CONFIGURATION.md, issue #1902
2020-05-29 s.fricke layers: Add function name prefix to more logs
2020-06-01 mark chassis: Address non-const refs
2020-05-24 mark chassis: Properly use vk_safe_struct.cpp without including it
2020-05-22 mark chassis: Factor out some common parsing functions
2020-05-29 mark chassis: Load default callbacks earlier in CreateInstance
2020-05-28 s.fricke tests: Add extra VK_EXT_sample_location test
2020-05-28 s.fricke layers: Fix VK_EXT_sample_locations bug
2020-05-28 mark tests: Added test for VUID-VkFBCreateInfo-pAttachments-00891
2020-05-28 mark corechecks: Add FB check for depth-stencil 3D image/imageviews
2020-05-28 s.fricke tests: Add VUID 02840
2020-05-27 s.fricke layers: Add VUID 02840
2020-05-29 mark layers: Clean up some variable name formatting issues
2020-05-26 souravp tests: Implement test for raytracing VUIDs
2020-05-26 souravp layers: Raytracing VUIDs
2020-05-28 shannon build: Update known-good file for 1.2.141 SDK
2020-05-24 s.fricke layers: Label BindBuffer2 VUIDs
2020-05-25 shannon build: Update known-good files for 1.2.141 header
2020-05-24 s.fricke layers: Label 01720 and 01721
2020-05-26 s.fricke layers: Remove CB device tracking
2020-05-26 tony layers: Temp removal of check for border color feature
2020-05-24 s.fricke layers: Label BindMemory2 VUIDs
2020-05-26 ynovikov layers: Fix crash in ValidationStateTracker::PreCallRecordDestroySampler

Created with:
  roll-dep third_party/vulkan-headers third_party/vulkan-validation-layers

Bug: None
TBR=enga@chromium.org

Change-Id: I1a1e35336d97938aede68ff5e5cc6458f2f9ba6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24444
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-07 14:28:41 +00:00
Corentin Wallez b2ea1915d4 Implement GPUBufferDescriptor.mappedAtCreation.
This CL:

 - Adds mappedAtCreation to dawn.json
 - Changes dawn_native to implement CreateBufferMapped in terms of
   mappedAtCreation.
 - Duplicates all the CreateBufferMappedTests to mappedAtCreation tests
   (both validation and end2end).
 - Implements dawn_wire's mappedAtCreation in terms of
   CreateBufferMapped. The reversal in dawn_wire will be done in a
   follow-up CL.

Bug: dawn:445

Change-Id: I70b9fa729b1402524a6b993c3f288987eb65c6c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24083
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-07-07 11:21:51 +00:00
Corentin Wallez cf77d75573 Roll third_party/swiftshader/ d25ce8725..f6f11215c (155 commits)
https://swiftshader.googlesource.com/SwiftShader/+log/d25ce8725224..f6f11215cd93

$ git log d25ce8725..f6f11215c --date=short --no-merges --format='%ad %ae %s'
2020-07-01 capn Implement shaderStorageImageExtendedFormats support
2020-07-05 capn Implement scatter/gather for 1- and 2-byte texels
2020-07-01 capn Fix float-to-half conversion
2020-07-03 capn Eliminate large image specialization
2020-06-24 capn Refactor texel buffer reads
2020-06-24 capn Implement SNORM uniform texel buffer support
2020-06-24 capn Implement B10G11R11_UFLOAT_PACK32 uniform texel buffer support
2020-07-02 sugoi ASTC Decoder: Trim unused struct members
2020-07-02 capn Fix /DEBUG:FASTLINK usage
2020-06-30 pcc Start reserving x18 by default on Android targets.
2020-06-25 srisser Fix debug assert from happening in release build
2020-06-10 capn Optimize clearing of depth and stencil images
2020-06-25 thakis mac: Add ARM64 support to swiftshader.
2020-06-22 amaiorano Kokoro: add builds with REACTOR_EMIT_DEBUG_INFO and REACTOR_EMIT_PRINT_LOCATION
2020-06-22 amaiorano Fix build when ENABLE_RR_DEBUG_INFO enabled
2020-06-22 amaiorano Make Windows Kokoro script less verbose
2020-06-22 cwallez Revert "Optimize clearing of depth and stencil images"
2020-06-11 capn Assert attachment format supports blending when blending is enabled
2020-06-10 capn Optimize copying image data for presentation
2020-06-10 capn Optimize clearing of depth and stencil images
2020-06-01 capn Assert reserved binding entries aren't accessed
2020-05-12 capn Optimize out-of-bounds checks with unsigned compare
2020-05-07 capn Replace instead of add pointer offsets when out of bounds
2020-06-15 capn Add a benchmark with multisampling enabled
2020-06-15 capn Refactor multisample benchmark support
2020-06-11 capn Implement multisample support for the triangle benchmark
2020-06-17 capn Don't assert thread_local initialization
2020-06-11 capn Ignore rasterization state pointers when rasterization is disabled
2020-06-11 capn Zero-initialize the context state and data
2020-06-15 sugoi Cleanup: using the proper Image subregion structure
2020-06-16 bclayton Squashed 'third_party/marl/' changes from 5c6c1532220..d29553a3730
2020-06-16 bclayton Squashed 'third_party/marl/' changes from c5127112545..5c6c1532220
2020-06-09 bclayton SpirvShaderDebugger: Show vector elements as xyzw
2020-06-09 bclayton SpirvShaderDebugger: Add a virtual destructor
2020-06-15 bclayton Squashed 'third_party/marl/' changes from 38c0c7a0f..c51271125
2020-06-15 bclayton Repoint marl branch from master to main
2020-06-15 bclayton SubzeroReactor: Use new marl::Scheduler::Config API.
2020-06-10 amaiorano Make rr::Print output to debugger and be stubbed
2020-06-10 sugoi Regres: Roll deqp forward to latest 1.2.1
2020-06-04 capn Validate the SPIR-V code in debug builds
2020-06-05 capn Add a triangle rendering benchmark
2020-06-10 capn Add glslang dependency to VulkanBenchmarks
2020-06-10 capn Add glslang as a submodule
2020-06-05 capn Move CMake build targets for PowerVR samples before unit tests
2020-06-01 capn Add microbenchmarks for vkCmdClear*Image
2020-06-04 capn Add back vulkan.hpp
2020-06-01 caio.oliveira Convert Vulkan headers from CRLF to LF endings
2020-06-02 ari.suonpaa Add Z mirroring support for image blit.
2020-05-26 vantablack Added reference counting for PipelineLayout objects
2020-06-02 bclayton libVulkan: Use new marl::Scheduler::Config API.
(...)
2020-05-01 amaiorano Regres: use Subzero backend by default
2020-04-30 bclayton Squashed 'third_party/marl/' changes from 748d3c161..3c643dd4c
2020-04-30 bclayton Vulkan/Debug: Don't step for column updates
2020-04-30 bclayton Vulkan/Debug: Fix build with clang-10.
2020-04-12 bclayton Device: Use std::unique_ptr instead of raw pointers
2020-04-09 amaiorano CMake: add graphviz generation scripts
2020-04-29 jrprice Fix null dereference in OFFSET macro
2020-04-29 capn Fix JIT on separate thread
2020-04-28 capn Avoid implicitly destructing thread-locals
2020-04-27 amaiorano Eliminate use of Vulkan header BEGIN_RANGE/END_RANGE/RANGE_SIZE enums
2020-04-27 amaiorano Run clang-format on renamed headers
2020-04-27 amaiorano Rename Vulkan-source .h to .hpp
2020-04-27 bclayton ReactorUnitTests: Speed up multithreaded tests
2020-04-22 capn Eliminate the ABORT() macro
2020-04-24 capn Record vkCmdBindDescriptorSets() as a single command
2020-04-23 capn Store binding information in the pipeline layout
2020-04-22 capn Don't expose individual descriptor set layouts to SPIR-V compilation
2020-04-23 capn Fix ordering of descriptor set bindings
2020-04-24 bclayton SpirvShader: Document activeLaneMask() and storesAndAtomicsMask()
2020-04-24 capn Omit ASSERT() expression evaluation in Release builds
2020-04-23 bclayton SpirvShaderDebugger: Ensure frames are fully popped
2020-04-23 bclayton SpirvShaderDebugger: Implement globals, stub array types
2020-04-22 bclayton SpirvShader: Add WriteCFGGraphVizDotFile debug function
2020-04-21 pcc Don't unlock Android buffers immediately after locking them.
2020-04-20 digit LLVM: Do not map read-only data sections as executable.
2020-04-17 digit Vulkan: Add vk_icdInitializeConnectToServiceCallback()
2020-04-23 amaiorano Kokoro: fix SWIFTSHADER_LESS_DEBUG_INFO not being set
2020-04-22 digit Update tests/presubmit.sh to accept Fuchsia bugs as fxb/#
2020-04-22 capn Fix specializing graphics routines for the pipeline layout
2019-05-15 bclayton SpirvShader: Add a flag for printing SPIRV execution
2020-04-17 bclayton Regres: Write logs to /dev/null
2020-04-20 amaiorano CMake: use target_compile_options/definitions for llvm
2020-04-20 amaiorano CMake: use target_link_options
2020-04-20 amaiorano CMake: require version 3.13
2020-04-20 amaiorano Kokoro: update CMake to latest version
2020-04-17 bclayton Regres: Limit the default number of threads to 100
2020-04-15 capn Pass only descriptor data to shader execution
2020-04-16 capn Reduce descriptor binding info exposure
2020-04-22 bclayton Kokoro: Fix ubuntu bots.
2020-04-17 digit Vulkan: Fix Fuchsia external semaphore fix tryWait().
2020-04-21 amaiorano CMake: fix astc code not being enabled correctly
2020-04-20 capn Don't use deprecated llvm::Type::getVectorNumElements()
2020-04-17 capn Fix JIT on separate thread
2020-04-03 bclayton Use Thread Safety Analysis annotations throughout SwiftShader.
2020-04-17 digit CMakeLists: Fix Fuchsia build.
2019-07-01 bclayton LLVMReactor: Drop codegenMutex, now thread safe.
2020-04-17 bclayton LLVMJIT: Remove the TargetMachine cache.
2020-04-17 bclayton LLVM 7: Set LLVM_ENABLE_THREADS to 1
2020-04-17 bclayton SpirvShader: Fix ASSERT firing in debugger
2020-04-17 bclayton Squashed 'third_party/marl/' changes from 539094011..748d3c161

Created with:
  roll-dep third_party/swiftshader

TBR=enga@chromium.org
Bug: None

Change-Id: I9c71f3e1810f0515ba5958cf18c9d31f0b3b40cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24441
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-07 10:24:41 +00:00
Tomek Ponitka 0f5d496f12 Rephrasing CopyBufferToTexture validation
Moved some of the validation helper functions from CommandEncoder.cpp
to CommandValidation.cpp. This will make them accessible for
Queue::WriteTexture. Also introduced ValidateLinearTextureData
and ValidateTextureCopyRange which combine already implemented
checks in a way that's defined in WebGPU spec.

Bug: dawn:483
Change-Id: I04304c5e4906f3745c6adf75758fae179c6ffcfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24283
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-07 10:18:51 +00:00
Ryan Harrison 92554d75f3 Update path of third_party/spirv-tools to SPIRV-Tools
Change-Id: Id0ee4940c7cec255558bcca3bfa578ee4bdb87ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24421
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-07-06 21:31:00 +00:00
Corentin Wallez 9585c468a2 Update dawn.json to more closely match webgpu.h
- Move wgpu::TextureUsage::Storage at the end of the enum.
 - Reorder some methods of device to be in alphabetical order.
 - Reorder members of wgpu::QuerySetDescriptor.
 - Change SurfaceDescriptorFromHTMLCanvasID to
   SurfaceDescriptorFromCanvasHTMLDescriptor.

Bug: dawn:22
Change-Id: Ib18fbaf153ad2969b0d0c4e49682e8736b00776c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-06 18:50:00 +00:00
Corentin Wallez dbf805fe8d Update GetMappedRange to not produce validation errors
GetMappedRange never produces errors and instead returns nullptr when it
is disallowed. When in a correct state, should return a valid pointer as
much as possible, even if the buffer is an error or if the device is
lost.

Adds tests for error buffers and device loss, and modify existing tests
to not expect a device error.

Also removes some dead code in the Vulkan backend and adds a fix for
missing deallocation of VkMemory on device shutdown.

Bug: dawn:445

Change-Id: Ia844ee3493cdaf75083424743dd194fa94faf591
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24160
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-07-06 18:08:10 +00:00
Xinghua Cao db34c78910 Check FP16 support on D3D backend
True FP16 is only supported in DXC through Shader Model 6.2, also
check the value of the Native16BitShaderOpsSupported member of
D3D12_FEATURE_DATA_D3D12_OPTIONS4 to view whether hardware actually
supports FP16 operations.

BUG=dawn:426
TEST=dawn_end2end_tests

Change-Id: If675f7ba650cb1bd8c792928b70619b9ccda048a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23243
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
2020-07-06 08:28:00 +00:00
Jiawei Shao 80f927d763 Implement buffer lazy initialization before writeBuffer
This patch implements buffer lazy initialization before writeBuffer():
if the buffer is not initialized and writeBuffer() doesn't cover the
whole buffer, the buffer will be cleared to 0, otherwise the buffer
shouldn't be cleared.

This patch also introduces a toggle LazyClearBufferOnFirstUse for the
development of buffer lazy initialization: before buffer lazy
initialization being completely supported, all the related code will
only be enabled behind this toggle to prevent the buffers with valid
content being unexpectedly cleared.

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: I99a2aa98ca4b9b21d69c6b32080afb525e2c4ad3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24041
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-06 08:24:30 +00:00
Dirk Pranke 59ccb1f6de Add proper data_deps to dawn_perf_tests.
Currently the Chromium build defines a wrapper build target
for Dawn (//chrome/test:dawn_perf_tests) that seems to exist
only to specify some extra data dependencies. By moving this
data dependencies onto the Dawn dawn_perf_tests itself, this
removes a problematic target in Chromium that would otherwise
block my planned changes for crbug.com/816629.

Bug: chromium:816629
Change-Id: I428698fe164bd1aad09c8dba14e57a4b7acebb1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24302
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-03 05:47:07 +00:00
Corentin Wallez f695264d30 Broaden -Wno-tautological-type-limit-compare
In https://dawn-review.googlesource.com/c/dawn/+/24162 it was added
inside the is_win condition so it didn't take effect on Linux.

TBR=enga@chromium.org
TBR=senorblanco@chromium.org
Bug: None
Change-Id: Icc9ea20ed3a5ae4e5c514ce32bff88009ad82b1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-02 09:21:08 +00:00
Jiawei Shao 4d007f34f3 Fix bugs in the multi-layer copies with BC formats on D3D12 and OpenGL
This patch fixes two bugs in the copy commands with BC formats and
multiple array layers on D3D12 and OpenGL and adds two end2end tests as
the regression tests.

This patch also removes "viewArrayLayer" in the struct CopyConfig used
in CompressedTextureBCFormatTest and sets the base array layer into
CopyConfig.copyOrigin3D.z instead.

BUG=dawn:453
TEST=dawn_end2end_tests

Change-Id: I1c2e6b79fb7c44fc996655ab5a908e27ba8c4729
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24183
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-02 09:08:09 +00:00
Hao Li 16ca52cc16 Roll third_party/shaderc/ caa519ca5..f4025c1cd (2 commits)
caa519ca53..f4025c1cd5

$ git log caa519ca5..f4025c1cd --date=short --no-merges --format='%ad %ae %s'
2020-07-01 xinghua.cao Add interface for enabling 16-bit types (#1091)
2020-06-23 rharrison Roll 5 dependencies and update tests/expectations (#1087)

Created with:
   roll-dep third_party/shaderc --roll-to 'origin/main'

Bug: dawn:426
Change-Id: I99198704f7cb3ce6e5ceab74f2941372fd4af025
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24220
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-02 08:50:28 +00:00
Idan Raiter bcc65f2d48 Vulkan: Enable robust buffer access if validation is on
Bug: dawn:480
Change-Id: Id145fab2fe24b70a063c3cc1f75f0a565635abf8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24182
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-01 21:37:57 +00:00
Austin Eng 509b811a75 Vulkan: Fix MemoryServiceOpaqueFD CreateImage
vkCreateImage when bound to imported memory, must also have
a VkExternalImageCreateInfo struct in its pNext chain that
has VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT as a
handleType.

This was discovered when tests started failing after a roll
of the Vulkan validation layers.

Tbr=cwallez@chromium.org, senorblanco@chromium.com
Bug: none
Change-Id: I4692d650af27b9325342baeda34a0d982fc49041
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24200
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-07-01 20:44:47 +00:00
Corentin Wallez 96c78ec737 Disable -Wtautological-type-limit-compare
This unblocks a roll into Skia.

Allow comparison against type limits that might be tautological on
32bit or 64bit systems. Without this the following produces an error
on 64bit:

  if (myUint64 > std::numeric_limits<size_t>::max()) {...}

Bug: None
Change-Id: I31fc579738b6fb85b40cfeac8f30936161a15da1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24162
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-01 14:36:56 +00:00
Tomek Ponitka 5fb974cf47 Changing pointers to Ref<> in GetOrCreateBGL
DeviceBase::GetOrCreateBindGroupLayout and
DeviceBase::GetOrCreateEmptyBindGroupLayout are now returning
ResultOrError<Ref<BindGroupLayoutBase>> instead of
ResultOrError<BindGroupLayoutBase*>.

Bug: dawn:466
Change-Id: I223864325aba9011b0ba6dc67589ead48d930309
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24082
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-01 13:09:46 +00:00
Hao Li 5191adc58c Query API: WriteTimestamp
Add WriteTimestamp API on CommandEncoder, ComputePassEncoder and
RenderPassEncoder.

Bug: dawn:434
Change-Id: Ifeca4efed01d80459d6fefa22ba05bea699b541f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23244
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2020-07-01 10:48:16 +00:00
Jiajie Hu 2ffc55ab38 Never try to populate the LASTCHANGE file in non-standalone checkout
Since the build/ directory is checked out behind 'dawn_standalone', the
'lastchange' hook depending on that should be guarded by the same
condition.

Bug: dawn:437
Change-Id: If6d1f5ee505eab5bc5519ec6d29b2efe5d69d9aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24123
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiajie Hu <jiajie.hu@intel.com>
2020-07-01 05:08:36 +00:00
Tomek Ponitka 268fe254ec Added constraints for too large uniform buffer bindings
Added a constraint in ValidateBufferBinding function checking for too
large uniform buffer bindings. Added MaxUniformBufferBindingSize
test in BindGroupValidationTest.

Bug: dawn:436
Change-Id: I31c6e2236ce928d5e81c43455eb18cf4eacdc0f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24081
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-06-30 18:49:20 +00:00
Bryan Bernhart bd2ab92853 D3D12: Limit QueueWriteBufferTests.ManyWriteBuffer
The stress test is causing timeouts on slower GPUs
due to the TDR threshold being hit. This halves the
number of writes required to complete the test.

BUG=dawn:228

Change-Id: I18dfa68b39a2c079b89eeadc78a69675e5c3269f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2020-06-30 18:48:20 +00:00
Corentin Wallez f7fab5a259 dawn_native: Use correct integer width for SetSubData.
SetSubData's count is a uint64_t while Queue::WriteBuffer's is a size_t
so we add a small validation check that no narrowing will occur.

No test is added because SetSubData will be removed soon, and it will be
hard to test because of the Null backend's artificial OOM.

This was found while debugging an unrelated fuzzer issue.

Bug: chromium:1099621
Change-Id: I27a9da2b94f51e889c5573f88d4a0a73fea5985c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23961
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-30 18:46:32 +00:00
Corentin Wallez 00d6215be9 dawn_wire/client: Add ToAPI and FromAPI helpers.
In the client code, we often need to translate between WGPUObject (the
API type) to Object* (the internal client type). This added a bunch of
reinterpret_casts that make the code less readable and more fragile.

This CL adds FromAPI and ToAPI helpers in the autogenerated
ApiObjects_autogen.h header, that convert between API and internal types
in a type-safe way.

Bug: dawn:445

Change-Id: Ia1bf624f0315ced496b95cb660adf88abd916d71
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24063
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-06-30 18:39:50 +00:00
Corentin Wallez 2f616dd108 dawn_wire: Remove client/ApiProcs_autogen.h
This header was only used to call DeviceCreateErrorBuffer and
DeviceInjectError that are used in some handwritten client commands.
We remove the need for the header by making these two commands
handwritten.

This also improves readability, previously injecting errors read:

  ClientDeviceInjectError(reinterpret_cast<WGPUDevice>(device),
                           WGPUErrorType_Validation,
                           "Some validation message");

And now reads:

  device->InjectError(WGPUErrorType_Validation, "Some validation message");

Bug: dawn:445

Change-Id: Ie11570aacf3036e13abd174d91670ecb84661226
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24080
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-06-30 18:26:30 +00:00
Corentin Wallez d411726003 dawn_wire: Make ApiProcs call into objects directly.
This CL modifies code generation so that the generated client procs call
the handwritten methods on client objects directly.

Previously the flow was:
  - wgpuBarDoStuff
  - ClientBarDoStuff
  - ClientHandwrittenBarDoStuff
  - client::Bar::DoStuff

With this CL the flow is:
  - wgpuBarDoStuff
  - ClientBarDoStuff
  - client::Bar::DoStuff

This required adding Buffer creation methods on client::Device instead
of calling client::Buffer static methods directly.

Bug: dawn:445

Change-Id: I1b332b71ac7a03685afcf8fd0617d3d27da468cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24062
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-06-30 18:01:50 +00:00
Corentin Wallez 9fa68833b2 dawn_wire/client: Encapsulate all queue/fence-related logic
This CL only moves code, renames client::Fence members, and introduces
client::Queue. Additional fence methods are added for the interaction
with the queue. There are no functional changes.

With this ApiProcs.cpp is almost passthrough and will be removed in a
follow-up CL.

Bug: dawn:445
Change-Id: I65544ef76b54614452cf7c74a948a96cb35a4cfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24061
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-30 17:53:08 +00:00
Corentin Wallez 91904cdfde D3D12: Simplify the mapping logic.
This also removes the reliance on BufferBase::IsMapped to know whether
to unmap on destroy. This call was confusing because it was used by the
D3D12 backend to know if its own storage was mapped, but semantically
seemed to check for Buffer::State::Mapped (and not MappedAtCreation).

Bug: dawn:445
Change-Id: I3d6fde1d2996798d53264d5643545f0efb90551a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24060
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <brandon1.jones@intel.com>
2020-06-30 12:21:54 +00:00
Corentin Wallez 1325ab1251 Add Buffer::Get[|Const]MappedRange
This CL adds GetMappedRange reusing the existing GetMappedPointerImpl
call in dawn_native. In dawn_wire tracking is added to keep a
Buffer::mMappedData around.

Tests are added to test the result of Get[|Const]MappedRange in all
buffer states.

Bug: dawn:445
Change-Id: I3737dc4d36f31d392839952da0b5c0d10c7c8a88
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-06-30 11:51:14 +00:00
Corentin Wallez 2008d15326 Buffer: Always use MappedAtCreation state when applicable.
In a follow-up CL we need to know if the buffer is in the
MappedAtCreation state for validation of GetMappedRange. Having the
state not 100% reflect the state in the spec meant that validation if
GetMappedRange would fail for buffers mapped at creation for which
IsMapWritable is true.

Bug: dawn:445
Change-Id: I4a64335a708b838526da8d65f907b21c782816e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23981
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-06-30 11:05:44 +00:00
Corentin Wallez bae16b4df9 dawn_wire/client: Encapsulate all buffer-related logic in Buffer.cpp
This CL only moves code, renames client::Buffer members and does
additional casts where needed. No functional changes.

Bug: dawn:445

Change-Id: I2bf83ecc1c9b36d5965d0365360dd981fcd41aac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23860
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-30 09:48:14 +00:00
Corentin Wallez b231c7fb71 Null: Make Increment/DecrementMemoryUsage use uint64_t.
Otherwise on 32-bit platforms, creation of a buffer bigger than the max
size_t would overflow the check and no OOM would be produced.

Bug: chromium:1099621

Change-Id: I987a338b150d10c0eabc3eb5fb3b815a5c2a5ca2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23960
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-06-29 20:03:16 +00:00
Yunchao He 1c9e045024 Fix a bug in PassResourceUsageTracker.cpp
In a render/compute pass, if a texture is used as the same usages
across its subresources, and it is also used as different usages
across its subresources. We should mark that it is not used as the
same usages across its subresources for this pass, and we need to
visit every single subresource to track its usages transition.

Bug: dawn:462

Change-Id: Ide0770db62a3b7b85664757b21eb3280a0bb646c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23300
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-06-29 19:00:05 +00:00
Tomek Ponitka bf27bd7a5e Caching empty bind group layouts
Added Device::GetOrCreateEmptyBindGroupLayout which caches the result
after being run and modified PipelineBase::getBindGroupLayout to use
that instead of creating a new empty bind group layout each time.

Bug: dawn:466
Change-Id: I70a5719265784eb8f60c2eedf6db7596462b21bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23980
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-06-29 11:13:43 +00:00
Bryan Bernhart b7ece23ffc D3D12: Remove ComPtr from d3d12::Buffer::GetD3D12Resource
Creating lots of SRVs needlessly refcounts and floods PIX traces.

BUG=dawn:155

Change-Id: I26fd1019c8c1326f0e6db3e94240a29e4d466be1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24002
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-29 08:50:03 +00:00