// npm 패키지
@antv/g-device-api
A Device API references WebGPU implementations
버전
45
메인테이너
51
라이선스
MIT
최초 publish
2023-09-26
publisher
lzxue
tarball
9,282,505 B
AUTO-PUBLISHED·1개 버전 인덱싱됨·최근 publish: 2024-10-10
// publisher 캠페인by lzxue
이 계정에서 catch된 패키지 9건고립된 catch가 아닙니다. 동일 publisher가 8개의 다른 패키지를 추가로 발행했고, 모두 파이프라인이 catch했습니다 — 일회성이 아닌 조직적 캠페인의 형태. 아래 링크는 각 형제 catch의 분석으로 이동합니다.
// offending code· @1.6.13· 2 files flagged
llm: benign · 0.85→ 의심 전송지 없음, 원격 실행 형태 없음 — 1 known-vendor host(s).
- @1.6.13··AUTO-PUBLISHED·publisher: lzxueheuristic 75/100static flags 1llm benign (0.85) via ollamamature-packageosv-flagged:MAL-2026-3917child-process-spawn
→ 의심 전송지 없음, 원격 실행 형태 없음 — 1 known-vendor host(s).
// offending code· 2 files flaggedpatterns: 1
--- package/lib/index.js (excerpt) --- 'use strict'; var util = require('@antv/util'); var tslib = require('tslib'); var EventEmitter = require('eventemitter3'); /** * ported from @luma.gl/constants * * Standard WebGL and WebGL2 constants * These constants are also defined on the WebGLRenderingContext interface. */ exports.GL = void 0; (function (GL) { // Clearing buffers // Constants passed to clear() to clear buffer masks. GL[GL["DEPTH_BUFFER_BIT"] = 256] = "DEPTH_BUFFER_BIT"; GL[GL["STENCIL_BUFFER_BIT"] = 1024] = "STENCIL_BUFFER_BIT"; GL[GL["COLOR_BUFFER_BIT"] = 16384] = "COLOR_BUFFER_BIT"; // Rendering primitives // Constants passed to drawElements() or drawArrays() to specify what kind of primitive to render. GL[GL["POINTS"] = 0] = "POINTS"; GL[GL["LINES"] = 1] = "LINES"; GL[GL["LINE_LOOP"] = 2] = "LINE_LOOP"; GL[GL["LINE_STRIP"] = 3] = "LINE_STRIP"; GL[GL["TRIANGLES"] = 4] = "TRIANGLES"; GL[GL["TRIANGLE_STRIP"] = 5] = "TRIANGLE_STRIP"; GL[GL["TRIANGLE_FAN"] = 6] = "TRIANGLE_FAN"; // Blending modes // Constants passed to blendFunc() or blendFuncSeparate() to specify the blending mode (for both, RBG and alpha, or separately). GL[GL["ZERO"] = 0] = "ZERO"; GL[GL["ONE"] = 1] = "ONE"; GL[GL["SRC_COLOR"] = 768] = "SRC_COLOR"; GL[GL["ONE_MINUS_SRC_COLOR"] = 769] = "ONE_MINUS_SRC_COLOR"; GL[GL["SRC_ALPHA"] = 770] = "SRC_ALPHA"; GL[GL["ONE_MINUS_SRC_ALPHA"] = 771] = "ONE_MINUS_SRC_ALPHA"; GL[GL["DST_ALPHA"] = 772] = "DST --- package/es/index.js (excerpt) --- import { isNil, isNumber, clamp } from '@antv/util'; import { __read, __extends, __values, __assign, __awaiter, __generator, __spreadArray, __rest } from 'tslib'; import EventEmitter from 'eventemitter3'; /** * ported from @luma.gl/constants * * Standard WebGL and WebGL2 constants * These constants are also defined on the WebGLRenderingContext interface. */ var GL; (function (GL) { // Clearing buffers // Constants passed to clear() to clear buffer masks. GL[GL["DEPTH_BUFFER_BIT"] = 256] = "DEPTH_BUFFER_BIT"; GL[GL["STENCIL_BUFFER_BIT"] = 1024] = "STENCIL_BUFFER_BIT"; GL[GL["COLOR_BUFFER_BIT"] = 16384] = "COLOR_BUFFER_BIT"; // Rendering primitives // Constants passed to drawElements() or drawArrays() to specify what kind of primitive to render. GL[GL["POINTS"] = 0] = "POINTS"; GL[GL["LINES"] = 1] = "LINES"; GL[GL["LINE_LOOP"] = 2] = "LINE_LOOP"; GL[GL["LINE_STRIP"] = 3] = "LINE_STRIP"; GL[GL["TRIANGLES"] = 4] = "TRIANGLES"; GL[GL["TRIANGLE_STRIP"] = 5] = "TRIANGLE_STRIP"; GL[GL["TRIANGLE_FAN"] = 6] = "TRIANGLE_FAN"; // Blending modes // Constants passed to blendFunc() or blendFuncSeparate() to specify the blending mode (for both, RBG and alpha, or separately). GL[GL["ZERO"] = 0] = "ZERO"; GL[GL["ONE"] = 1] = "ONE"; GL[GL["SRC_COLOR"] = 768] = "SRC_COLOR"; GL[GL["ONE_MINUS_SRC_COLOR"] = 769] = "ONE_MINUS_SRC_COLOR"; GL[GL["SRC_ALPHA"] = 770] = "SRC_ALPHA"; GL[GL["ONE_MINUS_SRC_ALPHA"] --- bundled output (OSV-MAL flagged — LLM scope expansion) --- --- dist/index.d.ts (bundled) --- export * from './api'; export * from './shader'; export { WebGLDeviceContribution } from './webgl/WebGLDeviceContribution'; export { WebGPUDeviceContribution } from './webgpu/WebGPUDeviceContribution'; --- dist/index.umd.min.js (bundled) --- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).GDeviceAPI={})}(this,(function(e){"use strict";var t,r,n,o,a,i,s,l,_,u,E,c,R,T,p,A,d,F,f,m,h,S,g,B,N,C;function L(e){return e}function O(e,t,r){return e<<16|t<<8|r}function M(e){return e>>>8&255}function I(e){return e>>>16&255}function U(e){return 255&e}function D(t){switch(t){case e.FormatTypeFlags.F32:case e.FormatTypeFlags.U32:case e.FormatTypeFlags.S32:return 4;case e.FormatTypeFlags.U16:case e.FormatTypeFlags.S16:case e.FormatTypeFlags.F16:return 2;case e.FormatTypeFlags.U8:case e.FormatTypeFlags.S8:return 1;default:throw Error("whoops")}}function G(e){return D(I(e))}function P(e){return D(I(e))*M(e)}function v(t){var r=U(t);if(r&e.FormatFlags.Depth)return e.SamplerFormatKind.Depth;if(r&e.FormatFlags.Normalized)return e.SamplerFormatKind.Float;var n=I(t);if(n===e.FormatTypeFlags.F16||n===e.FormatTypeFlags.F32)return e.SamplerFormatKind.Float;if(n===e.FormatTypeFlags.U8||n===e.FormatTypeFlags.U16||n===e.FormatTypeFlags.U32)return e.SamplerFormatKind.Uint;if(n===e.FormatTypeFlags.S8||n===e.FormatTypeFlags.S16||n===e.FormatTypeFlags.S32)return e.SamplerFormatKind.Sint;throw Error("whoops")}function y(e,t){if(void 0===t&&(t=""),!e)throw Error("Assert fail: ".concat(t))}function b(e){if(null!=e)return e;throw Error("Missing object")}function x(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}function X(e,t){e.r=t.r,e.g=t.g,e.b=t.b,e.a=t.a}function w(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}function W(e,t,r,n){return void 0===n&&(n=1),{r:e,g:t,b:r,a:n}}e.GL=void 0,(t=e.GL||(e.GL={}))[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="T --- dist/webgpu/Bindings.d.ts (bundled) --- /// <reference types="@webgpu/types" /> import type { Bindings, BindingsDescriptor } from '../api'; import { ResourceType } from '../api'; import type { BindGroupLayout, IDevice_WebGPU } from './interfaces'; import { ResourceBase_WebGPU } from './ResourceBase'; export declare class Bindings_WebGPU extends ResourceBase_WebGPU implements Bindings { type: ResourceType.Bindings; gpuBindGroup: GPUBindGroup[]; bindGroupLayout: BindGroupLayout; numUniformBuffers: number; constructor({ id, device, descriptor, }: { id: number; device: IDevice_WebGPU; descriptor: BindingsDescriptor; }); } --- dist/webgpu/Buffer.d.ts (bundled) --- /// <reference types="@webgpu/types" /> import { Buffer, BufferDescriptor } from '../api'; import { BufferUsage, ResourceType } from '../api'; import type { IDevice_WebGPU } from './interfaces'; import { ResourceBase_WebGPU } from './ResourceBase'; export declare class Buffer_WebGPU extends ResourceBase_WebGPU implements Buffer { type: ResourceType.Buffer; /** * @see https://www.w3.org/TR/webgpu/#gpubuffer */ gpuBuffer: GPUBuffer; /** * size in bytes */ size: number; view: ArrayBufferView | null; usage: BufferUsage; constructor({ id, device, descriptor, }: { id: number; device: IDevice_WebGPU; descriptor: BufferDescriptor; }); setSubData(dstByteOffset: number, src: Uint8Array, srcByteOffset?: number, byteLength?: number): void; destroy(): void; } --- dist/webgpu/ComputePass.d.ts (bundled) --- /// <reference types="@webgpu/types" /> import type { Buffer, Bindings, ComputePass, ComputePipeline } from '../api'; export declare class ComputePass_WebGPU implements ComputePass { frameCommandEncoder: GPUCommandEncoder | null; private gpuComputePassDescriptor; private gpuComputePassEncoder; /** * @see https://www.w3.org/TR/webgpu/#dom-gpucomputepassencoder-dispatchworkgroups */ dispatchWorkgroups(workgroupCountX: number, workgroupCountY?: number, workgroupCountZ?: number): void; /** * @see https://www.w3.org/TR/webgpu/#dom-gpucomputepassencoder-dispatchworkgroupsindirect */ dispatchWorkgroupsIndirect(indirectBuffer: Buffer, indirectOffset: number): void; finish(): void; /** * @see https://www.w3.org/TR/webgpu/#dom-gpucommandencoder-begincomputepass */ beginComputePass(commandEncoder: GPUCommandEncoder): void; setPipeline(pipeline_: ComputePipeline): void; setBindings(bindings_: Bindings): void; pushDebugGroup(name: string): void; popDebugGroup(): void; insertDebugMarker(markerLabel: string): void; } --- dist/webgpu/ComputePipeline.d.ts (bundled) --- /// <reference types="@webgpu/types" /> import type { ComputePipeline, ComputePipelineDescriptor } from '../api'; import { ResourceType } from '../api'; import type { IDevice_WebGPU } from './interfaces'; import { ResourceBase_WebGPU } from './ResourceBase'; export declare class ComputePipeline_WebGPU extends ResourceBase_WebGPU implements ComputePipeline { type: ResourceType.ComputePipeline; descriptor: ComputePipelineDescriptor; gpuComputePipeline: GPUComputePipeline | null; constructor({ id, device, descriptor, }: { id: number; device: IDevice_WebGPU; descriptor: ComputePipelineDescriptor; }); getBindGroupLayout(index: number): GPUBindGroupLayout; } --- dist/webgpu/Device.d.ts (bundled) --- /// <reference types="@webgpu/types" /> import type { Bindings, BindingsDescriptor, Buffer, BufferDescriptor, ComputePass, ComputePipeline, ComputePipelineDescriptor, Device, DeviceLimits, InputLayout, InputLayoutDescriptor, Program, ProgramDescriptor, QueryPool, QueryPoolType, Readback, RenderBundle, RenderPass, RenderPassDescriptor, RenderPipeline, RenderPipelineDescriptor, RenderTarget, RenderTargetDescriptor, Resource, Sampler, SamplerBinding, SamplerDescriptor, SwapChain, Texture, TextureDescriptor, VendorInfo } from '../api'; import { ClipSpaceNearZ, Format, ViewportOrigin } from '../api'; import type { glsl_compile as glsl_compile_, WGSLComposer } from '../../rust/pkg/glsl_wgsl_compiler'; import type { IDevice_WebGPU, TextureSharedDescriptor, TextureShared_WebGPU } from './interfaces'; export declare class Device_WebGPU implements SwapChain, IDevice_WebGPU { private swapChainWidth; private swapChainHeight; private swapChainFormat; private swapChainTextureUsage; private _resourceUniqueId; private renderPassPool; private computePassPool; private frameCommandEncoderPool; private fallbackTexture2D; private fallbackTexture2DDepth; private fallbackTexture2DArray; private fallbackTexture3D; private fallbackTextureCube; private fallbackSamplerFiltering; private fallbackSamplerComparison; private featureTextureCompressionBC; readonly platformString: string; readonly glslVersion = "#version 440"; readonly explicitBindingLocations = true; readonly separateSamplerTextures = true; readonly viewportOrigin = ViewportOrigin.UPPER_LEFT; readonly clipSpaceNearZ = ClipSpaceNearZ.ZERO; readonly supportsSyncPipelineCompilation: boolean; readonly supportMRT: boolean; device: GPUDevice; private canvas; private canvasContext; private glsl_compile; private WGSLComposer; constructor(adapter: GPUAdapter, device: GPUDevice, canvas: HTMLCanvasElement | OffscreenCanvas, --- dist/webgpu/InputLayout.d.ts (bundled) --- /// <reference types="@webgpu/types" /> import type { InputLayout, InputLayoutDescriptor } from '../api'; import { ResourceType } from '../api'; import typ
