diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/build.gradle b/build.gradle index 9c67c6bb..e75f0753 100644 --- a/build.gradle +++ b/build.gradle @@ -13,11 +13,21 @@ subprojects { apply plugin: 'java-library' - version "1.3.6" + version "1.4.0" sourceCompatibility = 14 targetCompatibility = 14 + tasks.withType(JavaCompile) { + options.compilerArgs += "--enable-preview" + } + tasks.withType(Test) { + jvmArgs += "--enable-preview" + } + tasks.withType(JavaExec) { + jvmArgs += "--enable-preview" + } + java { modularity.inferModulePath = true } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4c5803d1..bb8b2fc2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/org.sheepy.vsand.model/model/VSand.genmodel b/org.sheepy.vsand.model/model/VSand.genmodel index d3f89149..d52e0861 100644 --- a/org.sheepy.vsand.model/model/VSand.genmodel +++ b/org.sheepy.vsand.model/model/VSand.genmodel @@ -2,8 +2,8 @@ diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/ITransformation.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/ITransformation.java index 4ca07f15..4faca29a 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/ITransformation.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/ITransformation.java @@ -2,7 +2,7 @@ */ package org.sheepy.vsand.model; -import org.sheepy.lily.core.api.adapter.ILilyEObject; +import org.sheepy.lily.core.api.model.ILilyEObject; /** * diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Material.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Material.java index 762c7646..75b6e915 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Material.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Material.java @@ -2,7 +2,7 @@ */ package org.sheepy.vsand.model; -import org.sheepy.lily.core.api.adapter.ILilyEObject; +import org.sheepy.lily.core.api.model.ILilyEObject; import org.sheepy.lily.core.model.resource.Sound; /** diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/MaterialProvider.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/MaterialProvider.java index f44f902d..c20a33ef 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/MaterialProvider.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/MaterialProvider.java @@ -4,7 +4,7 @@ import org.eclipse.emf.common.util.EList; -import org.sheepy.lily.core.api.adapter.ILilyEObject; +import org.sheepy.lily.core.api.model.ILilyEObject; /** * diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Materials.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Materials.java index a89f89ad..1abd2f10 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Materials.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Materials.java @@ -3,7 +3,7 @@ package org.sheepy.vsand.model; import org.eclipse.emf.common.util.EList; -import org.sheepy.lily.core.api.adapter.ILilyEObject; +import org.sheepy.lily.core.api.model.ILilyEObject; /** * diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Transformations.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Transformations.java index 543cf5ad..511167cd 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Transformations.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/Transformations.java @@ -3,7 +3,7 @@ package org.sheepy.vsand.model; import org.eclipse.emf.common.util.EList; -import org.sheepy.lily.core.api.adapter.ILilyEObject; +import org.sheepy.lily.core.api.model.ILilyEObject; /** * diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawCircleImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawCircleImpl.java index 34b85516..3a0f3ad1 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawCircleImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawCircleImpl.java @@ -8,7 +8,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.DrawCircle; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.VSandPackage; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawLineImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawLineImpl.java index 582016c7..0be57f88 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawLineImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawLineImpl.java @@ -8,7 +8,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.DrawLine; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.VSandPackage; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawSquareImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawSquareImpl.java index 83db15eb..c8c87ea6 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawSquareImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/DrawSquareImpl.java @@ -8,7 +8,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.DrawSquare; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.VSandPackage; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/InputMaterialProviderImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/InputMaterialProviderImpl.java index a56dd7f7..6eaa173c 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/InputMaterialProviderImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/InputMaterialProviderImpl.java @@ -10,7 +10,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.InputMaterialProvider; import org.sheepy.vsand.model.Materials; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialImpl.java index b34042e7..5718e03f 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialImpl.java @@ -9,7 +9,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.lily.core.model.resource.Sound; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.VSandPackage; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialProviderImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialProviderImpl.java index cfeabb5b..a8e77c51 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialProviderImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialProviderImpl.java @@ -14,7 +14,7 @@ import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.MaterialProvider; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialsImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialsImpl.java index 1fea86cb..ce436c31 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialsImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MaterialsImpl.java @@ -13,7 +13,7 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.Materials; import org.sheepy.vsand.model.VSandPackage; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MultipleTransformationImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MultipleTransformationImpl.java index 8b79ae1e..15c2e334 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MultipleTransformationImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/MultipleTransformationImpl.java @@ -11,7 +11,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.MaterialProvider; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationImpl.java index f1613213..90aa3191 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationImpl.java @@ -9,7 +9,7 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.Material; import org.sheepy.vsand.model.Transformation; import org.sheepy.vsand.model.VSandPackage; diff --git a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationsImpl.java b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationsImpl.java index ef5f5bae..07ea1c41 100644 --- a/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationsImpl.java +++ b/org.sheepy.vsand/src/generated/java/org/sheepy/vsand/model/impl/TransformationsImpl.java @@ -13,7 +13,7 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; -import org.sheepy.lily.core.api.adapter.LilyEObject; +import org.sheepy.lily.core.api.model.LilyEObject; import org.sheepy.vsand.model.ITransformation; import org.sheepy.vsand.model.Transformations; import org.sheepy.vsand.model.VSandPackage; diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/VSandApplicationLauncher.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/VSandApplicationLauncher.java index eb1fdc4b..8153c760 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/VSandApplicationLauncher.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/VSandApplicationLauncher.java @@ -11,7 +11,7 @@ public class VSandApplicationLauncher { private static final String APPLICATION_PATH = "Application.vsand"; - private static final String APPLICATION_VERSION = "1.3.6"; + private static final String APPLICATION_VERSION = "1.4.0"; private static final IResourceLoader resourceLoader = IResourceLoader.INSTANCE; diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/audio/MaterialSoundManager.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/audio/MaterialSoundManager.java index 0567933e..aaca81b7 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/audio/MaterialSoundManager.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/audio/MaterialSoundManager.java @@ -17,7 +17,7 @@ public void start(Material material) if (paintSound != null) { final var pitch = material.getPitch(); - final var soundAdapter = paintSound.allocationHandle(IAudioAllocation.class).get(); + final var soundAdapter = paintSound.adapt(IAudioAllocation.class); audioHandle = soundAdapter.play(audioConfig.builder().pitch(pitch).build()); } } diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/constants/PixelConstantBufferAdapter.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/constants/PixelConstantBufferAdapter.java index 3c407f02..349a5525 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/constants/PixelConstantBufferAdapter.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/constants/PixelConstantBufferAdapter.java @@ -3,14 +3,11 @@ import org.lwjgl.system.MemoryUtil; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Dispose; -import org.sheepy.lily.core.api.adapter.annotation.Load; import org.sheepy.lily.core.api.cadence.Tick; import org.sheepy.lily.core.api.extender.ModelExtender; +import org.sheepy.lily.core.api.input.IInputManager; import org.sheepy.lily.core.api.util.ModelUtil; -import org.sheepy.lily.vulkan.api.engine.IVulkanEngineAdapter; -import org.sheepy.lily.vulkan.api.input.IVulkanInputManager; import org.sheepy.lily.vulkan.api.resource.buffer.IConstantBufferUpdater; -import org.sheepy.lily.vulkan.model.VulkanEngine; import org.sheepy.lily.vulkan.model.resource.ConstantBuffer; import org.sheepy.vsand.model.PixelConstantBuffer; import org.sheepy.vsand.model.VSandApplication; @@ -28,27 +25,16 @@ public final class PixelConstantBufferAdapter implements IConstantBufferUpdater private final PixelConstantBuffer constantBuffer; private final VSandApplication application; - - private ByteBuffer buffer = null; - - private IVulkanInputManager inputManager; + private final ByteBuffer buffer; + private final IInputManager inputManager; private PixelConstantBufferAdapter(PixelConstantBuffer constantBuffer) { this.constantBuffer = constantBuffer; application = (VSandApplication) ModelUtil.getApplication(constantBuffer); - } - - @Load - private void load() - { + inputManager = application.adapt(IInputManager.class); buffer = MemoryUtil.memAlloc(BYTE_SIZE); - - final var vulkanEngine = (VulkanEngine) application.getEngines().get(0); - final var engineAdapter = vulkanEngine.adapt(IVulkanEngineAdapter.class); - inputManager = engineAdapter.getInputManager(); - updateBuffer(); } diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/draw/IDrawCommandAdapter.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/draw/IDrawCommandAdapter.java index 1868c7f2..f917da36 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/draw/IDrawCommandAdapter.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/draw/IDrawCommandAdapter.java @@ -2,10 +2,10 @@ import java.nio.ByteBuffer; -import org.sheepy.lily.core.api.adapter.IAdapter; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.vsand.model.DrawCommand; -public interface IDrawCommandAdapter extends IAdapter +public interface IDrawCommandAdapter extends IExtender { void fillBuffer(T command, ByteBuffer buffer); } diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/AbstractDrawer.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/AbstractDrawer.java index 2b8ee152..3c0dbb87 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/AbstractDrawer.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/AbstractDrawer.java @@ -1,6 +1,6 @@ package org.sheepy.vsand.input; -import org.sheepy.lily.core.api.adapter.IAdapter; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.input.IInputManager; import org.sheepy.vsand.audio.MaterialSoundManager; import org.sheepy.vsand.draw.DrawManager; @@ -8,7 +8,7 @@ import org.sheepy.vsand.model.VSandApplication; import org.sheepy.vsand.util.BoardUtil; -abstract class AbstractDrawer implements IAdapter +abstract class AbstractDrawer implements IExtender { private final MaterialSoundManager soundManager = new MaterialSoundManager(); private final DrawManager drawManager = new DrawManager(); @@ -21,7 +21,7 @@ abstract class AbstractDrawer implements IAdapter public AbstractDrawer(VSandApplication application) { this.application = application; - inputManager = IInputManager.get(application).orElseThrow(); + inputManager = IInputManager.get(application); inputManager.listen(this::afterPollInputs, IInputManager.Features.AfterPollInputs); } diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/InputManager.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/InputManager.java index 27b641b4..c856a089 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/InputManager.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/InputManager.java @@ -1,8 +1,8 @@ package org.sheepy.vsand.input; import org.eclipse.emf.common.util.EList; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.core.api.input.IInputManager; import org.sheepy.lily.core.api.input.event.KeyEvent; @@ -13,7 +13,7 @@ @ModelExtender(scope = VSandApplication.class) @Adapter(lazy = false) -public final class InputManager implements IAdapter +public final class InputManager implements IExtender { private final VSandApplication application; private final IInputManager inputManager; @@ -24,7 +24,7 @@ public InputManager(VSandApplication application) { this.application = application; - inputManager = IInputManager.get(application).orElseThrow(); + inputManager = IInputManager.get(application); inputManager.showCursor(inputManager.isMouseOnUI()); inputManager.listen(this::onMouseOverUI, IInputManager.Features.MouseOverUIEvent); inputManager.listen(this::onKeyEvent, IInputManager.Features.KeyEvent); diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/PrimaryDrawer.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/PrimaryDrawer.java index d70cbe52..42b9edb9 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/PrimaryDrawer.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/PrimaryDrawer.java @@ -15,7 +15,7 @@ public PrimaryDrawer(final VSandApplication application) { super(application); - final var inputManager = IInputManager.get(application).orElseThrow(); + final var inputManager = IInputManager.get(application); inputManager.listen(this::onMouseClickEvent, IInputManager.Features.MouseClickEvent); } diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/SecondaryDrawer.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/SecondaryDrawer.java index 15436d07..eb441bc7 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/SecondaryDrawer.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/input/SecondaryDrawer.java @@ -15,7 +15,7 @@ public SecondaryDrawer(final VSandApplication application) { super(application); - final var inputManager = IInputManager.get(application).orElseThrow(); + final var inputManager = IInputManager.get(application); inputManager.listen(this::onMouseClickEvent, IInputManager.Features.MouseClickEvent); } diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board1BufferLoader.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board1BufferLoader.java index 5ff6bde3..8886e7c6 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board1BufferLoader.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board1BufferLoader.java @@ -1,10 +1,10 @@ package org.sheepy.vsand.loader; import org.lwjgl.system.MemoryUtil; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Dispose; import org.sheepy.lily.core.api.adapter.annotation.Load; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.core.api.util.ModelUtil; import org.sheepy.lily.vulkan.model.resource.Buffer; @@ -14,7 +14,7 @@ @ModelExtender(scope = Buffer.class, name = "Board Buffer 1") @Adapter(singleton = true, lazy = false) -public final class Board1BufferLoader implements IAdapter +public final class Board1BufferLoader implements IExtender { @Load private static void load(Buffer buffer) diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board2BufferLoader.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board2BufferLoader.java index 63317da6..3ce1bb28 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board2BufferLoader.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/Board2BufferLoader.java @@ -3,10 +3,10 @@ import java.nio.ByteBuffer; import org.lwjgl.system.MemoryUtil; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Dispose; import org.sheepy.lily.core.api.adapter.annotation.Load; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.core.api.util.ModelUtil; import org.sheepy.lily.vulkan.model.resource.Buffer; @@ -14,7 +14,7 @@ @ModelExtender(scope = Buffer.class, name = "Board Buffer 2") @Adapter(singleton = true, lazy = false) -public final class Board2BufferLoader implements IAdapter +public final class Board2BufferLoader implements IExtender { @Load private static void load(Buffer buffer) diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/BoardImageLoader.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/BoardImageLoader.java index 74043430..02537f29 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/BoardImageLoader.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/BoardImageLoader.java @@ -1,8 +1,8 @@ package org.sheepy.vsand.loader; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Load; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.core.api.util.ModelUtil; import org.sheepy.lily.vulkan.model.resource.StaticImage; @@ -11,7 +11,7 @@ @ModelExtender(scope = StaticImage.class, name = "Board Image") @Adapter(singleton = true, lazy = false) -public final class BoardImageLoader implements IAdapter +public final class BoardImageLoader implements IExtender { @Load private static void load(StaticImage image) diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ChunkBufferLoader.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ChunkBufferLoader.java index da13fbaf..1185256a 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ChunkBufferLoader.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ChunkBufferLoader.java @@ -1,10 +1,10 @@ package org.sheepy.vsand.loader; import org.lwjgl.system.MemoryUtil; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Dispose; import org.sheepy.lily.core.api.adapter.annotation.Load; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.core.api.util.ModelUtil; import org.sheepy.lily.vulkan.model.resource.Buffer; @@ -14,7 +14,7 @@ @ModelExtender(scope = Buffer.class, name = "Chunk Buffer") @Adapter(singleton = true, lazy = false) -public final class ChunkBufferLoader implements IAdapter +public final class ChunkBufferLoader implements IExtender { @Load private static void load(Buffer buffer) diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ConfigurationBufferLoader.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ConfigurationBufferLoader.java index c21a5d58..51f2d70c 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ConfigurationBufferLoader.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/ConfigurationBufferLoader.java @@ -2,10 +2,10 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.lwjgl.system.MemoryUtil; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Dispose; import org.sheepy.lily.core.api.adapter.annotation.Load; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.vulkan.model.resource.Buffer; import org.sheepy.vsand.model.Material; @@ -15,7 +15,7 @@ @ModelExtender(scope = Buffer.class, name = "Configuration") @Adapter(singleton = true, lazy = false) -public final class ConfigurationBufferLoader implements IAdapter +public final class ConfigurationBufferLoader implements IExtender { private static final int UNIT_BYTES = 8 * Integer.BYTES; diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/MaterialCountAdapter.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/MaterialCountAdapter.java index 8103454a..93bf7fc1 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/MaterialCountAdapter.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/MaterialCountAdapter.java @@ -2,9 +2,9 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.lwjgl.system.MemoryUtil; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Load; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.vulkan.model.resource.ConstantBuffer; import org.sheepy.vsand.model.VSandApplication; @@ -13,7 +13,7 @@ @ModelExtender(scope = ConstantBuffer.class, name = "MaterialCount") @Adapter(singleton = true, lazy = false) -public final class MaterialCountAdapter implements IAdapter +public final class MaterialCountAdapter implements IExtender { @Load private static void load(ConstantBuffer buffer) diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/TransformationBufferLoader.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/TransformationBufferLoader.java index 254c9831..d5e4166e 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/TransformationBufferLoader.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/loader/TransformationBufferLoader.java @@ -2,10 +2,10 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.lwjgl.system.MemoryUtil; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.Dispose; import org.sheepy.lily.core.api.adapter.annotation.Load; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.lily.vulkan.model.resource.Buffer; import org.sheepy.vsand.model.VSandApplication; @@ -13,7 +13,7 @@ @ModelExtender(scope = Buffer.class, name = "Transformation") @Adapter(singleton = true, lazy = false) -public final class TransformationBufferLoader implements IAdapter +public final class TransformationBufferLoader implements IExtender { @Load private static void load(Buffer buffer) diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/ApplicationBehaviour.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/ApplicationBehaviour.java index 3fcf1702..a5fd05ef 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/ApplicationBehaviour.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/ApplicationBehaviour.java @@ -1,16 +1,16 @@ package org.sheepy.vsand.logic; import org.eclipse.emf.common.notify.Notification; -import org.sheepy.lily.core.api.adapter.IAdapter; import org.sheepy.lily.core.api.adapter.annotation.Adapter; import org.sheepy.lily.core.api.adapter.annotation.NotifyChanged; +import org.sheepy.lily.core.api.extender.IExtender; import org.sheepy.lily.core.api.extender.ModelExtender; import org.sheepy.vsand.model.VSandApplication; import org.sheepy.vsand.model.VSandPackage; @ModelExtender(scope = VSandApplication.class) @Adapter(singleton = true, lazy = false) -public final class ApplicationBehaviour implements IAdapter +public final class ApplicationBehaviour implements IExtender { @NotifyChanged(featureIds = VSandPackage.VSAND_APPLICATION__NEXT_MODE) private static void nextModeChanged(Notification notification) diff --git a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/VSandMainLoop.java b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/VSandMainLoop.java index af4143c2..b371eca2 100644 --- a/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/VSandMainLoop.java +++ b/org.sheepy.vsand/src/main/java/org/sheepy/vsand/logic/VSandMainLoop.java @@ -16,10 +16,10 @@ public final class VSandMainLoop implements Runnable private final VSandApplication application; private final boolean benchmarkMode; private final int stopIteration; - private final IProcessAdapter boardProcessAdapter; - private final IProcessAdapter renderProcessAdapter; - private final IPipelineTask boardImageBarrier; + private IProcessAdapter boardProcessAdapter; + private IProcessAdapter renderProcessAdapter; + private IPipelineTask boardImageBarrier; private boolean loaded = false; private long currentIteration = 0; private long startNs; @@ -41,14 +41,6 @@ private VSandMainLoop(VSandApplication application, boolean benchmarkMode, int s this.application = application; this.benchmarkMode = benchmarkMode; this.stopIteration = stopIteration; - - final var vulkanEngine = (VulkanEngine) application.getEngines().get(0); - final var processes = vulkanEngine.getProcesses(); - final var boardProcess = (ComputeProcess) processes.get(0); - final var boardToPixelPipeline = (ComputePipeline) (boardProcess.getPipelinePkg().getPipelines().get(2)); - boardProcessAdapter = boardProcess.adaptNotNull(IProcessAdapter.class); - boardImageBarrier = boardToPixelPipeline.getTaskPkg().getTasks().get(2); - renderProcessAdapter = processes.get(1).adaptNotNull(IProcessAdapter.class); } @Override @@ -99,6 +91,13 @@ else if (renderProcessAdapter != null) private void load() { final var vulkanEngine = (VulkanEngine) application.getEngines().get(0); + final var processes = vulkanEngine.getProcesses(); + final var boardProcess = (ComputeProcess) processes.get(0); + final var boardToPixelPipeline = (ComputePipeline) (boardProcess.getPipelinePkg().getPipelines().get(2)); + boardProcessAdapter = boardProcess.adaptNotNull(IProcessAdapter.class); + boardImageBarrier = boardToPixelPipeline.getTaskPkgs().get(0).getTasks().get(2); + renderProcessAdapter = processes.get(1).adaptNotNull(IProcessAdapter.class); + final var engineAdapter = vulkanEngine.adapt(IVulkanEngineAdapter.class); final var window = engineAdapter.getWindow(); if (window != null) diff --git a/org.sheepy.vsand/src/main/resources/Application.vsand b/org.sheepy.vsand/src/main/resources/Application.vsand index 94e3f6db..03ec9b59 100644 --- a/org.sheepy.vsand/src/main/resources/Application.vsand +++ b/org.sheepy.vsand/src/main/resources/Application.vsand @@ -1,5 +1,5 @@ - + @@ -70,31 +70,34 @@ - + - + COMPUTE_BIT - + SHADER_READ_BIT SHADER_WRITE_BIT + - + SHADER_READ_BIT SHADER_WRITE_BIT + - + SHADER_READ_BIT SHADER_WRITE_BIT + - + @@ -102,21 +105,24 @@ COMPUTE_BIT - - + + - + SHADER_READ_BIT SHADER_WRITE_BIT + - + SHADER_READ_BIT SHADER_WRITE_BIT + - + SHADER_READ_BIT SHADER_WRITE_BIT + @@ -125,7 +131,7 @@ - + @@ -133,11 +139,11 @@ COMPUTE_BIT - + - + COMPUTE_BIT @@ -149,21 +155,24 @@ - + SHADER_WRITE_BIT SHADER_READ_BIT + - + SHADER_WRITE_BIT SHADER_READ_BIT + - + SHADER_WRITE_BIT SHADER_READ_BIT + - + @@ -172,21 +181,26 @@ + + + ColorAttachment TransferDst + - + - + + @@ -209,16 +223,16 @@ - - + + - + - +