Commit graph

971 commits

Author SHA1 Message Date
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
IThundxr
e6fecc60b5
Remove rubidium optional dependency (#270) 2024-11-08 09:05:50 -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
IThundxr
fa57f34c47
formatting changes 2024-10-14 17:53:30 -04:00
IThundxr
008b09891a
fix meshemitter 2024-10-14 17:44:55 -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
68e545bddb
forgeEventBus -> gameEventBus 2024-10-12 15:57:05 -04:00
IThundxr
f6ca19cee0
bring back comment 2024-10-12 15:54:08 -04:00
IThundxr
e39554e477
fix breaks formatting 2024-10-12 15:50:10 -04:00
IThundxr
dc3e264869
post to correct bus 2024-10-12 15:48:47 -04:00
IThundxr
6f946fcedc
Rename class 2024-10-12 15:45:14 -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
b408191d0f
Build against 1.21.1 2024-10-10 19:25:59 -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
Jozufozu
40577420d5 In the right direction
- Use vanilla light directions for diffuse lighting
- Copy mc's glsl code for it, but assume directions are normalized
- Add command/config to toggle use of light directions vs chunk accurate
  diffuse
- Always use shade in getItemMaterial
- Do not reload resource packs when updating light smoothness config,
  we don't need to anymore with lazy compilation
2024-09-29 11:52:35 -07:00
Jozufozu
22b5676e47 Quick thinking
- Decide not to render entities directly in the renderEntity method
- Prevents allocating large lists every frame to filter entities from
  the client level
2024-09-28 23:37:49 -07:00
Jozufozu
0a01b82647 Glimpse of glint
- Add pick glint material and system time uniform
- Move _FlwCullData to beginning of uniform block to ensure alignment
- Add helper to convert item rendertype into flywheel material
2024-09-28 23:27:28 -07:00
Jozufozu
bd0aadf9d9 Streamlined pipelines
- Make UberShaderComponent#build NotNull
- Move index update and key creation logic to PipelineCompiler
- Always update index when a resource location is requested to fix
  MaterialEncoder misses
- Indices trigger pipeline compiler deletion when updated
2024-09-28 22:05:38 -07:00
Jozufozu
ef05f7d3fd Errors galore
- Make everything in the compiler chain's results not null
- Throw errors immediately when encountered
- Log error messages when falling back
- Do not eagerly grab utility programs in IndirectDrawManager so we can
  actually catch errors and fall back
- Remove CompilerStats
2024-09-28 16:00:23 -07:00
Jozufozu
11ce4ac185 Dynamic ubering
- Remove fog shader registry
- Remove Registry and RegistryImpl
- Make shader indices mutable
- Track fog uber component in a static field in PipelineCompiler
- When a new fog source is added, delete the pipeline compilation
  harness and recreate the fog uber component
- Inline SourceLoader
2024-09-28 15:30:10 -07:00
Jozufozu
bce657804a Source of all pain
- Strip out almost all source registries
- Fog will be dealt with in a follow-up commit
- Remove most static #init methods
- Remove old ubershader indices from shaders
2024-09-28 14:48:22 -07:00