Bug 1850713: remove duplicated setting of early hint preloader id in `ScriptLoader...
[gecko.git] / dom / webgpu / ShaderModule.h
blob9c20c71c7d36a9acc6383351a47b30cdf9543ab1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GPU_ShaderModule_H_
7 #define GPU_ShaderModule_H_
9 #include "mozilla/webgpu/WebGPUTypes.h"
10 #include "nsWrapperCache.h"
11 #include "ObjectModel.h"
13 namespace mozilla::webgpu {
15 class CompilationInfo;
16 class Device;
18 class ShaderModule final : public ObjectBase, public ChildOf<Device> {
19 public:
20 GPU_DECL_CYCLE_COLLECTION(ShaderModule)
21 GPU_DECL_JS_WRAP(ShaderModule)
23 ShaderModule(Device* const aParent, RawId aId,
24 const RefPtr<dom::Promise>& aCompilationInfo);
25 already_AddRefed<dom::Promise> CompilationInfo(ErrorResult& aRv);
26 already_AddRefed<dom::Promise> GetCompilationInfo(ErrorResult& aRv);
28 const RawId mId;
30 private:
31 virtual ~ShaderModule();
32 void Cleanup();
34 RefPtr<dom::Promise> mCompilationInfo;
37 } // namespace mozilla::webgpu
39 #endif // GPU_ShaderModule_H_