use crate::analyses::candidate_plan::CandidatePlan;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TextureCandidate {
pub binding_slot: u32,
pub load_count: u32,
pub estimated_speedup_factor: f32,
}
pub type TexturePromotionPlan = CandidatePlan<TextureCandidate>;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn candidate_speedup_grows_with_log_load_count() {
let cand = TextureCandidate {
binding_slot: 0,
load_count: 8,
estimated_speedup_factor: 1.5 + 3.0, };
assert!((cand.estimated_speedup_factor - 4.5).abs() < 1e-5);
}
}