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:
Dzmitry Malyshau 2021-04-16 21:08:11 +00:00
Родитель c452023cc6
Коммит 19e0b39108
4 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -16,7 +16,7 @@
namespace mozilla { namespace mozilla {
namespace webgpu { namespace webgpu {
GPU_IMPL_CYCLE_COLLECTION(Adapter, mParent, mBridge) GPU_IMPL_CYCLE_COLLECTION(Adapter, mParent, mBridge, mFeatures, mLimits)
GPU_IMPL_JS_WRAP(Adapter) GPU_IMPL_JS_WRAP(Adapter)
Adapter::Adapter(Instance* const aParent, Adapter::Adapter(Instance* const aParent,

Просмотреть файл

@ -43,8 +43,10 @@ class Adapter final : public ObjectBase, public ChildOf<Instance> {
const RawId mId; const RawId mId;
const nsString mName; const nsString mName;
const RefPtr<AdapterFeatures> mFeatures; // Cant have them as `const` right now, since we wouldn't be able
const RefPtr<AdapterLimits> mLimits; // to unlink them in CC unlink.
RefPtr<AdapterFeatures> mFeatures;
RefPtr<AdapterLimits> mLimits;
public: public:
Adapter(Instance* const aParent, const ffi::WGPUAdapterInformation& aInfo); Adapter(Instance* const aParent, const ffi::WGPUAdapterInformation& aInfo);

Просмотреть файл

@ -21,7 +21,7 @@ const func = async function() {
const encoder = device.createCommandEncoder(); const encoder = device.createCommandEncoder();
encoder.copyBufferToBuffer(bufferWrite, 0, bufferRead, 0, 4); encoder.copyBufferToBuffer(bufferWrite, 0, bufferRead, 0, 4);
device.defaultQueue.submit([encoder.finish()]); device.queue.submit([encoder.finish()]);
await bufferRead.mapAsync(GPUMapMode.READ); await bufferRead.mapAsync(GPUMapMode.READ);
const data = bufferRead.getMappedRange(); const data = bufferRead.getMappedRange();

Просмотреть файл

@ -17,14 +17,14 @@ const func = async function() {
const texture = device.createTexture({ const texture = device.createTexture({
size: { width: 100, height: 100, depth: 1 }, size: { width: 100, height: 100, depth: 1 },
format: "rgba8unorm", format: "rgba8unorm",
usage: GPUTextureUsage.OUTPUT_ATTACHMENT, usage: GPUTextureUsage.RENDER_ATTACHMENT,
}); });
const view = texture.createView(); const view = texture.createView();
const encoder = device.createCommandEncoder(); const encoder = device.createCommandEncoder();
const pass = encoder.beginRenderPass({ const pass = encoder.beginRenderPass({
colorAttachments: [{ colorAttachments: [{
attachment: view, view,
loadValue: { r: 0, g: 0, b: 0, a: 0 }, loadValue: { r: 0, g: 0, b: 0, a: 0 },
storeOp: "store", storeOp: "store",
}], }],