0

Roll src/third_party/dawn/ e25a3aede..b9b088f57 (2 commits)

This is a manual roll because it contains renames for Dawn bitfields.

https://dawn.googlesource.com/dawn.git/+log/e25a3aede047..b9b088f57e3d

$ git log e25a3aede..b9b088f57 --date=short --no-merges --format='%ad %ae %s'
2019-08-27 cwallez Rename ShaderStageBit to ShaderStage.
2019-08-27 cwallez Remove Bit from TextureUsageBit and BufferUsageBit

Created with:
  roll-dep src/third_party/dawn

TBR=kbr@chromium.org
BUG=dawn:22

Change-Id: I8aeb049b9fb5db0cc56ae723e06819683a4d90fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1771810
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690693}
This commit is contained in:
Corentin Wallez
2019-08-27 12:25:17 +00:00
committed by Commit Bot
parent da5f734bf7
commit 9a3a93b5e2
17 changed files with 33 additions and 37 deletions

2
DEPS

@ -297,7 +297,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed
# and whatever else without interference from each other.
'dawn_revision': 'e25a3aede047111f023bfef2ccd8ff84814b5fe5',
'dawn_revision': 'b9b088f57e3d4567b9441251170cf1719125b2d1',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed
# and whatever else without interference from each other.

