Commit Graph

3927 Commits

Author SHA1 Message Date
Bryan Bernhart 31f039350b D3D12: Cache DXGI keyed mutexes on the external image.
Maintains a 11on12 resource cache on the external image
to prevent re-creating the wrapped resource then
flushing it per produced texture. To prevent
unbounded growth, a basic cap is used which gets
cleared.

This change fixes signficant CPU time spent in the WebGPU command
decoder for video import workloads and excessive memory overhead
from swap chain buffers.

Fixed: dawn:625

Change-Id: I72c07b02f6ab6877a9f21758650962c895933bf9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51421
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-08-12 23:32:49 +00:00
Dawn Autoroller f209e8ba83 Roll Tint from 67473c7a6c to 080fdf2ac0 (3 revisions)
https://dawn.googlesource.com/tint.git/+log/67473c7a6c05..080fdf2ac000

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I0833f0f84e52390dc4074807f6308cc3c4a99e31
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61880
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-12 20:22:49 +00:00
Juanmi 633bb68c6b Reland "Making D3D12 accept InternalUsageDescriptors"
This is a reland of 365d40b93a

Original change's description:
> Making D3D12 accept InternalUsageDescriptors
>
> This is a follow up from two previous CLs,
> https://dawn-review.googlesource.com/c/dawn/+/58440
> and
> https://dawn-review.googlesource.com/c/dawn/+/58140
>
> This CL adds in the D3D12Backend the possibility to use Dawn Texture
> Internal Usage Descriptor, and adds a series of tests to validate it.
>
> Change-Id: I94f6b39153b60ec8af61bda22d41a865898da613
> Bug: dawn:1027, dawn:1052
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61520
> Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>

Bug: dawn:1027, dawn:1052
Change-Id: I0d35cbf4dc1c6dc80e1a5dfb4770a5383ef543fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61840
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
2021-08-12 20:17:39 +00:00
Bryan Bernhart 0d6da1072c Fix ASSERT setting staging buffer label
Ensures the mapped staging buffer will
always be locked before setting the label.
Otherwise, setting the label could fail
and leave it unlocked which isn't
allowed.

BUG: chromium:1239112
Change-Id: I738f8d6fc3b20b8c8b51671d77e7014d967ffd52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61860
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2021-08-12 19:46:18 +00:00
Austin Eng 39c4fcbdd3 Revert "Making D3D12 accept InternalUsageDescriptors"
This reverts commit 365d40b93a.

Reason for revert: Broke the ChromeOS build in the Dawn roll.
https://chromium-review.googlesource.com/c/chromium/src/+/3090302

Original change's description:
> Making D3D12 accept InternalUsageDescriptors
>
> This is a follow up from two previous CLs,
> https://dawn-review.googlesource.com/c/dawn/+/58440
> and
> https://dawn-review.googlesource.com/c/dawn/+/58140
>
> This CL adds in the D3D12Backend the possibility to use Dawn Texture
> Internal Usage Descriptor, and adds a series of tests to validate it.
>
> Change-Id: I94f6b39153b60ec8af61bda22d41a865898da613
> Bug: dawn:1027, dawn:1052
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61520
> Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>

TBR=kainino@chromium.org,enga@chromium.org,juanmihd@chromium.org,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I11b246f38505df23a6c61e851d6d90e34c8d1287
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:1027, dawn:1052
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61820
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-12 17:05:21 +00:00
Dawn Autoroller 4d968c63d3 Roll Tint from 3bcbfc7862 to 67473c7a6c (2 revisions)
https://dawn.googlesource.com/tint.git/+log/3bcbfc7862ee..67473c7a6c05

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: Ib30d3ff57e2719b08121c9ffa252b193c8ecf69e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61740
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-12 15:41:15 +00:00
Juanmi 365d40b93a Making D3D12 accept InternalUsageDescriptors
This is a follow up from two previous CLs,
https://dawn-review.googlesource.com/c/dawn/+/58440
and
https://dawn-review.googlesource.com/c/dawn/+/58140

This CL adds in the D3D12Backend the possibility to use Dawn Texture
Internal Usage Descriptor, and adds a series of tests to validate it.

