Commit graph

215 commits

Author SHA1 Message Date
IThundxr
eb1c56e9ac
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-loader-1.21 2024-11-16 13:44:29 -05:00
Jozufozu
3811da166c Wait a minute
- Add debug flag to disable frame/tick plan execution
- Should help debugging cases where a visual constructor produces a
  visual in an invalid state like the weeping shulker bug
2024-11-15 18:18:44 -08:00
Jozufozu
f3845a15fb Not a lut left
- Prune empty layers from the lut to avoid it just getting larger as the
  player explores the world
2024-11-14 22:33:14 -08:00
Jozufozu
6431a84f67 Sky's edge
- Fix darkness when collecting light sections from high in the air
- Add dummy data layer impl to return a constant
- Empty sky section returns 15
- Empty block section returns 0
- Copy vanilla's logic for determining which data layer to use for a
  given position's sky light value
- While I'm at it, retrieve light section storage via an accessor to
  avoid allocating SectionPos objects
- Improve lut debug view
2024-11-14 22:33:14 -08:00
IThundxr
89d87555e6
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-loader-1.21 2024-11-13 16:30:36 -05:00
IThundxr
c726d7cfa2
Misc renames 2024-11-13 16:29:27 -05:00
PepperCode1
ac544245b3 Deferred default
- BackendManager.defaultBackend now dynamically computes the result every time it is invoked
- Forge backend config value now uses a supplier to provide the default backend
- Fix Fabric backend config being saved to "flw_backends" but loaded from "flw_backend"
2024-11-12 22:52:38 -08:00
PepperCode1
0d2971007b Fix VertexWriter
- Bump pack format in pack.mcmeta
2024-11-12 21:32:08 -08:00
IThundxr
c95bd4c722
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-loader-1.21
# Conflicts:
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlwCommands.java
2024-11-12 20:00:34 -05:00
Jozufozu
46fb59289f Weeping shulkers
- Properly fix shulker boxes appearing in the wrong location
2024-11-12 16:55:20 -08:00
IThundxr
fd786b0ad7
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-loader-1.21
# Conflicts:
#	.github/workflows/build.yml
#	forge/src/main/resources/META-INF/neoforge.mods.toml
2024-11-12 19:53:13 -05:00
Jozufozu
cfcb4246af Effective debugging
- Add light storage debug view courtesy of effect visuals
- Yellow boxes are filled in sections
- Red/green/blue bars represent the LUT
- Cyan boxes are the "wasted space" in the LUT. Freely representable
  sections that are simply not filled in
2024-11-12 13:33:30 -08:00
Jozufozu
6f0a2b0e56 Reticulated splines
- Fix line models rendering garbage
- Fix shulker boxes appear at the origin before snapping into place
- Make the box and line models public
2024-11-12 13:33:11 -08:00
Jozufozu
868a263c28 No one can hear you free
- Silence empty model warning behind a system property
- Fix gpu memory leak from light/matrix buffers on indirect
2024-11-11 22:33:41 -08:00
Jozufozu
6709682785 A little less lit
- Fix normalizing constant in light_lut.glsl to make shader light
  slightly darker and consistent with chunk lighting
2024-11-11 18:25:57 -08:00
Jozufozu
671d47a136 Swizzle
- Switch to Y X Z ordering
- In theory this will be more coherent since the first lut step on the
  GPU will have a more constrained range of values in the worst case
2024-11-10 12:10:47 -08:00
Jozufozu
bedb92c73c Lessen updates today!
- LightLut now does incremental updates java-side
- Still requires a full upload when changed, though it does not take up
  much space
- ShaderLightVisualStorage now actually triggers removal of light
  section from the lut
2024-11-10 11:59:05 -08:00
Jozufozu
5b97a56c8c Save yourself the trouble
- Don't initialize instancers if they have 0 instances
- Never shrink the index pool
- Actually process recently allocated meshes to avoid growing the list
  forever
2024-11-08 16:13:28 -08:00
Jozufozu
68453d8349 Always the first thing to fall apart
- Fix crumbling on indirect
2024-11-08 16:10:44 -08:00
Jozufozu
eae1d0ef94 The 3 time world heavyweight champion
- Fix instance hiding on indirect
2024-11-08 10:13:29 -08:00
Jozufozu
c8d76c32a7 Tightening the screws
- Fix hiz test bounds clamping, good ol off by 1 error
- Remove check for useMin since it's never used and the depth reduce
  shader is hard-coded already
2024-11-08 09:58:40 -08:00
Jozufozu
376ac76ac2 A whole lut of refactors
- Replace monolithic lut building function with a class representing a
  layer of the lut
- Actually need 2 classes because int[] and Object[] aren't trivial to
  make a type parameter, and we don't really want to be boxing ints here
- No longer need sorted inputs
- Should fix index out of bounds crash caused by reserving space for the
  wrong index layer
- This will make it much easier to change the coordinate ordering scheme
2024-11-08 09:32:27 -08:00
PepperCode1
69f4899ac6 VertexConsumer-related clean up
- Clean up VertexWriter to closer match BufferBuilder
- Clean up MeshEmitter on Fabric/NeoForge and remove BufferBuilderAccessor
- Remove model data and model data lookup parameters in NeoForge model builders; use IBlockGetterExtension#getModelData instead
- Fix artifact Minecraft version
2024-11-04 13:16:08 -08:00
IThundxr
461578ec0e
Automated testing (#269)
* Automated testing

* Testing testing

- Use 2 spaces for indents yaml
- Move setupTestMod to PlatformExtension
- Allow specifying the sourceSet for the testMod artifact
- Rename things to camelCase
- Use rootCompile from transitiveSourceSets for the testMod source sets
- Use a blanket remapTestModJar task in the gh actions build

* Fail slowly

- We want to know the results of both tests regardless

* Add workflow dispatch

* Shoes should be steel toed, dangerous stuff

* Update build.yml

* fix modid

* Update FlywheelTestModClient.java

* add debug logging

* fix syntax issues

* fix issues

* Update build.yml

* Add debug logging

* more logging

* get testmod from correct dir

* switch to env var

* Why wait?

- Immediately audit on client tick

* DidObfuscate

- Fix RenderSystemMixin on fabric
- setShaderFogShape's arguments need to be remapped, but the name of the
  function should not be. Fortunately mixin allows matching by function
  name alone

* Clever commit title

- Change the Fabric mod ID to match Forge
- Move "Flywheel Test Mod" to static
- Cleanup start/stop messages
- Use the client start event on Fabric

---------

Co-authored-by: Jozufozu <jozsefaug@gmail.com>
2024-11-03 17:57:47 -08:00
Jozufozu
4f0c1cc1ae Checking the source
- Remove source checks, it was very old and untouched
- Remove FIXMEs and TODOs that were already fixed/done
2024-11-03 12:15:04 -08:00
IThundxr
ad2f3c860b
Stubborn stubs
- Remove Stub SourceSet
2024-11-03 15:02:26 -05:00
Jozufozu
540fe7a7fe Acetaminophen
- Generic pain relief
- Use new Instance[] rather than capturing the class object of the
  instance type
- Make InstancePage static, but manually track the instancer parent so
  we can check when stealing
- Simplify array creation helpers and make them static
- Mark InstanceHandleImpl#state as UnknownNullability
2024-11-02 16:56:49 -07:00
Jozufozu
a9f2018c0a The epitome of laziness
- Only upload changed page frame descriptors
- In the instancer, track changed contents separately from changed
  validity, so we can separately upload objects and descriptors
2024-11-02 14:12:45 -07:00
Jozufozu
fc3e475ec9 Gattai!
- Combine pages only when they're at most half full, and not empty
- This guarantees that we'll fully empty a page, allowing us to free the memory for use by other instancers
- Track mergeable pages via a separate bitset
2024-11-01 23:50:06 -07:00
IThundxr
d881ba5302
Twas a snowy night full of scripting the builds
- Post merge fixes
- Remove stubs
2024-11-01 22:08:09 -04:00
Jozufozu
fac63168c1 Bookkeeping
- Mappings drop pages when they write zero validity bits
- Instancer only updates pages that changed
2024-11-01 12:47:15 -07:00
Jozufozu
20b3f78b9c A real page turner
- Try to shuffle over instances into pages with space
- Clear out now-unused logic from ObjectStorage
- Some cleanup and more comments in IndirectInstancer
2024-10-29 20:02:38 -07:00
Jozufozu
a7e7090866 Finding an old bookmark
- Make AbstractInstancer much more slim and move logic to BaseInstancer
- Extend paging concept to the indirect instancer
- Extend ObjectStorage to support more interesting layouts
- Instance creation on indirect is now entirely lock free and deletions
  no longer require re-uploading the entire instancer
2024-10-29 20:02:37 -07:00
IThundxr
ad938399b4
post merge fixes 2024-10-29 17:48:20 -04:00
IThundxr
07e66bb299
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-loader-1.21
# Conflicts:
#	common/src/lib/java/dev/engine_room/flywheel/lib/util/ShadersModHandler.java
#	common/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplat.java
#	common/src/main/java/dev/engine_room/flywheel/impl/compat/SodiumCompat.java
#	common/src/main/java/dev/engine_room/flywheel/impl/mixin/BlockEntityTypeMixin.java
#	fabric/build.gradle.kts
#	fabric/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java
#	fabric/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java
#	fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java
#	fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java
#	fabric/src/main/resources/fabric.mod.json
#	forge/build.gradle.kts
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java
#	forge/src/main/java/dev/engine_room/flywheel/impl/FlywheelForge.java
#	forge/src/main/resources/META-INF/neoforge.mods.toml
#	gradle.properties
#	gradle/wrapper/gradle-wrapper.properties
2024-10-29 17:38:23 -04:00
Jozufozu
3a949c717a Turn the cutout off crash off
- MaterialEncoder would trigger an indexing of CutoutShaders.OFF, though
  PipelineCompiler would explicitly not index OFF
- This caused a crash on instancing when MaterialEncoder would delete
  all pipeline shaders while instancing was trying to upload the packed
  ubershader uniform
2024-10-19 16:58:04 -07:00
IThundxr
3d2fdb7e83
Backport changes from 1.21.1 (#265)
* Backport changes from 1.21.1

* fix

* Fix building

* fix compile error

* fix

* fix build for real

* address reviews

* Fix sodium compat

* address requested changes

* mark rubidium as incompatible

* add missed call

* Should have worn steel toe boots

- Add "stub" sourceset to each subproject
- Directly pass vararg sourcesets to methods in PlatformExtension to
  avoid automatically shipping jars with the api stubs
- We may have to include stubs in setupLoomMod, but I don't think so
- A lot of this can be stripped back out if we don't need stub sources
  for the forge/fabric subprojects

* Guarded stubs

- Add Sodium 0.6 and Iris API stubs to stubs source set and remove Gradle dependencies on local Sodium jar, Iris, and Oculus
- Ensure usage of APIs that may not exist at runtime is in private classes and access is always guarded
- Change ShadersModHandler
  - Rename to ShadersModHelper
  - Convert methods to check for Iris' and Optifine's presence into static final fields
  - Move implementation to impl source set in form of IrisCompat and OptifineCompat classes
- Rename CompatMods to CompatMod and add public field to access mod ID
- Set BlockEntityType's Sodium predicate to null after it is removed
- Update repository links
- Remove local libs repository

---------

Co-authored-by: Jozufozu <jozsefaug@gmail.com>
Co-authored-by: PepperCode1 <44146161+PepperCode1@users.noreply.github.com>
2024-10-18 20:29:43 -07:00
PepperCode1
734506b010 Fix #266 2024-10-18 18:25:11 -07:00
IThundxr
68d15043a6
address requested changes 2024-10-14 18:11:54 -04:00
IThundxr
c705fdfc6f
address requested changes 2024-10-14 18:06:34 -04:00
Jozufozu
3193e16498 Weak assumption
- Use a weak hash set for PipelineCompiler.ALL
2024-10-12 17:02:50 -07:00
Jozufozu
efb68dc776 All or nothing?
- Actually add PipelineCompilers into the ALL list so they get deleted
  when uber components need updating
2024-10-12 16:36:20 -07:00
IThundxr
aeb9781bd4
Remove unused check 2024-10-12 17:28:24 -04:00
IThundxr
f6ca19cee0
bring back comment 2024-10-12 15:54:08 -04:00
IThundxr
178dd6c44e
address review 2024-10-12 08:37:52 -04:00
IThundxr
93c116384f
Last fixes 2024-10-10 20:54:25 -04:00
IThundxr
6cc2b74eef
Fix iris compat 2024-10-06 13:28:43 -04:00
IThundxr
05b82b50ca
Fix sprite UVs being messed up 2024-10-06 13:14:16 -04:00
IThundxr
ae4e4e79f5
post merge fixes 2024-10-05 12:59:27 -04:00
IThundxr
08866edf09
Merge branch '1.20/dev' into feat/multi-loader-1.21
# Conflicts:
#	forge/src/main/java/dev/engine_room/flywheel/impl/ForgeFlwConfig.java
2024-10-01 21:02:33 -04:00