Remove shader packs
A developer of Iris showed that Horizon's shader pack code was written from Iris's source. This removes it: the horizon-shaderpack crate, Java pack loading and its render stages, Horizon's own WGSL packs and the example packs, the Shader Packs screen and its option, the launcher's shader pack browsing and installing, and the docs about them. Shader packs may come back later as a clean-room rewrite. The vanilla renderer and its post-processing (resolution scale, FXAA) are unchanged. Options files that name a pack load and drop the key; the launcher reads manifests that list a shader pack, and files in `shaderpacks/` are never deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,12 +46,6 @@ fn support_by_kind() {
|
||||
old.reason().unwrap().starts_with("Made for 1.21.10:"),
|
||||
"{old:?}"
|
||||
);
|
||||
assert!(support(Kind::ShaderPack, &[], &v(&["iris"])).installable());
|
||||
assert!(support(Kind::ShaderPack, &[], &v(&["optifine"])).installable());
|
||||
let canvas = support(Kind::ShaderPack, &[], &v(&["canvas"]));
|
||||
assert!(!canvas.installable());
|
||||
assert!(canvas.reason().unwrap().contains("canvas"));
|
||||
assert!(!support(Kind::ShaderPack, &[], &[]).installable());
|
||||
assert!(support(Kind::Modpack, &v(&["1.21.1"]), &v(&["neoforge"])).installable());
|
||||
}
|
||||
|
||||
@@ -70,14 +64,6 @@ fn picks_the_newest_version_that_runs() {
|
||||
assert!(pick(Kind::ResourcePack, &old, false).is_none());
|
||||
assert_eq!(pick(Kind::ResourcePack, &old, true).unwrap().id, "old");
|
||||
|
||||
let shaders = [
|
||||
version("canvas", &[GAME], &["canvas"]),
|
||||
version("iris", &["1.21.1"], &["iris"]),
|
||||
];
|
||||
assert_eq!(pick(Kind::ShaderPack, &shaders, false).unwrap().id, "iris");
|
||||
let only_canvas = [version("canvas", &[GAME], &["canvas"])];
|
||||
assert!(pick(Kind::ShaderPack, &only_canvas, true).is_none());
|
||||
|
||||
let mut blocked = version("blocked", &[GAME], &["minecraft"]);
|
||||
blocked.blocked = Some("no".into());
|
||||
let mut empty = version("empty", &[GAME], &["minecraft"]);
|
||||
@@ -90,7 +76,7 @@ fn file_names_must_be_plain() {
|
||||
for good in [
|
||||
"Faithful 32x.zip",
|
||||
"FreshAnimations_v1.11.1_26.1+.zip",
|
||||
"BSL_v10.zip",
|
||||
"Faithful_v10.zip",
|
||||
] {
|
||||
assert_eq!(safe_name(good), Some(good));
|
||||
}
|
||||
@@ -122,12 +108,7 @@ fn modrinth_search_asks_for_what_runs() {
|
||||
url.contains("&index=relevance&") && url.ends_with("&query=faithful"),
|
||||
"{url}"
|
||||
);
|
||||
let shaders = Query::new("", Kind::ShaderPack);
|
||||
assert_eq!(
|
||||
modrinth::facets(&shaders),
|
||||
r#"[["project_type:shader"],["categories:iris","categories:optifine"]]"#
|
||||
);
|
||||
assert!(modrinth::search_url(&shaders).contains("&index=downloads&"));
|
||||
assert!(modrinth::search_url(&Query::new("", Kind::ResourcePack)).contains("&index=downloads&"));
|
||||
let everything = Query {
|
||||
everything: true,
|
||||
..Query::new("", Kind::ResourcePack)
|
||||
@@ -169,7 +150,7 @@ fn java_mods_are_checked_for_1_21_and_later() {
|
||||
}
|
||||
let versions = [
|
||||
version("snapshot", &["26.4-snapshot-1"], &["fabric"]),
|
||||
version("shaders", &[GAME], &["iris"]),
|
||||
version("plugin", &[GAME], &["bukkit"]),
|
||||
version("now", &[GAME], &["neoforge"]),
|
||||
version("older", &["1.21.1"], &["neoforge"]),
|
||||
];
|
||||
@@ -200,23 +181,22 @@ fn modrinth_answers() {
|
||||
assert_eq!(sodium.kind, Kind::Mod);
|
||||
assert_eq!(sodium.page, "https://modrinth.com/mod/sodium");
|
||||
assert!(matches!(sodium.support(), Support::Partial(_)));
|
||||
// Data packs and plugins are not.
|
||||
let plugin = json!({"project_id": "x", "project_type": "plugin", "slug": "p"});
|
||||
assert!(modrinth::parse_hit(&plugin).is_none());
|
||||
// Data packs, plugins and shader packs are not.
|
||||
for project_type in ["plugin", "shader"] {
|
||||
let hit = json!({"project_id": "x", "project_type": project_type, "slug": "p"});
|
||||
assert!(modrinth::parse_hit(&hit).is_none(), "{project_type}");
|
||||
}
|
||||
|
||||
let project = json!({
|
||||
"id": "HVnmMxH1", "project_type": "shader", "slug": "complementary-reimagined",
|
||||
"title": "Complementary Shaders - Reimagined", "description": "d",
|
||||
"license": {"id": "LicenseRef-Complementary", "name": ""},
|
||||
"game_versions": ["1.21.1"], "loaders": ["iris", "optifine"]
|
||||
"id": "HVnmMxH1", "project_type": "resourcepack", "slug": "fresh-animations",
|
||||
"title": "Fresh Animations", "description": "d",
|
||||
"license": {"id": "LicenseRef-Custom", "name": ""},
|
||||
"game_versions": ["26.3"], "loaders": ["minecraft"]
|
||||
});
|
||||
let p = modrinth::parse_project(&project).unwrap();
|
||||
assert_eq!(p.kind, Kind::ShaderPack);
|
||||
assert_eq!(p.license, "LicenseRef-Complementary");
|
||||
assert_eq!(
|
||||
p.page,
|
||||
"https://modrinth.com/shader/complementary-reimagined"
|
||||
);
|
||||
assert_eq!(p.kind, Kind::ResourcePack);
|
||||
assert_eq!(p.license, "LicenseRef-Custom");
|
||||
assert_eq!(p.page, "https://modrinth.com/resourcepack/fresh-animations");
|
||||
assert!(p.support().installable());
|
||||
|
||||
let version = json!({
|
||||
@@ -259,33 +239,32 @@ fn curseforge_stays_off_without_a_key() {
|
||||
|
||||
#[test]
|
||||
fn curseforge_answers() {
|
||||
let q = Query::new("bsl", Kind::ShaderPack);
|
||||
let q = Query::new("faithful", Kind::ResourcePack);
|
||||
let url = curseforge::search_url(&q);
|
||||
assert!(url.contains("gameId=432&classId=6552&"), "{url}");
|
||||
assert!(url.contains("gameId=432&classId=12&"), "{url}");
|
||||
assert!(
|
||||
!url.contains("gameVersion=") && url.ends_with("&searchFilter=bsl"),
|
||||
url.contains("&gameVersion=26.3") && url.ends_with("&searchFilter=faithful"),
|
||||
"{url}"
|
||||
);
|
||||
assert!(
|
||||
curseforge::search_url(&Query::new("", Kind::ResourcePack)).contains("&gameVersion=26.3")
|
||||
);
|
||||
|
||||
let m = json!({
|
||||
"id": 228756, "classId": 6552, "slug": "bsl-shaders", "name": "BSL Shaders",
|
||||
"summary": "s", "authors": [{"name": "CaptTatsu"}], "downloadCount": 1.5e7,
|
||||
"links": {"websiteUrl": "https://www.curseforge.com/minecraft/shaders/bsl-shaders"},
|
||||
"id": 238222, "classId": 6, "slug": "jei", "name": "Just Enough Items",
|
||||
"summary": "s", "authors": [{"name": "mezz"}], "downloadCount": 1.5e7,
|
||||
"links": {"websiteUrl": "https://www.curseforge.com/minecraft/mc-mods/jei"},
|
||||
"logo": {"thumbnailUrl": "https://media.forgecdn.net/avatars/thumbnails/x.png"},
|
||||
"latestFilesIndexes": [{"gameVersion": "1.21.1"}],
|
||||
"latestFiles": [{"gameVersions": ["1.21.1", "Iris", "OptiFine"]}]
|
||||
"latestFilesIndexes": [{"gameVersion": "1.21.1"}, {"gameVersion": "NeoForge"}]
|
||||
});
|
||||
let p = curseforge::parse_mod(&m).unwrap();
|
||||
assert_eq!(
|
||||
(p.source, p.id.as_str(), p.kind),
|
||||
(SourceId::CurseForge, "228756", Kind::ShaderPack)
|
||||
(SourceId::CurseForge, "238222", Kind::Mod)
|
||||
);
|
||||
assert_eq!(p.loaders, ["iris", "optifine"]);
|
||||
assert_eq!(p.author, "CaptTatsu");
|
||||
assert_eq!(p.game_versions, ["1.21.1"]);
|
||||
assert_eq!(p.loaders, ["neoforge"]);
|
||||
assert_eq!(p.author, "mezz");
|
||||
assert!(p.support().installable());
|
||||
// Shader packs (class 6552) are not offered.
|
||||
assert!(curseforge::parse_mod(&json!({"id": 1, "classId": 6552})).is_none());
|
||||
assert_eq!(
|
||||
curseforge::parse_mod(&json!({"id": 1, "classId": 6})).map(|p| p.kind),
|
||||
Some(Kind::Mod)
|
||||
@@ -293,15 +272,15 @@ fn curseforge_answers() {
|
||||
assert!(curseforge::parse_mod(&json!({"id": 1, "classId": 17})).is_none());
|
||||
|
||||
let file = json!({
|
||||
"id": 5000, "displayName": "BSL v10", "fileName": "BSL_v10.zip", "fileLength": 300,
|
||||
"fileDate": "2026-01-01T00:00:00Z", "downloadUrl": "https://edge.forgecdn.net/files/5/0/BSL_v10.zip",
|
||||
"gameVersions": ["1.21.1", "Iris"],
|
||||
"id": 5000, "displayName": "JEI 19", "fileName": "jei-19.jar", "fileLength": 300,
|
||||
"fileDate": "2026-01-01T00:00:00Z", "downloadUrl": "https://edge.forgecdn.net/files/5/0/jei-19.jar",
|
||||
"gameVersions": ["1.21.1", "NeoForge"],
|
||||
"hashes": [{"value": "D41D8CD9", "algo": 2}, {"value": "DA39A3EE", "algo": 1}],
|
||||
"dependencies": [{"modId": 7, "relationType": 3}, {"modId": 8, "relationType": 2}]
|
||||
});
|
||||
let ver = curseforge::parse_file(&file).unwrap();
|
||||
assert_eq!(ver.required, ["7"]);
|
||||
assert_eq!(ver.loaders, ["iris"]);
|
||||
assert_eq!(ver.loaders, ["neoforge"]);
|
||||
assert_eq!(ver.file().unwrap().checksum(), Some(("SHA-1", "da39a3ee")));
|
||||
assert!(ver.blocked.is_none());
|
||||
let mut closed = file.clone();
|
||||
|
||||
Reference in New Issue
Block a user