Change-Id: I94f6b39153b60ec8af61bda22d41a865898da613
Bug: dawn:1027, dawn:1052
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61520
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-08-12 15:35:48 +00:00
Stephen White 1935043d35 Fix CMake build.
SpirvUtils.* are now in the dawn_native/opengl/ directory.

Bug: dawn:1067

Change-Id: I9cfb7ee52ec1f4ac321cb03978008843e33f82c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61680
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-12 15:24:48 +00:00
Austin Eng 8e402bc4c5 Suppress flaky CopyTextureForBrowserTest on Win Vulkan Intel
Bug: dawn:1070
Change-Id: Ic5dc1b334e4b006594ee950bf508057361e821bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61720
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
2021-08-12 15:16:14 +00:00
Austin Eng eda73e3c4e Validate SPIRV produced by Tint
The now-removed SPIRV-Cross path used to always do this, and the
pure Tint-only path never actually validated the SPIRV. Tint
does not run SPIRV-Tools validation on its output, so add in
validation to ensure we don't pass invalid SPIRV to the driver.
The validation can probably eventually be removed when we're more
confident that Tint's SPIRV output is always correct.

Also include various cleanups for old / unused code.

Bug: dawn:1036
Change-Id: Iaab037518965e52edbd1829f6ab6ba2af0e70143
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61589
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Auto-Submit: Austin Eng <enga@chromium.org>
2021-08-12 05:20:48 +00:00
Dawn Autoroller c0132622c1 Roll Tint from 5085efb748 to 3bcbfc7862 (4 revisions)
https://dawn.googlesource.com/tint.git/+log/5085efb748c9..3bcbfc7862ee

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I286e447915c4b785d9b44d04cdd9239e65875d4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61587
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-11 21:52:30 +00:00
Austin Eng 5bed1ed838 More spirv-cross related removal
Bug: dawn:1036
Change-Id: Ia60c71558bd2c47a6b7148d86b8dcedfaa79ba89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61585
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-11 21:15:26 +00:00
shrekshao 4f2edf576e Add validation for fragment output and attachment interface matching
Validation rules discussed at
https://github.com/gpuweb/gpuweb/issues/2013

Bug: dawn:1063
Change-Id: I264eecb7c548f29975e5459a7ad020105acab634
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61383
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-08-11 21:12:36 +00:00
Austin Eng 6ef39372f8 Don't enable GL backends by default if build_with_chromium
This is the simplest change necessary to remove GL backends from
the build in Chrome. The backends will still be enabled on bots
that test Dawn. A more proper fix might be to update the dawn.py
recipe to explicitly enable the GLES backend (we don't test the
GL backend on bots using dawn.py, but we do test GLES), and then
defaulting both dawn_enable_desktop_gl and dawn_enable_opengles
to false.

For now, stick with the most minimal change for two reasons:
 1. Defaulting to false would lose automatically enabling the
    backends in Dawn standalone builds where they're supported.
 2. LUCI changes have changed the permissions to trigger tryjobs
    on recipe changes, so testing a recipe change is not possible
    right now. See crbug.com/1168315.

Bug: dawn:1036
Change-Id: I7f4977fbd271200f1d6161d2e2b3438cdb4db1ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61600
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-11 20:03:41 +00:00
Austin Eng 38534b6e74 D3D12: Only set the root signature when bind groups are applied
Dawn only reapplies bind groups that have changed on the layout
since the last draw. However, the D3D12 backend was always resetting
the root signature state upon switching pipelines. This led to a
bug where the root signature could be changed and dirtied without
reapplying the dirty bind groups.

Moving application of the root signature state to the same loop
that applies bind groups helps ensure the state stays in sync.

Fixed: dawn:1055
Change-Id: Iae89088560e83f6104c921d42de27c03095d654f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61582
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
2021-08-11 18:44:59 +00:00
Austin Eng e02bb36a2a Avoid [MTLDevice sampleTimestamps] unless the extension is enabled
This callsite was missed in a previous CL:
https://dawn-review.googlesource.com/c/dawn/+/59041

