Commit Graph

9474 Commits

Author SHA1 Message Date
Li Hao f112ceca34 Reland "Fix zero stride in input state for Metal validation"
Update stride value to max(attribute.offset + sizeof(attribute) for
each attribute) when input stride is 0 in Metal backend

BUG=dawn:75
TEST=dawn_end2end_tests

Change-Id: I449532807f7fba1bca22106f2c38d496b8cbf01f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7020
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2019-05-07 07:06:59 +00:00
Yizhou Jiang 8804bc541e Fix validation of mip map level
Mip map level starts with the size of texture image and halves the
size until a 1x1 dimension.

BUG=chromium:954769

Change-Id: I59e51af216d65c721a3d2c2023306883e524820d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
2019-05-06 01:53:16 +00:00
Jiawei Shao f8a1041e99 Check OpenGL passed fences with glClientWaitSync()
This patch fixes an issue in the check of passed OpenGL fences.
Currently Dawn checks if an OpenGL fence is passed with glGetSynciv(sync,
GL_SYNC_CONDITION, sizeof(GLint), &length, &status), which always returns
GL_SYNC_GPU_COMMANDS_COMPLETE and is meaningless. This patch uses
glClientWaitSync() to check if a fence is passed instead.

BUG=dawn:137

Change-Id: Iff6b18bcc7155b06bde98ff68c7ed104a27bfe55
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6800
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-05-06 01:10:16 +00:00
Rafael Cintron f54bb68f47 Improve usage of static_casts over reinterpret_casts
Static_casts are prefered over reinterpret_casts for better type
safety

Change-Id: I190cbee293591ebf8ab8035e900c081848eb1f30
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6921
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-03 00:58:27 +00:00
Austin Eng e99e2408e9 Run Dawn DEPS trybots as experimental
This change runs Dawn DEPS trybots as experimental. It allows us to know
when Dawn changes will break Chromium and the autoroller. They are
experimental because we expect Chromium integration to break when Dawn's
API changes.

Bug: chromium:948902
Change-Id: Ifb2ac253fefc90c68a4b56d5895099e1ddf596e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kenneth Russell <kbr@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-05-02 17:46:26 +00:00
Corentin Wallez 94274b63fb dawn_native: deduplicate render pipelines
BUG=dawn:143

Change-Id: I2f66387f95bcb44dc20f308b4a582b878803dbe8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6864
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-05-02 15:30:56 +00:00
Corentin Wallez 00f6b1af41 dawn_native: don't uncache error objects
Error objects that are cached still have mIsBlueprint to false and would
try to uncache themselves, which isn't valid.

Also adds a regression test.

BUG=dawn:143

Change-Id: Icd8bab52982b8520519d52296fffa6ed85088b8e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6900
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-05-01 15:49:07 +00:00
Corentin Wallez 1152bbaf8e dawn_native: deduplicate compute pipelines
BUG=dawn:143

Change-Id: I64e4660de2241bb72bb7c615a0bd1e675e043295
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6863
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-01 13:48:47 +00:00
Corentin Wallez c535198d96 dawn_native: deduplicate shader modules
BUG=dawn:143

Change-Id: I2c0fa63e3a6d77c137418f12b9807d16a0636d57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6862
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-01 13:27:07 +00:00
Corentin Wallez 0ee9859c91 dawn_native: deduplicate pipeline layouts
This is the first step to do pipeline deduplication. It also introduces
tests for deduplication.

BUG=dawn:143

Change-Id: Ib22496f543f8d1f9cfde04f725612504132c7d72
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-01 12:57:27 +00:00
Corentin Wallez cc141797df Fix dawn_end2end_tests -w
Code surrounding the swapchain needs to Flush the wire so that the
native swapchain implementation is initialized before GetPreferredFormat
is called. Likewise the swapchain should be destroyed before the last
FlushWire otherwise the native swapchain will still be using the window
at the beginning of the next test.

Also fixes the newly added ASSERT_DEVICE_ERROR not working with -w.

BUG=dawn:143

Change-Id: Ie3d6fa8c9236f68f5bff1ad7abd112ab25035843
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6860
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-05-01 12:07:37 +00:00
Brandon Jones 11b703904a Increase D3D12 Swap Chain Buffers to 3
Adds an additional buffer and frame to the D3D12 swap chain to
unthrottle fps in situations where we can't maintain a constant 60fps.

Bug: dawn:142
Change-Id: I06ef697ca37608dc51816dd99de5534cb8c9b843
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6840
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-30 08:31:38 +00:00
Brandon Jones 4baba8266b Use VK_PRESENT_MODE_FIFO_KHR for Vulkan Swap Chain
Change Vulkan Swap Chain from VK_PRESENT_MODE_IMMEDIATE_KHR to
VK_PRESENT_MODE_FIFO_KHR. Some common GPUs don't support immediate mode,
so we should default to a value that is required to be supported.

Bug: dawn:90
Change-Id: I66dec23141e69637ccfa8a2ed0ee651114b9ddcf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6820
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-30 08:31:08 +00:00
Corentin Wallez bbed457796 Texture: Add validation that the mip chain can't be too large
BUG=chromium:954769

Change-Id: I07a00230294cb9385b79edb6150d9f0f7b4b7284
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6760
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-04-29 09:31:06 +00:00
Yan, Shaobo 9286adcb0f Add end2end test for all vertex formats
BUG=dawn:41

Change-Id: I37bde37843522a8d7c8b3bea1cb24c0971efd8e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6340
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2019-04-26 15:25:18 +00:00
Corentin Wallez a32e3bd014 Metal: Invert CW and CCW because we compile with flip Y
BUG=dawn:43

Change-Id: I6d09118d141046cd307604b1b4d53a82d8d15bf6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6761
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-26 14:14:08 +00:00
Jiawei Shao 15d4c2e63b Emulate store and multisample resolve on Metal
This patch implements "store and MSAA resolve" store operation on Metal
drivers that don't support MTLStoreActionStoreAndMultisampleResolve with
a workaround that does MSAA resolve in another render pass.

Driver workaround is one type of Dawn Toggles. Dawn Toggles will include
other optional optimizations and features that can be configured to use
or not when we create Dawn Devices.

As all Metal try bots don't need this toggle, to better test this
patch on the try bots:
1. We add the support of forcing enabling a workaround when starting an
   Dawn end2end test so that we can test the workaround on the platforms
   where the workaround is disabled.
2. We add an optional parameter DeviceDescriptor to CreateDevice() so
   that we can custom the toggles the Dawn device should use.

This patch also adds the support of querying toggle details from Instance
and the names of the toggles in use from Device. These APIs are tested in
the Dawn unittests added in this patch.

BUG=dawn:56
TEST=dawn_end2end_tests
TEST=dawn_unittests

Change-Id: Iae31d2ded6057eee638b6099d3061e9d78b04d55
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-04-26 07:52:57 +00:00
Kai Ninomiya 8e97b4c8a5 Add a basic compute shared memory test
Change-Id: I6fab17d59d58434d10def29923e71106605c4f32
Bug: None
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6580
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2019-04-26 02:08:12 +00:00
Corentin Wallez ef90079944 CommandEncoder: promote errors to device errors after finish()
BUG=dawn:138

Change-Id: Iddb1aab886558c706d0188adc21c7ee8f68533d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6720
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-04-25 20:14:32 +00:00
Corentin Wallez 3826880f81 Metal: Implement Culling and FrontFace
This is implementing the feature on a single backend and without tests
so we can get it in the hands of people trying WebGPU quickly.

BUG=dawn:43

Change-Id: I4d0611efd21dd1af053288957f137febc78a74e8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6721
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-25 19:37:28 +00:00
Jiawei Shao 22cee9ae36 Enable MultisampledRenderingWithDepthTest on Windows Intel Vulkan
Now MultisampledRenderingWithDepthTest can pass on Windows Intel
Vulkan drivers with the fix in
https://dawn-review.googlesource.com/c/dawn/+/6640.

BUG=dawn:56
TEST=dawn_end2end_tests

