tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

RenderPipeline.cpp (1093B)


      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/. */
      5 
      6 #include "RenderPipeline.h"
      7 
      8 #include "Device.h"
      9 #include "mozilla/dom/WebGPUBinding.h"
     10 
     11 namespace mozilla::webgpu {
     12 
     13 GPU_IMPL_CYCLE_COLLECTION(RenderPipeline, mParent)
     14 GPU_IMPL_JS_WRAP(RenderPipeline)
     15 
     16 RenderPipeline::RenderPipeline(Device* const aParent, RawId aId)
     17    : ObjectBase(aParent->GetChild(), aId,
     18                 ffi::wgpu_client_drop_render_pipeline),
     19      ChildOf(aParent) {}
     20 
     21 RenderPipeline::~RenderPipeline() = default;
     22 
     23 already_AddRefed<BindGroupLayout> RenderPipeline::GetBindGroupLayout(
     24    uint32_t aIndex) const {
     25  const RawId bglId = ffi::wgpu_client_render_pipeline_get_bind_group_layout(
     26      GetClient(), mParent->GetId(), GetId(), aIndex);
     27 
     28  RefPtr<BindGroupLayout> object = new BindGroupLayout(mParent, bglId);
     29  return object.forget();
     30 }
     31 
     32 }  // namespace mozilla::webgpu