Shadow Compute Shaders (#1333)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2026-01-28 00:03:04 -08:00
1 parent b75a5d8f7d
commit bee9541797
37 files changed
+1111 -252

No files matched your search

@@ -21,6 +21,7 @@ public class ProgramDirectives {
private static final ImmutableList<String> LEGACY_RENDER_TARGETS = PackRenderTargetDirectives.LEGACY_RENDER_TARGETS;
private final int[] drawBuffers;
private boolean unknownDrawBuffers;
private final ViewportData viewportScale;
@Nullable
private final AlphaTestOverride alphaTestOverride;
@@ -40,6 +41,7 @@ public class ProgramDirectives {
this.bufferBlendInformations = bufferBlendInformations;
this.mipmappedBuffers = mipmappedBuffers;
this.explicitFlips = explicitFlips;
this.unknownDrawBuffers = false;
}
ProgramDirectives(ProgramSource source, ShaderProperties properties, Set<Integer> supportedRenderTargets, @Nullable BlendModeOverride defaultBlendOverride) {
@@ -53,7 +55,7 @@ public class ProgramDirectives {
final Optional<CommentDirective> optionalDrawbuffersDirective = findDrawbuffersDirective(source.getFragmentSource());
final Optional<CommentDirective> optionalRendertargetsDirective = findRendertargetsDirective(source.getFragmentSource());
final Optional<CommentDirective> optionalCommentDirective = getAppliedDirective(optionalDrawbuffersDirective, optionalRendertargetsDirective);
Optional<CommentDirective> optionalCommentDirective = getAppliedDirective(optionalDrawbuffersDirective, optionalRendertargetsDirective);
drawBuffers = optionalCommentDirective.map(commentDirective -> {
if (commentDirective.getType() == CommentDirective.Type.DRAWBUFFERS) {
return parseDigits(commentDirective.getDirective().toCharArray());
@@ -62,7 +64,10 @@ public class ProgramDirectives {
} else {
throw new IllegalStateException("Unhandled comment directive type!");
}
}).orElse(new int[] { 0 });
}).orElseGet(() -> {
unknownDrawBuffers = true;
return new int[]{0};
});
if (properties != null) {
viewportScale = properties.getViewportScaleOverrides().getOrDefault(source.getName(), ViewportData.defaultValue());
@@ -160,6 +165,10 @@ public class ProgramDirectives {
return drawBuffers;
}
public boolean hasUnknownDrawBuffers() {
return unknownDrawBuffers;
}
public ViewportData getViewportScale() {
return viewportScale;
}