This moves ownership of ObjectAllocators and CommandSerializers
from the Device to the Client. There may be also be multiple
Devices, so New() now takes the Device the object belongs to.
Device allocation specializes New() to take the owning Client so
that we can get a pointer to the Client from any Dawn API object.
Bug: dawn:88
Change-Id: Ie4274d46313884c44a857159e95d236dc1141c0c
Reviewed-on: https://dawn-review.googlesource.com/c/4001
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch copies methods and classes from WireServer.cpp and
distributes them over multiple files. Headers and forward declarations
are added as necessary, but no functional changes are made.
Bug: dawn:88
Change-Id: I471b8c27804916257eff266a51d087ba1ddbfeb6
Reviewed-on: https://dawn-review.googlesource.com/c/4000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Manages a single persistently mapped GPU heap which is sub-allocated
inside of ring-buffer for uploads. To handle larger buffers without additional
unused heaps, ring buffers are created on-demand.
BUG=dawn:28
TEST=dawn_unittests
Change-Id: Ifc5a1b06baf8633f1e133245ac1ee76275431cc5
Reviewed-on: https://dawn-review.googlesource.com/c/3160
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Roll SPIRV-Headers and SPIRV-Tools so we can roll shaderc so we can use
libshaderc_spvc in the SPIRV-Cross fuzzers.
BUG=dawn:95
Change-Id: I02f8dd4788e3094b1b59a99a27fdeba94d3aa47f
Reviewed-on: https://dawn-review.googlesource.com/c/4220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
This changes the dawn_static_and_shared_library template to be a
dawn_component template that mimics the behavior of Chromium's
components.
This helps avoid issues where on non-component builds on Windows the CRT
would get linked statically in both the Dawn shared libraries and the
test executables, causing alloc/deallocs across library boundaries to
crash.
BUG=dawn:29
Change-Id: I69287a523cc0bf5f2e921982ea9c26dcfed82f11
Reviewed-on: https://dawn-review.googlesource.com/c/4040
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
909f0d3d31..ce7d92182b
$ git log 909f0d3d3..ce7d92182 --date=short --no-merges --format='%ad %ae %s'
2019-01-22 fjhenigman Use the full spirv-cross dependency. (#550)
2019-01-22 corentin BUILD.gn: fix build error on is_component_build=true (#549)
2019-01-21 corentin BUILD.gn: Make libraries Chromium-style "components" (#548)
2019-01-17 fjhenigman Disable spvc build by default. (#542) (#547)
2019-01-16 fjhenigman Fix build with exceptions off. (#546)
2019-01-16 dneto Fix MinGW: Format %lu must be unsigned long. (#544)
2019-01-16 dneto Fix leaks in tests (#545)
2019-01-15 fjhenigman Fix ASAN build. (#543)
2019-01-15 fjhenigman Add libshaderc_spvc interface to SPIRV-Cross. (#524)
2019-01-15 fjhenigman Fix NDK build. (#540)
2019-01-11 dneto Android.mk: better fallback for SPIRV-Tools dir (#538)
2019-01-09 dj2 Roll RE2 Dep (#537)
2019-01-07 dj2 Fixup source matching test (#534)
2019-01-03 fjhenigman Fix Windows test script return value. (#533)
2019-01-02 dj2 Switch GLSLang to upstream (#515)
2018-12-28 alex Generate source text debug info if requested (#455) (#532)
2018-12-27 ehsann [kokoro] Stop running tests on VS 2013 builds. (#531)
2018-12-21 fjhenigman Update Android NDK. (#530)
2018-12-17 dneto Test shader uniforms need descriptor set and binding (#523)
2018-12-17 kknb1056 Add git clone of re2 and effcee to the Dockerfile (#527)
2018-11-28 dj2 Update to use Android.mk from glslang (#520)
2018-11-22 dneto Add unit tests for mesh and task shaders
2018-11-21 arseny.kapoulkine Add support for NV_EXTENSIONS in #pragma shader_stage()
2018-11-19 dj2 Build file updates. (#514)
2018-11-15 dj2 Fixup shadowed variables (#513)
2018-10-11 dneto Unpin googletest. It has been fixed upstream
2018-11-13 dj2 Add effcee and re2 when building spirv-tools tests (#510)
2018-10-24 dj2 Only include third_party directories if needed. (#507)
Created with:
roll-dep third_party/shaderc
TBR=kainino@chromium.org
BUG=dawn:29
Change-Id: I30df4fe9423465d5db135874f6dec2687391e505
Reviewed-on: https://dawn-review.googlesource.com/c/4160
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch fixes a crash issue on D3D12 backends that are caused by
a bug in computing bind group index in function GroupsInheritUpTo().
The return value of this function should be kMaxBindGroups instead of
(kMaxBindGroups + 1) as the maximum number of bind group sets is
kMaxBindGroups.
This patch also adds a regression test on this bug.
BUG=dawn:78
TEST=dawn_end2end_tests
Change-Id: Ie060a52f987803ed6a325b337ff678e6b73e2897
Reviewed-on: https://dawn-review.googlesource.com/c/4080
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Vulkan backend wasn't making a call to Tick(), meaning that
vkDestroy* operations were being enqueued, but never executed.
Change-Id: I597f59d6a17ea4247a1a042a2b5a7997d2e95612
Bug: dawn:94
Reviewed-on: https://dawn-review.googlesource.com/c/4020
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
There are a lot of annoying warnings about uninteresting mock
function calls when running dawn_unittests because object release
function calls are not included into the gtest EXPECT_CALL.
BUG=dawn:93
Change-Id: I49f772bc1b9da9eaa86a51ca3a754886e8f0bcdc
Reviewed-on: https://dawn-review.googlesource.com/c/3960
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch copies methods and classes from WireClient.cpp and
distributes them over multiple files. Headers and forward declarations
are added as necessary, but no logical changes are made.
Bug: dawn:88
Change-Id: I9d0fcaeb67e789c3ad0597eaa3839adefc3ac5f9
Reviewed-on: https://dawn-review.googlesource.com/c/3980
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Unify code generation for Client->Server and Server->Client commands.
Methods in dawn.json are converted into command records and additional
commands are specified in dawn_wire.json. This can then be used to
completely generate the command handlers and command struct definitions.
Bug: dawn:88
Change-Id: Ic796796ede0aafe02e14f1f96790324dad92f4c0
Reviewed-on: https://dawn-review.googlesource.com/c/3800
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This fixes a bug where D3D12 SetVertexBuffers was using the input info
from the last set pipeline's InputState. IASetVertexBuffers needs to be
reapplied if the input state changes.
Bug: dawn:91
Change-Id: I7d0b308ea20cee6d595f6b29548f57d82c8e47a4
Reviewed-on: https://dawn-review.googlesource.com/c/3860
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is useful for people using Dawn's standalone build to compile
static libraries to use in other projects. Without this static libraries
will act as source sets as is GN's default.
BUG=dawn:85
Change-Id: I4d99cbbbe67c73f226717651cb12ed0a172409b2
Reviewed-on: https://dawn-review.googlesource.com/c/3840
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This will help migrate PCI info collection from the device to the
adapter where it belongs.
BUG=dawn:29
Change-Id: Ifa7d167249c97f1934f7c10d420f864f59babd37
Reviewed-on: https://dawn-review.googlesource.com/c/3843
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Chromium will want to have both static and shared library versions of
Dawn to use in non-component and component builds respectively.
The *_export.h files are modified to noop when *_SHARED_LIBRARY is not
defined so that the static library doesn't export symbols that aren't
imported in dependents (this would break compilation on Windows).
A dawn_library_combo is introduced in BUILD.gn that factors out all the
logic needed to produce shared libraries and handle the _EXPORT macros.
Also contains a fix to dawncpp to export only the methods that aren't
defined in the header (otherwise they get defined multiple times)
BUG=dawn:85
Change-Id: Ib747deb9308e1165dd66002487147ba279d3eac0
Reviewed-on: https://dawn-review.googlesource.com/c/3761
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This adds a new FooBackend.cpp file for each backend that defines
exactly the symbols that are exported by libdawn_native's headers. THis
will allow factoring most of the compilation of dawn_native between the
shared and static library variants.
BUG=dawn:85
Change-Id: I69c808dac2fe5e8bb08356117e3997677787b08a
Reviewed-on: https://dawn-review.googlesource.com/c/3760
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This removes unnecessary builder and buffer info from server objects that
do not need them.
Bug: dawn:86
Change-Id: I97b11615da763725281495f05c70a4ee7a9c9e5a
Reviewed-on: https://dawn-review.googlesource.com/c/3780
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The backend had a "requiredInstanceExtensions" parameter to device
creation so that we could request the right instance extensions to
support swapchains. When we have dawn_native::Instance we don't want to
require this information before we can use the Vulkan backend. Instead
we make the backend always require all VkSurfaceKHR extensions. This
should be safe because these extensions basically enable copying a
struct into an opaque VkSurfaceKHR object and not much else.
BUG=dawn:29
Change-Id: I7fc5426f5770b65bb35f02793a1319eb0653782c
Reviewed-on: https://dawn-review.googlesource.com/c/3662
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
With adapters the Metal backend will be in charge of creating the
MTLDevice so we remove this responsibility from the bindings.
BUG=dawn:29
Change-Id: Id7b9e5f6249963e2b87a91242a18119ba8d11c13
Reviewed-on: https://dawn-review.googlesource.com/c/3661
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The OpenGL backend can't gather discover default adapters because it
needs getProc to do anything so we add DiscoverAdapters method to
Instance that takes backend-specific options.
dawn_native::opengl::CreateDevice is removed in favor of the adapter
path so OpenGLBinding is modified to create an instance locally. This is
only temporary until all backends support adapters, at which point a lot
of *Binding code will be factored.
Also contains a small fix for Result<T, E> with movable types.
BUG=dawn:29
Change-Id: I4eb3d4a14a871af73e1872132aff72b45e5fe566
Reviewed-on: https://dawn-review.googlesource.com/c/3663
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
New objects are introduced to control what happens before device
creation in dawn_native:
- Instance: a connection from the application to dawn_native that is
used for dependency injection and to discover adapters.
- Adapters: represents the possibility of device creation for a specific
(GPU, backend) pair.
- BackendConnection: an internal object that standardizes the interface
between the frontend and backends.
The BackendConnection interface is implemented for the Null backend and
stubbed out in other backends. This allows this change to port the
ValidationTests to use the new Instance and Adapters concept and deal
with other backends later.
BUG=dawn:29
Change-Id: I19719a9342b4af091accc0c02fb6b9697eadde7b
Reviewed-on: https://dawn-review.googlesource.com/c/3500
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This adds a CheckVkSuccess utility function that adds the VkResult value
to the context lost error message.
Also adds a small fix to dawn_native/Error.h interoperability between
MaybeError and ResultOrError<NonPointer> with tests.
BUG=chromium:917555
BUG=dawn:79
Change-Id: Icc01122d62d83693fc0ea3f26b272f2372fd3087
Reviewed-on: https://dawn-review.googlesource.com/c/3623
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The client might have asked for the buffer to be destroyed, but the
reference to the buffer is still alive because it is internally
referenced by Dawn.
BUG=chromium:918254
Change-Id: Id7d2de891eba98e3cf15e77730f66f64d9a3b9f9
Reviewed-on: https://dawn-review.googlesource.com/c/3622
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Both sampler and depth stencil include compare function, and we
need to change it to appropriate functions for different backends.
In order to avoid code duplication, we put it into a util file
for every backend, then include that file and call the function
from where we need it.
We can put similar functions which can be shared among different
objects into the util file in future.
Shaobo's patch has already created such a util function for compare
function for sampler. This patch removes the duplicated compare
function in RenderPipeline for depth stencil descriptor, and call
the function in util file instead.
BUG=dawn:31, dawn:47
Change-Id: Ia645b48e026b5a372d1023aa7e8ecdf1e4ed7c6d
Reviewed-on: https://dawn-review.googlesource.com/c/3641
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
WebGPUSampler is much more complete than Dawn's Sampler.
This patch implement the missing part.
BUG=dawn:47
Change-Id: Ief45cb9710493e9d79ddab60fe3be5a123b76ebd
Reviewed-on: https://dawn-review.googlesource.com/c/3540
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This change also removes DepthStencilState object.
Bug=dawn:31
Change-Id: I7bb54ef4da527184bb2726c77d93d411d44c3956
Reviewed-on: https://dawn-review.googlesource.com/c/3541
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>