Change-Id: If83d8183960960119e728d0372f5d1c5c11d849e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6680
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-04-19 05:18:20 +00:00
Austin Eng 342c6ea1a9 Fix MultisampledRenderingWithDepthTest
This test was using two separate depth-stencil textures for sequential
render passes. The second render pass is supposed to load the texture
from the first but it was instead loading a new uninitialized texture.

Bug: dawn:133
Change-Id: I615ec4502a6f26bd039187b0c1942ffbb806b549
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6640
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-04-18 18:28:48 +00:00
Austin Eng 0c133bbe55 Rename DawnColorStateDescriptor.colorWriteMask to writeMask
Bug: chromium:877147
Change-Id: I566cea409b89de8abd724f344f7ae83f80e56572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6600
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-04-15 20:43:35 +00:00
Corentin Wallez 2ec74dcc3f Add Adapter::GetDeviceType() (integrate vs. discrete vs. CPU)
BUG=chromium:852089
Change-Id: Ia447448392e09c5d604ae038b4758776ed3e66ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5180
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-04-15 16:36:25 +00:00
Austin Eng bff933affc Clear glColorMask at the start of a RenderPass for LoadOp::Clear attachments
Bug: dawn:133
Change-Id: Id8c6180f7a9ef2f7901aca6690d611fad4f13beb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6560
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-04-12 17:43:05 +00:00
Yunchao He 0c227e21d1 baseVertex in drawIndexed() should be int32, not uint32
baseVertex in drawIndexed() is int32 in web idl. But it is uint32 in Dawn
project. I also checked the native Graphics API sets. baseVertex is int32
on all native APIs (D3D12, Vulkan, Metal). So this feature in web idl is
definitely correct.

This small change makes dawn match web idl for this feature. And it also
adds a couple of tests to cover negative baseVertex.

BUG=dawn:135
TEST=dawn_end2end_tests

Change-Id: I642c96faed9103c8392979f3714527ed0aac4089
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6442
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-12 07:58:44 +00:00
Yunchao He c33a8c1885 Implement rasterization state for render pipeline - Part 1
This change adds rasterization state into dawn.json. It includes
back face culling and depth bias. It also adds validation code
and default values for rasterization state in ComboRenderPipelineDesc
to pass dawn_unittests.

Validation for back face culling and depth bias related parameters
is quite easy, so unittests are not needed.

BUG=dawn:43

Change-Id: I332cbf3f72545cfa8e62b3534d5a6a6e8fdc6d2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6460
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-04-11 18:46:54 +00:00
Corentin Wallez fbf7092ab3 PushConstantsTest: Don't use additive blending
One of the test was doing additive blending with a render target that
was uninitialized causing flaky failure. This additive blending was
useful when we had multi-pass render passes but isn't anymore.

BUG=dawn:133

Change-Id: I0aef3dc31e98dbc51c267dc1e481429930162a93
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2019-04-11 18:30:54 +00:00
Frank Henigman 9a9b837519 Roll all SPIR-V dependencies together.
Function name changed in shaderc.
SPIRV-Cross split up into additional files.

BUG=chromium:951016

Change-Id: I49abb0a163fefdd61b7d6352e57e2a10f519abd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6440
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-11 14:52:55 +00:00
Jiawei Shao 51fd66e3dd Add missing Constants.h in src/common/BUILD.gn
This patch adds the missing Constants.h in src/common/BUILD.gn so that
we can see this file under the folder "src/common" of the Visual Studio
project generated by GN.

BUG=dawn:134

Change-Id: I513315ee2adbd93cf1ff61d112e8a4f65f660bce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6520
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-11 07:41:38 +00:00
Corentin Wallez c005c9acf0 Metal: Fail BackendConnection creation when Metal isn't supported
Chromium still supports macOS 10.10 that doesn't have Metal support and
calling any Metal function there results in a crash. Prevent using the
backend when Metal isn't present by not creating a BackendConnection.

BUG=chromium:852089

Change-Id: I53ffe6972f7b926b6bcbe740275fcee88b9df67a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6480
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-11 07:14:28 +00:00
Austin Eng f4c3f4562e Disable RenderPassTest.TwoRenderPassesInOneCommandBuffer on OpenGL and Metal
This test is flaky on Metal and consistently failing on OpenGL.

