mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 07:26:48 +01:00
The great migration
- Move gl -> backend.gl - Move glsl -> backend.glsl - Move lib.layout -> backend.gl.layout
This commit is contained in:
parent
6047a05ec6
commit
dd64ac860c
124 changed files with 284 additions and 322 deletions
|
@ -3,7 +3,7 @@ package com.jozufozu.flywheel.api.context;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.jozufozu.flywheel.api.registry.Registry;
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.impl.RegistryImpl;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.jozufozu.flywheel.api.instance;
|
|||
import com.jozufozu.flywheel.api.layout.Layout;
|
||||
import com.jozufozu.flywheel.api.registry.Registry;
|
||||
import com.jozufozu.flywheel.impl.RegistryImpl;
|
||||
import com.jozufozu.flywheel.lib.layout.BufferLayout;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
@ -21,13 +20,6 @@ public interface InstanceType<I extends Instance> {
|
|||
*/
|
||||
I create(InstanceHandle handle);
|
||||
|
||||
/**
|
||||
* @return The layout of I when buffered.
|
||||
* @deprecated Use {@link #layout()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
BufferLayout oldLayout();
|
||||
|
||||
Layout layout();
|
||||
|
||||
InstanceWriter<I> writer();
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.jozufozu.flywheel.backend.compile.IndirectPrograms;
|
|||
import com.jozufozu.flywheel.backend.compile.InstancingPrograms;
|
||||
import com.jozufozu.flywheel.backend.engine.indirect.IndirectEngine;
|
||||
import com.jozufozu.flywheel.backend.engine.instancing.InstancingEngine;
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.lib.backend.SimpleBackend;
|
||||
import com.jozufozu.flywheel.lib.util.ShadersModHandler;
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.jozufozu.flywheel.backend;
|
|||
|
||||
import com.jozufozu.flywheel.Flywheel;
|
||||
import com.jozufozu.flywheel.api.vertex.VertexView;
|
||||
import com.jozufozu.flywheel.lib.layout.BufferLayout;
|
||||
import com.jozufozu.flywheel.lib.layout.CommonItems;
|
||||
import com.jozufozu.flywheel.backend.gl.layout.BufferLayout;
|
||||
import com.jozufozu.flywheel.backend.gl.layout.CommonItems;
|
||||
import com.jozufozu.flywheel.lib.vertex.FullVertexView;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
|
|
@ -10,8 +10,8 @@ import com.jozufozu.flywheel.Flywheel;
|
|||
import com.jozufozu.flywheel.backend.compile.core.CompilerStats;
|
||||
import com.jozufozu.flywheel.backend.compile.core.ProgramLinker;
|
||||
import com.jozufozu.flywheel.backend.compile.core.ShaderCompiler;
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.glsl.ShaderSources;
|
||||
|
||||
public class CompilationHarness<K> {
|
||||
private final KeyCompiler<K> compiler;
|
||||
|
|
|
@ -16,12 +16,12 @@ import org.jetbrains.annotations.Nullable;
|
|||
import com.jozufozu.flywheel.backend.compile.core.Compilation;
|
||||
import com.jozufozu.flywheel.backend.compile.core.ProgramLinker;
|
||||
import com.jozufozu.flywheel.backend.compile.core.ShaderCompiler;
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.backend.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.backend.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@ import com.jozufozu.flywheel.backend.ShaderIndices;
|
|||
import com.jozufozu.flywheel.backend.compile.component.UberShaderComponent;
|
||||
import com.jozufozu.flywheel.backend.compile.component.UniformComponent;
|
||||
import com.jozufozu.flywheel.backend.compile.core.CompilerStats;
|
||||
import com.jozufozu.flywheel.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraft.server.packs.resources.ResourceManagerReloadListener;
|
||||
|
|
|
@ -11,12 +11,12 @@ import com.jozufozu.flywheel.api.context.Context;
|
|||
import com.jozufozu.flywheel.api.instance.InstanceType;
|
||||
import com.jozufozu.flywheel.backend.compile.component.IndirectComponent;
|
||||
import com.jozufozu.flywheel.backend.compile.component.UniformComponent;
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.backend.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.backend.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.lib.util.Unit;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
|
|
@ -10,9 +10,9 @@ import com.jozufozu.flywheel.Flywheel;
|
|||
import com.jozufozu.flywheel.api.context.Context;
|
||||
import com.jozufozu.flywheel.api.instance.InstanceType;
|
||||
import com.jozufozu.flywheel.backend.compile.component.UniformComponent;
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
|
||||
public class InstancingPrograms {
|
||||
static InstancingPrograms instance;
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.jozufozu.flywheel.backend.compile;
|
|||
import java.util.Objects;
|
||||
|
||||
import com.jozufozu.flywheel.api.instance.InstanceType;
|
||||
import com.jozufozu.flywheel.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ import java.util.List;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.jozufozu.flywheel.backend.InternalVertex;
|
||||
import com.jozufozu.flywheel.backend.compile.component.UniformComponent;
|
||||
import com.jozufozu.flywheel.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.backend.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
|
||||
public class PipelineCompiler {
|
||||
private static final Compile<PipelineProgramKey> PIPELINE = new Compile<>();
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.compile;
|
|||
import com.jozufozu.flywheel.Flywheel;
|
||||
import com.jozufozu.flywheel.backend.compile.component.IndirectComponent;
|
||||
import com.jozufozu.flywheel.backend.compile.component.InstancedArraysComponent;
|
||||
import com.jozufozu.flywheel.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.backend.glsl.GlslVersion;
|
||||
|
||||
public final class Pipelines {
|
||||
public static final Pipeline INSTANCED_ARRAYS = Pipeline.builder()
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.jozufozu.flywheel.backend.compile;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.jozufozu.flywheel.backend.compile.core.CompilerStats;
|
||||
import com.jozufozu.flywheel.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.backend.glsl.ShaderSources;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceFile;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ import com.jozufozu.flywheel.api.layout.UnsignedIntegerRepr;
|
|||
import com.jozufozu.flywheel.api.layout.VectorElementType;
|
||||
import com.jozufozu.flywheel.backend.compile.LayoutInterpreter;
|
||||
import com.jozufozu.flywheel.backend.compile.Pipeline;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBlock;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslStruct;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBlock;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslStruct;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@ import com.jozufozu.flywheel.Flywheel;
|
|||
import com.jozufozu.flywheel.api.layout.Layout;
|
||||
import com.jozufozu.flywheel.backend.compile.LayoutInterpreter;
|
||||
import com.jozufozu.flywheel.backend.compile.Pipeline;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBlock;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBlock;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.compile.component;
|
|||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ import org.jetbrains.annotations.Nullable;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.jozufozu.flywheel.backend.compile.SourceLoader;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBlock;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslSwitch;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBlock;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslSwitch;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ import java.util.List;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.jozufozu.flywheel.backend.compile.SourceLoader;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBuilder;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
|
|
|
@ -9,12 +9,12 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.lwjgl.opengl.GL20;
|
||||
|
||||
import com.jozufozu.flywheel.Flywheel;
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.backend.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.lib.util.StringUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
|
@ -9,9 +9,9 @@ import java.util.stream.Collectors;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.jozufozu.flywheel.Flywheel;
|
||||
import com.jozufozu.flywheel.glsl.LoadError;
|
||||
import com.jozufozu.flywheel.glsl.LoadResult;
|
||||
import com.jozufozu.flywheel.glsl.error.ErrorBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.LoadError;
|
||||
import com.jozufozu.flywheel.backend.glsl.LoadResult;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.ErrorBuilder;
|
||||
import com.jozufozu.flywheel.lib.util.StringUtil;
|
||||
|
||||
public class CompilerStats {
|
||||
|
|
|
@ -11,12 +11,12 @@ import java.util.stream.Stream;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.jozufozu.flywheel.Flywheel;
|
||||
import com.jozufozu.flywheel.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.glsl.SourceLines;
|
||||
import com.jozufozu.flywheel.glsl.error.ConsoleColors;
|
||||
import com.jozufozu.flywheel.glsl.error.ErrorBuilder;
|
||||
import com.jozufozu.flywheel.glsl.error.ErrorLevel;
|
||||
import com.jozufozu.flywheel.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceLines;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.ConsoleColors;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.ErrorBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.ErrorLevel;
|
||||
import com.jozufozu.flywheel.backend.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.lib.util.StringUtil;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.compile.core;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
|
||||
public sealed interface LinkResult {
|
||||
@Nullable
|
||||
|
|
|
@ -12,8 +12,8 @@ import java.util.List;
|
|||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlShader;
|
||||
|
||||
public class ProgramLinker {
|
||||
private final CompilerStats stats;
|
||||
|
|
|
@ -10,10 +10,10 @@ import java.util.function.Consumer;
|
|||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.jozufozu.flywheel.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.glsl.SourceComponent;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.backend.glsl.GlslVersion;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceComponent;
|
||||
|
||||
public class ShaderCompiler {
|
||||
private final Map<ShaderKey, ShaderResult> shaderCache = new HashMap<>();
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.compile.core;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.jozufozu.flywheel.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlShader;
|
||||
|
||||
public sealed interface ShaderResult {
|
||||
@Nullable
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.engine;
|
|||
import com.jozufozu.flywheel.api.material.Material;
|
||||
import com.jozufozu.flywheel.api.material.Transparency;
|
||||
import com.jozufozu.flywheel.api.material.WriteMask;
|
||||
import com.jozufozu.flywheel.gl.GlTextureUnit;
|
||||
import com.jozufozu.flywheel.backend.gl.GlTextureUnit;
|
||||
import com.jozufozu.flywheel.lib.material.CutoutShaders;
|
||||
import com.jozufozu.flywheel.lib.material.FogShaders;
|
||||
import com.jozufozu.flywheel.lib.material.SimpleMaterial;
|
||||
|
|
|
@ -11,8 +11,8 @@ import com.jozufozu.flywheel.api.layout.ScalarElementType;
|
|||
import com.jozufozu.flywheel.api.layout.UnsignedIntegerRepr;
|
||||
import com.jozufozu.flywheel.api.layout.ValueRepr;
|
||||
import com.jozufozu.flywheel.api.layout.VectorElementType;
|
||||
import com.jozufozu.flywheel.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.backend.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.backend.gl.array.VertexAttribute;
|
||||
|
||||
public class LayoutAttributes {
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.jozufozu.flywheel.api.material.DepthTest;
|
|||
import com.jozufozu.flywheel.api.material.Material;
|
||||
import com.jozufozu.flywheel.api.material.Transparency;
|
||||
import com.jozufozu.flywheel.api.material.WriteMask;
|
||||
import com.jozufozu.flywheel.gl.GlTextureUnit;
|
||||
import com.jozufozu.flywheel.backend.gl.GlTextureUnit;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.lwjgl.opengl.GL32;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.jozufozu.flywheel.api.event.ReloadLevelRendererEvent;
|
||||
import com.jozufozu.flywheel.api.uniform.ShaderUniforms;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.lib.math.MoreMath;
|
||||
import com.jozufozu.flywheel.lib.memory.MemoryBlock;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import static org.lwjgl.opengl.GL44.nglBindBuffersRange;
|
|||
import org.lwjgl.system.MemoryUtil;
|
||||
import org.lwjgl.system.Pointer;
|
||||
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.lib.memory.MemoryBlock;
|
||||
|
||||
public class IndirectBuffers {
|
||||
|
|
|
@ -25,9 +25,9 @@ import com.jozufozu.flywheel.api.model.Model;
|
|||
import com.jozufozu.flywheel.backend.compile.IndirectPrograms;
|
||||
import com.jozufozu.flywheel.backend.engine.MaterialRenderState;
|
||||
import com.jozufozu.flywheel.backend.engine.UniformBuffer;
|
||||
import com.jozufozu.flywheel.gl.Driver;
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.gl.Driver;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.lib.context.Contexts;
|
||||
|
||||
public class IndirectCullingGroup<I extends Instance> {
|
||||
|
|
|
@ -23,8 +23,8 @@ import com.jozufozu.flywheel.backend.engine.InstanceHandleImpl;
|
|||
import com.jozufozu.flywheel.backend.engine.InstancerKey;
|
||||
import com.jozufozu.flywheel.backend.engine.InstancerStorage;
|
||||
import com.jozufozu.flywheel.backend.engine.MaterialRenderState;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.lib.material.SimpleMaterial;
|
||||
import com.jozufozu.flywheel.lib.memory.MemoryBlock;
|
||||
import com.jozufozu.flywheel.lib.util.Pair;
|
||||
|
|
|
@ -10,8 +10,8 @@ import com.jozufozu.flywheel.backend.engine.AbstractEngine;
|
|||
import com.jozufozu.flywheel.backend.engine.AbstractInstancer;
|
||||
import com.jozufozu.flywheel.backend.engine.InstancerStorage;
|
||||
import com.jozufozu.flywheel.backend.engine.MaterialRenderState;
|
||||
import com.jozufozu.flywheel.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.gl.GlTextureUnit;
|
||||
import com.jozufozu.flywheel.backend.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.backend.gl.GlTextureUnit;
|
||||
import com.jozufozu.flywheel.lib.task.Flag;
|
||||
import com.jozufozu.flywheel.lib.task.NamedFlag;
|
||||
import com.jozufozu.flywheel.lib.task.SyncedPlan;
|
||||
|
|
|
@ -10,9 +10,9 @@ import org.jetbrains.annotations.Nullable;
|
|||
import com.jozufozu.flywheel.api.model.Mesh;
|
||||
import com.jozufozu.flywheel.api.vertex.VertexView;
|
||||
import com.jozufozu.flywheel.backend.InternalVertex;
|
||||
import com.jozufozu.flywheel.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.gl.array.GlVertexArray;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.backend.gl.array.GlVertexArray;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.lib.memory.MemoryBlock;
|
||||
import com.jozufozu.flywheel.lib.model.QuadIndexSequence;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import static org.lwjgl.opengl.GL45.glCopyNamedBufferSubData;
|
|||
import static org.lwjgl.opengl.GL45.glCreateBuffers;
|
||||
import static org.lwjgl.opengl.GL45.glNamedBufferStorage;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlObject;
|
||||
import com.jozufozu.flywheel.backend.gl.GlObject;
|
||||
import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker;
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,9 +9,9 @@ import org.lwjgl.opengl.GL45C;
|
|||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import com.jozufozu.flywheel.backend.compile.IndirectPrograms;
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.gl.GlFence;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.GlFence;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker;
|
||||
import com.jozufozu.flywheel.lib.memory.MemoryBlock;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.jozufozu.flywheel.backend.engine.instancing;
|
|||
|
||||
import com.jozufozu.flywheel.backend.InternalVertex;
|
||||
import com.jozufozu.flywheel.backend.engine.InstanceHandleImpl;
|
||||
import com.jozufozu.flywheel.gl.array.GlVertexArray;
|
||||
import com.jozufozu.flywheel.backend.gl.array.GlVertexArray;
|
||||
|
||||
public class DrawCall {
|
||||
public final ShaderState shaderState;
|
||||
|
|
|
@ -7,9 +7,9 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import com.jozufozu.flywheel.api.model.IndexSequence;
|
||||
import com.jozufozu.flywheel.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.gl.buffer.Buffer;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBufferUsage;
|
||||
import com.jozufozu.flywheel.backend.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.Buffer;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBufferUsage;
|
||||
import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker;
|
||||
import com.jozufozu.flywheel.lib.model.QuadIndexSequence;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.jozufozu.flywheel.backend.engine.CommonCrumbling;
|
|||
import com.jozufozu.flywheel.backend.engine.InstanceHandleImpl;
|
||||
import com.jozufozu.flywheel.backend.engine.MaterialRenderState;
|
||||
import com.jozufozu.flywheel.backend.engine.UniformBuffer;
|
||||
import com.jozufozu.flywheel.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.backend.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.lib.context.Contexts;
|
||||
import com.jozufozu.flywheel.lib.material.SimpleMaterial;
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ import com.jozufozu.flywheel.api.instance.InstanceType;
|
|||
import com.jozufozu.flywheel.api.instance.InstanceWriter;
|
||||
import com.jozufozu.flywheel.backend.engine.AbstractInstancer;
|
||||
import com.jozufozu.flywheel.backend.engine.LayoutAttributes;
|
||||
import com.jozufozu.flywheel.gl.array.GlVertexArray;
|
||||
import com.jozufozu.flywheel.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBufferUsage;
|
||||
import com.jozufozu.flywheel.gl.buffer.MappedBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.array.GlVertexArray;
|
||||
import com.jozufozu.flywheel.backend.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBufferUsage;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.MappedBuffer;
|
||||
|
||||
public class InstancedInstancer<I extends Instance> extends AbstractInstancer<I> {
|
||||
private final List<VertexAttribute> instanceAttributes;
|
||||
|
|
|
@ -14,10 +14,10 @@ import com.jozufozu.flywheel.Flywheel;
|
|||
import com.jozufozu.flywheel.api.model.Mesh;
|
||||
import com.jozufozu.flywheel.api.vertex.VertexView;
|
||||
import com.jozufozu.flywheel.backend.InternalVertex;
|
||||
import com.jozufozu.flywheel.gl.GlPrimitive;
|
||||
import com.jozufozu.flywheel.gl.array.GlVertexArray;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.gl.buffer.MappedBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.GlPrimitive;
|
||||
import com.jozufozu.flywheel.backend.gl.array.GlVertexArray;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBuffer;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.MappedBuffer;
|
||||
|
||||
public class InstancedMeshPool {
|
||||
private final VertexView vertexView;
|
||||
|
|
|
@ -17,9 +17,9 @@ import com.jozufozu.flywheel.backend.engine.InstancerStorage;
|
|||
import com.jozufozu.flywheel.backend.engine.MaterialEncoder;
|
||||
import com.jozufozu.flywheel.backend.engine.MaterialRenderState;
|
||||
import com.jozufozu.flywheel.backend.engine.UniformBuffer;
|
||||
import com.jozufozu.flywheel.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.gl.GlTextureUnit;
|
||||
import com.jozufozu.flywheel.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.backend.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.backend.gl.GlTextureUnit;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
|
||||
import com.jozufozu.flywheel.lib.context.Contexts;
|
||||
import com.jozufozu.flywheel.lib.task.Flag;
|
||||
import com.jozufozu.flywheel.lib.task.NamedFlag;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
public enum Driver {
|
||||
NVIDIA,
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
import static org.lwjgl.opengl.GL32.GL_SIGNALED;
|
||||
import static org.lwjgl.opengl.GL32.GL_SYNC_GPU_COMMANDS_COMPLETE;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
// Utility class for safely dealing with gl object handles.
|
||||
public abstract class GlObject {
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl;
|
||||
package com.jozufozu.flywheel.backend.gl;
|
||||
|
||||
import static org.lwjgl.opengl.GL13.GL_TEXTURE0;
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package com.jozufozu.flywheel.gl.array;
|
||||
package com.jozufozu.flywheel.backend.gl.array;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL32;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlObject;
|
||||
import com.jozufozu.flywheel.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.backend.gl.GlObject;
|
||||
import com.jozufozu.flywheel.backend.gl.GlStateTracker;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
||||
public abstract class GlVertexArray extends GlObject {
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.array;
|
||||
package com.jozufozu.flywheel.backend.gl.array;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
import org.lwjgl.opengl.GL45C;
|
||||
import org.lwjgl.system.Checks;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.lib.util.FlwUtil;
|
||||
|
||||
public class GlVertexArrayDSA extends GlVertexArray {
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.array;
|
||||
package com.jozufozu.flywheel.backend.gl.array;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
@ -10,8 +10,8 @@ import org.lwjgl.opengl.GL32;
|
|||
import org.lwjgl.opengl.GL33C;
|
||||
import org.lwjgl.system.Checks;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.lib.util.FlwUtil;
|
||||
|
||||
public abstract class GlVertexArrayGL3 extends GlVertexArray {
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.array;
|
||||
package com.jozufozu.flywheel.backend.gl.array;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
@ -6,9 +6,9 @@ import java.util.List;
|
|||
import org.lwjgl.opengl.GL43C;
|
||||
import org.lwjgl.system.Checks;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType;
|
||||
import com.jozufozu.flywheel.lib.util.FlwUtil;
|
||||
|
||||
public class GlVertexArraySeparateAttributes extends GlVertexArray {
|
|
@ -1,6 +1,6 @@
|
|||
package com.jozufozu.flywheel.gl.array;
|
||||
package com.jozufozu.flywheel.backend.gl.array;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.backend.gl.GlNumericType;
|
||||
|
||||
public sealed interface VertexAttribute {
|
||||
int byteWidth();
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.buffer;
|
||||
package com.jozufozu.flywheel.backend.gl.buffer;
|
||||
|
||||
import org.lwjgl.opengl.GL15;
|
||||
import org.lwjgl.opengl.GL30;
|
||||
|
@ -6,7 +6,7 @@ import org.lwjgl.opengl.GL31;
|
|||
import org.lwjgl.opengl.GL45C;
|
||||
import org.lwjgl.system.Checks;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.gl.GlCompat;
|
||||
|
||||
public interface Buffer {
|
||||
Buffer IMPL = new DSA().fallback();
|
|
@ -1,8 +1,8 @@
|
|||
package com.jozufozu.flywheel.gl.buffer;
|
||||
package com.jozufozu.flywheel.backend.gl.buffer;
|
||||
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlObject;
|
||||
import com.jozufozu.flywheel.backend.gl.GlObject;
|
||||
import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker;
|
||||
import com.jozufozu.flywheel.lib.memory.MemoryBlock;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.buffer;
|
||||
package com.jozufozu.flywheel.backend.gl.buffer;
|
||||
|
||||
import org.lwjgl.opengl.GL15C;
|
||||
import org.lwjgl.opengl.GL21;
|
||||
|
@ -8,7 +8,7 @@ import org.lwjgl.opengl.GL40;
|
|||
import org.lwjgl.opengl.GL42;
|
||||
import org.lwjgl.opengl.GL43;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlStateTracker;
|
||||
import com.jozufozu.flywheel.backend.gl.GlStateTracker;
|
||||
|
||||
public enum GlBufferType {
|
||||
ARRAY_BUFFER(GL15C.GL_ARRAY_BUFFER, GL15C.GL_ARRAY_BUFFER_BINDING),
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.buffer;
|
||||
package com.jozufozu.flywheel.backend.gl.buffer;
|
||||
|
||||
import org.lwjgl.opengl.GL15;
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package com.jozufozu.flywheel.gl.buffer;
|
||||
package com.jozufozu.flywheel.backend.gl.buffer;
|
||||
|
||||
import static org.lwjgl.opengl.GL30.GL_MAP_WRITE_BIT;
|
||||
import static org.lwjgl.system.MemoryUtil.NULL;
|
||||
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import com.jozufozu.flywheel.gl.error.GlError;
|
||||
import com.jozufozu.flywheel.gl.error.GlException;
|
||||
import com.jozufozu.flywheel.backend.gl.error.GlError;
|
||||
import com.jozufozu.flywheel.backend.gl.error.GlException;
|
||||
|
||||
public class MappedBuffer implements AutoCloseable {
|
||||
private final int glBuffer;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.buffer;
|
||||
package com.jozufozu.flywheel.backend.gl.buffer;
|
||||
|
||||
import org.lwjgl.opengl.GL15C;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.error;
|
||||
package com.jozufozu.flywheel.backend.gl.error;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.error;
|
||||
package com.jozufozu.flywheel.backend.gl.error;
|
||||
|
||||
public class GlException extends RuntimeException {
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.jozufozu.flywheel.lib.layout;
|
||||
package com.jozufozu.flywheel.backend.gl.layout;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.jozufozu.flywheel.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.backend.gl.array.VertexAttribute;
|
||||
|
||||
/**
|
||||
* Classic Vertex Format with a clever name.
|
|
@ -1,9 +1,9 @@
|
|||
package com.jozufozu.flywheel.lib.layout;
|
||||
package com.jozufozu.flywheel.backend.gl.layout;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.backend.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
|
||||
public final class CommonItems {
|
||||
private static final String VEC2_TYPE = "vec2";
|
|
@ -1,10 +1,10 @@
|
|||
package com.jozufozu.flywheel.lib.layout;
|
||||
package com.jozufozu.flywheel.backend.gl.layout;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
|
||||
public interface InputType {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.lib.layout;
|
||||
package com.jozufozu.flywheel.backend.gl.layout;
|
||||
|
||||
public record LayoutItem(InputType type, String name) {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
package com.jozufozu.flywheel.lib.layout;
|
||||
package com.jozufozu.flywheel.backend.gl.layout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.gl.GlNumericType;
|
||||
import com.jozufozu.flywheel.backend.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.FnSignature;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
|
||||
public record MatInput(int rows, int cols, String typeName, String packedTypeName,
|
||||
String unpackingFunction) implements InputType {
|
|
@ -1,11 +1,11 @@
|
|||
package com.jozufozu.flywheel.lib.layout;
|
||||
package com.jozufozu.flywheel.backend.gl.layout;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.jozufozu.flywheel.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.glsl.generate.GlslExpr;
|
||||
import com.jozufozu.flywheel.backend.gl.array.VertexAttribute;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.generate.GlslExpr;
|
||||
|
||||
public class VecInput implements InputType {
|
||||
private final VertexAttribute attribute;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.shader;
|
||||
package com.jozufozu.flywheel.backend.gl.shader;
|
||||
|
||||
import static org.lwjgl.opengl.GL20.glDeleteProgram;
|
||||
import static org.lwjgl.opengl.GL20.glGetUniformLocation;
|
||||
|
@ -9,7 +9,7 @@ import static org.lwjgl.opengl.GL31.glUniformBlockBinding;
|
|||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlObject;
|
||||
import com.jozufozu.flywheel.backend.gl.GlObject;
|
||||
import com.mojang.blaze3d.shaders.ProgramManager;
|
||||
import com.mojang.logging.LogUtils;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.jozufozu.flywheel.gl.shader;
|
||||
package com.jozufozu.flywheel.backend.gl.shader;
|
||||
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
||||
import com.jozufozu.flywheel.gl.GlObject;
|
||||
import com.jozufozu.flywheel.backend.gl.GlObject;
|
||||
|
||||
public class GlShader extends GlObject {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.gl.shader;
|
||||
package com.jozufozu.flywheel.backend.gl.shader;
|
||||
|
||||
import org.lwjgl.opengl.GL20;
|
||||
import org.lwjgl.opengl.GL43;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl;
|
||||
package com.jozufozu.flywheel.backend.glsl;
|
||||
|
||||
public enum GlslVersion {
|
||||
V110(110),
|
|
@ -1,12 +1,12 @@
|
|||
package com.jozufozu.flywheel.glsl;
|
||||
package com.jozufozu.flywheel.backend.glsl;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.jozufozu.flywheel.glsl.error.ErrorBuilder;
|
||||
import com.jozufozu.flywheel.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.ErrorBuilder;
|
||||
import com.jozufozu.flywheel.backend.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.lib.util.Pair;
|
||||
|
||||
import net.minecraft.ResourceLocationException;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl;
|
||||
package com.jozufozu.flywheel.backend.glsl;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl;
|
||||
package com.jozufozu.flywheel.backend.glsl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl;
|
||||
package com.jozufozu.flywheel.backend.glsl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl;
|
||||
package com.jozufozu.flywheel.backend.glsl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -12,12 +12,12 @@ import org.jetbrains.annotations.Nullable;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.jozufozu.flywheel.glsl.parse.Import;
|
||||
import com.jozufozu.flywheel.glsl.parse.ShaderField;
|
||||
import com.jozufozu.flywheel.glsl.parse.ShaderFunction;
|
||||
import com.jozufozu.flywheel.glsl.parse.ShaderStruct;
|
||||
import com.jozufozu.flywheel.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.glsl.span.StringSpan;
|
||||
import com.jozufozu.flywheel.backend.glsl.parse.Import;
|
||||
import com.jozufozu.flywheel.backend.glsl.parse.ShaderField;
|
||||
import com.jozufozu.flywheel.backend.glsl.parse.ShaderFunction;
|
||||
import com.jozufozu.flywheel.backend.glsl.parse.ShaderStruct;
|
||||
import com.jozufozu.flywheel.backend.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.backend.glsl.span.StringSpan;
|
||||
import com.jozufozu.flywheel.lib.util.Pair;
|
||||
import com.jozufozu.flywheel.lib.util.ResourceUtil;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl;
|
||||
package com.jozufozu.flywheel.backend.glsl;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -6,7 +6,7 @@ import java.util.regex.Pattern;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.jozufozu.flywheel.glsl.span.CharPos;
|
||||
import com.jozufozu.flywheel.backend.glsl.span.CharPos;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error;
|
||||
package com.jozufozu.flywheel.backend.glsl.error;
|
||||
|
||||
// https://stackoverflow.com/a/45444716
|
||||
public final class ConsoleColors {
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error;
|
||||
package com.jozufozu.flywheel.backend.glsl.error;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -9,16 +9,16 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.VisibleForTesting;
|
||||
|
||||
import com.jozufozu.flywheel.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.glsl.SourceLines;
|
||||
import com.jozufozu.flywheel.glsl.error.lines.ErrorLine;
|
||||
import com.jozufozu.flywheel.glsl.error.lines.FileLine;
|
||||
import com.jozufozu.flywheel.glsl.error.lines.HeaderLine;
|
||||
import com.jozufozu.flywheel.glsl.error.lines.NestedLine;
|
||||
import com.jozufozu.flywheel.glsl.error.lines.SourceLine;
|
||||
import com.jozufozu.flywheel.glsl.error.lines.SpanHighlightLine;
|
||||
import com.jozufozu.flywheel.glsl.error.lines.TextLine;
|
||||
import com.jozufozu.flywheel.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceFile;
|
||||
import com.jozufozu.flywheel.backend.glsl.SourceLines;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.lines.ErrorLine;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.lines.FileLine;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.lines.HeaderLine;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.lines.NestedLine;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.lines.SourceLine;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.lines.SpanHighlightLine;
|
||||
import com.jozufozu.flywheel.backend.glsl.error.lines.TextLine;
|
||||
import com.jozufozu.flywheel.backend.glsl.span.Span;
|
||||
import com.jozufozu.flywheel.lib.util.StringUtil;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error;
|
||||
package com.jozufozu.flywheel.backend.glsl.error;
|
||||
|
||||
public enum ErrorLevel {
|
||||
WARN(ConsoleColors.YELLOW, "warn"),
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error.lines;
|
||||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public enum Divider {
|
||||
BAR(" | "),
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error.lines;
|
||||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public interface ErrorLine {
|
||||
|
||||
|
@ -6,8 +6,8 @@ public interface ErrorLine {
|
|||
return left().length();
|
||||
}
|
||||
|
||||
default Divider divider() {
|
||||
return Divider.BAR;
|
||||
default com.jozufozu.flywheel.glsl.error.lines.Divider divider() {
|
||||
return com.jozufozu.flywheel.glsl.error.lines.Divider.BAR;
|
||||
}
|
||||
|
||||
default String build() {
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error.lines;
|
||||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public record FileLine(String fileName) implements ErrorLine {
|
||||
|
||||
|
@ -8,8 +8,8 @@ public record FileLine(String fileName) implements ErrorLine {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Divider divider() {
|
||||
return Divider.ARROW;
|
||||
public com.jozufozu.flywheel.glsl.error.lines.Divider divider() {
|
||||
return com.jozufozu.flywheel.glsl.error.lines.Divider.ARROW;
|
||||
}
|
||||
|
||||
@Override
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error.lines;
|
||||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public record HeaderLine(String level, CharSequence message) implements ErrorLine {
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public record NestedLine(String right) implements ErrorLine {
|
||||
@Override
|
||||
public String right() {
|
||||
return right;
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.jozufozu.flywheel.glsl.error.lines.Divider divider() {
|
||||
return com.jozufozu.flywheel.glsl.error.lines.Divider.EQUALS;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error.lines;
|
||||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public record SourceLine(String number, String line) implements ErrorLine {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error.lines;
|
||||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public class SpanHighlightLine implements ErrorLine {
|
||||
private final String line;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.error.lines;
|
||||
package com.jozufozu.flywheel.backend.glsl.error.lines;
|
||||
|
||||
public record TextLine(String msg) implements ErrorLine {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
public enum BinOp {
|
||||
BITWISE_AND("&"),
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
public interface GlslStmt {
|
||||
GlslStmt BREAK = () -> "break;";
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jozufozu.flywheel.glsl.generate;
|
||||
package com.jozufozu.flywheel.backend.glsl.generate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue