Skip to content

Commit

Permalink
Backed out changeset 9e97159bb402 (bug 1622846) for causing bp-hybrid…
Browse files Browse the repository at this point in the history
… bustages on WebGPUChild.cpp CLOSED TREE
  • Loading branch information
ncsoregi committed Nov 29, 2021
1 parent c303fe1 commit 6065528
Show file tree
Hide file tree
Showing 347 changed files with 45,004 additions and 26,854 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ rev = "302c995f91f44cf26e77dc4758ad56c3ff0153ad"
[source."https://github.com/gfx-rs/wgpu"]
git = "https://github.com/gfx-rs/wgpu"
replace-with = "vendored-sources"
rev = "5f6c067"
rev = "37288a6"

[source."https://github.com/gfx-rs/naga"]
git = "https://github.com/gfx-rs/naga"
replace-with = "vendored-sources"
rev = "29571cc"
rev = "e226cf3"

[source."https://github.com/bytecodealliance/wasmtime"]
git = "https://github.com/bytecodealliance/wasmtime"
Expand Down
57 changes: 28 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions dom/webgpu/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ already_AddRefed<Texture> Device::InitSwapChain(
return CreateTexture(desc);
}

bool Device::CheckNewWarning(const nsACString& aMessage) {
return mKnownWarnings.EnsureInserted(aMessage);
}

void Device::Destroy() {
// TODO
}
Expand Down
3 changes: 0 additions & 3 deletions dom/webgpu/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define GPU_DEVICE_H_

#include "ObjectModel.h"
#include "nsTHashSet.h"
#include "mozilla/MozPromise.h"
#include "mozilla/RefPtr.h"
#include "mozilla/webgpu/WebGPUTypes.h"
Expand Down Expand Up @@ -94,7 +93,6 @@ class Device final : public DOMEventTargetHelper {
const dom::GPUCanvasConfiguration& aDesc,
wr::ExternalImageId aExternalImageId, gfx::SurfaceFormat aFormat,
gfx::IntSize* aDefaultSize);
bool CheckNewWarning(const nsACString& aMessage);

