Commit Graph

9064 Commits

Author SHA1 Message Date
Yunchao He 74ec15010f Assigning nullptr to descriptor's nextInChain in C++ is unneeded
It has already been initialized to nullptr by C++ autogen code.

BUG=dawn:82

Change-Id: I2c1cad003a7a12227cb3d17a90e12c16739ee9a0
Reviewed-on: https://dawn-review.googlesource.com/c/3600
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-01-03 10:33:55 +00:00
Yunchao He 2b9d702c09 Fix a bug for depth test on Vulkan backend
The default value for maxDepthBound should be 1.0.

BUG=dawn:81

Change-Id: I337aac884456c739222bc31f8003267aa6de96af
Reviewed-on: https://dawn-review.googlesource.com/c/3580
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-01-03 09:00:34 +00:00
Jiawei Shao d238bb67a5 Support using a layer of a texture as a color attachment on OpenGL
This patch implements using a layer of a texture as a color attachment
on OpenGL by using glFramebufferTextureLayer. As WebGPU won't support
rendering into a texture view whose format is different from the
original texture, it is correct to use glFramebufferTexture on the
OpenGL backends.

BUG=dawn:16

Change-Id: Iab6d905ee119bb9bb2d1bb212134cf757483c4d4
Reviewed-on: https://dawn-review.googlesource.com/c/3560
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-01-03 00:07:44 +00:00
Jiawei Shao 5dee56f39c Fix crash when creating texture view on textures from Metal swap chain
For the textures got from Metal swap chain, their "framebufferOnly" may
be true, which means they can only be used as attachments in a render
pass, and they are not allowed to be used in MTLRenderCommandEncoder,
MTLBlitCommandEncoder or MTLComputeCommandEncoder. So currently Dawn
examples all crash when METAL_DEVICE_WRAPPER_TYPE = 1 is set into
environmental variables.

This patch adds checks on the situations that we do not need to create
a Metal texture view:
1. We create Metal texture only when the usage of the texture includes
   Sampled or Storage.
2. We won't create Metal texture view if the view uses the same format
   as the original texture, the whole mipmap levels and array slices.
3. We use the original MTLTexture and set the slice and level in
   MTLRenderPassDescriptor.

Furthermore, with this patch, "setFramebufferOnly" is set to true only
when the usage passed to configure is a subset of (OutputAttachment |
Present).

BUG=dawn:69

Change-Id: Ie2670f383c16eafa3b1c6f99126922e940721174
Reviewed-on: https://dawn-review.googlesource.com/c/3400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-29 10:47:28 +00:00
Yunchao He 92700bfccd Replace BlendState builder via BlendState descriptor.
This change also removes BlendState object.

Bug=dawn:32

