@flighthq/render-gl 0.5.1-next.1350.8ce488b → 0.5.1-next.1404.457d1da
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/README.md +2 -2
- package/dist/contract.d.ts +1 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +1 -0
- package/dist/contract.js.map +1 -1
- package/dist/glElement.d.ts +3 -3
- package/dist/glElement.d.ts.map +1 -1
- package/dist/glElement.js +1 -1
- package/dist/glElement.js.map +1 -1
- package/dist/glRenderView.d.ts +5 -0
- package/dist/glRenderView.d.ts.map +1 -0
- package/dist/glRenderView.js +36 -0
- package/dist/glRenderView.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -11
- package/src/glElement.test.ts +3 -3
- package/src/glRenderView.test.ts +60 -0
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/render-gl`. The `@fl
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/render-gl@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/render-gl@0.5.1-next.1404.457d1da](https://github.com/flighthq/flight/tree/457d1da918a60be5853b84eb6c25530a66662cef/packages/render-gl)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/457d1da918a60be5853b84eb6c25530a66662cef/LICENSE.md)
|
package/dist/contract.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './glRenderTarget';
|
|
|
21
21
|
export * from './glRenderTexture';
|
|
22
22
|
export * from './glRenderTexturePool';
|
|
23
23
|
export * from './glRenderTargetPool';
|
|
24
|
+
export * from './glRenderView';
|
|
24
25
|
export * from './glShader';
|
|
25
26
|
export * from './glShaderBinding';
|
|
26
27
|
export * from './glSkinPaletteTexture';
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM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wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/contract.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from './glRenderTarget';
|
|
|
21
21
|
export * from './glRenderTexture';
|
|
22
22
|
export * from './glRenderTexturePool';
|
|
23
23
|
export * from './glRenderTargetPool';
|
|
24
|
+
export * from './glRenderView';
|
|
24
25
|
export * from './glShader';
|
|
25
26
|
export * from './glShaderBinding';
|
|
26
27
|
export * from './glSkinPaletteTexture';
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,O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E,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/glElement.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GlRenderSurfaceCreator } from '@flighthq/types/contract';
|
|
2
2
|
export declare function createGlCanvasElement(width: number, height: number, pixelRatio?: number): HTMLCanvasElement;
|
|
3
3
|
export declare function createGlRenderSurface(width: number, height: number, pixelRatio?: number): HTMLCanvasElement | null;
|
|
4
4
|
export declare function explainGlRenderSurfaceAbsence(): {
|
|
5
5
|
reason: 'provider-not-installed';
|
|
6
6
|
} | null;
|
|
7
|
-
export declare function getGlRenderSurfaceProvider(): Readonly<
|
|
7
|
+
export declare function getGlRenderSurfaceProvider(): Readonly<GlRenderSurfaceCreator> | null;
|
|
8
8
|
export declare function resetGlRenderSurfaceProviderForTest(): void;
|
|
9
|
-
export declare function setGlRenderSurfaceProvider(provider: Readonly<
|
|
9
|
+
export declare function setGlRenderSurfaceProvider(provider: Readonly<GlRenderSurfaceCreator> | null): void;
|
|
10
10
|
//# sourceMappingURL=glElement.d.ts.map
|
package/dist/glElement.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glElement.d.ts","sourceRoot":"","sources":["../src/glElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"glElement.d.ts","sourceRoot":"","sources":["../src/glElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIvE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,MAAU,GAAG,iBAAiB,CAM9G;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,MAAU,GAAG,iBAAiB,GAAG,IAAI,CAErH;AAED,wBAAgB,6BAA6B,IAAI;IAAE,MAAM,EAAE,wBAAwB,CAAA;CAAE,GAAG,IAAI,CAE3F;AAED,wBAAgB,0BAA0B,IAAI,QAAQ,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAEpF;AAED,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GAAG,IAAI,GAAG,IAAI,CAElG"}
|
package/dist/glElement.js
CHANGED
|
@@ -3,7 +3,7 @@ export function createGlCanvasElement(width, height, pixelRatio = 1) {
|
|
|
3
3
|
const surface = createGlRenderSurface(width, height, pixelRatio);
|
|
4
4
|
if (surface !== null)
|
|
5
5
|
return surface;
|
|
6
|
-
throw new Error('No GL render surface is available. Web callers must run enableHostWebGlRenderSurface() before creating GL state; native callers must inject a
|
|
6
|
+
throw new Error('No GL render surface is available. Web callers must run enableHostWebGlRenderSurface() before creating GL state; native callers must inject a GlRenderSurfaceCreator.');
|
|
7
7
|
}
|
|
8
8
|
export function createGlRenderSurface(width, height, pixelRatio = 1) {
|
|
9
9
|
return _provider?.createRenderSurface(width, height, pixelRatio) ?? null;
|
package/dist/glElement.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glElement.js","sourceRoot":"","sources":["../src/glElement.ts"],"names":[],"mappings":"AAEA,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"glElement.js","sourceRoot":"","sources":["../src/glElement.ts"],"names":[],"mappings":"AAEA,IAAI,SAAS,GAA4C,IAAI,CAAC;AAE9D,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,MAAc,EAAE,aAAqB,CAAC;IACzF,MAAM,OAAO,GAAG,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IACjE,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IACrC,MAAM,IAAI,KAAK,CACb,uKAAuK,CACxK,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,MAAc,EAAE,aAAqB,CAAC;IACzF,OAAO,SAAS,EAAE,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,mCAAmC;IACjD,SAAS,GAAG,IAAI,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAiD;IAC1F,SAAS,GAAG,QAAQ,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ApplicationRenderViewTargetOptions, GlContext, GlPipeline, GlRenderOptions, GlRenderViewResources } from '@flighthq/types/contract';
|
|
2
|
+
export declare function createGlRenderViewResources(context: GlContext, pipeline: Readonly<GlPipeline>, width: number, height: number, devicePixelRatio: number, render?: Readonly<GlRenderOptions>, target?: Readonly<ApplicationRenderViewTargetOptions>): GlRenderViewResources;
|
|
3
|
+
export declare function destroyGlRenderViewResources(resources: Readonly<GlRenderViewResources>): void;
|
|
4
|
+
export declare function resizeGlRenderViewResources(resources: Readonly<GlRenderViewResources>, width: number, height: number): void;
|
|
5
|
+
//# sourceMappingURL=glRenderView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glRenderView.d.ts","sourceRoot":"","sources":["../src/glRenderView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kCAAkC,EAClC,SAAS,EACT,UAAU,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAgBlC,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,EAC9B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EACxB,MAAM,GAAE,QAAQ,CAAC,eAAe,CAAM,EACtC,MAAM,GAAE,QAAQ,CAAC,kCAAkC,CAAM,GACxD,qBAAqB,CAMvB;AAID,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAG7F;AAKD,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAC1C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,IAAI,CAMN"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
2
|
+
import { createViewport } from '@flighthq/node/contract';
|
|
3
|
+
import { createGlRenderState, destroyGlRenderState, invalidateGlRenderStateCache } from './glRenderState';
|
|
4
|
+
import { createGlTextureRenderTarget, destroyGlTextureRenderTarget, resizeGlTextureRenderTarget, } from './glRenderTarget';
|
|
5
|
+
// The render-layer half of a GL application view. A caller acquires a context (host.gl for a
|
|
6
|
+
// provider-bound target) and passes it here; the window half and the resize reconciliation belong to
|
|
7
|
+
// @flighthq/application, which this package may not import — so the two are joined at the call site
|
|
8
|
+
// rather than by an assembly package.
|
|
9
|
+
//
|
|
10
|
+
// The canvas backing store is NOT sized here. A caller that owns the surface sizes it first, through
|
|
11
|
+
// host.surface.resize, then calls resizeGlRenderViewResources with the same extent.
|
|
12
|
+
export function createGlRenderViewResources(context, pipeline, width, height, devicePixelRatio, render = {}, target = {}) {
|
|
13
|
+
const out = allocateEntity();
|
|
14
|
+
out.renderState = createGlRenderState(context, pipeline, { ...render, pixelRatio: devicePixelRatio });
|
|
15
|
+
out.renderTarget = createGlTextureRenderTarget(out.renderState, { ...target, height, width });
|
|
16
|
+
out.viewport = createViewport({ devicePixelRatio, height, width });
|
|
17
|
+
return finishEntity(out);
|
|
18
|
+
}
|
|
19
|
+
// Frees the storage and command state this builder allocated. The context stays caller-owned: host.gl
|
|
20
|
+
// acquired it and releases it through the matching release hook.
|
|
21
|
+
export function destroyGlRenderViewResources(resources) {
|
|
22
|
+
destroyGlTextureRenderTarget(resources.renderTarget);
|
|
23
|
+
destroyGlRenderState(resources.renderState);
|
|
24
|
+
}
|
|
25
|
+
// Reallocates storage for a new device-pixel extent and drops the state's extent-dependent caches.
|
|
26
|
+
// Idempotent: a request matching the current storage extent is a no-op, which is what the application
|
|
27
|
+
// synchronize pass requires.
|
|
28
|
+
export function resizeGlRenderViewResources(resources, width, height) {
|
|
29
|
+
const storageWidth = Math.max(1, Math.ceil(width));
|
|
30
|
+
const storageHeight = Math.max(1, Math.ceil(height));
|
|
31
|
+
if (resources.renderTarget.width === storageWidth && resources.renderTarget.height === storageHeight)
|
|
32
|
+
return;
|
|
33
|
+
invalidateGlRenderStateCache(resources.renderState);
|
|
34
|
+
resizeGlTextureRenderTarget(resources.renderState, resources.renderTarget, width, height);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=glRenderView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glRenderView.js","sourceRoot":"","sources":["../src/glRenderView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AASzD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC1G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,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,IAAI,SAAS,CAAC,YAAY,CAAC,KAAK,KAAK,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC,MAAM,KAAK,aAAa;QAAE,OAAO;IAC7G,4BAA4B,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACpD,2BAA2B,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5F,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { acquireGlRenderTexture, applyGlBlendMode, beginGlCubeRenderFace, beginGlRenderPass, bindGlImageResourceTexture, bindGlRenderTexture, bindGlTexture, clearGlRenderTarget, clearGlRenderTargetAttachments, clearGlRenderTexture, createGlCanvasElement, createGlRenderSurface, createExternalGlTexture, createEmptyGlRegistries, createGlCubeRenderTarget, createGlPipeline, createGlRenderState, createGlRenderTexturePool, createGlScreenRenderTarget, createGlTextureRenderTarget, destroyGlCubeRenderTarget, destroyGlTextureRenderTarget, destroyGlRenderTexture, destroyGlRenderTexturePool, destroyGlRenderState, disposeExternalGlTexture, drawGlFullscreenPass, drawGlQuad, fillGlRect, enableGlRenderTextureGuards, enableGlRenderStateGuards, enableGlTextureResolverGuards, enableGlBlendModeSupport, endGlRenderPass, endGlCubeRenderFace, explainGlRenderSurfaceAbsence, explainGlTextureRenderTarget, explainGlRenderTexture, explainGlTextureResolution, getGlCurrentRenderPass, getGlPipelineRegistries, isGlRenderTargetFormatSupported, popGlRenderState, registerGlBitmapTextureResolver, registerGlCompressedTextureDecoder, registerGlCompressedImageTextureResolver, registerGlCompressedTextureUpload, registerGlImageTextureResolver, registerGlRenderTextureResolver, registerStandardGlTextureResolvers, registerGlTextureResolver, presentGlRenderTarget, pushGlRenderState, renderIntoGlRenderTexture, releaseGlRenderTexture, resolveGlTexture, setGlRenderTransform2D, standardGlBlendRealizations, standardGlTextureResolvers, uploadGlCompressedTextureContainer, withGlRenderState, withGlRenderTextures, } from './contract';
|
|
1
|
+
export { acquireGlRenderTexture, applyGlBlendMode, beginGlCubeRenderFace, beginGlRenderPass, bindGlImageResourceTexture, bindGlRenderTexture, bindGlTexture, clearGlRenderTarget, clearGlRenderTargetAttachments, clearGlRenderTexture, createGlCanvasElement, createGlRenderSurface, createExternalGlTexture, createEmptyGlRegistries, createGlCubeRenderTarget, createGlPipeline, createGlRenderState, createGlRenderTexturePool, createGlRenderViewResources, createGlScreenRenderTarget, createGlTextureRenderTarget, destroyGlCubeRenderTarget, destroyGlTextureRenderTarget, destroyGlRenderTexture, destroyGlRenderTexturePool, destroyGlRenderViewResources, destroyGlRenderState, disposeExternalGlTexture, drawGlFullscreenPass, drawGlQuad, fillGlRect, enableGlRenderTextureGuards, enableGlRenderStateGuards, enableGlTextureResolverGuards, enableGlBlendModeSupport, endGlRenderPass, endGlCubeRenderFace, explainGlRenderSurfaceAbsence, explainGlTextureRenderTarget, explainGlRenderTexture, explainGlTextureResolution, getGlCurrentRenderPass, getGlPipelineRegistries, isGlRenderTargetFormatSupported, popGlRenderState, registerGlBitmapTextureResolver, registerGlCompressedTextureDecoder, registerGlCompressedImageTextureResolver, registerGlCompressedTextureUpload, registerGlImageTextureResolver, registerGlRenderTextureResolver, registerStandardGlTextureResolvers, registerGlTextureResolver, presentGlRenderTarget, pushGlRenderState, renderIntoGlRenderTexture, releaseGlRenderTexture, resizeGlRenderViewResources, resolveGlTexture, setGlRenderTransform2D, standardGlBlendRealizations, standardGlTextureResolvers, uploadGlCompressedTextureContainer, withGlRenderState, withGlRenderTextures, } from './contract';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,gBAAgB,EAChB,+BAA+B,EAC/B,kCAAkC,EAClC,wCAAwC,EACxC,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,kCAAkC,EAClC,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,gBAAgB,EAChB,+BAA+B,EAC/B,kCAAkC,EAClC,wCAAwC,EACxC,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,kCAAkC,EAClC,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { acquireGlRenderTexture, applyGlBlendMode, beginGlCubeRenderFace, beginGlRenderPass, bindGlImageResourceTexture, bindGlRenderTexture, bindGlTexture, clearGlRenderTarget, clearGlRenderTargetAttachments, clearGlRenderTexture, createGlCanvasElement, createGlRenderSurface, createExternalGlTexture, createEmptyGlRegistries, createGlCubeRenderTarget, createGlPipeline, createGlRenderState, createGlRenderTexturePool, createGlScreenRenderTarget, createGlTextureRenderTarget, destroyGlCubeRenderTarget, destroyGlTextureRenderTarget, destroyGlRenderTexture, destroyGlRenderTexturePool, destroyGlRenderState, disposeExternalGlTexture, drawGlFullscreenPass, drawGlQuad, fillGlRect, enableGlRenderTextureGuards, enableGlRenderStateGuards, enableGlTextureResolverGuards, enableGlBlendModeSupport, endGlRenderPass, endGlCubeRenderFace, explainGlRenderSurfaceAbsence, explainGlTextureRenderTarget, explainGlRenderTexture, explainGlTextureResolution, getGlCurrentRenderPass, getGlPipelineRegistries, isGlRenderTargetFormatSupported, popGlRenderState, registerGlBitmapTextureResolver, registerGlCompressedTextureDecoder, registerGlCompressedImageTextureResolver, registerGlCompressedTextureUpload, registerGlImageTextureResolver, registerGlRenderTextureResolver, registerStandardGlTextureResolvers, registerGlTextureResolver, presentGlRenderTarget, pushGlRenderState, renderIntoGlRenderTexture, releaseGlRenderTexture, resolveGlTexture, setGlRenderTransform2D, standardGlBlendRealizations, standardGlTextureResolvers, uploadGlCompressedTextureContainer, withGlRenderState, withGlRenderTextures, } from './contract';
|
|
1
|
+
export { acquireGlRenderTexture, applyGlBlendMode, beginGlCubeRenderFace, beginGlRenderPass, bindGlImageResourceTexture, bindGlRenderTexture, bindGlTexture, clearGlRenderTarget, clearGlRenderTargetAttachments, clearGlRenderTexture, createGlCanvasElement, createGlRenderSurface, createExternalGlTexture, createEmptyGlRegistries, createGlCubeRenderTarget, createGlPipeline, createGlRenderState, createGlRenderTexturePool, createGlRenderViewResources, createGlScreenRenderTarget, createGlTextureRenderTarget, destroyGlCubeRenderTarget, destroyGlTextureRenderTarget, destroyGlRenderTexture, destroyGlRenderTexturePool, destroyGlRenderViewResources, destroyGlRenderState, disposeExternalGlTexture, drawGlFullscreenPass, drawGlQuad, fillGlRect, enableGlRenderTextureGuards, enableGlRenderStateGuards, enableGlTextureResolverGuards, enableGlBlendModeSupport, endGlRenderPass, endGlCubeRenderFace, explainGlRenderSurfaceAbsence, explainGlTextureRenderTarget, explainGlRenderTexture, explainGlTextureResolution, getGlCurrentRenderPass, getGlPipelineRegistries, isGlRenderTargetFormatSupported, popGlRenderState, registerGlBitmapTextureResolver, registerGlCompressedTextureDecoder, registerGlCompressedImageTextureResolver, registerGlCompressedTextureUpload, registerGlImageTextureResolver, registerGlRenderTextureResolver, registerStandardGlTextureResolvers, registerGlTextureResolver, presentGlRenderTarget, pushGlRenderState, renderIntoGlRenderTexture, releaseGlRenderTexture, resizeGlRenderViewResources, resolveGlTexture, setGlRenderTransform2D, standardGlBlendRealizations, standardGlTextureResolvers, uploadGlCompressedTextureContainer, withGlRenderState, withGlRenderTextures, } from './contract';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,gBAAgB,EAChB,+BAA+B,EAC/B,kCAAkC,EAClC,wCAAwC,EACxC,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,kCAAkC,EAClC,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,gBAAgB,EAChB,+BAA+B,EAC/B,kCAAkC,EAClC,wCAAwC,EACxC,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,kCAAkC,EAClC,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/render-gl",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.1404.457d1da",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,16 +38,17 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/color": "0.5.1-next.
|
|
42
|
-
"@flighthq/entity": "0.5.1-next.
|
|
43
|
-
"@flighthq/
|
|
44
|
-
"@flighthq/
|
|
45
|
-
"@flighthq/
|
|
46
|
-
"@flighthq/
|
|
47
|
-
"@flighthq/
|
|
48
|
-
"@flighthq/
|
|
49
|
-
"@flighthq/
|
|
50
|
-
"@flighthq/
|
|
41
|
+
"@flighthq/color": "0.5.1-next.1404.457d1da",
|
|
42
|
+
"@flighthq/entity": "0.5.1-next.1404.457d1da",
|
|
43
|
+
"@flighthq/geometry": "0.5.1-next.1404.457d1da",
|
|
44
|
+
"@flighthq/log": "0.5.1-next.1404.457d1da",
|
|
45
|
+
"@flighthq/node": "0.5.1-next.1404.457d1da",
|
|
46
|
+
"@flighthq/registry": "0.5.1-next.1404.457d1da",
|
|
47
|
+
"@flighthq/render": "0.5.1-next.1404.457d1da",
|
|
48
|
+
"@flighthq/scene2d": "0.5.1-next.1404.457d1da",
|
|
49
|
+
"@flighthq/signals": "0.5.1-next.1404.457d1da",
|
|
50
|
+
"@flighthq/texture": "0.5.1-next.1404.457d1da",
|
|
51
|
+
"@flighthq/types": "0.5.1-next.1404.457d1da"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"typescript": "^5.3.0"
|
package/src/glElement.test.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
setGlRenderSurfaceProvider,
|
|
8
8
|
} from './glElement';
|
|
9
9
|
|
|
10
|
-
function entityProvider(fields: Omit<
|
|
10
|
+
function entityProvider(fields: Omit<GlRenderSurfaceCreator, keyof Entity>): GlRenderSurfaceCreator {
|
|
11
11
|
return (() => {
|
|
12
12
|
const out = allocateEntity<any>();
|
|
13
13
|
Object.assign(out, fields);
|
|
@@ -28,7 +28,7 @@ describe('createGlCanvasElement', () => {
|
|
|
28
28
|
|
|
29
29
|
it('throws an actionable Web-only setup error when the provider is absent', () => {
|
|
30
30
|
expect(() => createGlCanvasElement(100, 200)).toThrowError(
|
|
31
|
-
/enableHostWebGlRenderSurface\(\).*inject a
|
|
31
|
+
/enableHostWebGlRenderSurface\(\).*inject a GlRenderSurfaceCreator/,
|
|
32
32
|
);
|
|
33
33
|
});
|
|
34
34
|
|
|
@@ -174,4 +174,4 @@ function withThrowingDocument(run: () => void): void {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
177
|
-
import type { Entity,
|
|
177
|
+
import type { Entity, GlRenderSurfaceCreator } from '@flighthq/types/contract';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
|
+
import type { GlRenderViewResources } from '@flighthq/types/contract';
|
|
3
|
+
|
|
4
|
+
import { createEmptyGlRegistries, createGlPipeline } from './glPipeline';
|
|
5
|
+
import { createGlRenderViewResources, destroyGlRenderViewResources, resizeGlRenderViewResources } from './glRenderView';
|
|
6
|
+
import { makeGL } from './glTestHelper';
|
|
7
|
+
|
|
8
|
+
function makeResources(width = 640, height = 480, devicePixelRatio = 1): GlRenderViewResources {
|
|
9
|
+
return createGlRenderViewResources(
|
|
10
|
+
makeGL(),
|
|
11
|
+
createGlPipeline(createEmptyGlRegistries()),
|
|
12
|
+
width,
|
|
13
|
+
height,
|
|
14
|
+
devicePixelRatio,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe('createGlRenderViewResources', () => {
|
|
19
|
+
it('allocates Entity-backed state, storage and a viewport at the requested extent', () => {
|
|
20
|
+
const resources = makeResources(640, 480, 2);
|
|
21
|
+
|
|
22
|
+
expect(EntityRuntimeKey in resources.renderState).toBe(true);
|
|
23
|
+
expect(EntityRuntimeKey in resources.renderTarget).toBe(true);
|
|
24
|
+
expect(EntityRuntimeKey in resources.viewport).toBe(true);
|
|
25
|
+
expect(resources.renderTarget.width).toBe(640);
|
|
26
|
+
expect(resources.renderTarget.height).toBe(480);
|
|
27
|
+
expect(resources.viewport.width).toBe(640);
|
|
28
|
+
expect(resources.viewport.height).toBe(480);
|
|
29
|
+
expect(resources.viewport.devicePixelRatio).toBe(2);
|
|
30
|
+
expect(resources.renderState.pixelRatio).toBe(2);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('destroyGlRenderViewResources', () => {
|
|
35
|
+
it('releases the storage and state this builder allocated', () => {
|
|
36
|
+
const resources = makeResources();
|
|
37
|
+
|
|
38
|
+
expect(() => destroyGlRenderViewResources(resources)).not.toThrow();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('resizeGlRenderViewResources', () => {
|
|
43
|
+
it('reallocates storage for a new device-pixel extent', () => {
|
|
44
|
+
const resources = makeResources(640, 480);
|
|
45
|
+
|
|
46
|
+
resizeGlRenderViewResources(resources, 800, 600);
|
|
47
|
+
|
|
48
|
+
expect(resources.renderTarget.width).toBe(800);
|
|
49
|
+
expect(resources.renderTarget.height).toBe(600);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('is idempotent at the extent storage already holds', () => {
|
|
53
|
+
const resources = makeResources(640, 480);
|
|
54
|
+
|
|
55
|
+
resizeGlRenderViewResources(resources, 640, 480);
|
|
56
|
+
|
|
57
|
+
expect(resources.renderTarget.width).toBe(640);
|
|
58
|
+
expect(resources.renderTarget.height).toBe(480);
|
|
59
|
+
});
|
|
60
|
+
});
|