generated from Legacy-Fabric/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
156 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
pkgs.mesa-demos | ||
pkgs.novnc | ||
pkgs.hostname-debian | ||
pkgs.turbovnc | ||
]; | ||
|
||
idx = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.thatmg393.legacyvkm.breeze3d; | ||
|
||
public class VDrawer { | ||
} | ||
|
4 changes: 2 additions & 2 deletions
4
...mg393/legacyvkm/impl/screen/Renderer.java → ...atmg393/legacyvkm/breeze3d/VRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/thatmg393/legacyvkm/breeze3d/image/VTexture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.thatmg393.legacyvkm.breeze3d.image; | ||
|
||
import java.nio.LongBuffer; | ||
|
||
import org.lwjgl.system.MemoryStack; | ||
import org.lwjgl.vulkan.VkImageViewCreateInfo; | ||
|
||
import com.thatmg393.legacyvkm.vulkan.image.base.BaseImage; | ||
|
||
public class VTexture extends BaseImage { | ||
private long mainImageView; | ||
|
||
public VTexture(Builder builder) { | ||
super(builder); | ||
} | ||
|
||
@Override | ||
protected void initImage() { | ||
super.initImage(); | ||
|
||
try (MemoryStack stack = MemoryStack.stackPush()) { | ||
VkImageViewCreateInfo vivci = VkImageViewCreateInfo.calloc(stack); | ||
vivci.sType$Default(); | ||
|
||
LongBuffer imageView = stack.mallocLong(1); | ||
mainImageView = imageView.get(0); | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/thatmg393/legacyvkm/breeze3d/passes/RenderPass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.thatmg393.legacyvkm.breeze3d.passes; | ||
|
||
public class RenderPass { | ||
|
||
} |
5 changes: 0 additions & 5 deletions
5
src/main/java/com/thatmg393/legacyvkm/impl/screen/Drawer.java
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/main/java/com/thatmg393/legacyvkm/impl/screen/passes/RenderPass.java
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
src/main/java/com/thatmg393/legacyvkm/vulkan/image/base/BaseImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.thatmg393.legacyvkm.vulkan.image.base; | ||
|
||
import static org.lwjgl.vulkan.VK10.*; | ||
|
||
import java.nio.LongBuffer; | ||
|
||
import org.lwjgl.PointerBuffer; | ||
import org.lwjgl.system.MemoryStack; | ||
|
||
import com.thatmg393.legacyvkm.vulkan.vma.VMAManager; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
public class BaseImage { | ||
private final Builder builder; | ||
|
||
private long id, allocation, sampler; | ||
|
||
public BaseImage(Builder builder) { | ||
this.builder = builder; | ||
this.sampler = 0; // mipLevels and samplerFlags | ||
} | ||
|
||
protected void initImage() { | ||
try (MemoryStack stack = MemoryStack.stackPush()) { | ||
LongBuffer id = stack.mallocLong(1); | ||
PointerBuffer allocation = stack.pointers(0L); | ||
|
||
VMAManager.getInstance().createImage( | ||
builder.width, builder.height, | ||
builder.mipLevels, builder.format, | ||
builder.tiling, builder.usage, | ||
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, | ||
stack.ints(0), // Graphics Queue | ||
id, allocation | ||
); | ||
|
||
this.id = id.get(0); | ||
this.allocation = allocation.get(0); | ||
|
||
VMAManager.getInstance().addImage(this); | ||
} | ||
} | ||
|
||
@lombok.Builder(builderClassName = "InternalBuilder", builderMethodName = "internalBuilder", access = AccessLevel.PRIVATE, toBuilder = true, setterPrefix = "set", buildMethodName = "buildVulkanImage") | ||
public static class Builder { | ||
private final int width, height; | ||
|
||
private int format = VK_FORMAT_R8G8B8A8_UNORM; | ||
private int tiling = VK_IMAGE_TILING_OPTIMAL; | ||
private int usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; | ||
private byte mipLevels = 1; | ||
private byte samplerFlags = 0; | ||
|
||
public static final Builder.InternalBuilder builder(int width, int height) { | ||
return internalBuilder().setWidth(width).setHeight(height); | ||
} | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
src/main/java/com/thatmg393/legacyvkm/vulkan/texture/VulkanImage.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters