Commit Graph

2438 Commits

Author SHA1 Message Date
Jozufozu
80001f0037 Indirectly materialized
- Pass material IDs through the indirect draw buffer
- Turns out buffers can be bound to both storage and draw indirect
- Use indexOf in ComponentRegistry to determine IDs
- Remove World/Crumbling Program and move sampler binding to
  ContextShader setup
2023-03-25 17:54:34 -07:00
Jozufozu
d197fe0a4f Uniforms!!!
- Basic idea is to let each mode get one uniform shader
- Uniform shader provides a struct with the mod's id as its name
- All structs get placed into one (1) ubo
- Uniforms are implicitly available in all shaders
- Add GlslUniformBlock for new codegen in UniformComponent
- Condense old uniform providers into one object
- ShaderStructs capture the optional variable name in struct definitions
- Change RecursiveIncluder to interleave root components with included
- GlProgram calls UniformBuffer#sync
2023-03-25 13:41:45 -07:00
PepperCode1
9a88bb96ab Move RenderStage from Material to InstancerManager#instancer 2023-03-24 17:04:22 -07:00
PepperCode1
bbcf019bc2 Remove InstancerFactory 2023-03-24 16:15:29 -07:00
PepperCode1
f370e85d6d Increment version 2023-01-13 16:08:32 -08:00
PepperCode1
83a5723420 Fix IndexedModel allocating incorrect amount of bytes
- model.size() returned the byte size relative to the model's
VertexType, but the byte size relative to the passed VertexType is
needed instead
2022-12-31 14:34:59 -08:00
Jozufozu
9a746f700d Finally have time off
- Attempt at componentizing ShaderCompiler, starting with Includer
 - Begin refactoring uniform providers
 - Context as an interface
 - Separate ContextSet objects for Pipeline shaders and Culling shaders
 - Inline ProgramAssembler
 - Replace StringUtil#trimEnd with String#stripTrailing
 - Add StringUtil#trimPrefix and #trimSuffix
2022-12-20 21:20:08 -08:00
Jozufozu
23c0ef6f33
Update changelog.txt 2022-12-14 09:16:21 -08:00
PepperCode1
27f2181752
Merge pull request #162 from marchermans/1.18/dev
Switch to the block vertex format for instancing
2022-12-08 15:05:16 -08:00
Marc Hermans
e04ae88073
Switch to the block vertex format. 2022-12-01 21:24:11 +01:00
PepperCode1
f56d0f9024 Models are (actually) temporary
- Call Model#delete on instancer delete
- Add constraint to modelSupplier in Material#model
- Fix memory leak in ModelPart
- Add ArrayModelRenderer#getModel
2022-11-22 13:04:03 -08:00
PepperCode1
f6d5ed01e7 A bit of backporting
- Backport general changes from 1.19
- Fix Javadoc of PartialModel
- Remove default Model#getType implementation
- Increment version to 0.6.8
- Update Parchment
2022-11-10 16:30:30 -08:00
PepperCode1
e328a270e2 Models are temporary
- Add Model.delete
- Allow BlockModel.createEBO to be called more than once for a single
instance
- Clear cache on QuadConverter.delete
2022-11-10 12:43:26 -08:00
Jozufozu
72a05ad35d State your state
- Address a few bugs with rubidium
 - Ignore EBOs when restoring state
 - ElementBuffer deals in raw gl handles
 - Document all state changes/restores/resets

Co-authored-by: PepperCode1 <44146161+peppercode1@users.noreply.github.com>
2022-11-10 12:39:01 -08:00
Jozufozu
ef568d22f7 Lyft shaders
- The ubershaders actually compile, but uniforms/material ids are broken
 - Convert vertex/fragment adapter components into generic builder
 - Support arbitrary adapted function signatures
 - Make an attempt at cleaning up generation code
2022-10-13 18:00:59 -07:00
Jozufozu
7a080a5538 Fix* the errors
- *make the errors understandable without actually solving them
 - Straighten out shader compilation/error generation
 - Interpret errors in generated code
 - Compilation returns a result type instead of throwing an exception
 - Still need to reimplement source checks?
 - Make error messages prettier
2022-10-11 20:16:15 -07:00
Jozufozu
99e4105e94 Taxi shaders
- Not *quite* ubershaders yet
 - Note: heavily broken
 - "Pull" based compilation
   - Sources are only ready when they are needed by the compiler
   - Compiler is responsible for import resolution
   - Compiler prepends file headers
 - Reduces need for FileResolution
   - May replace with ResourceLocations?
   - Not sure about the future of source checks
   - TODO: Lots of dead code left in FileResolution
 - PipelineShader -> Pipeline interface + Simple impl
   - Use Context object for assembler factory
2022-10-08 14:02:54 -07:00
Jozufozu
28e16a7810 Consolidated compilation
- Note: heavily broken
 - Move all compilation logic into a single package
 - FlwCompiler is responsible for compilation
 - CompilationEnvironment generates combinations and performs analysis
 - Create source components for vertex/fragment ubershader codegen
 - More hacky glsl generation utils
 - Strip explicit uniform buffers from uniform shaders
2022-09-29 20:41:44 -07:00
PepperCode1
36140623d3 Include new versions in bug report template 2022-09-28 20:05:41 -07:00
PepperCode1
098cb3ee70 Porting from all directions
- Diagonal-port restore state changes from 1.18/next
- Back-port buffer uploader changes and RenderLayerEvent dispatch point
change from 1.19/dev
- Make CrumblingRenderer return earlier if there is nothing to render
- Bump version
2022-09-21 15:34:58 -07:00
PepperCode1
79464361d2 Consists of inconsistency
- Make architecture of indirect engine and draw manager match that of
other engines and draw managers
2022-09-20 22:03:20 -07:00
PepperCode1
d3d5797fd3 Merge branch '1.18/batching-stage-support' into 1.18/next
Conflicts:
	src/main/java/com/jozufozu/flywheel/backend/Backend.java
	src/main/java/com/jozufozu/flywheel/backend/instancing/batching/DrawBuffer.java
	src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java
	src/main/java/com/jozufozu/flywheel/config/FlwConfig.java
	src/main/java/com/jozufozu/flywheel/core/hardcoded/ModelPart.java
	src/main/java/com/jozufozu/flywheel/core/model/SimpleMesh.java
2022-09-16 13:54:45 -07:00
PepperCode1
360ed4aa29 State restoration confusion
- Do not wrap BeginFrameEvent and RenderStageEvent with GL restore state
- Move GL state restoration into InstancingEngine
- Remove BufferUploaderMixin
- Add binding enum values to GlBufferType
- Remove debugNormals config
- Rename some occurrences of "world" to "level"
2022-09-16 13:32:13 -07:00
Jozufozu
cab922f187 Reorganize/rename
- No more set in builders
 - Move generated components to backend packages
 - Fix code organization
2022-09-15 12:37:18 -07:00
Jozufozu
03c2df4664 Instandirect
- Finishing touches on the unification
2022-09-12 22:32:30 -07:00
Jozufozu
cab7aff9c3 Fresh loaded entities here!
- Remove loaded chunk check from entity instance manager
2022-09-06 08:49:48 -07:00
Jozufozu
bf03f084c3 Inderinstanced 2022-09-06 00:48:00 -07:00
PepperCode1
5ac6065205 Memcpy: Batching Edition
- Add BatchedMeshPool
- Rename MeshPool to InstancedMeshPool
- Rename/remove/add methods to VertexList/ReusableVertexList
2022-08-24 17:51:24 -07:00
Jozufozu
61c2c76b47 Back-and better than ever
- Move BackendType to backend package
 - BackendType is now an interface whose implementors must be registered
2022-08-22 22:17:36 -07:00
PepperCode1
d7613fc5e4 Add batching stage support 2022-08-22 20:00:21 -07:00
Jozufozu
94bd6f4b98 Merge branch '1.18/culling' into 1.18/next
# Conflicts:
#	build.gradle
#	src/main/java/com/jozufozu/flywheel/Flywheel.java
#	src/main/java/com/jozufozu/flywheel/backend/Loader.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingDrawTracker.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/MeshPool.java
#	src/main/java/com/jozufozu/flywheel/core/compile/ProgramCompiler.java
#	src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingRenderer.java
#	src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
#	src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java
#	src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix3fMixin.java
#	src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix4fMixin.java
2022-08-22 17:18:13 -07:00
Jozufozu
04d291e01b Merge ease 2022-08-22 15:33:03 -07:00
Jozufozu
57f6a48969 One liners
- Fix nothing rendering + gl error spam when renderdoc is not attached
 - Fix fog rendering incorrectly with indirect
2022-08-21 23:02:43 -07:00
PepperCode1
d3c280d298 Fix flickering with batching
- Call syncPoint before submitting tasks
- Reset DrawBuffer even if it has no vertices when drawing
2022-08-21 20:56:22 -07:00
Jozufozu
9a4cfbe47c Cool Command Captures/Pauses
- Add frustum debug utility
 - Fix scaling for transformed bounding spheres
2022-08-21 17:35:43 -07:00
Jozufozu
f84b169bd7 Indirectly packed
- Use glsl structs to pack vec/mat data in ssbos
 - Support RenderStages
 - Dynamically sized draw storage
2022-08-21 16:47:15 -07:00
Jozufozu
ebef176089 Dynamically indirect
- Indirect engine now only allocates as much memory as it needs
2022-08-20 20:50:26 -07:00
PepperCode1
8bea467409 BatchingTransformManager
- Rename BatchingDrawManager to BatchingTransformManager
- Rename BatchDrawingTracker to BatchingDrawTracker
- Move BatchDrawingTracker from BatchingTransformManager to
BatchingEngine
- Do not prepare DrawBuffer if number of vertices is 0
- Add DrawBuffer#isPrepared
- Add checks to DrawBuffer methods
- Remove commented code from CPUInstancerFactory
2022-08-20 19:12:44 -07:00
PepperCode1
ba30aca869 BatchingDrawManager
- Merge BatchLists, BatchedModel, and some parts of BatchingEngine into
BatchingDrawManager for consistency with instancing code
- Have InstancingEngine accept the max origin distance as a constructor
parameter
- Rename TransformSet to TransformCall
2022-08-19 17:24:13 -07:00
PepperCode1
2fe69350ef No more leaks
- Free all DrawBuffers on renderer reload
- Add flw.debugMemorySafety flag to detect leaked untracked MemoryBlocks
- Replace VertexListProviderRegistry with static methods in
VertexListProvider and a VertexFormatMixin
- Make the DrawBuffer constructor accept a VertexFormat instead of a
RenderType
- Merge TStack into TransformStack
- Move all duck interfaces/extensions to extension package
- Make mixin style more consistent
2022-08-17 16:20:31 -07:00
Jozufozu
cfa79ec550 MeshP... InstancedMo... DrawC... RenderLists refactor
- RenderLists -> InstancingDrawManager, keeps track of:
  - Uninitialized models
  - All Instancers
  - All DrawCalls via DrawSet
  - All MeshPools
 - One MeshPool is now locked to a single VertexType
 - DrawCall binds instance attributes to avoid making assumptions about mesh attribute count
 - Yeet crumbling
 - Simplify GPUInstancerFactory
2022-08-17 14:58:46 -07:00
Jozufozu
bcaf36c48c Sparse instance updates
- Use MemoryBlock in IndirectBuffers
2022-08-16 23:43:56 -07:00
PepperCode1
bb7d971ebe Merge branch '1.18/dev' into 1.18/next
Conflicts:
	.github/ISSUE_TEMPLATE/bug_report.yml
	gradle.properties
	src/main/java/com/jozufozu/flywheel/backend/instancing/DrawBuffer.java
	src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java
2022-08-16 10:48:46 -07:00
PepperCode1
832c94f2ba Lazily instantiate DrawBuffers
- Iris/Oculus create wrapper RenderTypes whose DrawBuffers are never
used. Creating the DrawBuffer on retrieval solves this inefficiency.
- Add 1.18.2 as a Minecraft version to the issue template
2022-08-16 10:41:35 -07:00
Jozufozu
de09331e9b Merge branch '1.18/next' into 1.18/culling
# Conflicts:
#	src/main/java/com/jozufozu/flywheel/api/struct/StructType.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java
#	src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/MeshPool.java
#	src/main/java/com/jozufozu/flywheel/core/hardcoded/ModelPart.java
#	src/main/java/com/jozufozu/flywheel/core/model/Mesh.java
#	src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java
#	src/main/java/com/jozufozu/flywheel/core/model/SimpleMesh.java
#	src/main/java/com/jozufozu/flywheel/core/structs/model/TransformedWriterUnsafe.java
#	src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedType.java
#	src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedStorageWriter.java
#	src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedType.java
#	src/main/java/com/jozufozu/flywheel/core/uniform/ViewProvider.java
2022-08-14 23:29:01 -07:00
PepperCode1
9b39ba6c32 Hazardous light
- BatchingEngine no longer resets the light matrices
- Fix flw_constantAmbientLight always being 0
- Move code from FlwMemoryTracker#*Block methods into MemoryBlockImpl
and TrackedMemoryBlockImpl
- Convert LightVolume to use MemoryBlock
- Add FlwMemoryTracker#callocBuffer
- Add javadoc to deprecated FlwMemoryTracker#*Buffer methods
- Update Mesh javadoc
- Organize imports
2022-08-14 21:42:44 -07:00
Jozufozu
a1553b04e7 So unsafe it wrapped back around
- Convert buffer mapping to unsafe
 - Implement gpu memory tracking
 - Fix massive gl resource leak
 - Fix GPU memory leak caused by not deleting gl resources
 - Fix CPU memory leak caused by not deleting meshes in Models
 - Remove PersistentGlBuffer, merge GlBuffer and MappedGlBuffer
2022-08-13 23:18:44 -07:00
Jozufozu
251d599944 Indirectly transformed
- Indirect rendering supports TransformedType
 - Use single object to manage all ssbos
2022-08-13 21:28:39 -07:00
PepperCode1
70616d381a Fix crash with Rubidium when using batching
- Backport fix from 1.18/next
- Downgrade and lock ForgeGradle version to fix build
- Update Forge to match 1.18/next
- Bump version
2022-08-13 13:54:52 -07:00
PepperCode1
293d6ee59c Fix tracked MemoryBlocks 2022-08-11 15:48:08 -07:00