Skip to content

Commit

Permalink
Bug 1602880 - Rename dom.webgpu.enable pref and restrict the CTS r=jg…
Browse files Browse the repository at this point in the history
…ilbert,bzbarsky

addresses 1600364

Differential Revision: https://phabricator.services.mozilla.com/D56603
  • Loading branch information
kvark committed Dec 12, 2019
1 parent bc0b9f4 commit c0db22f
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 43 deletions.
2 changes: 1 addition & 1 deletion dom/webgpu/mochitest/mochitest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[DEFAULT]
subsuite = webgl1-core
prefs = dom.webgpu.enable=true
prefs = dom.webgpu.enabled=true

[test_enabled.html]
[test_device_creation.html]
Expand Down
2 changes: 1 addition & 1 deletion dom/webgpu/mochitest/test_buffer_mapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<script>

ok(SpecialPowers.getBoolPref('dom.webgpu.enable'), 'Pref should be enabled.');
ok(SpecialPowers.getBoolPref('dom.webgpu.enabled'), 'Pref should be enabled.');

const func = async function() {
const adapter = await navigator.gpu.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion dom/webgpu/mochitest/test_device_creation.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<script>

ok(SpecialPowers.getBoolPref('dom.webgpu.enable'), 'Pref should be enabled.');
ok(SpecialPowers.getBoolPref('dom.webgpu.enabled'), 'Pref should be enabled.');

const func = async function() {
const adapter = await navigator.gpu.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion dom/webgpu/mochitest/test_disabled.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<script>

ok(!SpecialPowers.getBoolPref('dom.webgpu.enable'), 'Pref should be disabled.');
ok(!SpecialPowers.getBoolPref('dom.webgpu.enabled'), 'Pref should be disabled.');
ok(navigator.gpu === undefined, 'navigator.gpu === undefined');

</script>
Expand Down
2 changes: 1 addition & 1 deletion dom/webgpu/mochitest/test_enabled.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<script>

ok(SpecialPowers.getBoolPref('dom.webgpu.enable'), 'Pref should be enabled.');
ok(SpecialPowers.getBoolPref('dom.webgpu.enabled'), 'Pref should be enabled.');
ok(navigator.gpu !== undefined, 'navigator.gpu !== undefined');

</script>
Expand Down
2 changes: 1 addition & 1 deletion dom/webidl/GPUUncapturedErrorEvent.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

[
Pref="dom.webgpu.enable",
Pref="dom.webgpu.enabled",
Exposed=Window,
]
interface GPUUncapturedErrorEvent : Event {
Expand Down
66 changes: 33 additions & 33 deletions dom/webidl/WebGPU.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dictionary GPUObjectDescriptorBase {
// ****************************************************************************

[
Pref="dom.webgpu.enable",
Pref="dom.webgpu.enabled",
Exposed=Window
]
interface GPU {
Expand All @@ -64,7 +64,7 @@ interface GPU {

// Add a "webgpu" member to Navigator/Worker that contains the global instance of a "WebGPU"
interface mixin GPUProvider {
[SameObject, Replaceable, Pref="dom.webgpu.enable", Exposed=Window] readonly attribute GPU gpu;
[SameObject, Replaceable, Pref="dom.webgpu.enabled", Exposed=Window] readonly attribute GPU gpu;
};

enum GPUPowerPreference {
Expand All @@ -76,7 +76,7 @@ dictionary GPURequestAdapterOptions {
GPUPowerPreference powerPreference;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUAdapter {
readonly attribute DOMString name;
Expand All @@ -98,7 +98,7 @@ dictionary GPULimits {
};

// Device
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUDevice {
//GPUExtensions getExtensions();
Expand Down Expand Up @@ -140,7 +140,7 @@ dictionary GPUDeviceDescriptor {
// ERROR HANDLING
// ****************************************************************************

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUDeviceLostInfo {
readonly attribute DOMString message;
Expand All @@ -152,13 +152,13 @@ enum GPUErrorFilter {
"validation"
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUOutOfMemoryError {
//constructor();
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUValidationError {
//constructor(DOMString message);
Expand All @@ -181,7 +181,7 @@ partial interface GPUDevice {

// Buffer
typedef u32 GPUBufferUsageFlags;
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUBufferUsage {
const u32 NONE = 0x0000;
Expand All @@ -201,7 +201,7 @@ dictionary GPUBufferDescriptor {
required GPUBufferUsageFlags usage;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUBuffer {
[NewObject]
Expand Down Expand Up @@ -277,7 +277,7 @@ enum GPUTextureFormat {
};

typedef u32 GPUTextureUsageFlags;
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUTextureUsage {
const u32 NONE = 0x00;
Expand All @@ -298,7 +298,7 @@ dictionary GPUTextureDescriptor {
required GPUTextureUsageFlags usage;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUTexture {
//GPUTextureView createView(GPUTextureViewDescriptor descriptor);
Expand Down Expand Up @@ -333,7 +333,7 @@ dictionary GPUTextureViewDescriptor : GPUObjectDescriptorBase {
u32 arrayLayerCount = 1;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUTextureView {
};
Expand Down Expand Up @@ -374,7 +374,7 @@ dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase {
GPUCompareFunction compare = "never";
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUSampler {
};
Expand All @@ -395,15 +395,15 @@ dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase {
required sequence<GPUBindGroupLayout> bindGroupLayouts;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUPipelineLayout {
};
GPUPipelineLayout includes GPUObjectBase;

// BindGroupLayout
typedef u32 GPUShaderStageFlags;
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUShaderStage {
const u32 NONE = 0;
Expand Down Expand Up @@ -435,7 +435,7 @@ dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase {
required sequence<GPUBindGroupLayoutBinding> bindings;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUBindGroupLayout {
};
Expand All @@ -460,7 +460,7 @@ dictionary GPUBindGroupDescriptor : GPUObjectDescriptorBase {
required sequence<GPUBindGroupBinding> bindings;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUBindGroup {
};
Expand Down Expand Up @@ -502,7 +502,7 @@ dictionary GPUBlendDescriptor {
};

typedef u32 GPUColorWriteFlags;
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUColorWrite {
const u32 NONE = 0;
Expand Down Expand Up @@ -621,7 +621,7 @@ dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase {
required GPUShaderCode code;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUShaderModule {
};
Expand All @@ -642,7 +642,7 @@ dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase {
required GPUProgrammableStageDescriptor computeStage;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUComputePipeline {
};
Expand Down Expand Up @@ -692,7 +692,7 @@ dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase {
boolean alphaToCoverageEnabled = false;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPURenderPipeline {
};
Expand Down Expand Up @@ -756,7 +756,7 @@ dictionary GPUImageBitmapCopyView {
dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase {
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUCommandEncoder {
//GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor);
Expand Down Expand Up @@ -799,7 +799,7 @@ interface GPUCommandEncoder {
};
GPUCommandEncoder includes GPUObjectBase;

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUProgrammablePassEncoder {
//void setBindGroup(u32 index, GPUBindGroup bindGroup,
Expand All @@ -812,7 +812,7 @@ interface GPUProgrammablePassEncoder {
GPUProgrammablePassEncoder includes GPUObjectBase;

// Render Pass
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPURenderEncoderBase : GPUProgrammablePassEncoder {
//void setPipeline(GPURenderPipeline pipeline);
Expand All @@ -830,7 +830,7 @@ interface GPURenderEncoderBase : GPUProgrammablePassEncoder {
//void drawIndexedIndirect(GPUBuffer indirectBuffer, u64 indirectOffset);
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPURenderPassEncoder : GPURenderEncoderBase {
//void setViewport(float x, float y,
Expand All @@ -850,7 +850,7 @@ interface GPURenderPassEncoder : GPURenderEncoderBase {
dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase {
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUComputePassEncoder : GPUProgrammablePassEncoder {
//void setPipeline(GPUComputePipeline pipeline);
Expand All @@ -864,7 +864,7 @@ interface GPUComputePassEncoder : GPUProgrammablePassEncoder {
dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase {
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUCommandBuffer {
};
Expand All @@ -877,7 +877,7 @@ dictionary GPURenderBundleEncoderDescriptor : GPUObjectDescriptorBase {
};

// Render Bundle
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPURenderBundleEncoder : GPURenderEncoderBase {
//GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {});
Expand All @@ -886,7 +886,7 @@ interface GPURenderBundleEncoder : GPURenderEncoderBase {
dictionary GPURenderBundleDescriptor : GPUObjectDescriptorBase {
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPURenderBundle {
};
Expand All @@ -901,7 +901,7 @@ dictionary GPUFenceDescriptor : GPUObjectDescriptorBase {
u64 initialValue = 0;
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUFence {
//u64 getCompletedValue();
Expand All @@ -910,7 +910,7 @@ interface GPUFence {
GPUFence includes GPUObjectBase;

// Queue
[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUQueue {
//void submit(sequence<GPUCommandBuffer> buffers);
Expand All @@ -920,7 +920,7 @@ interface GPUQueue {
};
GPUQueue includes GPUObjectBase;

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUSwapChain {
//GPUTexture getCurrentTexture();
Expand All @@ -933,7 +933,7 @@ dictionary GPUSwapChainDescriptor : GPUObjectDescriptorBase {
GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.OUTPUT_ATTACHMENT
};

[Pref="dom.webgpu.enable",
[Pref="dom.webgpu.enabled",
Exposed=Window]
interface GPUCanvasContext {
// Calling configureSwapChain a second time invalidates the previous one,
Expand Down
2 changes: 1 addition & 1 deletion gfx/thebes/gfxPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3346,7 +3346,7 @@ void gfxPlatform::InitWebRenderConfig() {

void gfxPlatform::InitWebGPUConfig() {
FeatureState& feature = gfxConfig::GetFeature(Feature::WEBGPU);
feature.SetDefaultFromPref("dom.webgpu.enable", true, false);
feature.SetDefaultFromPref("dom.webgpu.enabled", true, false);
}

void gfxPlatform::InitOMTPConfig() {
Expand Down
2 changes: 1 addition & 1 deletion modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@
mirror: always

# Is support for the Web GPU API enabled?
- name: dom.webgpu.enable
- name: dom.webgpu.enabled
type: RelaxedAtomicBool
value: false
mirror: always
Expand Down
2 changes: 2 additions & 0 deletions testing/web-platform/meta/webgpu/__dir__.ini
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
leak-threshold: [default:51200]

prefs: [dom.webgpu.enabled:true]
Loading

0 comments on commit c0db22f

Please sign in to comment.