UNPKG

2.83 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/webgpu/WebGPUFramebuffer.ts"],"names":["WebGPUFramebuffer","engine","options","colorTexture","depthTexture","width","height","color","colors","depth","stencil","get","destroy","resize"],"mappings":";;;IAUqBA,iB;AAMnB,6BACUC,MADV,EAEUC,OAFV,EAGE;AAAA;;AAAA,SAFQD,MAER,GAFQA,MAER;AAAA,SADQC,OACR,GADQA,OACR;AAAA,SARMC,YAQN;AAAA,SAPMC,YAON;AAAA,SANMC,KAMN,GANsB,CAMtB;AAAA,SALMC,MAKN,GALuB,CAKvB;AAAA,mBACyDJ,OADzD;AAAA,QACQG,KADR,YACQA,KADR;AAAA,QACeC,MADf,YACeA,MADf;AAAA,QACuBC,KADvB,YACuBA,KADvB;AAAA,QAC8BC,MAD9B,YAC8BA,MAD9B;AAAA,QACsCC,KADtC,YACsCA,KADtC;AAAA,QAC6CC,OAD7C,YAC6CA,OAD7C;;AAEA,QAAIH,KAAJ,EAAW;AACT,WAAKJ,YAAL,GAAoBI,KAApB;AACD;;AACD,QAAIE,KAAJ,EAAW;AACT,WAAKL,YAAL,GAAoBK,KAApB;AACD,KAPD,CAQA;;AACD;;;;0BAEY;AAAA;;AACX,aAAO;AACLF,QAAAA,KAAK,wBAAE,KAAKJ,YAAP,uDAAE,mBAAmBQ,GAAnB,EADF;AAELF,QAAAA,KAAK,wBAAE,KAAKL,YAAP,uDAAE,mBAAmBO,GAAnB;AAFF,OAAP;AAID;;;8BAEgB;AAAA;;AACf,kCAAKR,YAAL,4EAAmBS,OAAnB;AACA,kCAAKR,YAAL,4EAAmBQ,OAAnB;AACD;;;iCAEmE;AAAA,UAApDP,KAAoD,QAApDA,KAAoD;AAAA,UAA7CC,MAA6C,QAA7CA,MAA6C;;AAClE,UAAID,KAAK,KAAK,KAAKA,KAAf,IAAwBC,MAAM,KAAK,KAAKA,MAA5C,EAAoD;AAAA;;AAClD,oCAAKH,YAAL,4EAAmBU,MAAnB,CAA0B;AAAER,UAAAA,KAAK,EAALA,KAAF;AAASC,UAAAA,MAAM,EAANA;AAAT,SAA1B;AACA,oCAAKF,YAAL,4EAAmBS,MAAnB,CAA0B;AAAER,UAAAA,KAAK,EAALA,KAAF;AAASC,UAAAA,MAAM,EAANA;AAAT,SAA1B;AACD;;AACD,WAAKD,KAAL,GAAaA,KAAb;AACA,WAAKC,MAAL,GAAcA,MAAd;AACD;;;;;;SAvCkBN,iB","sourcesContent":["import {\n gl,\n IFramebuffer,\n IFramebufferInitializationOptions,\n IRenderbuffer,\n ITexture2D,\n} from '@antv/g-webgpu-core';\nimport { WebGPUEngine } from '.';\nimport WebGPUTexture2D from './WebGPUTexture2D';\n\nexport default class WebGPUFramebuffer implements IFramebuffer {\n private colorTexture: WebGPUTexture2D | null;\n private depthTexture: WebGPUTexture2D | null;\n private width: number = 0;\n private height: number = 0;\n\n constructor(\n private engine: WebGPUEngine,\n private options: IFramebufferInitializationOptions,\n ) {\n const { width, height, color, colors, depth, stencil } = options;\n if (color) {\n this.colorTexture = color as WebGPUTexture2D;\n }\n if (depth) {\n this.depthTexture = depth as WebGPUTexture2D;\n }\n // TODO: depth & stencil\n }\n\n public get() {\n return {\n color: this.colorTexture?.get(),\n depth: this.depthTexture?.get(),\n };\n }\n\n public destroy() {\n this.colorTexture?.destroy();\n this.depthTexture?.destroy();\n }\n\n public resize({ width, height }: { width: number; height: number }) {\n if (width !== this.width || height !== this.height) {\n this.colorTexture?.resize({ width, height });\n this.depthTexture?.resize({ width, height });\n }\n this.width = width;\n this.height = height;\n }\n}\n"],"file":"WebGPUFramebuffer.js"}
\No newline at end of file