TBR=cwallez@chromium.org,kainino@chromium.org
Bug: chromium:950768
Change-Id: I0e62b87053009182afef39e5ef2459b30a866418
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6500
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-04-10 20:25:57 +00:00
Austin Eng b4b3ea05eb Reland "Rename texture.createTextureView to createView to match WebGPU"
This is a reland of 6f0b021dbf.
It also renames CreateDefaultTextureView to CreateDefaultView in a test
that landed after the tryjobs for the reverted patch passed.

Original change's description:
> Rename texture.createTextureView to createView to match WebGPU
>
> Bug: chromium:877147
> Change-Id: I186fc26054cc6729c859a4161c755a1133dc0bca
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6360
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

Bug: chromium:877147
Change-Id: I8e1a1adc07ad2c78081ae3cb0fa2bdb648b39c50
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6361
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-04-09 16:57:00 +00:00
Yuly Novikov 2d4c66d2b8 Revert "Rename texture.createTextureView to createView to match WebGPU"
This reverts commit 6f0b021dbf.

Reason for revert: breaks compilation on https://ci.chromium.org/p/chromium/builders/ci/GPU%20FYI%20Linux%20Builder%20%28dbg%29/62003

Original change's description:
> Rename texture.createTextureView to createView to match WebGPU
> 
> Bug: chromium:877147
> Change-Id: I186fc26054cc6729c859a4161c755a1133dc0bca
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6360
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

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

Change-Id: I2d337881fc05cf8128ae7ab268514ea7ef462123
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:877147
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@google.com>
2019-04-09 15:28:01 +00:00
Austin Eng fbe6cfdb16 Update ComputePipelineDescriptor to use PipelineStageDescriptor
The contents of PipelineStageDescriptor were inlined inside of
ComputePipelineDescriptor. This changes updates
ComputePipelineDescriptor to contain PipelineStageDescriptor to match
WebGPU.

Bug: chromium:877147
Change-Id: Ic030b7bd7a237945cbbaf4c567cc361940e1ad00
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6400
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-09 15:17:30 +00:00
Austin Eng 6f0b021dbf Rename texture.createTextureView to createView to match WebGPU
Bug: chromium:877147
Change-Id: I186fc26054cc6729c859a4161c755a1133dc0bca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6360
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-09 15:13:10 +00:00
Austin Eng 5f1d2e1c8d Remove sampler border color from Dawn to match WebGPU
Bug: chromium:877147
Change-Id: I9760b3c6cb67a3ffa08feeaff8e8b24b80ec4200
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6380
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-09 15:12:50 +00:00
Jiawei Shao 865cad89b9 Support multisampled rendering on Metal - Part I
This patch implements MSAA resolve on Metal backends with the store
action MTLStoreActionStoreAndMultisampleResolve. Note that this store
action is not supported on all Metal drivers. In the future we will
emulate it by doing MSAA resolve in another render pass.

The end2end tests ResolveIntoOneMipmapLevelOf2DTexture and
ResolveInto2DArrayTexture are temporarily disabled on Intel and NVidia
Metal drivers due to driver issues.

BUG=dawn:56
TEST=dawn_end2end_tests

Change-Id: I7e87aa344691c7d0a389aca80500c7b89a427ea3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-04-09 08:04:59 +00:00
Austin Eng cf52d711fb Change buffer-related sizes/offsets to be uint64_t
Bug: dawn:121
Change-Id: I9d88e2b2b8eff4eda98d25ae0922bc07199a69c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5720
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-04-05 20:51:29 +00:00
Jiawei Shao 952860bf9f Support multisampled rendering on Vulkan
MultisampledRenderingTest/MultisampledRenderingWithDepthTest is skipped
temporarily on Intel Windows Vulkan drivers due to the failure of that
case on the try bots.

BUG=dawn:56
TEST=dawn_end2end_tests

