Closed
Bug 1712963
Opened 3 years ago
Closed 5 months ago
Refactor mValid checks in WebGPU for early-out
Categories
(Core :: Graphics: WebGPU, task, P3)
Core
Graphics: WebGPU
Tracking
()
RESOLVED
FIXED
127 Branch
Tracking | Status | |
---|---|---|
firefox127 | --- | fixed |
People
(Reporter: kvark, Assigned: bradwerth)
References
(Blocks 2 open bugs, Regressed 2 open bugs)
Details
Attachments
(1 file)
Requested in https://phabricator.services.mozilla.com/D114878#inline-643161
In code like this:
if (mValid) {
ffi::wgpu_render_bundle_draw(mEncoder, aVertexCount, aInstanceCount,
aFirstVertex, aFirstInstance);
}
The suggestion is to d oif (!mValid) { ... return; }
instead.
Updated•1 year ago
|
Updated•7 months ago
|
Blocks: webgpu-triage
Assignee | ||
Updated•5 months ago
|
Assignee: nobody → bwerth
Assignee | ||
Comment 1•5 months ago
|
||
Primarily this standardizes ComputePassEncoder, RenderBundleEncoder and
RenderPassEncoder on the "if (!mValid)" pattern for early exits for ffi
functions. It also attempts to make each class have at most two ways to
become invalid:
- RenderBundleEncoder and RenderPassEncoder can become invalid at
construction time. - Those classes and ComputePassEncoder all now have an implementation
of their ::Cleanup method, which is called from the destructor, and the
Cleanup method is responsible for making the object invalid and
releasing internal resources (possibly by calling another method).
Together these changes make it easier to reason about what mValid means
for these classes, and what is the state of their internal resources.
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e98d0558c0bf
Simplify mValid handling in some WebGPU classes. r=webgpu-reviewers,nical
Comment 3•5 months ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 months ago
status-firefox127:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
Updated•5 months ago
|
Type: enhancement → task
You need to log in
before you can comment on or make changes to this bug.
Description
•