mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-18 19:39:09 +00:00
Fix NaNs on EP (#2231)
* Fix NaNs on EP * Also add hidden writes handling * optimize this mess * Another optimization pass
This commit is contained in:
1 parent
0d959c2b90
commit
159f7ff8cc
16 files changed
+968
-405
No files matched your search
@@ -108,7 +108,7 @@ public final class RwImageStoreExtractor {
|
||||
}
|
||||
|
||||
public static Result tryExtract(String source, PatchShaderType stage, String programName, RwExtractMode vertexMode) {
|
||||
if (source == null) return null;
|
||||
if (source == null || !mayWriteImages(source)) return null;
|
||||
if (stage != PatchShaderType.VERTEX && stage != PatchShaderType.FRAGMENT) return null;
|
||||
|
||||
final ShaderParser.ParsedShader parsed = ShaderParser.parseShader(source);
|
||||
@@ -146,8 +146,12 @@ public final class RwImageStoreExtractor {
|
||||
return new Result(stripped, compute, writtenImages, mode, atomicImages(root, writtenImages));
|
||||
}
|
||||
|
||||
private static boolean mayWriteImages(String source) {
|
||||
return source.contains("imageStore") || source.contains("imageAtomic");
|
||||
}
|
||||
|
||||
public static Result tryExtractVertexReplay(String source) {
|
||||
if (source == null) return null;
|
||||
if (source == null || !mayWriteImages(source)) return null;
|
||||
|
||||
final ShaderParser.ParsedShader parsed = ShaderParser.parseShader(source);
|
||||
final GLSLParser.Translation_unitContext root = parsed.full();
|
||||
|
||||
@@ -756,12 +756,6 @@ public class ShaderTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
public static void addIfNotExistsType(Transformer transformer, String name, String type) {
|
||||
if (!transformer.hasVariable(name)) {
|
||||
transformer.injectVariable(type + " " + name + ";");
|
||||
}
|
||||
}
|
||||
|
||||
private static final class CeleritasHeader {
|
||||
static final String VALUE = computeCeleritasHeader();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user