Commit Graph

2248 Commits

Author SHA1 Message Date
Ryan Harrison 4fa5ad4bf0 Rolling 5 dependencies and fix test slow down
Roll third_party/SPIRV-Tools/ 2e1d208ed..c8590c18b (2 commits)

2e1d208ed9..c8590c18bd

$ git log 2e1d208ed..c8590c18b --date=short --no-merges --format='%ad %ae %s'
2020-05-06 jaebaek Preserve debug info for wrap-opkill (#3331)
2020-05-05 jbolz Validate ShaderCallKHR memory scope (#3332)

Roll third_party/glslang/ b5f003d7a..4fa68edd6 (3 commits)

b5f003d7a3..4fa68edd68

$ git log b5f003d7a..4fa68edd6 --date=short --no-merges --format='%ad %ae %s'
2020-05-12 cepheus Address #2211: Improve the copy constructor of TVarLivePair.
2020-05-11 xilefmai Fix Web build
2020-05-08 sebastian.neubauer Explicitly mark some enums as unsigned

Roll third_party/shaderc/ 15a66d72f..00ac5d821 (4 commits)

15a66d72f3..00ac5d8217

$ git log 15a66d72f..00ac5d821 --date=short --no-merges --format='%ad %ae %s'
2020-05-11 rharrison Rolling 4 dependencies (#1062)
2020-05-11 chinmaygarde Only add -fPIC if supported by the compiler. (#1061)
2020-05-06 rharrison Remove Singleton pattern around access to glslang (#1059)
2020-05-05 rharrison Add .NET bindings to README.md (#1060)

Roll third_party/spirv-cross/ 92f7d36c7..d638d2df9 (4 commits)

92f7d36c72..d638d2df9c

$ git log 92f7d36c7..d638d2df9 --date=short --no-merges --format='%ad %ae %s'
2020-05-08 post Support gl_InstanceID in RT shaders.
2020-05-06 post MSL: Avoid packed arrays in more cases.
2020-05-06 post Add missing reference files from PR merge.
2020-05-06 lehoangq Fix #1359: MSL: If the packed type is scalar, don't emit "pack_" prefix.

Roll third_party/tint/ 1f1f08f94..0bbf1e746 (6 commits)

https://dawn.googlesource.com/tint/+log/1f1f08f94a11..0bbf1e746093

$ git log 1f1f08f94..0bbf1e746 --date=short --no-merges --format='%ad %ae %s'
2020-05-11 rharrison Small fix for BUILD.gn
2020-05-08 dneto Rolling 6 dependencies
2020-05-07 dneto [spirv-reader] Find if-selection internal headers
2020-05-07 dneto [spirv-reader] Rename Edge::kToMerge to kIfBreak
2020-05-07 dneto [spirv-reader] Classify kSwitchBreak from deep in control flow
2020-05-07 dsinclair Rename brace and bracket to match spec

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers third_party/tint

Change-Id: I8d9ca3e29b4fa8907147fffacb3905acd48a9c0b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21603
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-12 17:26:42 +00:00
Austin Eng 02beecaec5 Fuzzer: Wait for all commands to complete before destroying the wire
Bug: chromium:1074739
Change-Id: I32591efe42559299234053f112a2f846d43612ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21366
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-05-11 20:55:22 +00:00
Austin Eng a1800c04f3 Make fence descriptor optional
Bug: dawn:22
Change-Id: I5d14aa8e12899eb577d7c50081a6ee6f7ec248a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21365
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-05-11 20:29:22 +00:00
Corentin Wallez a6cf7b5b1d Make error scope shutdown iterative instead of recursive.
This avoids a stack overflow when many error scopes are pushed on device
shutdown. It also changes the error scopes to return a Unknown error
type on shutdown instead of NoError.

A regression test is added.

Bug: chromium:1078438
Bug: chromium:1081063
Change-Id: Ibfab8dd19480414c1854ec2bd4928939663ba698
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21440
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-05-11 20:26:12 +00:00
Yunchao He c2542cde3e Fix a bug for multi-writes in ResourceUsageTrackingTests.cpp
It is valid to have race condition for multiple writes on the same
resource in some situations in render pass. These situations are:
1) multple storage buffer bindings on the same buffer,
2) multiple writeonly storage texture bindings on the same texture.

This change fixed a bug in tests and added a new test, in order to
make sure that validation code in Dawn allows this kind race condition.

Bug: dawn:407

Change-Id: I42332418bea5b6e608f6730e42f60c1c12b0b025
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21361
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2020-05-11 19:12:12 +00:00
Ryan Harrison 5ffded3956 Revert "Rolling 4 dependencies"
This reverts commit 4084c94c43.

Reason for revert: Performance issue, this is causing tests that took mS to run to now take seconds.

Original change's description:
> Rolling 4 dependencies
> 
> Roll third_party/SPIRV-Tools/ 2e1d208ed..c8590c18b (2 commits)
> 
> 2e1d208ed9..c8590c18bd
> 
> $ git log 2e1d208ed..c8590c18b --date=short --no-merges --format='%ad %ae %s'
> 2020-05-06 jaebaek Preserve debug info for wrap-opkill (#3331)
> 2020-05-05 jbolz Validate ShaderCallKHR memory scope (#3332)
> 
> Roll third_party/shaderc/ 15a66d72f..6b4f6313e (3 commits)
> 
> 15a66d72f3..6b4f6313ed
> 
> $ git log 15a66d72f..6b4f6313e --date=short --no-merges --format='%ad %ae %s'
> 2020-05-11 chinmaygarde Only add -fPIC if supported by the compiler. (#1061)
> 2020-05-06 rharrison Remove Singleton pattern around access to glslang (#1059)
> 2020-05-05 rharrison Add .NET bindings to README.md (#1060)
> 
> Roll third_party/spirv-cross/ 92f7d36c7..d638d2df9 (4 commits)
> 
> 92f7d36c72..d638d2df9c
> 
> $ git log 92f7d36c7..d638d2df9 --date=short --no-merges --format='%ad %ae %s'
> 2020-05-08 post Support gl_InstanceID in RT shaders.
> 2020-05-06 post MSL: Avoid packed arrays in more cases.
> 2020-05-06 post Add missing reference files from PR merge.
> 2020-05-06 lehoangq Fix #1359: MSL: If the packed type is scalar, don't emit "pack_" prefix.
> 
> Roll third_party/tint/ 1f1f08f94..0bbf1e746 (6 commits)
> 
> https://dawn.googlesource.com/tint/+log/1f1f08f94a11..0bbf1e746093
> 
> $ git log 1f1f08f94..0bbf1e746 --date=short --no-merges --format='%ad %ae %s'
> 2020-05-11 rharrison Small fix for BUILD.gn
> 2020-05-08 dneto Rolling 6 dependencies
> 2020-05-07 dneto [spirv-reader] Find if-selection internal headers
> 2020-05-07 dneto [spirv-reader] Rename Edge::kToMerge to kIfBreak
> 2020-05-07 dneto [spirv-reader] Classify kSwitchBreak from deep in control flow
> 2020-05-07 dsinclair Rename brace and bracket to match spec
> 
> Created with:
>   roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers third_party/tint
> 
> Change-Id: I7ad5ec308574599138a4297b8b4dd55c215bbf99
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21520
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Ryan Harrison <rharrison@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,rharrison@chromium.org

Change-Id: I8c06d2cefdbb6f60b75ee80687d956ebadeee51d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21600
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-11 19:02:53 +00:00
Corentin Wallez bf009f50c5 Add a test for creating a 0-sized buffer.
This is valid in WebGPU but causes validation errors in backends.

Also make it an OOM error on Metal to request a buffer close to
UINT32_MAX size because it would truncate the size, and could lead to
OOBs.

Bug: chromium:1069076
Change-Id: Ib961cb236cb7cabc0ae21203bf1d72ba82a56272
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21060
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-05-11 18:55:52 +00:00
Bryan Bernhart 19b21c5b85 D3D12: Remove ComPtr from D3D12 objects when possible.
Returning COM for getters needlessly refcounts which wastes CPU cycles
in critial sections and floods PIX traces with [Add/Release]Ref.

BUG=dawn:212

Change-Id: Ifa853f2d5f78a450fdb7ffb9492f0d08dfbcdd37
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21364
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-05-11 16:47:21 +00:00
Ryan Harrison 4084c94c43 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ 2e1d208ed..c8590c18b (2 commits)

2e1d208ed9..c8590c18bd

$ git log 2e1d208ed..c8590c18b --date=short --no-merges --format='%ad %ae %s'
2020-05-06 jaebaek Preserve debug info for wrap-opkill (#3331)
2020-05-05 jbolz Validate ShaderCallKHR memory scope (#3332)

Roll third_party/shaderc/ 15a66d72f..6b4f6313e (3 commits)

15a66d72f3..6b4f6313ed

$ git log 15a66d72f..6b4f6313e --date=short --no-merges --format='%ad %ae %s'
2020-05-11 chinmaygarde Only add -fPIC if supported by the compiler. (#1061)
2020-05-06 rharrison Remove Singleton pattern around access to glslang (#1059)
2020-05-05 rharrison Add .NET bindings to README.md (#1060)

Roll third_party/spirv-cross/ 92f7d36c7..d638d2df9 (4 commits)

92f7d36c72..d638d2df9c

$ git log 92f7d36c7..d638d2df9 --date=short --no-merges --format='%ad %ae %s'
2020-05-08 post Support gl_InstanceID in RT shaders.
2020-05-06 post MSL: Avoid packed arrays in more cases.
2020-05-06 post Add missing reference files from PR merge.
2020-05-06 lehoangq Fix #1359: MSL: If the packed type is scalar, don't emit "pack_" prefix.

Roll third_party/tint/ 1f1f08f94..0bbf1e746 (6 commits)

https://dawn.googlesource.com/tint/+log/1f1f08f94a11..0bbf1e746093

$ git log 1f1f08f94..0bbf1e746 --date=short --no-merges --format='%ad %ae %s'
2020-05-11 rharrison Small fix for BUILD.gn
2020-05-08 dneto Rolling 6 dependencies
2020-05-07 dneto [spirv-reader] Find if-selection internal headers
2020-05-07 dneto [spirv-reader] Rename Edge::kToMerge to kIfBreak
2020-05-07 dneto [spirv-reader] Classify kSwitchBreak from deep in control flow
2020-05-07 dsinclair Rename brace and bracket to match spec

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers third_party/tint

Change-Id: I7ad5ec308574599138a4297b8b4dd55c215bbf99
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21520
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-11 16:09:21 +00:00
Corentin Wallez a02619dbf2 Roll third_party/googletest/ e3f0319d8..a09ea700d (27 commits)
e3f0319d89..a09ea700d3

$ git log e3f0319d8..a09ea700d --date=short --no-merges --format='%ad %ae %s'
2020-05-07 absl-team Googletest export
2020-05-04 absl-team Googletest export
2020-04-30 absl-team Googletest export
2020-04-28 absl-team Googletest export
2020-04-27 absl-team Googletest export
2020-04-24 absl-team Googletest export
2020-04-23 absl-team Googletest export
2020-04-20 absl-team Googletest export
2020-04-20 absl-team Googletest export
2020-04-17 absl-team Googletest export
2020-05-01 56075233+keshavgbpecdelhi Removed a typo in README.md
2020-03-28 arthur.j.odwyer Add -Wdeprecated to the build configuration.
2020-04-16 arthur.j.odwyer Fix a -Wdeprecated warning.
2020-04-16 arthur.j.odwyer Fix a -Wdeprecated warning.
2020-04-16 arthur.j.odwyer Fix a -Wdeprecated warning.
2020-04-16 arthur.j.odwyer Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_.
2020-04-19 igor.n.nazarenko Enable protobuf printing for open-source proto messages.
2020-04-16 arthur.j.odwyer VariadicMatcher needs a non-defaulted move constructor for compile-time performance.
2020-04-10 absl-team Googletest export
2020-04-12 jbohl fix signed/unsigned comparison issue (on OpenBSD)
2020-04-09 malcolm.parsons Remove redundant .c_str()
2020-04-06 mail gtest-unittest-api_test - fix warning in clang build
2020-04-05 jijyunneng Remove duplicate codes existed in get-nprocessors.sh
2020-03-28 arthur.j.odwyer Replace the last instance of `throw()` with `noexcept`. NFC.
2020-03-28 arthur.j.odwyer Fix a typo in .travis.yml
2020-03-21 ngompa13 Ensure that gtest/gmock pkgconfig requirements specify version
2020-03-18 calum.robinson Add GTEST_BRIEF option

Created with:
  roll-dep third_party/googletest

Bug: dawn:394

Change-Id: I5084555477ab60c2cef8f45e9e7432dd81003cff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-05-11 15:37:11 +00:00
Austin Eng 562255a943 Load Swiftshader Vulkan separately from the system Vulkan
This enables both Swiftshader Vulkan and the system Vulkan drivers
to be discovered and used simultaneously.

Bug: dawn:396, dawn:283
Change-Id: I580ca26c12296fe13c0331c4faf6e7a4520664e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21041
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-05-08 19:31:00 +00:00
Austin Eng 818c6b7082 Validate that ShaderModuleDescriptor has chained descriptor
Bug: chromium:1074575
Change-Id: Ibb124ca8c4771d9b8f2846d3a5f79dca6de8743d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21360
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-05-08 18:05:19 +00:00
Yunchao He 70ffa0c285 Add more tests for resource usage tracking
This change added more tests for texture usage tracking for compute.
It also added multiple write usages related tests for both buffer
and texture.

Bug: dawn:358, dawn:359

Change-Id: I8e3dbc92a06ceccfa5fce3ed319e4e641e72e41f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21100
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2020-05-07 23:49:15 +00:00
Natasha Lee 351c95a477 Refactor Serial tracking to be owned by Device frontend.
Move mCompletedSerial and mLastSubmittedSerial to Device frontend and
add getters and setters for the device backend to access such.
This is to aid the Device in taking more ownership of Serials and Ticking.

Bug: dawn:400
Change-Id: Ifa53ac294a871e484716842a3d212373b57847c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20480
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-05-07 21:52:54 +00:00
Ryan Harrison 4f3811c064 Add Tint to BUILD.gn
Tint is behind a build flag, since Tint is not yet available in
chromium's third_party.

BUG=dawn:403

Change-Id: If5fa36b36216ef6965341b886c3bd70d27daf23a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-07 21:15:55 +00:00
Austin Eng 4fe8ead090 Revert "Support depth32float sampling on D3D12"
This reverts commit 071fe56ffe.

Reason for revert: SamplerRender/D3D12 has flaky crashes

Original change's description:
> Support depth32float sampling on D3D12
> 
> Bug: dawn:367
> Change-Id: I026e718130cbd92427c6292045fd041c878d4f77
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20840
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Stephen White <senorblanco@chromium.org>

TBR=cwallez@chromium.org,senorblanco@chromium.org,enga@chromium.org

Change-Id: I35df2ac35986d4a32437a52b70b025a370302651
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:367
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-05-07 20:38:37 +00:00
Austin Eng d785988172 Add missing include in DawnWireServerAndFrontendFuzzer.cpp
This file was missing an include of libfuzzer_exports.h which was
causing LLVMFuzzerInitialize to be stripped from the binary.

Tbr=cwallez@chromium.org
Bug: chromium:1075605
Change-Id: I251e3dd7ad1b3ebb95339dec946b80ce2e5d4a05
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-05-07 20:23:55 +00:00
Yunchao He 17e1e197e8 Add tests for texture usage tracking - 3
This change added tests for invisible and unsed bindings for
texture usage tracking. It also removed one buffer test, which
is not useful.

Bug: dawn:365

Change-Id: I01232836fb150ecea011a5fcbc250fa1eb7207cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21120
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2020-05-07 16:49:05 +00:00
Austin Eng 071fe56ffe Support depth32float sampling on D3D12
Bug: dawn:367
Change-Id: I026e718130cbd92427c6292045fd041c878d4f77
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20840
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-05-07 16:47:55 +00:00
Jiawei Shao e8bf706d16 Add basic supports of storage textures on D3D12
This patch adds the basic supports of read-only and write-only storage
textures on D3D12.

The subresource tracking and barriers on the subresources used as
read-only and write-only storage textures are not included in this
patch.

BUG=dawn:267
TEST=dawn_end2end_tests

Change-Id: Ie29a3a9962cd1a79217bc87815ed0bd27623e3a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21140
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-05-07 00:06:44 +00:00
Austin Eng 458ab1bf7f Expand depth sampling tests
This renames ComparisonSamplerTests to DepthSamplingTests
and adds tests which do normal sampling of depth32float textures
as well as sampling and comparison sampling in compute shaders.

Comparison samplers in compute shaders appear to be broken at least
on Metal Intel Haswell Iris 5100

Bug: dawn:367, dawn:401
Change-Id: I4a8208265675892d42b591126ffed2aadd420ab1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20782
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-05-07 00:06:34 +00:00
Austin Eng 531253357e Split ComparisonSampler tests with/without normalized depth textures
Depth textures outside the 0-1 range are clamped on OpenGL unless we
reinterpret contents as R32

Bug: dawn:367
Change-Id: Ifb539689c55bb5a4a16427025c9f0d97c4156c6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20823
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-05-06 23:19:54 +00:00
Ryan Harrison 991b947173 Add Tint to DEPS for standalone checkouts
BUG=dawn:386

Change-Id: I0f518bed7e81e4d42ed2a1ef154738d9e8fa4a9c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-06 23:15:54 +00:00
Austin Eng b7dbb48351 Fix OpenGL format table for GL_DEPTH_COMPONENT textures
GL_DEPTH is for calls like glEnable(GL_DEPTH) and
glClearBuffer(GL_DEPTH, ...). GL_DEPTH_COMPONENT is the
enum for the texture internal format.

Bug: dawn:367
Change-Id: I8f237e26148e3fd5a624a8bb4ed69e65fdd1acd7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20822
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-05-06 21:17:04 +00:00
Corentin Wallez 5ffca2eb90 NativeSwapChainImplVk: Remove unnecessary transition on Configure
Configure was transitioning the swapchain images from undefined to
present layout but this was already happening because TextureVk starts
with a mLastUsage of None that will force a transition from undefined
when used.

Also introduce an internal texture usage bit kPresentTextureUsage to
prepare for the eventual remove of wgpu::TextureUsage::Present when
old swapchains are removed.

Bug: dawn:269
Change-Id: I57d26f18e34cacd5d91419a45787b2ece9558846
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20881
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-05-06 07:12:48 +00:00
Yunchao He 0abddd21c9 Add dispatch call in usage tracking tests
Resource usage tracking for compute is per dispatch. So we should
call pipeline and dispatch to trigger resource tracking in compute.
This change added dispatch calls for compute pass related tests.

This change also changed inappropriate comments, and moved a test
to a proper location in the file.

Bug: dawn:358

Change-Id: I6d31169164c434c2f446cd5746170433dd1eb4b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21000
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-05-05 17:18:47 +00:00
Ryan Harrison 2b2c557462 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ 49ca250b4..2e1d208ed (3 commits)

49ca250b44..2e1d208ed9

$ git log 49ca250b4..2e1d208ed --date=short --no-merges --format='%ad %ae %s'
2020-05-01 afdx spirv-fuzz: Do not allow adding stores to read-only pointers (#3316)
2020-04-30 paulthomson reduce: increase default step limit (#3327)
2020-04-30 afdx Generalize IsReadOnlyVariable() to apply to pointers (#3325)

Roll third_party/glslang/ 39281fb71..b5f003d7a (6 commits)

39281fb710..b5f003d7a3

$ git log 39281fb71..b5f003d7a --date=short --no-merges --format='%ad %ae %s'
2020-05-01 cepheus Fix #2191: Error check for indexing reference containing unsize array.
2020-05-01 cepheus GLSL: Separate out swizzle handling (potentially fixing bugs).
2020-04-21 pmistry Add support for es extension GL_EXT_blend_func_extended * Introduces builtin variables gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT * Introduces builtin constant gl_MaxDualSourceDrawBuffersEXT * enables support for layout qualifier "index" in es profile
2020-04-30 63069047+pmistryNV Add support for extension GL_EXT_shader_integer_mix (#2203)
2020-04-26 pmistry Add support for extension GL_EXT_shader_implicit_conversions Updated extension management in TIntermediate class.
2020-04-30 cepheus Fix #2201: Improve const and copy constructor for TVarLivePair.

Roll third_party/shaderc/ 41f271e61..15a66d72f (1 commit)

41f271e613..15a66d72f3

$ git log 41f271e61..15a66d72f --date=short --no-merges --format='%ad %ae %s'
2020-05-04 rharrison Rolling 5 dependencies and fixing build (#1057)

Roll third_party/spirv-cross/ 7e0295abf..92f7d36c7 (2 commits)

7e0295abf8..92f7d36c72

$ git log 7e0295abf..92f7d36c7 --date=short --no-merges --format='%ad %ae %s'
2020-04-30 post MSL: Redirect member indices when buffer has been sorted by Offset.
2020-04-30 cwallez Fix -Wmicrosoft-enum-value

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: Ic556a6b7bdbbee47af3c2af5016de51d917766f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21040
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-05 15:02:37 +00:00
Corentin Wallez 94efed23e7 Start adding docs about device facilities.
Bug: dawn:373
Change-Id: I837b0fe15ff98d58caf6b69ea6d8d92bee33e52e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18762
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-05-05 08:46:15 +00:00
Corentin Wallez ecf93472d4 Move validation of the copy commands in the entrypoint.
This will allow follow-up CLs to no-op empty copies without making the
nooped copy skip the validation.

Bug: chromium:1069076
Change-Id: Id2460c531bc68e4a8a27705520aeaec7e944d7a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20880
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-05-05 08:33:55 +00:00
Corentin Wallez 3874434bf1 TextureVk: Make a Create function for swapchain textures.
This aligns this constructor to be used via Create like the other
vulkan::Texture constructors.

Bug: dawn:269
Change-Id: Ib85874bf24bfe49b644b4faa63c9248c540811c8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20882
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-05-05 08:33:35 +00:00
Yunchao He 07328ba0bb Add validation tests for texture resource tracking - 2
This patch adds tests to verify that texture usage tracking is per
each pass for render, and it is per each dispatch for compute.

Bug: dawn:358
Change-Id: I7ed0f470a6457e4cc53b02cd03c3da7d68cbca9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20162
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-05-04 17:19:19 +00:00
Yunchao He 23428ea82f Add validation code for texture subresource usage tracking
This patch also add validation tests for texture subresource tracking
for render pass. Resource usage tracking for compute is per each
dispatch() call, I will add it in next patch.

BUG=dawn:157

Change-Id: I6c4b932e317d66521fa428311e727876d0adf4ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17661
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-05-04 17:10:49 +00:00
Yunchao He a6d7f56cf8 Add resource usage tests in a single draw/dispatch
It is invalid to read and write on the same buffer/texture in
a single draw or dispatch. This change adds tests to cover this
situation.

Note that we have already added resource usage tests between passes
in the same command buffer, and tests between draw or dispatch calls
in the same pass. And this patch adds tests inside a draw or dispatch
call.

Bug: dawn:358

Change-Id: Ic52b2e559e9c996e5b76ea960183d80d67c24178
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20821
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2020-05-04 16:23:09 +00:00
Corentin Wallez a8337c378e DescriptorSetAllocation.h: Add missing include
Bug:
Change-Id: Iff2c62a83f479a85407c3cce8dba2b3376d6ab57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-05-04 16:05:39 +00:00
Corentin Wallez dbec2fa2f6 Use unordered_set<std::string> for deprecation warnings
This fixes the roll in Google3, otherwise it complains that
unordered_set<const char*> hashes the pointer, which is most likely not
what you want to do.

Bug: dawn:394
Change-Id: I1ef06c923bb45e55b39c23e5e7734f1577c47255
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20860
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-05-04 16:04:40 +00:00
Yunchao He 798cefb78d Fix incorrect validation error in CommandBufferStateTracker
If we are missing pipeline in render or compute pass, it always reports
that we are missing vertex buffers or bind groups for render and compute
pass respectively.

Bug: dawn:359

Change-Id: I5550e55fcc9f29c0f2fb71462def836061038add
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20784
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-05-04 06:05:47 +00:00
Yunchao He ccc40f6ffa Fix a bug in ResourceUsageTrackingTests
When we test resource per draw/dispatch, we need to set pipeline, etc.,
in addition to set bind groups.

Bug: dawn:358

Change-Id: Ic51986d0608baf786521158c887a0c1ced7ccacf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20800
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-05-04 05:37:32 +00:00
Bryan Bernhart 303a3daf0d D3D12: Decouple descriptor heap allocations.
Allows bindgroups to be populated by heap type. Previously, failing to
populate one type of GPU descriptor heap required both GPU heaps
to be switched out. This resulted in extra copies and heap allocations
should only one heap type overflow.

This change also simplifies GPU descriptor heap management:
- Allocator no longer needs to operate on both heaps.
- Sub-allocation tracking can be moved into handles.

A follow-up change will remove duplicated sampler heap allocations.

BUG=dawn:155

Change-Id: I1960cf3a8bc3d86d3e8b2775da3d0c92125bcf82
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19887
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-04-30 23:19:16 +00:00
Yunchao He 2ba90d6654 Add tests for resource tracking in compute - 1
This patch adds resource usage tracking tests for overwritten
situations within a draw/dispatch when we call multiple
SetBindGroup. We should track the overwritten resources
even though they are not used in render/compute pass.

Bug: dawn:357

Change-Id: I7467db1c0b43fed8513ddb7604adbbd1be55866f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20160
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-04-30 22:08:18 +00:00
Austin Eng 129dc00c69 Suppress MSVC warnings about invalid switch values
Dawn extends texture and buffer usage enums with additional internal
usages.

Bug: dawn:397
Change-Id: Idb3918e1455f596b1e21f109016dd622d8b66732
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20781
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-30 22:05:38 +00:00
Corentin Wallez a121e7fff0 Enable -Wno-language-extension-token except on Windows
It is required on Windows to be able to use __uuidof().

Bug: dawn:394
Change-Id: I02c1a4d36688c5985d5eb7f65737f6b821655ddc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20703
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-30 16:10:48 +00:00
Corentin Wallez 75f55bfaa3 Fix and enable -Wgnu-anonymous-struct
Bug: dawn:394
Change-Id: I7753b7daff2beaeb67fe6cbb54b002ddbe077f6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20701
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-30 16:01:08 +00:00
Corentin Wallez e642b1d959 Fix and enable -Wnested-anon-types
Bug: dawn:394
Change-Id: I51b533c07f21bcacd22a058cf4a080b9b2b853f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20700
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-30 15:58:28 +00:00
Jiawei Shao 754c161fd3 Add basic supports of storage textures on Vulkan
This patch adds the basic supports of read-only and write-only storage
textures on Vulkan.

The subresource tracking and barriers on the subresources used as
read-only and write-only storage textures are not included in this
patch.

BUG=dawn:267
TEST=dawn_end2end_tests

Change-Id: I6831b96202a97182763ecd28bc41ab03df904a7c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20560
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-30 02:43:08 +00:00
Corentin Wallez c85ef7927f Fix and enable -Wfour-char-constants
Bug: dawn:394
Change-Id: Ic11924bf81820f6d3a67bf5d70cce7104e70954f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20581
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-29 21:07:21 +00:00
Corentin Wallez b2d1d7b2ce Fix and enable -Wvla-extension
Bug: dawn:394
Change-Id: If5ced5f910da7fd598521113aba89e6a9051f4a9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20582
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-29 16:00:41 +00:00
Corentin Wallez 85cc603394 Enable -Wc++20-designator
Bug: dawn:394
Change-Id: I03f0c779e4fb3f0a32d171e986de885c857fe782
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20580
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-29 15:56:41 +00:00
Ryan Harrison 349a82a382 Rolling 5 dependencies
Roll third_party/SPIRV-Tools/ 61b7de3c3..49ca250b4 (13 commits)

61b7de3c39..49ca250b44

$ git log 61b7de3c3..49ca250b4 --date=short --no-merges --format='%ad %ae %s'
2020-04-28 stevenperron Delete nullptr in function bb list immedietly (#3326)
2020-04-28 jaebaek Set DebugScope for termination instructions (#3323)
2020-04-28 afdx spirv-fuzz: Do not outline regions that end with a loop header (#3312)
2020-04-27 bclayton vscode: Handle '|' chains on BitEnum / ValueEnum (#3309)
2020-04-27 jaebaek Add debug information analysis (#3305)
2020-04-27 dneto Add spvtools::opt::Operand::AsLiteralUint64 (#3320)
2020-04-27 afdx spirv-fuzz: Pass on validator options during shrinking (#3317)
2020-04-27 afdx spirv-fuzz: Clamp statically out-of-bounds accesses in code donation (#3315)
2020-04-27 afdx spirv-fuzz: Fix memory management in the fact manager (#3313)
2020-04-27 afdx spirv-fuzz: Do not replace the Sample argument in OpImageTexelPointer (#3311)
2020-04-23 afdx Allow various validation options to be passed to spirv-opt (#3314)
2020-04-23 Chaitanyas0101 typo fix: in README.md exectuable->executable (#3306)
2020-04-20 afdx spirv-fuzz: Make handling of synonym facts more efficient (#3301)

Roll third_party/glslang/ 3f4e5c456..39281fb71 (10 commits)

3f4e5c4563..39281fb710

$ git log 3f4e5c456..39281fb71 --date=short --no-merges --format='%ad %ae %s'
2020-04-29 63069047+pmistryNV Add support for extension GL_ARB_vertex_attrib_64bit (#2193)
2020-04-27 63069047+pmistryNV Add support for extension GL_ARB_texture_query_lod. (#2194)
2020-04-28 dj2 Remove unused Es310Desktop430 (#2200)
2020-04-27 63069047+pmistryNV Add support for extension GL_ARB_shading_language_packing (#2192)
2020-04-27 cepheus Move to SPIR-V 1.5 Rev. 3, bump revision, remove a status from README.
2020-04-24 johnkslang Note about Build Status.
2020-04-24 cepheus Move to latest SPIR-V header, and bump glslang revision.
2020-04-22 63069047+pmistryNV Add support for extension GL_ARB_shader_storage_buffer_object (#2184)
2020-04-22 antidote.crk TPpToken: Fix compiling on clang-10 (#2189)
2020-04-21 mennovink20 xcode warnings fix (#2188)

Roll third_party/shaderc/ ced9c72d0..41f271e61 (1 commit)

ced9c72d00..41f271e613

$ git log ced9c72d0..41f271e61 --date=short --no-merges --format='%ad %ae %s'
2020-04-28 rharrison Rolling 5 dependencies, updating expectations, and fixing build issues (#1051)

Roll third_party/spirv-cross/ f38cbeb81..7e0295abf (17 commits)

f38cbeb814..7e0295abf8

$ git log f38cbeb81..7e0295abf --date=short --no-merges --format='%ad %ae %s'
2020-04-28 rharrison Update SPIR-V Headers to 1.5 rev 3
2020-04-27 post Work around odd deadlock in test_shaders.py in --parallel mode.
2020-04-27 post Implement OpAtomicLoad/OpAtomicStore.
2020-04-27 post MSL: Fix case where subpassInput is passed to leaf functions.
2020-04-27 alexis.payen Fixed recursion in combined_decoration_for_member Members in nested structs were not properly iterated on, and as a result, flags like row major for matrices could be not propagated properly.
2020-04-23 dsinclair Roll GLSLang, SPIRV-Tools and SPIRV-Headers.
2020-04-21 post GLSL: Support f16x2 <-> f32 bitcast.
2020-04-21 post Be a bit more careful what nonuniform state is propagated.
2020-04-21 post Handle RayQueryKHR type.
2020-04-21 post Update SPIR-V headers.
2020-04-18 devsh.graphicsprogramming Fix issue #1327
2020-04-21 post HLSL: Add parens in unpackUint2x32 for clarity.
2020-04-21 post HLSL: Only allow 64-bit integers in SM 6.0.
2020-04-21 post Ensure unpack/pack2x32 tests are compatible with test suite.
2020-04-17 bingkan GLSL/HLSL: Support packUint2x32 and unpackUint2x32
2020-04-21 post MSL: Deal correctly with initializers on Private variables.
2020-04-20 post MSL: Support edge case with DX layout in scalar block layout.

Roll third_party/spirv-headers/ 2ad0492fb..c0df742ec (5 commits)

2ad0492fb0..c0df742ec0

$ git log 2ad0492fb..c0df742ec --date=short --no-merges --format='%ad %ae %s'
2020-04-24 cepheus Update headers to SPIR-V 1.5 Revision 3
2020-04-24 cepheus Add a bunch of missing "version" : "None" for ray tracing.
2020-04-24 cepheus Rebuild the headers with the fixed grammar file.
2020-04-24 cepheus Add missing "version" : "None" for ShaderCallKHR
2020-04-24 cepheus Grammar: The ray-tracing updates were not done in numerical ordering.

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: I6750e36ac1717b3a30f805771ad09f89355083ff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20600
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-04-29 14:52:51 +00:00
Corentin Wallez 2d79ef264e Do not use Dawn's warnings for compiling Chromium's gtest main.
When building in Chromium, Dawn's gtest targets use sources files
in Chromium so it can use Chromium's GTest harness. These source
files were compiled with the "dawn_internal" config included.
This made them include Dawn-specific warnings that trigger on parts
of Chromium's //base.

Instead compile these "main" files as separate source_sets without
dawn_internal and link them in the dawn test executables.

Bug: chromium:1075817

Change-Id: I573390ca3e6a7dfd1e8a949dc10ed268f0d0f63e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20520
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-28 17:12:05 +00:00
Bryan Bernhart c94f4a7a19 D3D12: Fix invalid allocation size check.
GetResourceAllocationInfo() returns UINT_MAX64 when
the requested size is too large. This corrects the
validation to OOM when D3D considers the size
invalid.

Only validating for zero-size would cause a device
loss as certain D3D drivers may not always consider
zero-sized invalid and NextPowerOfTwo(UINT_MAX64)
would overflow the allocator.

BUG=dawn:393

Change-Id: Idaad10c139f6428d4f48bca24027a6691257aca9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20400
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2020-04-28 15:58:45 +00:00