mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-28 16:06:28 +01:00
Scull
- Add header to define uniforms/other api variables for the cull shader.
This commit is contained in:
parent
233cf4e7a8
commit
c13b7637c5
2 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,7 @@ import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
|
||||||
public class IndirectPrograms extends AbstractPrograms {
|
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 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 APPLY_SHADER_MAIN = Flywheel.rl("internal/indirect/apply.glsl");
|
||||||
private static final ResourceLocation SCATTER_SHADER_MAIN = Flywheel.rl("internal/indirect/scatter.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()
|
return CULL.program()
|
||||||
.link(CULL.shader(GlslVersion.V460, ShaderType.COMPUTE)
|
.link(CULL.shader(GlslVersion.V460, ShaderType.COMPUTE)
|
||||||
.define("_FLW_SUBGROUP_SIZE", GlCompat.SUBGROUP_SIZE)
|
.define("_FLW_SUBGROUP_SIZE", GlCompat.SUBGROUP_SIZE)
|
||||||
|
.withResource(CULL_SHADER_HEADER)
|
||||||
.withComponent(IndirectComponent::create)
|
.withComponent(IndirectComponent::create)
|
||||||
.withResource(InstanceType::cullShader)
|
.withResource(InstanceType::cullShader)
|
||||||
.withResource(CULL_SHADER_MAIN))
|
.withResource(CULL_SHADER_MAIN))
|
||||||
|
|
|
@ -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"
|
Loading…
Reference in a new issue