refactor: consolidate render graph architecture
Amp-Thread-ID: https://ampcode.com/threads/T-019f9d91-77c1-7206-a60f-ed6554ce92ab Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
@@ -345,76 +345,3 @@ export function adaptFxNodeSnapshot(raw, revision = 1) {
|
||||
fail("AUTHORING_SHAPE");
|
||||
}
|
||||
}
|
||||
export const adaptGraphSnapshot = adaptFxNodeSnapshot;
|
||||
|
||||
/** Compatibility helper retained for V1 presets. */
|
||||
export function semanticProjectionToV1(p, revision = 1) {
|
||||
const extent = {
|
||||
kind: "surface_relative",
|
||||
width: { numerator: 1, denominator: 1 },
|
||||
height: { numerator: 1, denominator: 1 },
|
||||
depthOrArrayLayers: 1,
|
||||
};
|
||||
return {
|
||||
schemaVersion: 1,
|
||||
graphId: p.graphId,
|
||||
revision,
|
||||
resources: [
|
||||
{
|
||||
id: "surface",
|
||||
version: 0,
|
||||
residency: { kind: "external", source: "surface_color" },
|
||||
texture: {
|
||||
dimension: "d2",
|
||||
format: "surface",
|
||||
extent,
|
||||
mipLevelCount: 1,
|
||||
sampleCount: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "depth",
|
||||
version: 0,
|
||||
residency: { kind: "transient" },
|
||||
texture: {
|
||||
dimension: "d2",
|
||||
format: "depth32_float",
|
||||
extent,
|
||||
mipLevelCount: 1,
|
||||
sampleCount: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
passes: [
|
||||
{
|
||||
id: "forward",
|
||||
state: p.passState,
|
||||
executor: { key: "scene_forward", version: 1 },
|
||||
parameters: {},
|
||||
reads: [],
|
||||
writes: [
|
||||
{
|
||||
binding: "color",
|
||||
resource: { id: "surface", version: 0 },
|
||||
access: {
|
||||
kind: "color_attachment",
|
||||
location: 0,
|
||||
load: { op: "clear", value: p.clearColor },
|
||||
store: "store",
|
||||
},
|
||||
},
|
||||
{
|
||||
binding: "depth",
|
||||
resource: { id: "depth", version: 0 },
|
||||
access: {
|
||||
kind: "depth_attachment",
|
||||
load: { op: "clear", value: p.clearDepth },
|
||||
store: "store",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
outputs: [{ name: "present", resource: { id: "surface", version: 0 } }],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user