Bug: chromium:1226078
Change-Id: I3829dc16a8ec3c7b7274bc6057030bdade598ade
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61584
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-11 15:36:35 +00:00
Dawn Autoroller 3229c5b46c Roll Tint from bfb27f00d7 to 5085efb748 (1 revision)
https://dawn.googlesource.com/tint.git/+log/bfb27f00d70a..5085efb748c9

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I9895406fb70ff5adcdd62200552201e34dbc61d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61583
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-11 14:49:44 +00:00
Austin Eng 9978b2f742 Add Adapter::SupportsExternalImages
This commit adds a getter so that Chromium can check whether an
Adapter would support external images. External images are
necessary to implement the WebGPU swapchain and interop with the
rest of the web platform. We should not expose adapters that
cannot interop with the canvas and other web platform primitives
until WebGPU gains options to request more "limited" adapters.

Bug: dawn:1056
Change-Id: Iff83ac26b0e92dccdd4e29c0d854d9276a4a37bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61580
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Brian Ho <hob@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-11 14:27:55 +00:00
Dawn Autoroller a6ddb0e116 Roll Tint from 34f7eedf74 to bfb27f00d7 (2 revisions)
https://dawn.googlesource.com/tint.git/+log/34f7eedf7427..bfb27f00d70a

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I4fc359a476d8980005290d0de1fcac74874f3988
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61581
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-10 23:48:46 +00:00
Stephen White bcbe2e0c94 Move SPIRV-Cross functions into OpenGL backend.
Since the other backends no longer need it, move all of the
utility functions specific to SPIRV-Cross into the OpenGL backend.
This obviates the need for the DAWN_USE_SPIRV_CROSS define, so remove it.

Bug: dawn:1036

Change-Id: I67bb5a85dc128a6f343d09876046cf559395e05f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61541
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2021-08-10 22:04:33 +00:00
Stephen White 5d17ed6541 Wrap all uses of SPIRV-Cross in #define.
Put all cross-platform code references to Spirv-Cross behind
ifdef DAWN_USE_SPIRV_CROSS. Hide build dependencies behind
dawn_use_spirv_cross, which itself is set from dawn_enable_opengl,
since it is the only backend which is still using SPIRV-Cross.

Bug: dawn:1036

Change-Id: Id61512230b50a32c63827a16fece40d7899968d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61400
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-08-10 18:30:55 +00:00
Dawn Autoroller ec9b81142f Roll Tint from 32e905f4cb to 34f7eedf74 (1 revision)
https://dawn.googlesource.com/tint.git/+log/32e905f4cb99..34f7eedf7427

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC jrprice@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: jrprice@google.com
Change-Id: I84b9207b043aeb51a76c1097c08b8b94f8e90aca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61500
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-10 17:55:35 +00:00
Stephen White ebbbcc7ecb Remove SPIRV-Cross support from D3D12 backend.
Bug: dawn:1036

Change-Id: If447f93f7a17ecfe73f04605a60893edb00990d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61402
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-08-10 14:51:27 +00:00
Brandon Jones 27e17a6aad Update deprecated TextureUsage flag names
Older names are kept around as an alias for a while. Unfortunately we
have no mechanism for producing deprecation error messages when they
are used.

Bug: dawn:1035
Change-Id: Ic6716fd526ecbedaa8e7925ab93e3ff32f642d97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61382
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2021-08-10 04:07:37 +00:00
Jiawei Shao f99d5aa7d4 Remove a useless comment
This patch removes the comment about adding "interpolationType" and
"interpolationSampling" to InterStageVariableInfo as they have already
added before. Sorry that we forgot to remove it in the PR of adding
these two members to InterStageVariableInfo.

BUG=dawn:802

Change-Id: Ib2f3769f2dc1c8152280a28aad77bf90abf76608
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61384
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-08-10 03:42:44 +00:00
Stephen White a03e847227 Remove SPIRV-Cross support from Vulkan backend.
Bug: dawn:1036

Change-Id: I463d067af03fbcd732402fd0e0cc7045669e13b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61220
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-08-10 02:56:03 +00:00
Bryan Bernhart c61a24b5fd D3D12: Fix crash from non-initialized adapter.
If the Adapter failed to create a D3D device, it would
attempt to access it on destruction causing the
process to crash.

