Commit Graph

1292 Commits

Author SHA1 Message Date
Corentin Wallez abdb566c30 Remove OpenGLBinding's dependency on glad
This move all the OpenGL-specific code for swapchain handling in a new
NativeSwapChainImpl in the OpenGL backend so no code outside of
dawn_native needs OpenGL.

BUG=dawn:165

Change-Id: I3c0c1055e3215a59fdc8e9550baf30762a7014b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8161
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-06-17 09:01:09 +00:00
Austin Eng 21eba761b5 Implement CreateBufferMappedAsync in dawn_wire and dawn_native
Bug: dawn:7
Change-Id: I1a4e5eece53d83a4c5395ba6b41df2e20668c5bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8120
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-14 17:35:56 +00:00
Brandon Jones d1b4b5cba5 Allow D3D12 Implicit State Transitions
When transitioning from the COMMON state, an explicit ResourceBarrier
call is unnecessary and can be handled implicitly by the driver. This
acts as an optimization because no synchronization waits are required
when transitioning from the COMMON state.

Bug: dawn:167
Change-Id: Ifd45236dc51c339de8b9945e6f4e2a00934f3676
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7920
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-14 15:14:12 +00:00
Corentin Wallez e0a2ae8a0b Fix casing of includes in D3D12Info
BUG=dawn:144

Change-Id: I95fd1839247ccdf2d4e3b75e6ad84fad02c71ede
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8162
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Nico Weber <thakis@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-06-14 12:44:22 +00:00
Corentin Wallez 55ab6aacac Fix compilation of the GL backend on Windows
The generated OpenGLFunctionsBase code uses the MemoryBarrier identifier
which is a macro defined in windows.h. Undefined it in
windows_with_undefs.

BUG=dawn:165

Change-Id: I6fcfef8fa14074e946d6c13536c1ae33b38c2ac2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8160
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-06-14 08:50:42 +00:00
Corentin Wallez df69f24824 OpenGL: Don't use glad to load OpenGL entrypoints
This makes the OpenGL entry points loaded at Adapter creation from the
getProcAddress passed in the DiscoveryOptions and update all GL calls in
the backend to go through the new OpenGLFunctions object.

A code generator is added that generates the function loader and list of
GL procs from Khronos' gl.xml file but we can't get rid of glad yet
because it is used to have the PROC typedefs and enum values.

BUG=dawn:165

Change-Id: I2a583d79752f55877fa4190846f5be16cf91651a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7983
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-06-13 10:22:32 +00:00
Jiawei Shao 87ab2f96d9 Vulkan: always specify TRANSFER_DST_BIT usage when creating images
This patch adds VK_IMAGE_USAGE_TRANSFER_DST_BIT usage when creating
Vulkan images because when we do resource initialization with
vkCmdClearColorImage() and vkCmdClearDepthStencilImage(), the image must
have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
according to Vulkan SPEC.

BUG=dawn:171
TEST=dawn_end2end_tests

Change-Id: Iaba6c04c6942354cc6be502eeee04457d3f43ba7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-06-13 00:07:42 +00:00
Corentin Wallez 3dc8bf4c6f Update glad for Desktop GL 4.6 and GLES 3.2
This is necessary because we currently use GLAD to generate all the
OpenGL enums and proc typedef that we use.

BUG=dawn:165

Change-Id: Ie1b88fd676421703e9af63dafe6dee168c600d4d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7982
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-06-12 21:59:42 +00:00
Bryan Bernhart 970101a102 Improve D3D12 adapter initialization.
Gather device info at device initialization rather than adapter initialization.

BUG=dawn:144

Change-Id: I07e114731a37f3738daa585afa99675f2fd36289
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7700
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-12 18:54:57 +00:00
Idan Raiter 0e646e95e0 Add Vulkan / D3D12 indirect buffer flags
Adds missing flags for the indirect usage in vulkan and d3d12.

Bug: dawn:169
Change-Id: I786ea56faaefcbd10100dae40c7893bbc6d5d0ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8061
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Idan Raiter <idanr@google.com>
2019-06-12 16:35:09 +00:00
Jiawei Shao 17738b6d8c Fix wrong computation of texture copy buffer size
This patch fixes a bug in the computation of texture copy buffer size.
As the 'width' and 'height' in copy commands are all in pixels, while
the buffer size is counted in bytes, we shoud first convert 'width' into
bytes before calculating the buffer size.

BUG=dawn:42
TEST=dawn_unittests

Change-Id: Iebd5ed07a54eea762f4a653e295ecacb845ba32f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7940
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-12 08:53:45 +00:00
Ryan Harrison 3e51fada29 Remove Full SPIRV-Cross fuzzers
BUG=chromium:972753

Change-Id: Ic61d5d0ed44b0693f4df09b1f9c34bd928609c3a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8080
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-12 08:49:15 +00:00
Idan Raiter 8f813ac8a2 Fix indirect draw test for MSVC
We need a negative number in a buffer of uint32_t, to test negative
baseVertex. MSVC requires an explicit cast here.

Bug: dawn:172
Change-Id: Iea6c609f11054ba02e5c041fff89def0557c8091
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8060
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-11 19:05:45 +00:00
Natasha Lee 28232ce9f5 Clear Vulkan Textures at first usage
This prevents dirty textures to be used when memory is recycled
while destroying/creating textures. If a texture is not cleared at load,
it will be cleared to 0 before it is used.

Bug: dawn:145
Change-Id: Ia3f02427478fb48649089829186ccb377caa1912
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6960
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-11 18:11:05 +00:00
Corentin Wallez 031fbbbaa1 Generators: main.py is now dawn_json_generator.py
This merges all the files for main.py together again except
generator_lib.py because there doesn't seeem to be a good way to
separate the pure dawn.json generators and the dawn wire generator.

Also updates the GN templates to make it easier to define new generators
based on generator_lib, and move the Jinja2 template "stdlib" to
generator_lib.py

BUG=dawn:165

Change-Id: I1b5b2ef0a59cb142e214f3af9a58048a88ae949a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7880
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-11 18:03:05 +00:00
Austin Eng 88860d1ced Add 32 bit Linux/Windows builders to the Dawn CQ
We need a 32-bit Dawn CQ builders to catch build breakages on those
platforms.

Bug: dawn:168
Change-Id: Iafc1af9002992fbf16c9ca996fd578dc21aa516d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8040
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-06-11 16:51:24 +00:00
Yunchao He 29f3de54a5 Update VertexInput (InputState) to match the spec - Part 4
This patch added support for null vertex buffer(s).

BUG=dawn:80, dawn:107

Change-Id: I3fb9427fcd4323c6df441be7011223088b40ec53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-06-11 16:45:04 +00:00
Ryan Harrison 903fc2b049 Explictly set the environment for the Fast fuzzers
BUG=chromium:970300

Change-Id: Ib57a2dcd92a378412588901df9cadc271cad18d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8001
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-06-11 14:38:51 +00:00
Idan Raiter 05f7ad5ac8 Reland "dawn_native: Indirect draw/dispatch"
This is a reland of 7eb6be186b
Fixes casting issue on 32 bit machines

Original change's description:
> dawn_native: Indirect draw/dispatch
>
> Adds indirect draw and dispatch for all backends (without validation).
>
> Tests for opengl negative offset are skipped since there is no easy
> way to add the index buffer offset. Current idea is to use a compute
> shader to modify the indirect draw buffer.
>
> Change-Id: I1d3eec7c699b211423f4b911769cca17bfbcd045
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7481
> Commit-Queue: Idan Raiter <idanr@google.com>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>

Change-Id: Id28c5658ee18ec5c030f721fb44d9f11ebe21ff9
Bug:dawn:54,chromium:972358
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7961
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Idan Raiter <idanr@google.com>
2019-06-10 20:56:27 +00:00
Austin Eng 9d4d3eac14 Always back Buffers with data in the Null backend.
Now that CreateBufferMapped is implemented. Buffers of any usage may
be initialized with staging data. All buffers need to have backing data
otherwise copying from staging data to the buffer will dereference nullptr.

