implement PBS low-level asset host surface
This commit is contained in:
+22
@@ -59,6 +59,9 @@ prometeu-compiler/frontends/prometeu-frontend-pbs/
|
||||
gfx/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
asset/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
audio/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
@@ -82,6 +85,7 @@ The compiler must treat the physical layout as a logical stdlib environment.
|
||||
Required mapping:
|
||||
|
||||
- `stdlib/<N>/sdk/gfx` -> `@sdk:gfx`
|
||||
- `stdlib/<N>/sdk/asset` -> `@sdk:asset`
|
||||
- `stdlib/<N>/sdk/audio` -> `@sdk:audio`
|
||||
- `stdlib/<N>/core/math` -> `@core:math`
|
||||
- `stdlib/<N>/core/math/vector` -> `@core:math/vector`
|
||||
@@ -204,6 +208,16 @@ declare host Gfx {
|
||||
}
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```pbs
|
||||
declare host LowAssets {
|
||||
[Host(module = "asset", name = "load", version = 1)]
|
||||
[Capability(name = "asset")]
|
||||
fn load(asset_id: int, slot: int) -> (status: int, loading_handle: int);
|
||||
}
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- the parser reads the attribute as part of the interface module source,
|
||||
@@ -211,6 +225,14 @@ Rules:
|
||||
- the compiler stores the extracted metadata in its interface graph,
|
||||
- the raw attribute surface is not treated as a runtime object,
|
||||
- later lowering stages may consume the extracted metadata to produce PBX host-binding declarations.
|
||||
- stdlib line `1` MUST expose the low-level asset interface module at `@sdk:asset`,
|
||||
- that module MUST declare `LowAssets`,
|
||||
- that module MUST use runtime module `asset` and capability `asset`,
|
||||
- that module MUST use the runtime-aligned signatures:
|
||||
- `load(asset_id: int, slot: int) -> (status: int, loading_handle: int)`
|
||||
- `status(loading_handle: int) -> int`
|
||||
- `commit(loading_handle: int) -> int`
|
||||
- `cancel(loading_handle: int) -> int`
|
||||
|
||||
## 10. Resources as an Implementation Strategy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user