Bug: dawn:460
Change-Id: I3f13043e8049cd71806ee54efa92c70e26561580
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61300
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2021-08-09 17:46:03 +00:00
Dawn Autoroller 167f67f3cb Roll Tint from b2619443d9 to 32e905f4cb (1 revision)
https://dawn.googlesource.com/tint.git/+log/b2619443d9a6..32e905f4cb99

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: enga@google.com
Change-Id: Ib5c431913954782331002ee1cc8d29d57b8df270
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61320
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-07 19:07:38 +00:00
Dawn Autoroller a1dd9b917d Roll Tint from 1a1c42ef12 to b2619443d9 (1 revision)
https://dawn.googlesource.com/tint.git/+log/1a1c42ef1276..b2619443d9a6

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: enga@google.com
Change-Id: I2a7d13201545f98b5f6795fbd73e1f2023524134
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61282
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-07 01:36:49 +00:00
Michael Tang ed9681c921 dawn_native: Fallback sorting bindings in BindGroupLayout to use the binding number
This helps us merge contiguous descriptor ranges in https://dawn-review.googlesource.com/c/dawn/+/60764

Change-Id: I772262b117087ec1f1d744596be2585a5996325f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60765
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
2021-08-06 22:39:21 +00:00
Jiawei Shao 8d8fadbbe4 Validate MaxInterStageShaderComponents when creating shader module
According to the discussion[1], the sum of all the user-defined
inter-stage component count and all the inter-stage builtin component
count should be no more than MaxInterStageShaderComponents (currently
in Dawn it is always 60).

[1] https://github.com/gpuweb/gpuweb/issues/1962

BUG=dawn:1032
TEST=dawn_unittests

Change-Id: Id5266b72b89c48f5b7073b8307f8f2c0512c8a33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61104
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-08-06 20:57:18 +00:00
Dawn Autoroller 9eb890dff4 Roll Tint from b612c50593 to 1a1c42ef12 (1 revision)
https://dawn.googlesource.com/tint.git/+log/b612c505939b..1a1c42ef1276

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: enga@google.com
Change-Id: Ib04471869e88feb123f60fadbb0f372c48890dc6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61281
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-06 20:45:29 +00:00
Austin Eng 93011d0305 Set the Tint MSL emit_vertex_point_size option when necessary
If [[point_size]] is not emitted, it is undefined. Set the option for
Tint to explicitly set it to 1.0 when necessary.

Bug: dawn:1059
Change-Id: I27c19e88cda30aef0a8f31b213c58d5bf87feabd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61280
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-08-06 18:19:38 +00:00
Austin Eng 567e071b5b Free VkCommandPool if vkResetCommandPool fails
Bug: chromium:1234680
Change-Id: If8f5c2dc0cdf14bf8a0c713d724b883657bd1463
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61103
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2021-08-06 16:16:20 +00:00
Brandon Jones 9096fc290f Remove createRenderPipeline2 and GPURenderPipelineDescriptor2
Blocked on:
https://chromium-review.googlesource.com/c/chromium/src/+/3075622
https://skia-review.googlesource.com/c/skia/+/437076

Change-Id: I49773b422c0fda7c752b90c341e5a9f243fc0b36
Bug: dawn:751
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61101
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2021-08-06 03:58:50 +00:00
Jiawei Shao a7f5fa36f0 Roll third_party/tint/ 11c6fcdb5..b612c5059 (3 commits)
Change-Id: I117798401ad2af56524560548ec4db0d76503f43
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61102
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2021-08-06 01:43:19 +00:00
Stephen White 6ab06f8881 Remove SPIRV-Cross usage from Metal backend.
Change-Id: I456b6cc660779175afc73bbef5134fbcf4988ad3
Bug: dawn:1036
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60900
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2021-08-06 01:24:59 +00:00
Juanmi f00c68a216 Adding APICopyTextureToTextureInternal
This CL adds an internal method to copy textures, that will disregard
the need of having CopySrc usage.

This CL adds an intermediate helped method to be used by both
APIContextTextureToTexture and APIContextTextureToTextureInternal.

Fixed: dawn:1052
Change-Id: Icd28e0ef58ecfaa412eefe8c95e41cd2298a9acc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58440
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
2021-08-05 22:55:09 +00:00
Dawn Autoroller b42d701abe Roll Tint from 4038fa7f43 to 11c6fcdb51 (3 revisions)
https://dawn.googlesource.com/tint.git/+log/4038fa7f4326..11c6fcdb514d

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: enga@google.com
Change-Id: I698fee43585cac4bd272d129583b7b9ab6c5ea04
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61140
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-05 22:23:21 +00:00
James Price 565863e954 Fix linker error with iOS build
The IsMacOSVersionAtLeast() function is only defined on macOS, but was
being used on all Apple platforms.