Bug: chromium:971542
Change-Id: I623cc236ffab918ec048cd1949520a4cb329c1b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7980
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-06-10 20:53:57 +00:00
Ryan Harrison fa8190ae44 Manually roll shaderc related dependencies
Getting the autorollers fully working is going to take a while, so
rolling ahead the DEPS by hand, so the new shaderc API can be used and
some tasks unblocked.

BUG=chromium:970300

Change-Id: I2137deb27e867cd8439ef0143b36cf91d89d8b1b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8000
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-06-10 19:01:17 +00:00
Austin Eng 39b8ddfbd9 Revert "dawn_native: Indirect draw/dispatch"
This reverts commit 7eb6be186b.

Reason for revert: This change is breaking Clusterfuzz bots. crbug.com/972358

Bug: chromium:972358

Original change's description:
> dawn_native: Indirect draw/dispatch
>
> Adds indirect draw and dispatch for all backends (without validation).
>
> Tests for opengl negative offset are skipped since there is no easy
> way to add the index buffer offset. Current idea is to use a compute
> shader to modify the indirect draw buffer.
>
> Change-Id: I1d3eec7c699b211423f4b911769cca17bfbcd045
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7481
> Commit-Queue: Idan Raiter <idanr@google.com>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,idanr@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I9b7b63de0900e20c4da8561ceb9b2dece77c3885
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7960
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-06-10 17:15:27 +00:00
Idan Raiter 7eb6be186b dawn_native: Indirect draw/dispatch
Adds indirect draw and dispatch for all backends (without validation).

Tests for opengl negative offset are skipped since there is no easy
way to add the index buffer offset. Current idea is to use a compute
shader to modify the indirect draw buffer.

Change-Id: I1d3eec7c699b211423f4b911769cca17bfbcd045
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7481
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-07 17:32:37 +00:00
Brandon Jones de1ac9fd7b D3D12: Batch Usage Transitions For Render Pass
Instead of looping through usages and calling ResourceBarrier for
each transition, we should load all transitions into a single call.
This allows the driver to make better optimization decisions.

Bug: dawn:163
Change-Id: I4859aa2c71b60a40249df00ad67ab13eb0389cd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7680
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
2019-06-07 17:08:47 +00:00
Corentin Wallez 2b82eb2902 Fix incorrect ASSERT in vertex validation.
Also adds a test that would have fired the ASSERT.

BUG=dawn:80
BUG=dawn:107

Change-Id: I56cdbc91956465c8941b45bb5e9da4c27da301ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7840
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-07 11:05:37 +00:00
Corentin Wallez 0c38e92187 Split off the reusable part of the code generator
This is in preparation for using it to generate code for replacing glad
with our own OpenGL function pointer loading code.

BUG=dawn:165

Change-Id: Ic3e774ab207e85a1491f299ad06131c8095416ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7781
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-06-07 08:59:17 +00:00
Austin Eng 120f5d9062 Return nullptr from MakeErrorMapped if OOM allocating staging data
Bug: chromium:970305
Change-Id: If5ea037170260b8b8dddf3e3428ad2e77d4b67a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7800
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-07 03:53:07 +00:00
Austin Eng fa7228a1fa Cleanup CopyBufferToBufferCmd
This command internally used a BufferCopy struct which is meant for
Buffer->Texture / Texture->Buffer copies. It contained unnecessary rowPitch
and imageHeight. This patch changes the members of CopyBufferToBufferCmd to
match the CopyBufferToBuffer api call.

Bug: dawn:164
Change-Id: I4737eb4ceb655e8282964c438242627070e355dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-06-07 03:06:47 +00:00
Yunchao He 2d4b529443 Update VertexInput (InputState) to match the spec - Part 3
Rename num{Attribute|Buffer}s to {Attribute|Buffer}Count for VertexInput

BUG=dawn:80, dawn:107

Change-Id: I7ad62f28449e6283d5c5788dfbd5df1d1e9c813e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-06 17:54:30 +00:00
Corentin Wallez 67ab1ea8c7 dawn.json: Use void* instead of uint8_t* for data pointers
This requires some changes in the wire because WireCmd doesn't know the
size of void. This also adds a handwritten implementation of the Wire
commands for SetSubData that internally converts to uint8_t so that
WireCmd can generate the de/serialization.

