UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.32 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import"../../core/has.js";import{BufferObject as r}from"./BufferObject.js";import{Usage as e,BufferType as t,PrimitiveType as i,DataType as s}from"./enums.js";class n{constructor(r){this._rctx=r,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:"#version 300 es\n precision highp float;\n\n void main(void) {\n gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0);\n }",fragment:"#version 300 es\n precision highp float;\n\n out vec4 fragColor;\n\n void main(void) {\n fragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }"}}_createHelperProgram(){const r=n.getShaderSources();return this._rctx.programCache.acquire(r.vertex,r.fragment,new Map([]))}_createIndexbuffer(){return r.createIndex(this._rctx,e.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,t.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(i.POINTS,1,s.UNSIGNED_INT,0))}dispose(){this._program.dispose(),this._indexBuffer.dispose()}get test(){}}export{n as AppleAmdDriverHelper};