/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ext/webgpu/command_buffer.rs
59 строк
1 KB
Kenta Moriuchi
chore: Happy New Year 2026 (#31748)
08 янв 2026, 18:28
Не верифицирован
08 янв 2026, 18:28
8193cf9
Код
Авторство
О чём код?
// Copyright 2018-2026 the Deno authors. MIT license. use deno_core::GarbageCollected; use deno_core::WebIDL; use deno_core::op2; use crate::Instance; use crate::error::GPUGenericError; pub struct GPUCommandBuffer { pub instance: Instance, pub id: wgpu_core::id::CommandBufferId, pub label: String, } impl Drop for GPUCommandBuffer { fn drop(&mut self) { self.instance.command_buffer_drop(self.id); } } impl deno_core::webidl::WebIdlInterfaceConverter for GPUCommandBuffer { const NAME: &'static str = "GPUCommandBuffer"; } // SAFETY: we're sure this can be GCed unsafe impl GarbageCollected for GPUCommandBuffer { fn trace(&self, _visitor: &mut deno_core::v8::cppgc::Visitor) {} fn get_name(&self) -> &'static std::ffi::CStr { c"GPUCommandBuffer" } } #[op2] impl GPUCommandBuffer { #[constructor] #[cppgc] fn constructor(_: bool) -> Result<GPUCommandBuffer, GPUGenericError> { Err(GPUGenericError::InvalidConstructor) } #[getter] #[string] fn label(&self) -> String { self.label.clone() } #[setter] #[string] fn label(&self, #[webidl] _label: String) { // TODO(@crowlKats): no-op, needs wpgu to implement changing the label } } #[derive(WebIDL)] #[webidl(dictionary)] pub(crate) struct GPUCommandBufferDescriptor { #[webidl(default = String::new())] pub label: String, }