feat: compile multisampled graph attachments

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:
Amp
2026-07-29 00:48:35 +00:00
co-authored by heaust
parent eb640f0183
commit b5366d8b77
14 changed files with 985 additions and 179 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
export const GRAPH_ID = "authored_gpu_culling";
export const CATALOG_VERSION = 9;
export const CATALOG_VERSION = 10;
const exact = (type) => ({ kind: "exact", types: [type] });
const i = (type, required = true, authoringType, defaultPolicy = required ? "none" : "parameter_literal") => ({
accepted: typeof type === "string" ? exact(type) : type,
@@ -76,7 +76,7 @@ export const semanticCatalog = Object.freeze({
parameters: {},
},
texture: {
version: 1,
version: 2,
execution: "source",
inputs: {},
outputs: { texture: o("texture") },
@@ -108,7 +108,7 @@ export const semanticCatalog = Object.freeze({
parameters: { cameraSelection: "active" },
},
pipeline: {
version: 3,
version: 4,
execution: "render",
inputs: {
mesh: i("mesh_data"),
+8 -3
View File
@@ -4,11 +4,11 @@ const input = (node, socket) => ({ node, socket });
const node = (id, key, parameters = {}, inputs = {}) => ({
id, state: "enabled", executor: { key, version: descriptors[key].version }, parameters, inputs,
});
const texture = (format, scale = 1, heightScale = scale) => ({
const texture = (format, scale = 1, heightScale = scale, sampleCount = 1) => ({
texture: {
dimension: "d2", format,
extent: { kind: "surface_relative", width: { numerator: 1, denominator: scale }, height: { numerator: 1, denominator: heightScale }, depthOrArrayLayers: 1 },
mipLevelCount: 1, sampleCount: 1, viewFormats: [],
mipLevelCount: 1, sampleCount, viewFormats: [],
},
residency: "transient",
});
@@ -57,6 +57,11 @@ export const hdr = graph("preset_hdr_fullscreen", [
...scene(),
node("frame_out", "frame_out", frameOut(true), { color: input("pbr_double", "color") }),
]);
export const msaa = graph("preset_msaa", [
node("msaa_hdr", "texture", texture("rgba16_float", 1, 1, 4)),
...scene("msaa_hdr"),
node("frame_out", "frame_out", frameOut(true), { color: input("pbr_double", "color") }),
]);
export const culling = graph("preset_gpu_culling", (() => {
return [...scene(undefined, undefined, 1, true), node("frame_out", "frame_out", frameOut(true), { color: input("pbr_double", "color") })];
})());
@@ -108,4 +113,4 @@ export const grading = graph("preset_grading", [
node("mixer", "channel_mixer", { redOutput: [1,0,0], greenOutput: [0,1,0], blueOutput: [0,0,1], factor: 1 }, { source: input("saturation", "color"), colorTarget: input("mixer_hdr", "texture") }),
node("frame_out", "frame_out", frameOut(true), { color: input("mixer", "color") }),
]);
export const renderGraphPresets = Object.freeze({ midnight, ember, hdr, culling, tone, contain, reinhard, linear, grading, edges, bloom, combined });
export const renderGraphPresets = Object.freeze({ midnight, ember, hdr, msaa, culling, tone, contain, reinhard, linear, grading, edges, bloom, combined });