BUG=dawn:160

Change-Id: Icbf0fd7dd841639ee6f67333844e027b27a8afcc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7780
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-06 16:19:15 +00:00
Yunchao He 97c0885a4a Update VertexInput (InputState) to match the spec - Part 2
This patch changed the front end code and tests and examples.

BUG=dawn:80, dawn:107

Change-Id: Ia6c60232c04a1bfb862263766eb28e9afc3bc8db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7620
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-06 01:56:57 +00:00
Austin Eng 9cd21f1bf9 Implement CreateBufferMapped for non-mappable buffers
This uses an intermediate staging buffer to copy data into the buffer.

Bug: dawn:7
Change-Id: I3bda19a8450ef0eddc5b4382ce1b9120f074b917
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7500
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-05 18:35:31 +00:00
Austin Eng 233ce73c50 Add Create/ReleaseStagingBuffer to DynamicUploader
StagingBuffers need to be created and explicitly released outside of
the RingBuffer for CreateBufferMapped since the staging buffer must live
until the Buffer is Unmapped or Destroyed. This patch adds methods to the
DynamicUploaded for creating and tracking the release of StagingBuffers.

This patch also fixes SerialQueue for non-copy-constructible types.

Bug: dawn:7
Change-Id: I582c4d9cf452f808a8a7ab4164ff833087619a18
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7720
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-05 16:16:37 +00:00
Corentin Wallez b632bc58ed Vulkan: Don't enable primitiveRestart on "list" topologies
This conforms to the Vulkan usage validation rules and is otherwise a
noop because primitive restart would do nothing for "list" topologies.

BUG=dawn:162

Change-Id: Icda96b15e2f931a0abd3fba794c2aff56dccb714
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7660
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2019-06-03 22:53:29 +00:00
Jiawei Shao c2750abd0c Add validations on the creation of textures in BC formats
This patch adds all the BC compressed texture formats and the checks on
the creation of textures in BC formats. If a texture is in BC format,
then:
1. The width and height of the texture must be multiple of 4.
2. The usage of the texture can only be Sampled or TransferSrc or
   TransferDst.
3. The sample count of the texture can only be 1.

BUG=dawn:42
TEST=dawn_unittests

Change-Id: I0844fb6a1aadbb96d94a61fd969db07c21b6adf5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7600
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-06-01 02:30:51 +00:00
Corentin Wallez 8dfc593eb7 Remove the concept of push constants
BUG=dawn:14

Change-Id: I20587081ec806034ce4f90457c3d475a6fbe834d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7180
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-29 13:16:06 +00:00
Corentin Wallez 839053b90c Replace dawn::CallbackUserdata with void*
This initial reasoning for having a u64 userdata was to be able to pack
two u32s in a single userdata but that was never used, and made a bunch
of code uglier than it should.

BUG=dawn:160

Change-Id: Ia0d20bc23f09f5d8f3748ca4edd1a331604f2ba8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7561
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-29 13:03:50 +00:00
Austin Eng 26d3cf08c2 Fix dawn_end2end_tests with the wire
https://dawn-review.googlesource.com/c/dawn/+/7484 landed at the same
time as the change that enabled dawn_end2end_wire_tests so this bug
was not caught. An extra declaration which shadows the original
declaration was created due to a rebase error.

Bug: dawn:56
Change-Id: I36a1b4478a072f58f6bb6660853c3b28f7ce0467
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7580
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-05-29 01:10:47 +00:00
Jiawei Shao 93373abb2f Support force enabling multiple toggles in Dawn end2end tests
This patch adds the support of enabling multiple toggles in Dawn end2end
tests so that we can run MultisampledRenderingTests with all MSAA
related toggles enabled.

BUG=dawn:56
TEST=dawn_end2end_tests

Change-Id: Ia1a16a25261a2eddbb0e54326eebf1188dab9c10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7484
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-05-29 00:07:37 +00:00
Corentin Wallez 8b5fc36191 Suppress failing shared memory test on GTX 1660 D3D12
BUG=dawn:159

