core: manual buffer sync with sync-rows, reuse unchanged buffers and pipelines across activations
Also lets the screenshot suite point at another reference directory and settle longer. Amp-Thread-ID: https://ampcode.com/threads/T-01a0b2dd-db32-712d-99ce-12ce4a86d979 Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
@@ -85,7 +85,7 @@ pub struct PipelineDeclarations {
|
||||
pub compute: Vec<ComputePipeline>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct RenderPipeline {
|
||||
pub id: String,
|
||||
@@ -102,7 +102,7 @@ pub struct RenderPipeline {
|
||||
pub multisample: Value,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[derive(Clone, Deserialize, PartialEq, Eq)]
|
||||
pub struct ComputePipeline {
|
||||
pub id: String,
|
||||
pub code: String,
|
||||
@@ -110,7 +110,7 @@ pub struct ComputePipeline {
|
||||
pub entry: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[derive(Clone, Deserialize, PartialEq, Eq)]
|
||||
pub struct VertexStage {
|
||||
#[serde(default = "vertex_entry")]
|
||||
pub entry: String,
|
||||
@@ -127,7 +127,7 @@ impl Default for VertexStage {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Deserialize)]
|
||||
#[derive(Clone, Default, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct VertexBuffer {
|
||||
pub array_stride: u64,
|
||||
@@ -137,7 +137,7 @@ pub struct VertexBuffer {
|
||||
pub attributes: Vec<VertexAttribute>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[derive(Clone, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct VertexAttribute {
|
||||
pub format: String,
|
||||
@@ -145,7 +145,7 @@ pub struct VertexAttribute {
|
||||
pub shader_location: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
pub struct FragmentStage {
|
||||
#[serde(default = "fragment_entry")]
|
||||
pub entry: String,
|
||||
@@ -162,7 +162,7 @@ impl Default for FragmentStage {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[derive(Clone, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct FragmentTarget {
|
||||
pub format: String,
|
||||
@@ -519,7 +519,7 @@ impl RenderGraph {
|
||||
.resources
|
||||
.buffers
|
||||
.iter()
|
||||
.any(|buffer| !matches!(buffer.sync.as_str(), "frame" | "loadout"))
|
||||
.any(|buffer| !matches!(buffer.sync.as_str(), "frame" | "manual"))
|
||||
{
|
||||
return Err("GRAPH_BUFFER_SYNC");
|
||||
}
|
||||
@@ -561,6 +561,24 @@ impl Pass {
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderPipeline {
|
||||
/// Same GPU pipeline regardless of declaration ID.
|
||||
pub(crate) fn same_as(&self, other: &Self) -> bool {
|
||||
self.code == other.code
|
||||
&& self.vertex == other.vertex
|
||||
&& self.fragment == other.fragment
|
||||
&& self.primitive == other.primitive
|
||||
&& self.depth_stencil == other.depth_stencil
|
||||
&& self.multisample == other.multisample
|
||||
}
|
||||
}
|
||||
|
||||
impl ComputePipeline {
|
||||
pub(crate) fn same_as(&self, other: &Self) -> bool {
|
||||
self.code == other.code && self.entry == other.entry
|
||||
}
|
||||
}
|
||||
|
||||
impl Texture {
|
||||
pub(crate) fn key(&self) -> Result<String, &'static str> {
|
||||
let mut usage = self.usage.clone();
|
||||
|
||||
Reference in New Issue
Block a user