mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 1705531 - Hook up Adapter to Limits and Features for CC r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D112269
This commit is contained in:
parent
c452023cc6
commit
19e0b39108
@ -16,7 +16,7 @@
|
||||
namespace mozilla {
|
||||
namespace webgpu {
|
||||
|
||||
GPU_IMPL_CYCLE_COLLECTION(Adapter, mParent, mBridge)
|
||||
GPU_IMPL_CYCLE_COLLECTION(Adapter, mParent, mBridge, mFeatures, mLimits)
|
||||
GPU_IMPL_JS_WRAP(Adapter)
|
||||
|
||||
Adapter::Adapter(Instance* const aParent,
|
||||
|
@ -43,8 +43,10 @@ class Adapter final : public ObjectBase, public ChildOf<Instance> {
|
||||
|
||||
const RawId mId;
|
||||
const nsString mName;
|
||||
const RefPtr<AdapterFeatures> mFeatures;
|
||||
const RefPtr<AdapterLimits> mLimits;
|
||||
// Cant have them as `const` right now, since we wouldn't be able
|
||||
// to unlink them in CC unlink.
|
||||
RefPtr<AdapterFeatures> mFeatures;
|
||||
RefPtr<AdapterLimits> mLimits;
|
||||
|
||||
public:
|
||||
Adapter(Instance* const aParent, const ffi::WGPUAdapterInformation& aInfo);
|
||||
|
@ -21,7 +21,7 @@ const func = async function() {
|
||||
|
||||
const encoder = device.createCommandEncoder();
|
||||
encoder.copyBufferToBuffer(bufferWrite, 0, bufferRead, 0, 4);
|
||||
device.defaultQueue.submit([encoder.finish()]);
|
||||
device.queue.submit([encoder.finish()]);
|
||||
|
||||
await bufferRead.mapAsync(GPUMapMode.READ);
|
||||
const data = bufferRead.getMappedRange();
|
||||
|
@ -17,14 +17,14 @@ const func = async function() {
|
||||
const texture = device.createTexture({
|
||||
size: { width: 100, height: 100, depth: 1 },
|
||||
format: "rgba8unorm",
|
||||
usage: GPUTextureUsage.OUTPUT_ATTACHMENT,
|
||||
usage: GPUTextureUsage.RENDER_ATTACHMENT,
|
||||
});
|
||||
const view = texture.createView();
|
||||
|
||||
const encoder = device.createCommandEncoder();
|
||||
const pass = encoder.beginRenderPass({
|
||||
colorAttachments: [{
|
||||
attachment: view,
|
||||
view,
|
||||
loadValue: { r: 0, g: 0, b: 0, a: 0 },
|
||||
storeOp: "store",
|
||||
}],
|
||||
|
Loading…
x
Reference in New Issue
Block a user