Change-Id: I3aca2019641b0eec2a111e4a59a0d3a927f9c645
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7560
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-05-28 09:11:44 +00:00
Yan, Shaobo 3dd6153eb7 Dynamic Buffer Offset : Vulkan Backend
In a typical application, most draws will use different uniforms values for
things like the world position and orientation. In the current state of WebGPU
this means that a new bind group needs to be created for each draw to set the
right uniforms. Bind group creation is expected to be more expensive than
recording draws because they incur an allocation.

This feature is to reduce the number of bind groups that need to be
created.

The patch implements dynamic buffer offset on vulkan backend. But Vulkan
takes dynamic offset as uint32_t type, which is not the same size as the VkDeviceSize
used to create buffers so we cast them for now.

Bug=dawn:55

Change-Id: I6163866feb040d1a653f9a20d2ce22d80509968e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7461
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-27 04:35:03 +00:00
Kai Ninomiya 7777078fb9 Null backend: disallow more than 256M of Buffer allocations
Should prevent some uninteresting fuzzer failures.

Bug: dawn:37
Change-Id: I6b2bef01deb700239e02ef5afa9313023ec83899
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7483
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2019-05-24 23:29:41 +00:00
Natasha Lee 58ae08e132 Add nonzero_clear_resources_on_creation_for_testing toggle for d3d12
Forces texture to clear to non-zero on creation to test the logic of
lazy clearing.

Bug: dawn:145
Change-Id: Ia738bf03be29dc620caf5f6d04b57c29b6919e85
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7280
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-24 22:53:31 +00:00
Austin Eng 8aa036e9e4 Fix backend Device leak in dawn_end2end_tests harness with the wire
Bug: dawn:158
Change-Id: I248ba66864d03c3366fc077fd89824a1233a230e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7520
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-05-24 22:31:36 +00:00
Austin Eng f56efdf0d1 Skip IOSurfaceTests if UsesWire() is true
These tests cannot be run using the wire because the wire client
device is not a real Metal device.

Bug: dawn:158
Change-Id: I97dec7f10fa19d118a72a965f57ee6703cc57765
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-05-24 22:31:06 +00:00
Austin Eng c391fb7c69 Use single 64bit atomic refcount for Dawn objects
Bug: dawn:105
Change-Id: I7741d5f01579f269db272200d39088c07e2acd92
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-05-23 23:55:14 +00:00
Yan, Shaobo 34f2fe8a52 Dynamic Buffer Offset : Metal Backend
In a typical application, most draws will use different uniforms values for
things like the world position and orientation. In the current state of WebGPU
this means that a new bind group needs to be created for each draw to set the
right uniforms. Bind group creation is expected to be more expensive than
recording draws because they incur an allocation.

This feature is to reduce the number of bind groups that need to be
created.

The patch implemented dynamic buffer offset on metal backend.

Bug=dawn:55

Change-Id: I34f397ec9ec10fa5b8e8a1c029d2d6a19e8dc0ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2019-05-23 00:45:12 +00:00
Yunchao He eea2091068 Update VertexInput (InputState) to match spec - Part 1
This is only a renaming: change VertexInput to VertexBuffer, and
change InputState to VertexInput.

The next two patches will do as follows:
1) change the structure of vertex input descriptor related stuff.
2) change num to count.

BUG=dawn:80, dawn:107

Change-Id: Ie76aa653a527759a9c3b4a4792e3254689f053b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-05-22 22:46:32 +00:00
Brandon Jones 820a04b9ce Add Debug Marker Functionality for D3D12
Implemention of InsertDebugMarker, PushDebugGroup and PopDebugGroup
for D3D12 using PIX event runtime.

Bug: dawn:44
Change-Id: I488f4638777afad3420ba96b350d9f19f2cd80dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
2019-05-22 22:35:22 +00:00
Austin Eng 76e3de4b08 Implement CreateBufferMapped in dawn_wire
Bug: dawn:7
Change-Id: I7112c87c3b671cd7a7774af7f3a094a189f2b4b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7402
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-05-22 18:49:59 +00:00