Change-Id: Ibcf4a07198e4ebad304170e8df9778dc965349df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-04-05 03:06:38 +00:00
Yunchao He cfea934e2b Remove unneeded TODO for SetScissorRect in unittests
This change also fixed a small style issue in dawn.json.

BUG=

Change-Id: I731aca5558ebe1eb0d6bd144a0e2a9b01963558a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6261
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-02 14:31:29 +00:00
Yunchao He 2a30e14074 Generate an error if scissor rect is empty
We need to change related tests in end2end_tests and unittests.

Bug=dawn:127
TEST=dawn_end2end_tests, dawn_unittests

Change-Id: I523d4eeb930990b5db381544b228d2f11912049b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6240
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-02 07:42:18 +00:00
Jiawei Shao 8e50ba19ba Support multisampled rendering on D3D12
This patch adds the basic support of multisampled rendering on D3D12
backends and enables the related end2end test on D3D12 backends.

D3D12 render pass is not used in this patch. We plan to make use of it
in the future.

BUG=dawn:56
TEST=dawn_end2end_tests

Change-Id: I63759431654ec0abe9d21157f679d4c971cd92a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6200
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-04-02 07:42:09 +00:00
Corentin Wallez 941a04cd43 Remove stray include for dawncpp_traits.h
The CQ passed on the patch that removes dawncpp_traits even if we forgot
this include because the builders still had the generated header in
their build cache.

TBR=enga@chromium.org
BUG=dawn:125

Change-Id: Ie266bc32e6ebc4881f80c759435ca1e3f0d00e9c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6221
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-02 07:04:48 +00:00
Corentin Wallez 4f5fc2d325 Nuke Builders part 4: headers, proctable and miscreferences
BUG=dawn:125

Change-Id: If1b2feb1b0880eb8ad168cfabb9d67ece4f02190
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6220
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-01 21:48:38 +00:00
Corentin Wallez c3155205fa Nuke Builders Part 3: remove validation test builder expectations
BUG=dawn:125

Change-Id: I64a0b957e39b60334916ad71fb4beee5d8baa9db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6162
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-01 21:16:08 +00:00
Corentin Wallez cb2c64f7d9 Nuke Builders Part 2: remove all builder code from wire
This removes blocks of code that were obviously builder-specific but
also removes the ObjectStorage::valid member that was used to implement
the maybe monad on the wire server side. This is no longer needed since
dawn_native handles the maybe monad internally now.

BUG=dawn:125

Change-Id: I8c30daae9fc70853bc1996d85a860b4877c5976c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6161
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-04-01 21:04:17 +00:00
Natasha Lee 20b0c33913 Buffer DestroyImpl check for buffer resource to avoid double free
Double free was happening if buffer.Destroy() was called right
before the buffer went out of scope since DestroyImpl wouldn't
check to see if the resource was already released.

Also refactor Destroy in Texture classes to match the pattern
of Buffer classes. Added validation of the texture object when
Destroy is called.

Bug: dawn:124, chromium:947323
Change-Id: I0e4a652ff5b86a151b4919c781c1dd385b4e3213
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6060
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
2019-04-01 19:49:04 +00:00
Jiawei Shao 14487c34f7 Skip RenderPassLoadOpTests.ColorClearThenLoadAndDraw on Linux Intel OpenGL
RenderPassLoadOpTests.ColorClearThenLoadAndDraw is flaky on Linux Intel
drivers, so we have to skip it temporarily. As currently we cannot collect
PCI IDs on OpenGL drivers, we have to skip this test on all OpenGL
backends.

BUG=dawn:126, chromium:947246

Change-Id: Ic1b75ee70d72b8e96ac87018cfc886661e4ae3de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-04-01 07:47:47 +00:00
Natasha Lee 10c24684ab Fix use of uninitialized value in ValidateTextureViewDescriptor
ValidateTextureViewDescriptor was running into use of uninitialized
value. Fixing this by moving the texture state check below the texture
object check. This should validate the texture object before trying to
validate it's texture state.

Bug: chromium:947150
Change-Id: I9b41791bfb960fbe4873ba5fcadf046bd32e5853
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6180
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
2019-03-28 22:49:53 +00:00