- Add header to define uniforms/other api variables for the cull shader.
This commit is contained in:
Jozufozu 2024-01-19 11:52:09 -08:00
parent 233cf4e7a8
commit c13b7637c5
2 changed files with 7 additions and 0 deletions

View file

@ -22,6 +22,7 @@ import com.jozufozu.flywheel.backend.glsl.SourceComponent;
import net.minecraft.resources.ResourceLocation;
public class IndirectPrograms extends AbstractPrograms {
private static final ResourceLocation CULL_SHADER_HEADER = Flywheel.rl("internal/indirect/cull_header.glsl");
private static final ResourceLocation CULL_SHADER_MAIN = Flywheel.rl("internal/indirect/cull.glsl");
private static final ResourceLocation APPLY_SHADER_MAIN = Flywheel.rl("internal/indirect/apply.glsl");
private static final ResourceLocation SCATTER_SHADER_MAIN = Flywheel.rl("internal/indirect/scatter.glsl");
@ -74,6 +75,7 @@ public class IndirectPrograms extends AbstractPrograms {
return CULL.program()
.link(CULL.shader(GlslVersion.V460, ShaderType.COMPUTE)
.define("_FLW_SUBGROUP_SIZE", GlCompat.SUBGROUP_SIZE)
.withResource(CULL_SHADER_HEADER)
.withComponent(IndirectComponent::create)
.withResource(InstanceType::cullShader)
.withResource(CULL_SHADER_MAIN))

View file

@ -0,0 +1,5 @@
#include "flywheel:internal/uniforms/frame.glsl"
// Fog doesn't seem like a valid thing to query during the cull pass. Other uniforms added in the
// future may also be excluded, and we'll have to document each one.
// #include "flywheel:internal/uniforms/fog.glsl"