@solidrt/flux-types 0.0.63 → 0.0.64
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/gui/gpu.d.ts +46 -6
- package/gui/spatial.d.ts +10 -0
- package/package.json +1 -1
package/gui/gpu.d.ts
CHANGED
|
@@ -219,10 +219,19 @@ declare module "flux:gpu" {
|
|
|
219
219
|
* via `<texture src>` is out of contract; also a draw target format (the
|
|
220
220
|
* target encodes what a pass writes).
|
|
221
221
|
*
|
|
222
|
+
* "rgba32ui" is the integer data-texture format: four u32 per texel
|
|
223
|
+
* (a Uint32Array of width*height*4), fetched through a `usampler2D` as a
|
|
224
|
+
* uvec4 and unpacked in the shader (`uintBitsToFloat`, `unpackHalf2x16`,
|
|
225
|
+
* `unpackUnorm4x8`) - bit-exact packed records where a float texel would
|
|
226
|
+
* canonicalize the bits (a splat cloud's records and SH bands, any
|
|
227
|
+
* packed table). Nearest-only and sample-only exactly like "rgba32f"
|
|
228
|
+
* (integer textures never filter), and a float sampler over it (or a
|
|
229
|
+
* `usampler2D` over any other format) throws at bind.
|
|
230
|
+
*
|
|
222
231
|
* Reserved future value of this same vocabulary: "etc2-rgba8" (compressed
|
|
223
232
|
* uploads).
|
|
224
233
|
*/
|
|
225
|
-
export type TextureFormat = "rgba8" | "rgba8-srgb" | "r8" | "r32f" | "rgba32f" | "rgba16f"
|
|
234
|
+
export type TextureFormat = "rgba8" | "rgba8-srgb" | "r8" | "r32f" | "rgba32f" | "rgba16f" | "rgba32ui"
|
|
226
235
|
export type TextureFormatOption = { format?: TextureFormat }
|
|
227
236
|
/**
|
|
228
237
|
* This device's hard ceilings, queried once at startup: process constants.
|
|
@@ -276,7 +285,7 @@ declare module "flux:gpu" {
|
|
|
276
285
|
* float formats ("r32f", "rgba32f", "rgba16f") a Float32Array. Returns
|
|
277
286
|
* the texture id.
|
|
278
287
|
*/
|
|
279
|
-
export function createTexture(data: Uint8Array | Float32Array, width: number, height: number, opts?: SamplerOptions & TextureFormatOption & LabelOption): TextureId
|
|
288
|
+
export function createTexture(data: Uint8Array | Float32Array | Uint32Array, width: number, height: number, opts?: SamplerOptions & TextureFormatOption & LabelOption): TextureId
|
|
280
289
|
/**
|
|
281
290
|
* Create a cube map from six square faces in GL order (+X, -X, +Y, -Y,
|
|
282
291
|
* +Z, -Z), each exactly one `size` x `size` frame at the declared format
|
|
@@ -297,7 +306,7 @@ declare module "flux:gpu" {
|
|
|
297
306
|
* returns (the cube seen from outside), so a face set authored as seen
|
|
298
307
|
* from inside (Three's) is mirrored per image before upload.
|
|
299
308
|
*/
|
|
300
|
-
export function createCubeTexture(faces: (Uint8Array | Float32Array)[] | (Uint8Array | Float32Array)[][], size: number, opts?: SamplerOptions & TextureFormatOption & LabelOption): TextureId
|
|
309
|
+
export function createCubeTexture(faces: (Uint8Array | Float32Array | Uint32Array)[] | (Uint8Array | Float32Array | Uint32Array)[][], size: number, opts?: SamplerOptions & TextureFormatOption & LabelOption): TextureId
|
|
301
310
|
/**
|
|
302
311
|
* Create a texture intended to be updated later via {@link uploadTexture}. The
|
|
303
312
|
* seed buffer must hold at least one frame at the declared format's size
|
|
@@ -305,14 +314,14 @@ declare module "flux:gpu" {
|
|
|
305
314
|
* {@link createTexture}, the view type must match the format (Uint8Array
|
|
306
315
|
* for byte formats, Float32Array for float formats).
|
|
307
316
|
*/
|
|
308
|
-
export function createMutableTexture(data: Uint8Array | Float32Array, width: number, height: number, opts?: SamplerOptions & TextureFormatOption & LabelOption): TextureId
|
|
317
|
+
export function createMutableTexture(data: Uint8Array | Float32Array | Uint32Array, width: number, height: number, opts?: SamplerOptions & TextureFormatOption & LabelOption): TextureId
|
|
309
318
|
/**
|
|
310
319
|
* Replace a mutable texture's pixels; the frame size and required view
|
|
311
320
|
* type (Uint8Array for byte formats, Float32Array for float formats)
|
|
312
321
|
* follow the format the id was created with. `data` may hold several
|
|
313
322
|
* frames; `offset` (default 0) selects which frame to upload.
|
|
314
323
|
*/
|
|
315
|
-
export function uploadTexture(id: TextureId, data: Uint8Array | Float32Array, offset?: number): void
|
|
324
|
+
export function uploadTexture(id: TextureId, data: Uint8Array | Float32Array | Uint32Array, offset?: number): void
|
|
316
325
|
/**
|
|
317
326
|
* Replace a texture's storage with a new size at the same id (an id-stable
|
|
318
327
|
* resize): `<texture src>` references and shader sampler bindings keep
|
|
@@ -322,7 +331,7 @@ declare module "flux:gpu" {
|
|
|
322
331
|
* state). Render target ids are rejected - resize those with
|
|
323
332
|
* {@link setTargetSize}.
|
|
324
333
|
*/
|
|
325
|
-
export function resizeTexture(id: TextureId, data: Uint8Array | Float32Array, width: number, height: number): void
|
|
334
|
+
export function resizeTexture(id: TextureId, data: Uint8Array | Float32Array | Uint32Array, width: number, height: number): void
|
|
326
335
|
/**
|
|
327
336
|
* Destroy a texture (immutable, mutable, or shader). Frame-safe: the id is
|
|
328
337
|
* reclaimed by the runtime once the render tree no longer references it, so
|
|
@@ -775,6 +784,21 @@ declare module "flux:gpu" {
|
|
|
775
784
|
* nothing there and throws.
|
|
776
785
|
*/
|
|
777
786
|
retain?: boolean
|
|
787
|
+
/**
|
|
788
|
+
* The INDEX materialization, for a population whose records live in a
|
|
789
|
+
* data texture the shader fetches by record index: the records are
|
|
790
|
+
* handed off with {@link transferRecords} at `stride` bytes each (the
|
|
791
|
+
* key offsets address them), and the ordered instance buffer holds
|
|
792
|
+
* the sorted record indices as u32 - `arrayStride / 4` ids per
|
|
793
|
+
* instance record, so one drawn instance covers K records - written
|
|
794
|
+
* whole on every re-sort (the sorted ids, then 0xFFFFFFFF to the end
|
|
795
|
+
* of the buffer, which the shader culls before fetching). A re-sort
|
|
796
|
+
* then uploads 4 bytes per record instead of the record. Retains by
|
|
797
|
+
* nature; takes exactly one instance-step buffer, over handed-off
|
|
798
|
+
* records only (publishing that buffer through the lease throws), and
|
|
799
|
+
* `instanceCount` picks the first count x K records of the mirror.
|
|
800
|
+
*/
|
|
801
|
+
indices?: { stride: number }
|
|
778
802
|
}
|
|
779
803
|
/**
|
|
780
804
|
* The order half of a draw-entry update: `orderDirection` replaces the
|
|
@@ -887,6 +911,22 @@ declare module "flux:gpu" {
|
|
|
887
911
|
* record sets through {@link beginBufferWrite}/{@link endBufferWrite}.
|
|
888
912
|
*/
|
|
889
913
|
export function writeBuffer(id: BufferId, data: Uint8Array, byteOffset?: number): void
|
|
914
|
+
/**
|
|
915
|
+
* Hand a buffer's full record set to the engine - the write-once form of
|
|
916
|
+
* an ordered instance buffer ({@link InstanceOrder}): the engine's order
|
|
917
|
+
* mirror takes ownership of a copy, so the app keeps none, and the
|
|
918
|
+
* ordered entry sorts and republishes from the mirror on its own - the
|
|
919
|
+
* first publish when the entry attaches (nothing draws before that),
|
|
920
|
+
* re-sorts on `orderDirection` changes, and prefix republishes when the
|
|
921
|
+
* entry's `instanceCount` changes (the first n records are the sorted
|
|
922
|
+
* population). Hand off before the entry attaches; a second call
|
|
923
|
+
* replaces the records wholesale. By the time an entry attaches over
|
|
924
|
+
* the buffer the records must be whole records of the order's stride
|
|
925
|
+
* and, for gathered records, fit the buffer (an indexed order's buffer
|
|
926
|
+
* holds their ids instead, see {@link InstanceOrder}). The mirror is
|
|
927
|
+
* freed with the buffer.
|
|
928
|
+
*/
|
|
929
|
+
export function transferRecords(id: BufferId, records: Uint8Array): void
|
|
890
930
|
/**
|
|
891
931
|
* Destroy a vertex buffer. Pipeline textures drawing from it hold their own
|
|
892
932
|
* reference, so destruction order does not matter; further writes to the id
|
package/gui/spatial.d.ts
CHANGED
|
@@ -178,6 +178,16 @@ declare module "flux:spatial" {
|
|
|
178
178
|
queue?: number
|
|
179
179
|
/** Ascending above depth inside the queue; default 0. */
|
|
180
180
|
renderOrder?: number
|
|
181
|
+
/** Feed the entry's instance-order projected-key direction (the
|
|
182
|
+
* `orderDirection` update of a position-key `instanceOrder`) from the
|
|
183
|
+
* target's view: each flush whose view forward, mapped into the
|
|
184
|
+
* node's model frame, turned past a small core-side epsilon writes
|
|
185
|
+
* the new direction - on a retained order that re-sorts and
|
|
186
|
+
* republishes the records core-side, so a whole population follows
|
|
187
|
+
* the camera with no per-frame work here. For entries that declared
|
|
188
|
+
* a position-key instanceOrder; on any other entry the first feed
|
|
189
|
+
* fails (with a warning) and the feed stops, the sink stays. */
|
|
190
|
+
orderFeed?: boolean
|
|
181
191
|
}
|
|
182
192
|
/**
|
|
183
193
|
* Route the node's world matrix to one draw entry's `uModel` (and
|