Change-Id: I8bf4ff7531e7504efb17b6bae3ca01f1f2b4131e
Reviewed-on: https://dawn-review.googlesource.com/c/3042
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2018-12-27 06:32:31 +00:00
Kai Ninomiya cb71ba7b3a Don't use ConsumedError on device initialization errors
If there's an error during device initialization, it's too early to use
ConsumedError (SetErrorCallback can't possibly have been called).
In this case, manually handle the error from initialization.

This will help us diagnose issue chromium:917555, where device
initialization is failing but the error is not printed.

TBR: cwallez@chromium.org
Bug: chromium:917555
Change-Id: I63ba3983688f508550afe2815ca1dda36130fed1
Reviewed-on: https://dawn-review.googlesource.com/c/3520
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2018-12-22 05:40:11 +00:00
Yan, Shaobo 300eec0f82 Rename SetRenderPipeline and SetComputePipeline to SetPipeline
To match the WebGPU idl, SetRenderPipeline and SetComputePipeline need to change
the name to SetPipeline.

This patch just rename these two APIs

BUG=dawn:52

Change-Id: I2545c94158ebd051027a018650bf760a25845d73
Reviewed-on: https://dawn-review.googlesource.com/c/3480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2018-12-21 10:40:26 +00:00
Yan, Shaobo 21ed12045b Guard header files in utils with #ifdef and #endif
Some header files in utils missing #ifdef and #endif and this caused including
header files multiple times.

This patch fix it.

BUG=dawn:72

Change-Id: Ib28b1a1cef91e49a5754ec6b3d66327076070d99
Reviewed-on: https://dawn-review.googlesource.com/c/3461
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-20 11:21:04 +00:00
Yan, Shaobo c8bf89ddf0 Remove "Builders" related with pipeline
RenderPipeline and ComputePipeline has been created with descriptors and PipelineBuilder
is not needed anymore.

This patch remove these remain "Builders" in dawn.

BUG=dawn:52

Change-Id: I8b119c540952beb3386913197f25b9c441f53ba4
Reviewed-on: https://dawn-review.googlesource.com/c/3460
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-20 11:00:32 +00:00
Corentin Wallez 2745f37875 Suppress more failure on GPU FYI Linux AMD Release (R7 240)
Tests are run in this order: 1, 2, 3

After suppressing test 2, test 3 started failing on the builder, this
seems to point out that test 1 is leaving the driver in a bad state.

We add suppressions both 1 and 3 just to be safe.

TBR=senorblanco@chromium.org
BUG=chromium:915430

Change-Id: Ie601b03f9e5038c623d8b7e009d2a9fb8086d181
Reviewed-on: https://dawn-review.googlesource.com/c/3420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-19 13:36:53 +00:00
Jiawei Shao 5e811aeee5 Add render pass color and depth stencil attachment descriptor
This patch is the first one of the descriptorization of render pass. In
this patch we add support of RenderPassColorAttachmentDescriptor
and RenderPassDepthStencilAttachmentDescriptor to
RenderPassDescriptorBuilder.

This patch also adds StoreOp to render pass color and depth stencil
attachment descriptor.

RenderPassDescriptorBuilder will be completely removed in the next
patch.

BUG=dawn:6, dawn:49
TEST=dawn_end2end_tests, dawn_unittests

Change-Id: If623b41d04016425efa53932ae1648daf2263675
Reviewed-on: https://dawn-review.googlesource.com/c/3300
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-12-19 08:21:13 +00:00
Brandon Jones 292c0c31f2 Add D3D12 Functionality For Multiple Bind Groups
SPIRV-Cross outputs HLSL utilizing register spaces for seperate bind groups.
This changes the D3D12 backend to also use them.

Bug: dawn:66
Change-Id: I0590ae59fa3d369b57cdb32e4c9808c137fa88dc
Reviewed-on: https://dawn-review.googlesource.com/c/3360
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
2018-12-18 19:59:59 +00:00
Corentin Wallez d23fdd3624 Fix the suppression on OpenGL to not specify the GPU
The OpenGL backend doesn't expose PCI device and vendor IDs yet which
means that IsAMD() is always false, making the test not skipped.

TBR=senorblanco@chromium.org
BUG=chromium:915430

Change-Id: Ic630080df442826b572cbd294978820109424229
Reviewed-on: https://dawn-review.googlesource.com/c/3381
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-18 18:04:42 +00:00
Corentin Wallez 12a2f65c43 Suppress failure on GPU FYI Linux AMD Release (R7 240)
TBR=senorblanco@chromium.org
BUG=chromium:915430

Change-Id: I57cc253eda45faa4c68a2cc012f594bc3514ae42
Reviewed-on: https://dawn-review.googlesource.com/c/3380
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-18 12:57:10 +00:00
Corentin Wallez 6322010014 Buffer: fix overflows in SetSubData and mapping validation
Also adds tests for overflows.

BUG=chromium:914240

Change-Id: Ibb4f86c04ffab1f1d834b8a439ba542a5291441f
Reviewed-on: https://dawn-review.googlesource.com/c/3320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-17 17:08:41 +00:00
Corentin Wallez 0d95887dbc WireServer: don't skip destroy on error objects.
An old-style builder might become an error object when a
validation error occurs on one of its methods. It still has
to be freed, so the correct check for "destroy" is to check
that the handle is not null.

BUG=chromium:914819
BUG=chromium:914867
BUG=chromium:914964
BUG=chromium:915083

Change-Id: I349faffa48f369b72c603d47dd23ffae7d86891e
Reviewed-on: https://dawn-review.googlesource.com/c/3323
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-17 10:55:25 +00:00
Corentin Wallez 28c1fba1c0 Validate CommmandBuffers aren't ended mid pass.
Also adds regression tests.

BUG=chromium:914566
BUG=chromium:914641

Change-Id: Ic1f9f2440580c3598831c8b2d1310e81aa944133
Reviewed-on: https://dawn-review.googlesource.com/c/3321
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-15 10:34:42 +00:00
Corentin Wallez e018292bed WireAndFrontendFuzzer "wait" for all commands before freeing
Otherwise the Device might fire callbacks when it is destroyed,
causing use-after-frees on the wire server.

BUG=chromium:914620
BUG=chromium:914615

Change-Id: Ic47b219b4ebe2eb5abd525741c0ff1180282c87d
Reviewed-on: https://dawn-review.googlesource.com/c/3322
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-15 10:34:02 +00:00
Yunchao He 48485e36a8 Add StencilStateFaceDescriptor, in order to match web idl
BUG=dawn:31

Change-Id: I52f95ed134ae5afdf4fc872d5cfc5f36ec1a7a69
Reviewed-on: https://dawn-review.googlesource.com/c/3302
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2018-12-15 02:32:34 +00:00
Frank Henigman 8d7de591f4 Tell shaderc where to find SPIRV-Cross.
Set a variable in build_overrides that gives the location of shaderc's
new SPIRV-Cross dependency.  The variable will take a different value
for a chrome build.

BUG=chromium:915096

Change-Id: I92d29cee0bac4a968bffba5c2fd9bb02c040de52
Reviewed-on: https://dawn-review.googlesource.com/c/3301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
2018-12-14 20:33:50 +00:00
Austin Eng 08aa58f8d6 Check if fence is nullptr in PostHandleQueueSignal
PostHandleQueueSignal assumed that fence was not null because QueueSignal
generates an error if it is. The errors are not surfaced immediately so
this additional check is needed before doing the post-handler.

Bug: chromium:914808
Change-Id: I2a99f5229712d49d3c9a2d1f3f2dd1009247a24c
Reviewed-on: https://dawn-review.googlesource.com/c/3280
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-14 08:29:38 +00:00
Corentin Wallez fd3717fa7c Fix the build with only the OpenGL and Null backends enabled
BUG=chromium:914375

Change-Id: I07dbdbdb7518ac6b9800483f570fe97c16f08ee1
Reviewed-on: https://dawn-review.googlesource.com/c/3243
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-14 08:28:55 +00:00
Jiawei Shao ff9562f792 Implement 'baseVertex' in drawIndexed() on D3D12, Metal and Vulkan
This patch adds the support of the parameter 'baseVertex' of drawIndexed
on D3D12, Metal and Vulkan back-ends.

BUG=dawn:51
TEST=dawn_end2end_tests

Change-Id: Ibd25884ad2abceaaed744d74c4ee6b0ae6b3fa1b
Reviewed-on: https://dawn-review.googlesource.com/c/3221
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-12-13 01:05:26 +00:00
Corentin Wallez 8d08d23a66 README.md: Add a link to the mailing list.
BUG=

Change-Id: Ieab1e83ce5126881421f0f7a456476db3fde2a0a
Reviewed-on: https://dawn-review.googlesource.com/c/3242
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-12 16:14:53 +00:00
Corentin Wallez b59d04f79e Run linux-dawn-rel on the CQ
TBR=kainino@chromium.org
TBR=senorblanco@chromium.org
BUG=chromium:901830

Change-Id: I27e3046875a990756f1128a74e901dd41a34d2e5
Reviewed-on: https://dawn-review.googlesource.com/c/3241
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-12 11:55:46 +00:00
Li Hao 90d9787257 Roll Chromium build to fix undeclared argument in mac toolchain
We build mac target with a warning that v8_current_cpu is set as a
build argument but not declared, actually v8 is not imported here.
Fixed this in chromium build system and pick up the fix in Dawn.
See https://chromium-review.googlesource.com/c/chromium/src/+/1369645

Change-Id: I266650907dc2d290c92d425a9b9609bf14c1d36b
Reviewed-on: https://dawn-review.googlesource.com/c/3220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-12 09:39:00 +00:00
Brandon Jones 069664e58b Remove textureAspect from TextureCopyView
Delete all references to textureAspect inside of TextureCopyView to
reflect WebGPU IDL change.

Bug: dawn:17
Change-Id: Ib849f07bed6aff93e2759739e5c7a92367658df4
Reviewed-on: https://dawn-review.googlesource.com/c/3200
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-12-12 09:27:46 +00:00
Jiawei Shao 8bff3b22be Make TextureDescriptor match WebGPU IDL
This patch updates the definition of TextureDescriptor to make it match
WebGPU IDL:
1. Rename 'arrayLayer' to 'arraySize'
2. Add the missing member "sampleCount" and check that currently
   sampleCount can only be 1.

BUG=dawn:56
TEST=dawn_unittests

Change-Id: I642186529f045865ae344cb5545ac80e14445c59
Reviewed-on: https://dawn-review.googlesource.com/c/3180
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-12 09:27:16 +00:00
Brandon Jones d86edb310a Implement BufferCopyView.imageHeight Parameter
Implement BufferCopyView.imageHeight Parameter. Adds validation tests.
Adequate functional testing not possible without 3D texture support.

Bug: dawn:48
Change-Id: I00e4464eb451c948dee2890a11fb0984eff681a0
Reviewed-on: https://dawn-review.googlesource.com/c/2980
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-12-11 09:48:36 +00:00
Yan, Shaobo a49242766a Render Pipeline Descriptorization -- Part I
This patch remove render pipeline builder and use descriptor to create render pipeline.
Sub-objects in descriptor will be removed in future.

Bug: dawn:4
Change-Id: I58dd569c7be42c2648311847b939c681189c2854
Reviewed-on: https://dawn-review.googlesource.com/c/2180
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2018-12-10 19:47:22 +00:00
Corentin Wallez 07df605a2b BUILD.gn: Add temporary proxy groups for test targets
This will allow use to update gn_isolate_map_pyl to point to the groups
instead of the targets, while we move the actual targets in a different
file.

BUG=chromium:913171

Change-Id: Ic681fb12d9cbc99557b742784f5b1bf779b76ed1
Reviewed-on: https://dawn-review.googlesource.com/c/3100
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-10 16:45:24 +00:00
Corentin Wallez c3ecb5a77c Temporarily add nullptr checks in frontend
The fuzzer is able to trigger nullptr reads by failing to create objects
and then using the resulting nullptr in other operations. The proper fix
is to implement WebGPU error handling where creation failure returns a
valid but "error" object.

However implementing this error handling is a lot of work, so in the
meantime we use nullptr checks in relevant places to fix the fuzzer
issue. These checks will be removed once the error handling is changed.

BUG=dawn:8

Change-Id: I6777a7fa40383b3d2235e071c3f0109de7605a22
Reviewed-on: https://dawn-review.googlesource.com/c/2565
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-10 10:03:08 +00:00
Jiawei Shao c789b84d8d Rename draw commands to match WebGPU IDL
BUG=dawn:51

Change-Id: I2a78f4e77c54aeae48d3fb78bf4701352ff40529
Reviewed-on: https://dawn-review.googlesource.com/c/3040
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2018-12-10 05:20:19 +00:00
Corentin Wallez 48a1923afb Revert "Create new src/tests BUILD.gn file."
This reverts commit 672d29d14c.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=913171

Original change's description:
> Create new src/tests BUILD.gn file.
> 
> Move all test-related build stuff into its own BUILD.gn file. This
> required moving the dawn_generator template into a common file, so it
> can be called by both BUILD.gn and src/tests/BUILD.gn.
> 
> [This is a reland of https://dawn-review.googlesource.com/c/dawn/+/2940
> with a fix for mock_dawn.]
> 
> Bug: dawn:61
> Change-Id: Id1e6d0c2b07caa2610cebe206511e972ac18fe8d
> Reviewed-on: https://dawn-review.googlesource.com/c/3020
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Stephen White <senorblanco@chromium.org>

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

Change-Id: I54cdc558b128935dc8a8d22ec2b5e879271c35ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:61
Reviewed-on: https://dawn-review.googlesource.com/c/3080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-08 10:35:53 +00:00
Stephen White 672d29d14c Create new src/tests BUILD.gn file.
Move all test-related build stuff into its own BUILD.gn file. This
required moving the dawn_generator template into a common file, so it
can be called by both BUILD.gn and src/tests/BUILD.gn.

[This is a reland of https://dawn-review.googlesource.com/c/dawn/+/2940
with a fix for mock_dawn.]

Bug: dawn:61
Change-Id: Id1e6d0c2b07caa2610cebe206511e972ac18fe8d
Reviewed-on: https://dawn-review.googlesource.com/c/3020
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-12-07 21:54:48 +00:00
Corentin Wallez 67737f1d4a WireServer: Don't allow freeing the Device
BUG=chromium:907278
BUG=chromium:911155

Change-Id: I6ec721b34b214bb242ac0d217e6ab12832c7323a
Reviewed-on: https://dawn-review.googlesource.com/c/2842
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-07 16:25:36 +00:00
Corentin Wallez 1d2850a129 WireServer: on destruction, free all objects.
The fuzzer is correctly detecting leaks when an object is created but
not freed through the wire. It isn't clear yet if we want leftover
objects to be freed by the wire of by the Device itself, but in the
meantime we make the wire free them to fix the fuzzer issues.

BUG=dawn:59

Change-Id: Id7bff93e60a52e1f833f31b1eb3bfd30f8fe4215
Reviewed-on: https://dawn-review.googlesource.com/c/2566
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2018-12-07 16:13:36 +00:00
Corentin Wallez 6f0e1f9d82 Remove BufferView and inline offset/size in BindGroup
BUG=dawn:2

Change-Id: I811024c4ac3a6167dd0caff05eca3fbb2640e862
Reviewed-on: https://dawn-review.googlesource.com/c/2941
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-07 12:31:53 +00:00
Stephen White 0f50114b3c Disable/avoid some warnings.
Implement DAWN_DECLARE_UNUSED macro to avoid -Wunneeded-internal-declaration
warning.

Change-Id: I4d087d2b09b74e35ba7ea69533df2c5adef4ef82
Reviewed-on: https://dawn-review.googlesource.com/c/2943
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-12-06 19:01:22 +00:00
Corentin Wallez 5aacd29d5e ProcTable: only cast the return value if needed.
Fence::GetCompletedValue introduced the first return value that's not an
object which reinterpret_cast to its own type. MSVC complains about it,
so instead we reinterpret_cast only if the value is an object.

BUG=

Change-Id: I35225cd1ff47a91868572a45a67ebe979e4b064f
Reviewed-on: https://dawn-review.googlesource.com/c/2942
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-06 10:43:33 +00:00
Kai Ninomiya bdd887fce7 Revert "Create new src/tests BUILD.gn file."
This reverts commit 0a7ddd43d7.

Reason for revert: Broke compile in https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/linux-rel/12314
See also: https://chromium-review.googlesource.com/c/chromium/src/+/1364694

Original change's description:
> Create new src/tests BUILD.gn file.
> 
> Move all test-related build stuff into its own BUILD.gn file. This
> required moving the dawn_generator template into a common file, so it
> can be called by both BUILD.gn and src/tests/BUILD.gn.
> 
> Bug: dawn:61
> 
> Change-Id: Icaa459270bdaa60306e053b93835812e70dba6f5
> Reviewed-on: https://dawn-review.googlesource.com/c/2940
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Stephen White <senorblanco@chromium.org>

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

Change-Id: If6d8c759f63c12b244471016f10e92c07299303f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:61
Reviewed-on: https://dawn-review.googlesource.com/c/3000
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2018-12-06 06:41:59 +00:00
Stephen White 0a7ddd43d7 Create new src/tests BUILD.gn file.
Move all test-related build stuff into its own BUILD.gn file. This
required moving the dawn_generator template into a common file, so it
can be called by both BUILD.gn and src/tests/BUILD.gn.

Bug: dawn:61

Change-Id: Icaa459270bdaa60306e053b93835812e70dba6f5
Reviewed-on: https://dawn-review.googlesource.com/c/2940
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2018-12-05 22:42:23 +00:00
Corentin Wallez e2f948469c generator: Unify handling of argument and member parsing
This completes the handling of "length" for structure members which were
missing const* structures defaulting to being of length one.

Also renames "record" to json_data to more precisely describe what it
is.

BUG=dawn:4

Change-Id: Ia53e4fcec15ebc9f9dae58ddba5b460d1f2eeebd
Reviewed-on: https://dawn-review.googlesource.com/c/2881
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-05 17:49:04 +00:00
Corentin Wallez 7b3ea34b6b WireCmd: Update buffer pointer when serializing sub elements
Without this the serialize step failed to increment the pointer to
the buffer to account for the recording of "main" in the render
pipeline descriptor:

  descriptor->vertexStage->entryPoint = "main";

BUG=dawn:4

Change-Id: Ic3829787af2213577ac67ee93625679afdae1cc9
Reviewed-on: https://dawn-review.googlesource.com/c/2880
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-05 10:13:52 +00:00
Corentin Wallez 6f9d21e805 Descriptorize BindGroups.
This commit adds utils::MakeBindGroup to make code craeting bind groups
nicer to read. Additional tests are added that give 100% coverage of
ValidateBindGroupDescriptor.

BUG=dawn:3

Change-Id: I56e1da8c2952306ad233845b0ec3ec32aef793d9
Reviewed-on: https://dawn-review.googlesource.com/c/2802
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-05 07:18:30 +00:00
Stephen White 006f218392 Use std::nullptr_t in place of nullptr_t.
(It's not clear to me why only some projects/compilers are complaining
but other parts of the code are using the explicit namespace.)

Change-Id: I24b0c3b8104932b4ec82a25f5eb96c08abff87b5
Reviewed-on: https://dawn-review.googlesource.com/c/2901
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-12-05 04:10:52 +00:00
Jiawei Shao 33af94fd8d Implement using a layer of a texture as color attachment - Part I
This patch implements using a layer of a texture as a color
attachment on D3D12, Metal and Vulkan.

This feature is not implemented on OpenGL back-ends in this patch.

BUG=dawn:16
TEST=dawn_unittests

Change-Id: Iffc194c6117f6e3e6506c6fcbfd51ca2fbe9ede8
Reviewed-on: https://dawn-review.googlesource.com/c/2660
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-12-05 03:22:04 +00:00
Austin Eng 66b024e499 Vulkan: Explicitly wait for all fences to complete on Device destruction
This ensures that all fences are complete. Flaky failures on Windows
showed some fence statuses were NOT_READY despite having been checked
after calling vkQueueWaitIdle.

Bug: dawn:60
Change-Id: Id4fa18c8842daf75faa9df6fcba8afdca43623c9
Reviewed-on: https://dawn-review.googlesource.com/c/2920
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2018-12-04 23:55:01 +00:00
Stephen White 9fca812285 Minor clang-format on third_party/BUILD.gn.
Just reorders some files.

Change-Id: I58845fe72fb8381fff32b0d81bb0561d6656c7be
Reviewed-on: https://dawn-review.googlesource.com/c/2900
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-12-04 19:44:52 +00:00
Corentin Wallez f48e6b74b7 dawncpp.h: Add nullptr ObjectBase constructor and assignment
BUG=dawn:3

Change-Id: I9f7ec0ae1c7885809888a603ed056c6565751bec
Reviewed-on: https://dawn-review.googlesource.com/c/2840
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-12-04 12:13:03 +00:00