@ -48,7 +48,7 @@ ExternalVkImageDawnRepresentation::~ExternalVkImageDawnRepresentation() {
}
DawnTexture ExternalVkImageDawnRepresentation::BeginAccess(
DawnTextureUsageBit usage) {
DawnTextureUsage usage) {
std::vector<SemaphoreHandle> handles;
if (!backing_impl()->BeginAccess(false, &handles, false /* is_gl */)) {

@ -22,7 +22,7 @@ class ExternalVkImageDawnRepresentation : public SharedImageRepresentationDawn {
uint32_t memory_type_index);
~ExternalVkImageDawnRepresentation() override;
DawnTexture BeginAccess(DawnTextureUsageBit usage) override;
DawnTexture BeginAccess(DawnTextureUsage usage) override;
void EndAccess() override;
private:

@ -296,7 +296,7 @@ class SharedImageRepresentationDawnIOSurface
dawn_procs_.deviceRelease(device_);
}
DawnTexture BeginAccess(DawnTextureUsageBit usage) final {
DawnTexture BeginAccess(DawnTextureUsage usage) final {
DawnTextureDescriptor desc;
desc.nextInChain = nullptr;
desc.format = dawn_format_;

@ -290,9 +290,8 @@ TEST_F(SharedImageBackingFactoryIOSurfaceTest, Dawn_SkiaGL) {
// Clear the shared image to green using Dawn.
{
dawn::Texture texture =
dawn::Texture::Acquire(dawn_representation->BeginAccess(
DAWN_TEXTURE_USAGE_BIT_OUTPUT_ATTACHMENT));
dawn::Texture texture = dawn::Texture::Acquire(
dawn_representation->BeginAccess(DAWN_TEXTURE_USAGE_OUTPUT_ATTACHMENT));
dawn::RenderPassColorAttachmentDescriptor color_desc;
color_desc.attachment = texture.CreateDefaultView();

@ -303,7 +303,7 @@ class SharedImageRepresentationDawn : public SharedImageRepresentation {
// TODO(penghuang): Add ScopedAccess helper class.
// This can return null in case of a Dawn validation error, for example if
// usage is invalid.
virtual DawnTexture BeginAccess(DawnTextureUsageBit usage) = 0;
virtual DawnTexture BeginAccess(DawnTextureUsage usage) = 0;
virtual void EndAccess() = 0;
};

@ -574,7 +574,7 @@ error::Error WebGPUDecoderImpl::HandleAssociateMailboxImmediate(
uint32_t device_generation = static_cast<uint32_t>(c.device_generation);
uint32_t id = static_cast<uint32_t>(c.id);
uint32_t generation = static_cast<uint32_t>(c.generation);
uint32_t usage = static_cast<DawnTextureUsageBit>(c.usage);
uint32_t usage = static_cast<DawnTextureUsage>(c.usage);
// Unpack the mailbox
if (sizeof(Mailbox) > immediate_data_size) {
@ -599,14 +599,13 @@ error::Error WebGPUDecoderImpl::HandleAssociateMailboxImmediate(
}
static constexpr uint32_t kAllowedTextureUsages = static_cast<uint32_t>(
DAWN_TEXTURE_USAGE_BIT_COPY_SRC | DAWN_TEXTURE_USAGE_BIT_COPY_DST |
DAWN_TEXTURE_USAGE_BIT_SAMPLED |
DAWN_TEXTURE_USAGE_BIT_OUTPUT_ATTACHMENT);
DAWN_TEXTURE_USAGE_COPY_SRC | DAWN_TEXTURE_USAGE_COPY_DST |
DAWN_TEXTURE_USAGE_SAMPLED | DAWN_TEXTURE_USAGE_OUTPUT_ATTACHMENT);
if (usage & ~kAllowedTextureUsages) {
DLOG(ERROR) << "AssociateMailbox: Invalid usage";
return error::kInvalidArguments;
}
DawnTextureUsageBit dawn_usage = static_cast<DawnTextureUsageBit>(usage);
DawnTextureUsage dawn_usage = static_cast<DawnTextureUsage>(usage);
// Create a DawnTexture from the mailbox.
std::unique_ptr<SharedImageRepresentationDawn> shared_image =

@ -109,7 +109,7 @@ TEST_F(WebGPUDecoderTest, AssociateMailbox) {
{
gpu::Mailbox bad_mailbox;
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_BIT_SAMPLED, bad_mailbox.name);
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_SAMPLED, bad_mailbox.name);
EXPECT_EQ(error::kInvalidArguments,
ExecuteImmediateCmd(cmd.cmd, sizeof(bad_mailbox.name)));
}
@ -117,7 +117,7 @@ TEST_F(WebGPUDecoderTest, AssociateMailbox) {
// Error case: device doesn't exist.
{
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(42, 42, 1, 0, DAWN_TEXTURE_USAGE_BIT_SAMPLED, mailbox.name);
cmd.cmd.Init(42, 42, 1, 0, DAWN_TEXTURE_USAGE_SAMPLED, mailbox.name);
EXPECT_EQ(error::kInvalidArguments,
ExecuteImmediateCmd(cmd.cmd, sizeof(mailbox.name)));
}
@ -125,7 +125,7 @@ TEST_F(WebGPUDecoderTest, AssociateMailbox) {
// Error case: texture ID invalid for the wire server.
{
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(0, 0, 42, 42, DAWN_TEXTURE_USAGE_BIT_SAMPLED, mailbox.name);
cmd.cmd.Init(0, 0, 42, 42, DAWN_TEXTURE_USAGE_SAMPLED, mailbox.name);
EXPECT_EQ(error::kInvalidArguments,
ExecuteImmediateCmd(cmd.cmd, sizeof(mailbox.name)));
}
@ -133,7 +133,7 @@ TEST_F(WebGPUDecoderTest, AssociateMailbox) {
// Error case: invalid usage.
{
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(0, 0, 42, 42, DAWN_TEXTURE_USAGE_BIT_SAMPLED, mailbox.name);
cmd.cmd.Init(0, 0, 42, 42, DAWN_TEXTURE_USAGE_SAMPLED, mailbox.name);
EXPECT_EQ(error::kInvalidArguments,
ExecuteImmediateCmd(cmd.cmd, sizeof(mailbox.name)));
}
@ -141,7 +141,7 @@ TEST_F(WebGPUDecoderTest, AssociateMailbox) {
// Error case: invalid texture usage.
{
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_BIT_FORCE32, mailbox.name);
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_FORCE32, mailbox.name);
EXPECT_EQ(error::kInvalidArguments,
ExecuteImmediateCmd(cmd.cmd, sizeof(mailbox.name)));
}
@ -153,7 +153,7 @@ TEST_F(WebGPUDecoderTest, AssociateMailbox) {
// and generation invalid.
{
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_BIT_SAMPLED, mailbox.name);
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_SAMPLED, mailbox.name);
EXPECT_EQ(error::kNoError,
ExecuteImmediateCmd(cmd.cmd, sizeof(mailbox.name)));
}
@ -161,7 +161,7 @@ TEST_F(WebGPUDecoderTest, AssociateMailbox) {
// Error case: associated to an already associated texture.
{
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_BIT_SAMPLED, mailbox.name);
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_SAMPLED, mailbox.name);
EXPECT_EQ(error::kInvalidArguments,
ExecuteImmediateCmd(cmd.cmd, sizeof(mailbox.name)));
}
@ -188,7 +188,7 @@ TEST_F(WebGPUDecoderTest, DissociateMailbox) {
// Associate a mailbox so we can later dissociate it.
{
AssociateMailboxCmdStorage cmd;
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_BIT_SAMPLED, mailbox.name);
cmd.cmd.Init(0, 0, 1, 0, DAWN_TEXTURE_USAGE_SAMPLED, mailbox.name);
EXPECT_EQ(error::kNoError,
ExecuteImmediateCmd(cmd.cmd, sizeof(mailbox.name)));
}

@ -97,7 +97,7 @@ TEST_F(WebGPUMailboxTest, WriteToMailboxThenReadFromIt) {
webgpu()->ReserveTexture(device.Get());
webgpu()->AssociateMailbox(0, 0, reservation.id, reservation.generation,
DAWN_TEXTURE_USAGE_BIT_OUTPUT_ATTACHMENT,
DAWN_TEXTURE_USAGE_OUTPUT_ATTACHMENT,
reinterpret_cast<GLbyte*>(&mailbox));
dawn::Texture texture = dawn::Texture::Acquire(reservation.texture);
@ -141,15 +141,14 @@ TEST_F(WebGPUMailboxTest, WriteToMailboxThenReadFromIt) {
webgpu()->FlushCommands();
webgpu()->AssociateMailbox(0, 0, reservation.id, reservation.generation,
DAWN_TEXTURE_USAGE_BIT_COPY_SRC,
DAWN_TEXTURE_USAGE_COPY_SRC,
reinterpret_cast<GLbyte*>(&mailbox));
dawn::Texture texture = dawn::Texture::Acquire(reservation.texture);
// Copy the texture in a mappable buffer.
dawn::BufferDescriptor buffer_desc;
buffer_desc.size = 4;
buffer_desc.usage =
dawn::BufferUsageBit::MapRead | dawn::BufferUsageBit::CopyDst;
buffer_desc.usage = dawn::BufferUsage::MapRead | dawn::BufferUsage::CopyDst;
dawn::Buffer readback_buffer = device.CreateBuffer(&buffer_desc);
dawn::TextureCopyView copy_src;
@ -218,7 +217,7 @@ TEST_F(WebGPUMailboxTest, ErrorWhenUsingTextureAfterDissociate) {
dawn::Texture texture = dawn::Texture::Acquire(reservation.texture);
webgpu()->AssociateMailbox(0, 0, reservation.id, reservation.generation,
DAWN_TEXTURE_USAGE_BIT_OUTPUT_ATTACHMENT,
DAWN_TEXTURE_USAGE_OUTPUT_ATTACHMENT,
reinterpret_cast<GLbyte*>(&mailbox));
webgpu()->DissociateMailbox(reservation.id, reservation.generation);

@ -17,7 +17,7 @@ DawnBindGroupLayoutBinding AsDawnType(
dawn_binding.binding = webgpu_binding->binding();
dawn_binding.type = AsDawnEnum<DawnBindingType>(webgpu_binding->type());
dawn_binding.visibility =
AsDawnEnum<DawnShaderStageBit>(webgpu_binding->visibility());
AsDawnEnum<DawnShaderStage>(webgpu_binding->visibility());
dawn_binding.textureComponentType = AsDawnEnum<DawnTextureComponentType>(
webgpu_binding->textureComponentType());
dawn_binding.multisampled = webgpu_binding->multisampled();

@ -49,7 +49,7 @@ DawnBufferDescriptor AsDawnType(const GPUBufferDescriptor* webgpu_desc) {
DawnBufferDescriptor dawn_desc = {};
dawn_desc.nextInChain = nullptr;
dawn_desc.usage = AsDawnEnum<DawnBufferUsageBit>(webgpu_desc->usage());
dawn_desc.usage = AsDawnEnum<DawnBufferUsage>(webgpu_desc->usage());
dawn_desc.size = webgpu_desc->size();
return dawn_desc;

@ -23,7 +23,7 @@ GPUSwapChain::GPUSwapChain(GPUCanvasContext* context,
: DawnObjectBase(descriptor->device()->GetDawnControlClient()),
device_(descriptor->device()),
context_(context),
usage_(AsDawnEnum<DawnTextureUsageBit>(descriptor->usage())) {
usage_(AsDawnEnum<DawnTextureUsage>(descriptor->usage())) {
swap_buffers_ = base::AdoptRef(new WebGPUSwapBufferProvider(
this, GetDawnControlClient(), usage_,
AsDawnEnum<DawnTextureFormat>(descriptor->format())));

@ -48,7 +48,7 @@ class GPUSwapChain : public DawnObjectBase,
Member<GPUDevice> device_;
Member<GPUCanvasContext> context_;
DawnTextureUsageBit usage_;
DawnTextureUsage usage_;
Member<GPUTexture> texture_;
};

@ -19,7 +19,7 @@ DawnTextureDescriptor AsDawnType(const GPUTextureDescriptor* webgpu_desc) {
DawnTextureDescriptor dawn_desc = {};
dawn_desc.nextInChain = nullptr;
dawn_desc.usage = static_cast<DawnTextureUsageBit>(webgpu_desc->usage());
dawn_desc.usage = static_cast<DawnTextureUsage>(webgpu_desc->usage());
dawn_desc.dimension =
AsDawnEnum<DawnTextureDimension>(webgpu_desc->dimension());
dawn_desc.size = AsDawnType(webgpu_desc->size());

@ -29,7 +29,7 @@ viz::ResourceFormat DawnFormatToViz(DawnTextureFormat format) {
WebGPUSwapBufferProvider::WebGPUSwapBufferProvider(
Client* client,
scoped_refptr<DawnControlClientHolder> dawn_control_client,
DawnTextureUsageBit usage,
DawnTextureUsage usage,
DawnTextureFormat format)
: dawn_control_client_(dawn_control_client),
client_(client),

@ -35,7 +35,7 @@ class PLATFORM_EXPORT WebGPUSwapBufferProvider
WebGPUSwapBufferProvider(
Client* client,
scoped_refptr<DawnControlClientHolder> dawn_control_client,
DawnTextureUsageBit usage,
DawnTextureUsage usage,
DawnTextureFormat format);
~WebGPUSwapBufferProvider() override;
@ -84,7 +84,7 @@ class PLATFORM_EXPORT WebGPUSwapBufferProvider
scoped_refptr<cc::TextureLayer> layer_;
bool neutered_ = false;
DawnTextureUsageBit usage_;
DawnTextureUsage usage_;
uint32_t wire_texture_id_ = 0;
uint32_t wire_texture_generation_ = 0;

@ -58,7 +58,7 @@ class WebGPUSwapBufferProviderForTests : public WebGPUSwapBufferProvider {
bool* alive,
Client* client,
scoped_refptr<DawnControlClientHolder> dawn_control_client,
DawnTextureUsageBit usage,
DawnTextureUsage usage,
DawnTextureFormat format)
: WebGPUSwapBufferProvider(client, dawn_control_client, usage, format),
alive_(alive) {}
@ -84,8 +84,7 @@ class WebGPUSwapBufferProviderTest : public testing::Test {
base::MakeRefCounted<DawnControlClientHolder>(std::move(provider));
provider_ = base::MakeRefCounted<WebGPUSwapBufferProviderForTests>(
&provider_alive_, &client_, dawn_control_client_,
DAWN_TEXTURE_USAGE_BIT_OUTPUT_ATTACHMENT,
DAWN_TEXTURE_FORMAT_RGBA8_UNORM);
DAWN_TEXTURE_USAGE_OUTPUT_ATTACHMENT, DAWN_TEXTURE_FORMAT_RGBA8_UNORM);
}
scoped_refptr<DawnControlClientHolder> dawn_control_client_;