Change-Id: Ie5e37fb8e408f424e55795327cca7f2a345bfdfa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61120
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-08-05 20:35:19 +00:00
Dawn Autoroller 2086c655e5 Roll Tint from b5025dbc82 to 4038fa7f43 (1 revision)
https://dawn.googlesource.com/tint.git/+log/b5025dbc82e1..4038fa7f4326

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: enga@google.com
Change-Id: I98e822adb47300a50bf30c94f960ba26deab8a95
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61040
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-05 17:00:59 +00:00
Austin Eng 6c6707021a Add Buffer::GetAllocatedSize()
Buffer allocations may need padding based on backend requirements.
GetAllocatedSize returns the size of the buffer actually allocated.

This CL also updates the backends to use GetAllocatedSize for buffer
clearing and barrier operations which should operate over the
entire allocated resource.

Bug: dawn:1011
Change-Id: Ic5233214414fa090725a4f50fff70d6e178494c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60701
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-05 15:26:58 +00:00
Aleksi Sapon fef90b8a4a Fix bind groups not being applied
Fix for crbug.com/dawn/1049, where setting a pipeline without drawing can
prevent bind groups from being applied later. This occurs because the mask
for the pipeline is being saved but not its layout, because the bind
groups are never applied. This changes to only save the mask if the bind
groups are applied (the pipeline is used in a draw or dispatch).

Bug: dawn:1049
Change-Id: I4c7ae1125d1b6a06af90aea49a9dd1e4883f4826
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-05 14:45:48 +00:00
Austin Eng ae840d5e61 D3D12: Check for device lost after ID3D12Fence::GetCompletedValue
The D3D12 docs say it returns UINT64_MAX if the device was removed

Fixed: dawn:1051
Change-Id: Ide3731e9389bdb4a5a81c9f65aa9bcad1b049446
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60961
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-05 14:02:49 +00:00
Dawn Autoroller 213ac89edf Roll Tint from a5d73ce965 to b5025dbc82 (1 revision)
https://dawn.googlesource.com/tint.git/+log/a5d73ce965a7..b5025dbc82e1

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: dawn:802
Tbr: enga@google.com
Change-Id: I25f7dad8571f34b5233a3f0d516271bd39c07544
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60981
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-05 05:51:28 +00:00
Dawn Autoroller 1ee777fcd5 Roll Tint from 5c61d6d12c to a5d73ce965 (4 revisions)
https://dawn.googlesource.com/tint.git/+log/5c61d6d12ce3..a5d73ce965a7

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: enga@google.com
Change-Id: I0bed78e89a6b5bb832c2185d8bc90e769a48a1ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60980
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-05 01:08:38 +00:00
Bryan Bernhart 18bc89ee62 D3D12: Enable D3D12 debug names in Dawn builds.
Labels GPU allocations by Dawn resource type so we
can debug GPU memory consumption given traces or
full memory dumps.

BUG=dawn:967

Change-Id: I7eb19b4f2f9dd4c55c9039d39ffec9f09461556f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60620
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2021-08-04 21:52:29 +00:00
Austin Eng b5e2089768 Hook up dump_shaders toggle to dump SPIRV and GLSL
Bug: none
Change-Id: I742067d70bac5b43afe38d8d39b5eb2dae647a74
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60960
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-04 21:11:19 +00:00
Ben Clayton 5c19bf25e3 metal: Fix stray '\' prefix on MSL shaders
Seems harmless, but I'm assuming it was not intentional.

Change-Id: I86875f8bbe5923435b4c02cd224197ec2dc6f3a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60924
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-08-04 20:44:18 +00:00
Dawn Autoroller 616bfb832e Roll Tint from 98fbf241d8 to 5c61d6d12c (1 revision)
https://dawn.googlesource.com/tint.git/+log/98fbf241d80a..5c61d6d12ce3

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: enga@google.com
Change-Id: I76553e1710de7bf02df973032c4a95a4c34067cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60940
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-08-04 20:03:18 +00:00