@forgeax/engine-rhi 0.1.7 → 0.1.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/engine-rhi",
3
- "version": "0.1.7",
3
+ "version": "0.1.20",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -26,7 +26,7 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "dependencies": {
29
- "@forgeax/engine-types": "0.1.7",
29
+ "@forgeax/engine-types": "0.1.20",
30
30
  "@webgpu/types": "^0.1.71"
31
31
  },
32
32
  "forgeax": {
@@ -1,12 +1,12 @@
1
1
  // w4 type-level - RhiRenderPassEncoder spec method-set alignment (research F-2 /
2
- // plan-strategy D-S4: 17 spec stable + 1 setBindGroup overload + 3 placeholder).
2
+ // plan-strategy D-S4: 17 spec stable + 1 setBindGroup overload + 1 unavailable public entry).
3
3
  //
4
4
  // Asserts (RED until w5 lands the impl):
5
5
  // - 17 spec stable methods exist on RhiRenderPassEncoder
6
6
  // - setBindGroup has both overloads (a) array form (b) Uint32Array form
7
- // - 3 placeholder methods (executeBundles / beginOcclusionQuery /
8
- // endOcclusionQuery) are present in the interface and return
9
- // Result<void, RhiError> (so AI users can route 'rhi-not-available' at
7
+ // - executeBundles is the one unavailable public entry; begin/end occlusion
8
+ // query are real stateful operations. All three methods return
9
+ // Result<void, RhiError> (so AI users can route structured failure at
10
10
  // runtime; charter proposition 4 explicit failure).
11
11
  // - setImmediates (PROPOSED) is NOT exposed (per D-S4 explicit non-receipt;
12
12
  // charter proposition 4: untested features hide behind caps, not surfaces).
@@ -32,7 +32,7 @@ import type {
32
32
  TextureView,
33
33
  } from '../index';
34
34
 
35
- describe('w4 - RhiRenderPassEncoder spec method set (17 stable + 1 overload + 3 placeholders)', () => {
35
+ describe('w4 - RhiRenderPassEncoder spec method set (17 stable + 1 overload + 1 unavailable entry)', () => {
36
36
  // 7 already-shipped methods (Round 1 baseline; locked in this closure):
37
37
  it('keeps existing setPipeline / setIndexBuffer / setVertexBuffer', () => {
38
38
  expectTypeOf<RhiRenderPassEncoder['setPipeline']>().toBeFunction();
@@ -109,21 +109,21 @@ describe('w4 - RhiRenderPassEncoder spec method set (17 stable + 1 overload + 3
109
109
  expectTypeOf<HasSliceOverload>().toEqualTypeOf<true>();
110
110
  });
111
111
 
112
- // 3 placeholders: signature lives in the interface; shim returns Result.err
113
- // ({ code: 'rhi-not-available' }) at runtime per D-S4.
114
- it('exposes executeBundles (placeholder; capability-gated by RenderBundle)', () => {
112
+ // The unavailable public entry keeps a typed Result so callers can branch on
113
+ // the structured rhi-not-available error until RenderBundle is constructible.
114
+ it('exposes executeBundles (unavailable until RenderBundle is constructible)', () => {
115
115
  type Method = RhiRenderPassEncoder['executeBundles'];
116
116
  expectTypeOf<Method>().toBeFunction();
117
117
  expectTypeOf<Method>().returns.toEqualTypeOf<Result<void, RhiError>>();
118
118
  });
119
119
 
120
- it('exposes beginOcclusionQuery (placeholder; capability-gated by QuerySet)', () => {
120
+ it('exposes beginOcclusionQuery (stateful occlusion-query operation)', () => {
121
121
  type Method = RhiRenderPassEncoder['beginOcclusionQuery'];
122
122
  expectTypeOf<Method>().toBeFunction();
123
123
  expectTypeOf<Method>().returns.toEqualTypeOf<Result<void, RhiError>>();
124
124
  });
125
125
 
126
- it('exposes endOcclusionQuery (placeholder; capability-gated by QuerySet)', () => {
126
+ it('exposes endOcclusionQuery (stateful occlusion-query operation)', () => {
127
127
  type Method = RhiRenderPassEncoder['endOcclusionQuery'];
128
128
  expectTypeOf<Method>().toBeFunction();
129
129
  expectTypeOf<Method>().returns.toEqualTypeOf<Result<void, RhiError>>();
package/src/index.ts CHANGED
@@ -1365,7 +1365,31 @@ export interface RhiSurface {
1365
1365
  * **must NOT be cached across frames** — every frame must call
1366
1366
  * `getCurrentTexture()` afresh.
1367
1367
  */
1368
+ /** Configure-time proof that a storage surface can present through its endpoint. */
1369
+ export interface RhiCanvasSurfaceDescriptorFacts {
1370
+ readonly format: string;
1371
+ readonly usage: number;
1372
+ readonly width: number;
1373
+ readonly height: number;
1374
+ readonly alphaMode: string;
1375
+ readonly presentMode: string;
1376
+ }
1377
+
1378
+ export interface RhiCanvasSurfacePresentationProof {
1379
+ readonly descriptor: boolean;
1380
+ readonly acquisition: boolean;
1381
+ readonly validation: boolean;
1382
+ /** Stable identity for the concrete surface that produced this proof. */
1383
+ readonly surfaceIdentity?: string;
1384
+ /** Descriptor requested by the owner at configure time. */
1385
+ readonly requested?: RhiCanvasSurfaceDescriptorFacts;
1386
+ /** Descriptor accepted and validated by the concrete surface. */
1387
+ readonly validated?: RhiCanvasSurfaceDescriptorFacts;
1388
+ }
1389
+
1368
1390
  export interface RhiCanvasContext {
1391
+ /** Backend-produced configure-time presentation proof; absent means fail closed. */
1392
+ readonly presentationProof?: RhiCanvasSurfacePresentationProof;
1369
1393
  /**
1370
1394
  * Configure the canvas context with a forgeax CanvasConfiguration.
1371
1395
  *