@gjsify/webgl 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/canvas-webgl-widget.js +12 -0
- package/lib/esm/conformance/attribs.spec.js +296 -0
- package/lib/esm/conformance/buffers.spec.js +203 -0
- package/lib/esm/conformance/context.spec.js +302 -0
- package/lib/esm/conformance/programs.spec.js +468 -0
- package/lib/esm/conformance/rendering-basic.spec.js +136 -0
- package/lib/esm/conformance/rendering.spec.js +424 -0
- package/lib/esm/conformance/setup.js +36 -0
- package/lib/esm/conformance/state.spec.js +348 -0
- package/lib/esm/conformance/textures.spec.js +354 -0
- package/lib/esm/conformance/uniforms.spec.js +305 -0
- package/lib/esm/conformance-test.js +23 -0
- package/lib/esm/extensions/ext-color-buffer-float.js +13 -0
- package/lib/esm/extensions/ext-color-buffer-half-float.js +13 -0
- package/lib/esm/extensions/oes-texture-half-float.js +19 -0
- package/lib/esm/index.js +5 -0
- package/lib/esm/test-utils.js +65 -0
- package/lib/esm/test.js +2 -2
- package/lib/esm/webgl-buffer.js +1 -1
- package/lib/esm/webgl-context-base.js +3371 -0
- package/lib/esm/webgl-framebuffer.js +1 -1
- package/lib/esm/webgl-program.js +1 -1
- package/lib/esm/webgl-renderbuffer.js +1 -1
- package/lib/esm/webgl-rendering-context.js +95 -3253
- package/lib/esm/webgl-shader.js +2 -1
- package/lib/esm/webgl-texture.js +1 -1
- package/lib/esm/{index.spec.js → webgl1.spec.js} +2 -2
- package/lib/esm/webgl2-rendering-context.js +617 -27
- package/lib/esm/webgl2.spec.js +573 -1
- package/lib/types/conformance/setup.d.ts +14 -0
- package/lib/types/extensions/ext-blend-minmax.d.ts +2 -2
- package/lib/types/extensions/ext-color-buffer-float.d.ts +4 -0
- package/lib/types/extensions/ext-color-buffer-half-float.d.ts +4 -0
- package/lib/types/extensions/ext-texture-filter-anisotropic.d.ts +2 -2
- package/lib/types/extensions/oes-element-index-unit.d.ts +2 -2
- package/lib/types/extensions/oes-standard-derivatives.d.ts +2 -2
- package/lib/types/extensions/oes-texture-float-linear.d.ts +2 -2
- package/lib/types/extensions/oes-texture-float.d.ts +2 -2
- package/lib/types/extensions/oes-texture-half-float.d.ts +5 -0
- package/lib/types/extensions/stackgl-destroy-context.d.ts +3 -3
- package/lib/types/extensions/stackgl-resize-drawing-buffer.d.ts +3 -3
- package/lib/types/index.d.ts +1 -0
- package/lib/types/test-utils.d.ts +24 -0
- package/lib/types/types/extension.d.ts +2 -2
- package/lib/types/utils.d.ts +9 -10
- package/lib/types/webgl-buffer.d.ts +3 -3
- package/lib/types/webgl-context-base.d.ts +267 -0
- package/lib/types/webgl-framebuffer.d.ts +3 -3
- package/lib/types/webgl-program.d.ts +3 -3
- package/lib/types/webgl-renderbuffer.d.ts +3 -3
- package/lib/types/webgl-rendering-context.d.ts +5 -250
- package/lib/types/webgl-shader.d.ts +4 -3
- package/lib/types/webgl-texture-unit.d.ts +3 -3
- package/lib/types/webgl-texture.d.ts +3 -3
- package/lib/types/webgl-vertex-attribute.d.ts +5 -5
- package/lib/types/webgl2-rendering-context.d.ts +95 -6
- package/package.json +13 -11
- package/prebuilds/linux-x86_64/Gwebgl-0.1.typelib +0 -0
- package/prebuilds/linux-x86_64/libgwebgl.so +0 -0
package/lib/esm/webgl2.spec.js
CHANGED
|
@@ -5,7 +5,11 @@ import {
|
|
|
5
5
|
drawTriangle,
|
|
6
6
|
readPixel,
|
|
7
7
|
makeTestFBO,
|
|
8
|
-
destroyTestFBO
|
|
8
|
+
destroyTestFBO,
|
|
9
|
+
makeTestFBOFloat,
|
|
10
|
+
makeTestFBOWithDepthTexture,
|
|
11
|
+
TEXTURE_VS_300,
|
|
12
|
+
TEXTURE_FS_300
|
|
9
13
|
} from "./test-utils.js";
|
|
10
14
|
import GLib from "@girs/glib-2.0";
|
|
11
15
|
import Gtk from "@girs/gtk-4.0";
|
|
@@ -570,6 +574,574 @@ var webgl2_spec_default = async () => {
|
|
|
570
574
|
}
|
|
571
575
|
});
|
|
572
576
|
});
|
|
577
|
+
await describe("WebGL2 extensions", async () => {
|
|
578
|
+
beforeEach(async () => {
|
|
579
|
+
glArea.make_current();
|
|
580
|
+
});
|
|
581
|
+
await it("supports EXT_color_buffer_float", async () => {
|
|
582
|
+
const ext = gl2.getExtension("EXT_color_buffer_float");
|
|
583
|
+
expect(ext).toBeTruthy();
|
|
584
|
+
});
|
|
585
|
+
await it("supports EXT_color_buffer_half_float", async () => {
|
|
586
|
+
const ext = gl2.getExtension("EXT_color_buffer_half_float");
|
|
587
|
+
expect(ext).toBeTruthy();
|
|
588
|
+
});
|
|
589
|
+
await it("supports OES_texture_half_float", async () => {
|
|
590
|
+
const ext = gl2.getExtension("OES_texture_half_float");
|
|
591
|
+
expect(ext).toBeTruthy();
|
|
592
|
+
});
|
|
593
|
+
await it("OES_texture_half_float exposes HALF_FLOAT_OES constant", async () => {
|
|
594
|
+
const ext = gl2.getExtension("OES_texture_half_float");
|
|
595
|
+
expect(ext).toBeTruthy();
|
|
596
|
+
expect(ext.HALF_FLOAT_OES).toBe(36193);
|
|
597
|
+
});
|
|
598
|
+
});
|
|
599
|
+
await describe("WebGL2 renderbufferStorage formats", async () => {
|
|
600
|
+
beforeEach(async () => {
|
|
601
|
+
glArea.make_current();
|
|
602
|
+
});
|
|
603
|
+
async function testRbFormat(internalFormat) {
|
|
604
|
+
const rb = gl2.createRenderbuffer();
|
|
605
|
+
gl2.bindRenderbuffer(gl2.RENDERBUFFER, rb);
|
|
606
|
+
gl2.renderbufferStorage(gl2.RENDERBUFFER, internalFormat, 64, 64);
|
|
607
|
+
const err = gl2.getError();
|
|
608
|
+
gl2.deleteRenderbuffer(rb);
|
|
609
|
+
return err;
|
|
610
|
+
}
|
|
611
|
+
await it("accepts RGBA8 (0x8058)", async () => {
|
|
612
|
+
expect(await testRbFormat(32856)).toBe(gl2.NO_ERROR);
|
|
613
|
+
});
|
|
614
|
+
await it("accepts DEPTH_COMPONENT24 (0x81A6)", async () => {
|
|
615
|
+
expect(await testRbFormat(33190)).toBe(gl2.NO_ERROR);
|
|
616
|
+
});
|
|
617
|
+
await it("accepts DEPTH24_STENCIL8 (0x88F0)", async () => {
|
|
618
|
+
expect(await testRbFormat(35056)).toBe(gl2.NO_ERROR);
|
|
619
|
+
});
|
|
620
|
+
});
|
|
621
|
+
await describe("WebGL2 float render target", async () => {
|
|
622
|
+
beforeEach(async () => {
|
|
623
|
+
glArea.make_current();
|
|
624
|
+
});
|
|
625
|
+
await it("can create RGBA16F texture and attach to FBO", async () => {
|
|
626
|
+
const RGBA16F = 34842;
|
|
627
|
+
const HALF_FLOAT = 5131;
|
|
628
|
+
const tex = gl2.createTexture();
|
|
629
|
+
gl2.bindTexture(gl2.TEXTURE_2D, tex);
|
|
630
|
+
gl2.texImage2D(gl2.TEXTURE_2D, 0, RGBA16F, 64, 64, 0, gl2.RGBA, HALF_FLOAT, null);
|
|
631
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
632
|
+
const fbo = gl2.createFramebuffer();
|
|
633
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fbo);
|
|
634
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, tex, 0);
|
|
635
|
+
const status = gl2.checkFramebufferStatus(gl2.FRAMEBUFFER);
|
|
636
|
+
expect(status).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
637
|
+
gl2.clearColor(1, 0, 0, 1);
|
|
638
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
639
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
640
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
641
|
+
gl2.deleteFramebuffer(fbo);
|
|
642
|
+
gl2.deleteTexture(tex);
|
|
643
|
+
});
|
|
644
|
+
await it("can create RGBA8 renderbuffer FBO", async () => {
|
|
645
|
+
const RGBA8 = 32856;
|
|
646
|
+
const rb = gl2.createRenderbuffer();
|
|
647
|
+
gl2.bindRenderbuffer(gl2.RENDERBUFFER, rb);
|
|
648
|
+
gl2.renderbufferStorage(gl2.RENDERBUFFER, RGBA8, 64, 64);
|
|
649
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
650
|
+
const fbo = gl2.createFramebuffer();
|
|
651
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fbo);
|
|
652
|
+
gl2.framebufferRenderbuffer(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.RENDERBUFFER, rb);
|
|
653
|
+
const status = gl2.checkFramebufferStatus(gl2.FRAMEBUFFER);
|
|
654
|
+
expect(status).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
655
|
+
gl2.clearColor(0, 1, 0, 1);
|
|
656
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
657
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
658
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
659
|
+
gl2.deleteFramebuffer(fbo);
|
|
660
|
+
gl2.deleteRenderbuffer(rb);
|
|
661
|
+
});
|
|
662
|
+
});
|
|
663
|
+
await describe("WebGL2 GLSL 1.0 compatibility", async () => {
|
|
664
|
+
beforeEach(async () => {
|
|
665
|
+
glArea.make_current();
|
|
666
|
+
});
|
|
667
|
+
await it("compiles versionless shaders with attribute/varying", async () => {
|
|
668
|
+
const vs = "attribute vec2 position;\nvarying vec2 vUv;\nvoid main() { vUv = position; gl_Position = vec4(position, 0.0, 1.0); }";
|
|
669
|
+
const fs = "precision mediump float;\nvarying vec2 vUv;\nvoid main() { gl_FragColor = vec4(vUv, 0.0, 1.0); }";
|
|
670
|
+
const prog = makeProgram(gl2, vs, fs);
|
|
671
|
+
expect(prog).toBeTruthy();
|
|
672
|
+
if (prog) {
|
|
673
|
+
expect(gl2.getProgramParameter(prog, gl2.LINK_STATUS)).toBeTruthy();
|
|
674
|
+
gl2.deleteProgram(prog);
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
await describe("WebGL2 textured rendering", async () => {
|
|
679
|
+
beforeEach(async () => {
|
|
680
|
+
glArea.make_current();
|
|
681
|
+
});
|
|
682
|
+
await it("samples a 2x2 RGBA texture to produce red output", async () => {
|
|
683
|
+
const fbo = makeTestFBO(gl2, 4, 4);
|
|
684
|
+
const tex = gl2.createTexture();
|
|
685
|
+
gl2.bindTexture(gl2.TEXTURE_2D, tex);
|
|
686
|
+
const pixels = new Uint8Array([
|
|
687
|
+
255,
|
|
688
|
+
0,
|
|
689
|
+
0,
|
|
690
|
+
255,
|
|
691
|
+
255,
|
|
692
|
+
0,
|
|
693
|
+
0,
|
|
694
|
+
255,
|
|
695
|
+
255,
|
|
696
|
+
0,
|
|
697
|
+
0,
|
|
698
|
+
255,
|
|
699
|
+
255,
|
|
700
|
+
0,
|
|
701
|
+
0,
|
|
702
|
+
255
|
|
703
|
+
]);
|
|
704
|
+
gl2.texImage2D(gl2.TEXTURE_2D, 0, gl2.RGBA, 2, 2, 0, gl2.RGBA, gl2.UNSIGNED_BYTE, pixels);
|
|
705
|
+
gl2.texParameteri(gl2.TEXTURE_2D, gl2.TEXTURE_MIN_FILTER, gl2.NEAREST);
|
|
706
|
+
gl2.texParameteri(gl2.TEXTURE_2D, gl2.TEXTURE_MAG_FILTER, gl2.NEAREST);
|
|
707
|
+
const prog = makeProgram(gl2, TEXTURE_VS_300, TEXTURE_FS_300);
|
|
708
|
+
expect(gl2.getProgramParameter(prog, gl2.LINK_STATUS)).toBeTruthy();
|
|
709
|
+
gl2.useProgram(prog);
|
|
710
|
+
const loc = gl2.getUniformLocation(prog, "uTexture");
|
|
711
|
+
gl2.uniform1i(loc, 0);
|
|
712
|
+
gl2.activeTexture(gl2.TEXTURE0);
|
|
713
|
+
gl2.bindTexture(gl2.TEXTURE_2D, tex);
|
|
714
|
+
drawTriangle(gl2);
|
|
715
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
716
|
+
const p = readPixel(gl2, 0, 0);
|
|
717
|
+
expect(p[0]).toBe(255);
|
|
718
|
+
expect(p[1]).toBe(0);
|
|
719
|
+
expect(p[2]).toBe(0);
|
|
720
|
+
expect(p[3]).toBe(255);
|
|
721
|
+
gl2.deleteTexture(tex);
|
|
722
|
+
gl2.deleteProgram(prog);
|
|
723
|
+
destroyTestFBO(gl2, fbo);
|
|
724
|
+
});
|
|
725
|
+
});
|
|
726
|
+
await describe("WebGL2 FBO chain (post-processing)", async () => {
|
|
727
|
+
beforeEach(async () => {
|
|
728
|
+
glArea.make_current();
|
|
729
|
+
});
|
|
730
|
+
await it("renders green to FBO1, samples FBO1 texture into FBO2", async () => {
|
|
731
|
+
const VS = [
|
|
732
|
+
"#version 300 es",
|
|
733
|
+
"in vec2 position;",
|
|
734
|
+
"void main() { gl_Position = vec4(position,0.0,1.0); }"
|
|
735
|
+
].join("\n");
|
|
736
|
+
const FS_GREEN = [
|
|
737
|
+
"#version 300 es",
|
|
738
|
+
"precision mediump float;",
|
|
739
|
+
"out vec4 c;",
|
|
740
|
+
"void main() { c = vec4(0.0,1.0,0.0,1.0); }"
|
|
741
|
+
].join("\n");
|
|
742
|
+
const fbo1 = makeTestFBO(gl2, 4, 4);
|
|
743
|
+
const status1 = gl2.checkFramebufferStatus(gl2.FRAMEBUFFER);
|
|
744
|
+
expect(status1).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
745
|
+
const progGreen = makeProgram(gl2, VS, FS_GREEN);
|
|
746
|
+
gl2.useProgram(progGreen);
|
|
747
|
+
gl2.clearColor(0, 0, 0, 1);
|
|
748
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
749
|
+
drawTriangle(gl2);
|
|
750
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
751
|
+
const p1 = readPixel(gl2, 0, 0);
|
|
752
|
+
expect(p1[1]).toBe(255);
|
|
753
|
+
const fbo2 = makeTestFBO(gl2, 4, 4);
|
|
754
|
+
const status2 = gl2.checkFramebufferStatus(gl2.FRAMEBUFFER);
|
|
755
|
+
expect(status2).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
756
|
+
const progTex = makeProgram(gl2, TEXTURE_VS_300, TEXTURE_FS_300);
|
|
757
|
+
gl2.useProgram(progTex);
|
|
758
|
+
const texLoc = gl2.getUniformLocation(progTex, "uTexture");
|
|
759
|
+
gl2.uniform1i(texLoc, 0);
|
|
760
|
+
gl2.activeTexture(gl2.TEXTURE0);
|
|
761
|
+
gl2.bindTexture(gl2.TEXTURE_2D, fbo1.colorTex);
|
|
762
|
+
gl2.clearColor(0, 0, 0, 1);
|
|
763
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
764
|
+
drawTriangle(gl2);
|
|
765
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
766
|
+
const p2 = readPixel(gl2, 0, 0);
|
|
767
|
+
expect(p2[1]).toBe(255);
|
|
768
|
+
gl2.deleteProgram(progGreen);
|
|
769
|
+
gl2.deleteProgram(progTex);
|
|
770
|
+
destroyTestFBO(gl2, fbo2);
|
|
771
|
+
destroyTestFBO(gl2, fbo1);
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
await describe("WebGL2 half-float FBO chain", async () => {
|
|
775
|
+
beforeEach(async () => {
|
|
776
|
+
glArea.make_current();
|
|
777
|
+
});
|
|
778
|
+
await it("renders green to RGBA16F FBO, samples into RGBA8 FBO", async () => {
|
|
779
|
+
const VS = [
|
|
780
|
+
"#version 300 es",
|
|
781
|
+
"in vec2 position;",
|
|
782
|
+
"void main() { gl_Position = vec4(position,0.0,1.0); }"
|
|
783
|
+
].join("\n");
|
|
784
|
+
const FS_GREEN = [
|
|
785
|
+
"#version 300 es",
|
|
786
|
+
"precision mediump float;",
|
|
787
|
+
"out vec4 c;",
|
|
788
|
+
"void main() { c = vec4(0.0,1.0,0.0,1.0); }"
|
|
789
|
+
].join("\n");
|
|
790
|
+
const fboFloat = makeTestFBOFloat(gl2, 4, 4);
|
|
791
|
+
const status1 = gl2.checkFramebufferStatus(gl2.FRAMEBUFFER);
|
|
792
|
+
expect(status1).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
793
|
+
const progGreen = makeProgram(gl2, VS, FS_GREEN);
|
|
794
|
+
gl2.useProgram(progGreen);
|
|
795
|
+
gl2.clearColor(0, 0, 0, 1);
|
|
796
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
797
|
+
drawTriangle(gl2);
|
|
798
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
799
|
+
const fbo2 = makeTestFBO(gl2, 4, 4);
|
|
800
|
+
const progTex = makeProgram(gl2, TEXTURE_VS_300, TEXTURE_FS_300);
|
|
801
|
+
gl2.useProgram(progTex);
|
|
802
|
+
const texLoc = gl2.getUniformLocation(progTex, "uTexture");
|
|
803
|
+
gl2.uniform1i(texLoc, 0);
|
|
804
|
+
gl2.activeTexture(gl2.TEXTURE0);
|
|
805
|
+
gl2.bindTexture(gl2.TEXTURE_2D, fboFloat.colorTex);
|
|
806
|
+
gl2.clearColor(0, 0, 0, 1);
|
|
807
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
808
|
+
drawTriangle(gl2);
|
|
809
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
810
|
+
const p = readPixel(gl2, 0, 0);
|
|
811
|
+
expect(p[1]).toBe(255);
|
|
812
|
+
gl2.deleteProgram(progGreen);
|
|
813
|
+
gl2.deleteProgram(progTex);
|
|
814
|
+
destroyTestFBO(gl2, fbo2);
|
|
815
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fboFloat.fb);
|
|
816
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, null, 0);
|
|
817
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
818
|
+
gl2.deleteTexture(fboFloat.colorTex);
|
|
819
|
+
gl2.deleteFramebuffer(fboFloat.fb);
|
|
820
|
+
});
|
|
821
|
+
});
|
|
822
|
+
await describe("WebGL2 depth texture FBO", async () => {
|
|
823
|
+
beforeEach(async () => {
|
|
824
|
+
glArea.make_current();
|
|
825
|
+
});
|
|
826
|
+
await it("creates FBO with depth texture and renders with depth test", async () => {
|
|
827
|
+
const fbo = makeTestFBOWithDepthTexture(gl2, 4, 4);
|
|
828
|
+
const status = gl2.checkFramebufferStatus(gl2.FRAMEBUFFER);
|
|
829
|
+
expect(status).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
830
|
+
const VS = [
|
|
831
|
+
"#version 300 es",
|
|
832
|
+
"in vec2 position;",
|
|
833
|
+
"uniform float uDepth;",
|
|
834
|
+
"void main() { gl_Position = vec4(position, uDepth, 1.0); }"
|
|
835
|
+
].join("\n");
|
|
836
|
+
const FS = [
|
|
837
|
+
"#version 300 es",
|
|
838
|
+
"precision mediump float;",
|
|
839
|
+
"uniform vec4 uColor;",
|
|
840
|
+
"out vec4 c;",
|
|
841
|
+
"void main() { c = uColor; }"
|
|
842
|
+
].join("\n");
|
|
843
|
+
const prog = makeProgram(gl2, VS, FS);
|
|
844
|
+
gl2.useProgram(prog);
|
|
845
|
+
gl2.enable(gl2.DEPTH_TEST);
|
|
846
|
+
gl2.depthFunc(gl2.LESS);
|
|
847
|
+
gl2.clearColor(0, 0, 0, 1);
|
|
848
|
+
gl2.clearDepth(1);
|
|
849
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT | gl2.DEPTH_BUFFER_BIT);
|
|
850
|
+
const colorLoc = gl2.getUniformLocation(prog, "uColor");
|
|
851
|
+
const depthLoc = gl2.getUniformLocation(prog, "uDepth");
|
|
852
|
+
gl2.uniform4f(colorLoc, 1, 0, 0, 1);
|
|
853
|
+
gl2.uniform1f(depthLoc, 0.5);
|
|
854
|
+
drawTriangle(gl2);
|
|
855
|
+
gl2.uniform4f(colorLoc, 0, 1, 0, 1);
|
|
856
|
+
gl2.uniform1f(depthLoc, 0);
|
|
857
|
+
drawTriangle(gl2);
|
|
858
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
859
|
+
const p = readPixel(gl2, 0, 0);
|
|
860
|
+
expect(p[1]).toBe(255);
|
|
861
|
+
gl2.disable(gl2.DEPTH_TEST);
|
|
862
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fbo.fb);
|
|
863
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, null, 0);
|
|
864
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.DEPTH_ATTACHMENT, gl2.TEXTURE_2D, null, 0);
|
|
865
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
866
|
+
gl2.deleteTexture(fbo.colorTex);
|
|
867
|
+
gl2.deleteTexture(fbo.depthTex);
|
|
868
|
+
gl2.deleteFramebuffer(fbo.fb);
|
|
869
|
+
gl2.deleteProgram(prog);
|
|
870
|
+
});
|
|
871
|
+
});
|
|
872
|
+
await describe("WebGL2 generateMipmap", async () => {
|
|
873
|
+
beforeEach(async () => {
|
|
874
|
+
glArea.make_current();
|
|
875
|
+
});
|
|
876
|
+
await it("generates mipmaps for a 4x4 texture without error", async () => {
|
|
877
|
+
const tex = gl2.createTexture();
|
|
878
|
+
gl2.bindTexture(gl2.TEXTURE_2D, tex);
|
|
879
|
+
const data = new Uint8Array(4 * 4 * 4);
|
|
880
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
881
|
+
data[i] = 255;
|
|
882
|
+
data[i + 3] = 255;
|
|
883
|
+
}
|
|
884
|
+
gl2.texImage2D(gl2.TEXTURE_2D, 0, gl2.RGBA, 4, 4, 0, gl2.RGBA, gl2.UNSIGNED_BYTE, data);
|
|
885
|
+
gl2.generateMipmap(gl2.TEXTURE_2D);
|
|
886
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
887
|
+
gl2.texParameteri(gl2.TEXTURE_2D, gl2.TEXTURE_MIN_FILTER, gl2.LINEAR_MIPMAP_LINEAR);
|
|
888
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
889
|
+
const fbo = makeTestFBO(gl2, 4, 4);
|
|
890
|
+
const prog = makeProgram(gl2, TEXTURE_VS_300, TEXTURE_FS_300);
|
|
891
|
+
gl2.useProgram(prog);
|
|
892
|
+
gl2.bindTexture(gl2.TEXTURE_2D, tex);
|
|
893
|
+
gl2.uniform1i(gl2.getUniformLocation(prog, "uTexture"), 0);
|
|
894
|
+
drawTriangle(gl2);
|
|
895
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
896
|
+
const p = readPixel(gl2, 0, 0);
|
|
897
|
+
expect(p[0]).toBeGreaterThan(200);
|
|
898
|
+
gl2.deleteTexture(tex);
|
|
899
|
+
gl2.deleteProgram(prog);
|
|
900
|
+
destroyTestFBO(gl2, fbo);
|
|
901
|
+
});
|
|
902
|
+
});
|
|
903
|
+
await describe("WebGL2 cubemap texture", async () => {
|
|
904
|
+
beforeEach(async () => {
|
|
905
|
+
glArea.make_current();
|
|
906
|
+
});
|
|
907
|
+
await it("creates cubemap and verifies FBO attachment", async () => {
|
|
908
|
+
const tex = gl2.createTexture();
|
|
909
|
+
gl2.bindTexture(gl2.TEXTURE_CUBE_MAP, tex);
|
|
910
|
+
const faces = [
|
|
911
|
+
gl2.TEXTURE_CUBE_MAP_POSITIVE_X,
|
|
912
|
+
gl2.TEXTURE_CUBE_MAP_NEGATIVE_X,
|
|
913
|
+
gl2.TEXTURE_CUBE_MAP_POSITIVE_Y,
|
|
914
|
+
gl2.TEXTURE_CUBE_MAP_NEGATIVE_Y,
|
|
915
|
+
gl2.TEXTURE_CUBE_MAP_POSITIVE_Z,
|
|
916
|
+
gl2.TEXTURE_CUBE_MAP_NEGATIVE_Z
|
|
917
|
+
];
|
|
918
|
+
const colors = [
|
|
919
|
+
[255, 0, 0, 255],
|
|
920
|
+
// +X = red
|
|
921
|
+
[0, 255, 0, 255],
|
|
922
|
+
// -X = green
|
|
923
|
+
[0, 0, 255, 255],
|
|
924
|
+
// +Y = blue
|
|
925
|
+
[255, 255, 0, 255],
|
|
926
|
+
// -Y = yellow
|
|
927
|
+
[255, 0, 255, 255],
|
|
928
|
+
// +Z = magenta
|
|
929
|
+
[0, 255, 255, 255]
|
|
930
|
+
// -Z = cyan
|
|
931
|
+
];
|
|
932
|
+
for (let i = 0; i < 6; i++) {
|
|
933
|
+
gl2.texImage2D(
|
|
934
|
+
faces[i],
|
|
935
|
+
0,
|
|
936
|
+
gl2.RGBA,
|
|
937
|
+
1,
|
|
938
|
+
1,
|
|
939
|
+
0,
|
|
940
|
+
gl2.RGBA,
|
|
941
|
+
gl2.UNSIGNED_BYTE,
|
|
942
|
+
new Uint8Array(colors[i])
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
946
|
+
gl2.texParameteri(gl2.TEXTURE_CUBE_MAP, gl2.TEXTURE_MIN_FILTER, gl2.NEAREST);
|
|
947
|
+
gl2.texParameteri(gl2.TEXTURE_CUBE_MAP, gl2.TEXTURE_MAG_FILTER, gl2.NEAREST);
|
|
948
|
+
const fb = gl2.createFramebuffer();
|
|
949
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fb);
|
|
950
|
+
gl2.framebufferTexture2D(
|
|
951
|
+
gl2.FRAMEBUFFER,
|
|
952
|
+
gl2.COLOR_ATTACHMENT0,
|
|
953
|
+
gl2.TEXTURE_CUBE_MAP_POSITIVE_X,
|
|
954
|
+
tex,
|
|
955
|
+
0
|
|
956
|
+
);
|
|
957
|
+
const status = gl2.checkFramebufferStatus(gl2.FRAMEBUFFER);
|
|
958
|
+
expect(status).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
959
|
+
gl2.viewport(0, 0, 1, 1);
|
|
960
|
+
gl2.clearColor(0, 1, 1, 1);
|
|
961
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
962
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
963
|
+
const p = readPixel(gl2, 0, 0);
|
|
964
|
+
expect(p[0]).toBe(0);
|
|
965
|
+
expect(p[1]).toBe(255);
|
|
966
|
+
expect(p[2]).toBe(255);
|
|
967
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
968
|
+
gl2.deleteFramebuffer(fb);
|
|
969
|
+
gl2.deleteTexture(tex);
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
await describe("WebGL2 READ_FRAMEBUFFER / DRAW_FRAMEBUFFER", async () => {
|
|
973
|
+
beforeEach(async () => {
|
|
974
|
+
glArea.make_current();
|
|
975
|
+
});
|
|
976
|
+
await it("bindFramebuffer accepts READ_FRAMEBUFFER and DRAW_FRAMEBUFFER", async () => {
|
|
977
|
+
const fb1 = gl2.createFramebuffer();
|
|
978
|
+
const fb2 = gl2.createFramebuffer();
|
|
979
|
+
gl2.bindFramebuffer(36008, fb1);
|
|
980
|
+
gl2.bindFramebuffer(36009, fb2);
|
|
981
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
982
|
+
expect(gl2.getParameter(
|
|
983
|
+
36010
|
|
984
|
+
/* READ_FRAMEBUFFER_BINDING */
|
|
985
|
+
)).toBe(fb1);
|
|
986
|
+
expect(gl2.getParameter(
|
|
987
|
+
36006
|
|
988
|
+
/* DRAW_FRAMEBUFFER_BINDING */
|
|
989
|
+
)).toBe(fb2);
|
|
990
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
991
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
992
|
+
gl2.deleteFramebuffer(fb1);
|
|
993
|
+
gl2.deleteFramebuffer(fb2);
|
|
994
|
+
});
|
|
995
|
+
});
|
|
996
|
+
await describe("WebGL2 RGBA8 FBO (sized internal format)", async () => {
|
|
997
|
+
beforeEach(async () => {
|
|
998
|
+
glArea.make_current();
|
|
999
|
+
});
|
|
1000
|
+
await it("renders solid color to RGBA8 FBO, readPixels confirms result", async () => {
|
|
1001
|
+
const RGBA8 = 32856;
|
|
1002
|
+
const w = 4;
|
|
1003
|
+
const h = 4;
|
|
1004
|
+
const fb = gl2.createFramebuffer();
|
|
1005
|
+
const tex = gl2.createTexture();
|
|
1006
|
+
gl2.bindTexture(gl2.TEXTURE_2D, tex);
|
|
1007
|
+
gl2.texImage2D(gl2.TEXTURE_2D, 0, RGBA8, w, h, 0, gl2.RGBA, gl2.UNSIGNED_BYTE, null);
|
|
1008
|
+
gl2.texParameteri(gl2.TEXTURE_2D, gl2.TEXTURE_MIN_FILTER, gl2.NEAREST);
|
|
1009
|
+
gl2.texParameteri(gl2.TEXTURE_2D, gl2.TEXTURE_MAG_FILTER, gl2.NEAREST);
|
|
1010
|
+
gl2.bindTexture(gl2.TEXTURE_2D, null);
|
|
1011
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fb);
|
|
1012
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, tex, 0);
|
|
1013
|
+
expect(gl2.checkFramebufferStatus(gl2.FRAMEBUFFER)).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
1014
|
+
gl2.viewport(0, 0, w, h);
|
|
1015
|
+
gl2.clearColor(0, 1, 0, 1);
|
|
1016
|
+
gl2.clear(gl2.COLOR_BUFFER_BIT);
|
|
1017
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
1018
|
+
const pixels = new Uint8Array(4);
|
|
1019
|
+
gl2.readPixels(0, 0, 1, 1, gl2.RGBA, gl2.UNSIGNED_BYTE, pixels);
|
|
1020
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
1021
|
+
expect(pixels[0]).toBe(0);
|
|
1022
|
+
expect(pixels[1]).toBe(255);
|
|
1023
|
+
expect(pixels[2]).toBe(0);
|
|
1024
|
+
expect(pixels[3]).toBe(255);
|
|
1025
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fb);
|
|
1026
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, null, 0);
|
|
1027
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
1028
|
+
gl2.deleteTexture(tex);
|
|
1029
|
+
gl2.deleteFramebuffer(fb);
|
|
1030
|
+
});
|
|
1031
|
+
});
|
|
1032
|
+
await describe("WebGL2 RGBA16F FBO draw + FLOAT readPixels", async () => {
|
|
1033
|
+
beforeEach(async () => {
|
|
1034
|
+
glArea.make_current();
|
|
1035
|
+
});
|
|
1036
|
+
await it("renders red triangle to RGBA16F FBO, reads back as FLOAT", async () => {
|
|
1037
|
+
const gl = gl2;
|
|
1038
|
+
const vs = `#version 300 es
|
|
1039
|
+
in vec2 position;
|
|
1040
|
+
void main(){gl_Position=vec4(position,0.,1.);}`;
|
|
1041
|
+
const fs = `#version 300 es
|
|
1042
|
+
precision mediump float;
|
|
1043
|
+
out vec4 c;
|
|
1044
|
+
void main(){c=vec4(1.,0.,0.,1.);}`;
|
|
1045
|
+
const prog = makeProgram(gl, vs, fs);
|
|
1046
|
+
expect(gl2.getProgramParameter(prog, gl2.LINK_STATUS)).toBeTruthy();
|
|
1047
|
+
const fbo = makeTestFBOFloat(gl2);
|
|
1048
|
+
gl2.useProgram(prog);
|
|
1049
|
+
drawTriangle(gl);
|
|
1050
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
1051
|
+
const pixels = new Float32Array(4);
|
|
1052
|
+
gl2.readPixels(0, 0, 1, 1, gl2.RGBA, gl2.FLOAT, pixels);
|
|
1053
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
1054
|
+
expect(Math.abs(pixels[0] - 1) < 0.01).toBeTruthy();
|
|
1055
|
+
expect(Math.abs(pixels[1] - 0) < 0.01).toBeTruthy();
|
|
1056
|
+
expect(Math.abs(pixels[2] - 0) < 0.01).toBeTruthy();
|
|
1057
|
+
expect(Math.abs(pixels[3] - 1) < 0.01).toBeTruthy();
|
|
1058
|
+
gl2.useProgram(null);
|
|
1059
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fbo.fb);
|
|
1060
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, null, 0);
|
|
1061
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
1062
|
+
gl2.deleteTexture(fbo.colorTex);
|
|
1063
|
+
gl2.deleteFramebuffer(fbo.fb);
|
|
1064
|
+
gl2.deleteProgram(prog);
|
|
1065
|
+
});
|
|
1066
|
+
});
|
|
1067
|
+
await describe("WebGL2 MRT \u2014 writes to COLOR_ATTACHMENT0 and COLOR_ATTACHMENT1", async () => {
|
|
1068
|
+
beforeEach(async () => {
|
|
1069
|
+
glArea.make_current();
|
|
1070
|
+
});
|
|
1071
|
+
await it("MRT shader writes different colors to CA0 and CA1", async () => {
|
|
1072
|
+
const gl = gl2;
|
|
1073
|
+
const w = 4;
|
|
1074
|
+
const h = 4;
|
|
1075
|
+
const vs = `#version 300 es
|
|
1076
|
+
in vec2 position;
|
|
1077
|
+
void main(){gl_Position=vec4(position,0.,1.);}`;
|
|
1078
|
+
const fs = `#version 300 es
|
|
1079
|
+
precision mediump float;
|
|
1080
|
+
layout(location=0) out vec4 c0;
|
|
1081
|
+
layout(location=1) out vec4 c1;
|
|
1082
|
+
void main(){c0=vec4(1.,0.,0.,1.);c1=vec4(0.,0.,1.,1.);}`;
|
|
1083
|
+
const prog = makeProgram(gl, vs, fs);
|
|
1084
|
+
expect(gl2.getProgramParameter(prog, gl2.LINK_STATUS)).toBeTruthy();
|
|
1085
|
+
const fb = gl2.createFramebuffer();
|
|
1086
|
+
const tex0 = gl2.createTexture();
|
|
1087
|
+
const tex1 = gl2.createTexture();
|
|
1088
|
+
for (const [tex, attachment] of [[tex0, gl2.COLOR_ATTACHMENT0], [tex1, gl2.COLOR_ATTACHMENT0 + 1]]) {
|
|
1089
|
+
gl2.bindTexture(gl2.TEXTURE_2D, tex);
|
|
1090
|
+
gl2.texImage2D(gl2.TEXTURE_2D, 0, gl2.RGBA, w, h, 0, gl2.RGBA, gl2.UNSIGNED_BYTE, null);
|
|
1091
|
+
gl2.texParameteri(gl2.TEXTURE_2D, gl2.TEXTURE_MIN_FILTER, gl2.NEAREST);
|
|
1092
|
+
gl2.texParameteri(gl2.TEXTURE_2D, gl2.TEXTURE_MAG_FILTER, gl2.NEAREST);
|
|
1093
|
+
gl2.bindTexture(gl2.TEXTURE_2D, null);
|
|
1094
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fb);
|
|
1095
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, attachment, gl2.TEXTURE_2D, tex, 0);
|
|
1096
|
+
}
|
|
1097
|
+
expect(gl2.checkFramebufferStatus(gl2.FRAMEBUFFER)).toBe(gl2.FRAMEBUFFER_COMPLETE);
|
|
1098
|
+
gl2.viewport(0, 0, w, h);
|
|
1099
|
+
gl2.drawBuffers([gl2.COLOR_ATTACHMENT0, gl2.COLOR_ATTACHMENT0 + 1]);
|
|
1100
|
+
gl2.useProgram(prog);
|
|
1101
|
+
drawTriangle(gl);
|
|
1102
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
1103
|
+
const fbRead0 = gl2.createFramebuffer();
|
|
1104
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fbRead0);
|
|
1105
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, tex0, 0);
|
|
1106
|
+
const p0 = new Uint8Array(4);
|
|
1107
|
+
gl2.readPixels(0, 0, 1, 1, gl2.RGBA, gl2.UNSIGNED_BYTE, p0);
|
|
1108
|
+
expect(p0[0]).toBe(255);
|
|
1109
|
+
expect(p0[1]).toBe(0);
|
|
1110
|
+
expect(p0[2]).toBe(0);
|
|
1111
|
+
const fbRead1 = gl2.createFramebuffer();
|
|
1112
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, fbRead1);
|
|
1113
|
+
gl2.framebufferTexture2D(gl2.FRAMEBUFFER, gl2.COLOR_ATTACHMENT0, gl2.TEXTURE_2D, tex1, 0);
|
|
1114
|
+
const p1 = new Uint8Array(4);
|
|
1115
|
+
gl2.readPixels(0, 0, 1, 1, gl2.RGBA, gl2.UNSIGNED_BYTE, p1);
|
|
1116
|
+
expect(p1[0]).toBe(0);
|
|
1117
|
+
expect(p1[1]).toBe(0);
|
|
1118
|
+
expect(p1[2]).toBe(255);
|
|
1119
|
+
gl2.useProgram(null);
|
|
1120
|
+
gl2.bindFramebuffer(gl2.FRAMEBUFFER, null);
|
|
1121
|
+
gl2.deleteTexture(tex0);
|
|
1122
|
+
gl2.deleteTexture(tex1);
|
|
1123
|
+
gl2.deleteFramebuffer(fb);
|
|
1124
|
+
gl2.deleteFramebuffer(fbRead0);
|
|
1125
|
+
gl2.deleteFramebuffer(fbRead1);
|
|
1126
|
+
gl2.deleteProgram(prog);
|
|
1127
|
+
});
|
|
1128
|
+
});
|
|
1129
|
+
await describe("WebGL2 bufferSubData with UNIFORM_BUFFER", async () => {
|
|
1130
|
+
beforeEach(async () => {
|
|
1131
|
+
glArea.make_current();
|
|
1132
|
+
});
|
|
1133
|
+
await it("bufferSubData with UNIFORM_BUFFER target returns NO_ERROR", async () => {
|
|
1134
|
+
const UNIFORM_BUFFER = 35345;
|
|
1135
|
+
const buf = gl2.createBuffer();
|
|
1136
|
+
gl2.bindBuffer(UNIFORM_BUFFER, buf);
|
|
1137
|
+
gl2.bufferData(UNIFORM_BUFFER, new Float32Array([1, 0, 0, 1]), gl2.STATIC_DRAW);
|
|
1138
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
1139
|
+
gl2.bufferSubData(UNIFORM_BUFFER, 0, new Float32Array([0, 1, 0, 1]));
|
|
1140
|
+
expect(gl2.getError()).toBe(gl2.NO_ERROR);
|
|
1141
|
+
gl2.bindBuffer(UNIFORM_BUFFER, null);
|
|
1142
|
+
gl2.deleteBuffer(buf);
|
|
1143
|
+
});
|
|
1144
|
+
});
|
|
573
1145
|
win.destroy();
|
|
574
1146
|
});
|
|
575
1147
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CanvasWebGLWidget } from '@gjsify/webgl';
|
|
2
|
+
import Gtk from '@girs/gtk-4.0';
|
|
3
|
+
export interface GLSetup {
|
|
4
|
+
gl: WebGLRenderingContext;
|
|
5
|
+
gl2: WebGL2RenderingContext | null;
|
|
6
|
+
glArea: CanvasWebGLWidget;
|
|
7
|
+
win: Gtk.Window;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Synchronously initialises a GTK window + CanvasWebGLWidget and blocks until
|
|
11
|
+
* the GL context is ready (or 10 s timeout).
|
|
12
|
+
* Returns null when no display is available.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createGLSetup(): GLSetup | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class EXTBlendMinMax {
|
|
3
3
|
MIN_EXT: number;
|
|
4
4
|
MAX_EXT: number;
|
|
5
5
|
constructor();
|
|
6
6
|
}
|
|
7
|
-
export declare function getEXTBlendMinMax(context:
|
|
7
|
+
export declare function getEXTBlendMinMax(context: WebGLContextBase): any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class EXTTextureFilterAnisotropic {
|
|
3
3
|
TEXTURE_MAX_ANISOTROPY_EXT: number;
|
|
4
4
|
MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
|
|
5
5
|
constructor();
|
|
6
6
|
}
|
|
7
|
-
export declare function getEXTTextureFilterAnisotropic(context:
|
|
7
|
+
export declare function getEXTTextureFilterAnisotropic(context: WebGLContextBase): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class OESElementIndexUint {
|
|
3
3
|
}
|
|
4
|
-
export declare function getOESElementIndexUint(context:
|
|
4
|
+
export declare function getOESElementIndexUint(context: WebGLContextBase): any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class OESStandardDerivatives {
|
|
3
3
|
FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;
|
|
4
4
|
constructor();
|
|
5
5
|
}
|
|
6
|
-
export declare function getOESStandardDerivatives(context:
|
|
6
|
+
export declare function getOESStandardDerivatives(context: WebGLContextBase): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class OESTextureFloatLinear {
|
|
3
3
|
}
|
|
4
|
-
export declare function getOESTextureFloatLinear(context:
|
|
4
|
+
export declare function getOESTextureFloatLinear(context: WebGLContextBase): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLContextBase } from '../webgl-context-base.js';
|
|
2
2
|
export declare class OESTextureFloat {
|
|
3
3
|
}
|
|
4
|
-
export declare function getOESTextureFloat(context:
|
|
4
|
+
export declare function getOESTextureFloat(context: WebGLContextBase): any;
|