private:
~Device();
Expand All @@ -104,7 +102,6 @@ class Device final : public DOMEventTargetHelper {
bool mValid = true;
nsString mLabel;
RefPtr<Queue> mQueue;
nsTHashSet<nsCString> mKnownWarnings;

public:
void GetLabel(nsAString& aValue) const;
Expand Down
23 changes: 9 additions & 14 deletions dom/webgpu/ipc/WebGPUChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include "mozilla/webgpu/ffi/wgpu.h"
#include "Sampler.h"

const int MAX_KNOWN_WARNINGS = 10;

namespace mozilla {
namespace webgpu {

Expand Down Expand Up @@ -832,18 +830,15 @@ ipc::IPCResult WebGPUChild::RecvDeviceUncapturedError(
} else {
auto* target = targetIter->second;
MOZ_ASSERT(target);
// We don't want to spam the errors to the console indefinitely
if (target->CheckNewWarning(aMessage)) {
JsWarning(target->GetOwnerGlobal(), aMessage);

dom::GPUUncapturedErrorEventInit init;
init.mError.SetAsGPUValidationError() =
new ValidationError(target, aMessage);
RefPtr<mozilla::dom::GPUUncapturedErrorEvent> event =
dom::GPUUncapturedErrorEvent::Constructor(
target, u"uncapturederror"_ns, init);
target->DispatchEvent(*event);
}
JsWarning(target->GetOwnerGlobal(), aMessage);

dom::GPUUncapturedErrorEventInit init;
init.mError.SetAsGPUValidationError() =
new ValidationError(target, aMessage);
RefPtr<mozilla::dom::GPUUncapturedErrorEvent> event =
dom::GPUUncapturedErrorEvent::Constructor(target, u"uncapturederror"_ns,
init);
target->DispatchEvent(*event);
}
return IPC_OK();
}
Expand Down
4 changes: 2 additions & 2 deletions dom/webidl/WebGPU.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ typedef [EnforceRange] unsigned long GPUTextureUsageFlags;
interface GPUTextureUsage {
const GPUTextureUsageFlags COPY_SRC = 0x01;
const GPUTextureUsageFlags COPY_DST = 0x02;
const GPUTextureUsageFlags TEXTURE_BINDING = 0x04;
const GPUTextureUsageFlags STORAGE_BINDING = 0x08;
const GPUTextureUsageFlags SAMPLED = 0x04;
const GPUTextureUsageFlags STORAGE = 0x08;
const GPUTextureUsageFlags RENDER_ATTACHMENT = 0x10;
};

Expand Down
8 changes: 3 additions & 5 deletions gfx/wgpu_bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@ default = []
[dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "5f6c067"
#Note: "replay" shouldn't ideally be needed,
# but it allows us to serialize everything across IPC.
rev = "37288a6"
features = ["replay", "trace", "serial-pass"]

[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "5f6c067"
rev = "37288a6"

[dependencies.wgh]
package = "wgpu-hal"
git = "https://github.com/gfx-rs/wgpu"
rev = "5f6c067"
rev = "37288a6"

[dependencies]
bincode = "1"
Expand Down
20 changes: 6 additions & 14 deletions gfx/wgpu_bindings/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub struct PrimitiveState<'a> {
front_face: wgt::FrontFace,
cull_mode: Option<&'a wgt::Face>,
polygon_mode: wgt::PolygonMode,
unclipped_depth: bool,
clamp_depth: bool,
}

impl PrimitiveState<'_> {
Expand All @@ -145,7 +145,7 @@ impl PrimitiveState<'_> {
front_face: self.front_face.clone(),
cull_mode: self.cull_mode.cloned(),
polygon_mode: self.polygon_mode,
unclipped_depth: self.unclipped_depth,
clamp_depth: self.clamp_depth,
conservative: false,
}
}
Expand Down Expand Up @@ -628,7 +628,6 @@ pub extern "C" fn wgpu_device_create_render_bundle_encoder(
stencil_read_only: false,
}),
sample_count: desc.sample_count,
multiview: None,
};
match wgc::command::RenderBundleEncoder::new(&descriptor, device_id, None) {
Ok(encoder) => Box::into_raw(Box::new(encoder)),
Expand Down Expand Up @@ -778,15 +777,10 @@ pub unsafe extern "C" fn wgpu_client_create_bind_group_layout(
has_dynamic_offset: entry.has_dynamic_offset,
min_binding_size: entry.min_binding_size,
},
RawBindingType::Sampler => wgt::BindingType::Sampler(
if entry.sampler_compare {
wgt::SamplerBindingType::Comparison
} else if entry.sampler_filter {
wgt::SamplerBindingType::Filtering
} else {
wgt::SamplerBindingType::NonFiltering
}
),
RawBindingType::Sampler => wgt::BindingType::Sampler {
comparison: entry.sampler_compare,
filtering: entry.sampler_filter,
},
RawBindingType::SampledTexture => wgt::BindingType::Texture {
//TODO: the spec has a bug here
view_dimension: *entry
Expand Down Expand Up @@ -921,7 +915,6 @@ pub unsafe extern "C" fn wgpu_client_create_shader_module(
std::str::from_utf8_unchecked(std::slice::from_raw_parts(desc.code, desc.code_length));
let desc = wgc::pipeline::ShaderModuleDescriptor {
label: cow_label(&desc.label),
shader_bound_checks: wgt::ShaderBoundChecks::new(),
};

let action = DeviceAction::CreateShaderModule(id, desc, Cow::Borrowed(code));
Expand Down Expand Up @@ -986,7 +979,6 @@ pub unsafe extern "C" fn wgpu_client_create_render_pipeline(
primitive: desc.primitive.to_wgpu(),
depth_stencil: desc.depth_stencil.cloned(),
multisample: desc.multisample.clone(),
multiview: None,
};

let implicit = match desc.layout {
Expand Down
4 changes: 2 additions & 2 deletions gfx/wgpu_bindings/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ impl GlobalExt for Global {
error_buf.init(err);
}
}
CommandEncoderAction::FillBuffer { dst, offset, size } => {
if let Err(err) = self.command_encoder_fill_buffer::<A>(self_id, dst, offset, size)
CommandEncoderAction::ClearBuffer { dst, offset, size } => {
if let Err(err) = self.command_encoder_clear_buffer::<A>(self_id, dst, offset, size)
{
error_buf.init(err);
}
Expand Down
1 change: 1 addition & 0 deletions third_party/rust/fixedbitset/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"files":{"Cargo.toml":"bcacef1787d5859f9f7b01a07cba08ca89f296ccca569fcb01b1ee67a8d1d90b","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"ce592787ff2321feab698a4c612237f4378cc658ebb1d472913e5802cc47afb4","README.rst":"ea76fe055c46ccb817d87fc68b2dcff2540e8e0a7823a7a819fe8d9a8fdff27a","benches/benches.rs":"745803c7962409ba8a63635336ca5f6b971ef1dc8f46e2cdee2a8a0c6b86e9a9","src/lib.rs":"9b6462707f38ee2c21fed5d2701102ae6c06437429858dd138a42dd163885e0d","src/range.rs":"6c9fd2462e353221dcf63393a78783428995a9460de3e4c799bd00a273dda9d8"},"package":"398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e"}
35 changes: 35 additions & 0 deletions third_party/rust/fixedbitset/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)

[package]
name = "fixedbitset"
version = "0.4.0"
authors = ["bluss"]
description = "FixedBitSet is a simple bitset collection"
documentation = "https://docs.rs/fixedbitset/"
keywords = ["container", "data-structure", "bitvec", "bitset", "no_std"]
categories = ["data-structures"]
license = "MIT/Apache-2.0"
repository = "https://github.com/bluss/fixedbitset"
[package.metadata.release]
no-dev-version = true
tag-name = "{{version}}"
[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true
[dev-dependencies.serde_json]
version = "1.0"

[features]
default = ["std"]
std = []
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 RON developers
Copyright (c) 2015-2017

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down
Loading

0 comments on commit 6065528

Please sign in to comment.