-
Notifications
You must be signed in to change notification settings - Fork 24
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
8 changed files
with
74 additions
and
23 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 |
---|---|---|
|
@@ -94,6 +94,6 @@ public long updateAndGetSet(VCmdBuff cmd) { | |
} | ||
|
||
public void destroy() { | ||
|
||
this.pool.free(); | ||
} | ||
} |
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
59 changes: 59 additions & 0 deletions
59
src/main/java/me/cortex/vulkanite/client/rendering/srp/lua/LuaConstants.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,59 @@ | ||
package me.cortex.vulkanite.client.rendering.srp.lua; | ||
|
||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.registry.RegistryKeys; | ||
import org.luaj.vm2.LuaValue; | ||
|
||
import static me.cortex.vulkanite.client.rendering.srp.api.layout.LayoutBinding.ACCESS_READ; | ||
import static me.cortex.vulkanite.client.rendering.srp.api.layout.LayoutBinding.ACCESS_WRITE; | ||
import static org.lwjgl.vulkan.KHRAccelerationStructure.VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR; | ||
import static org.lwjgl.vulkan.KHRRayTracingPipeline.*; | ||
import static org.lwjgl.vulkan.VK10.*; | ||
|
||
//Environment about the game such as block lists, biomes etc | ||
public class LuaConstants { | ||
public static void addVkConstants(LuaValue env) { | ||
env.set("SHADER_RAY_GEN", VK_SHADER_STAGE_RAYGEN_BIT_KHR); | ||
env.set("SHADER_RAY_MISS", VK_SHADER_STAGE_MISS_BIT_KHR); | ||
env.set("SHADER_RAY_CHIT", VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR); | ||
env.set("SHADER_RAY_AHIT", VK_SHADER_STAGE_ANY_HIT_BIT_KHR); | ||
env.set("SHADER_RAY_INTER", VK_SHADER_STAGE_INTERSECTION_BIT_KHR); | ||
env.set("SHADER_COMPUTE", VK_SHADER_STAGE_COMPUTE_BIT); | ||
|
||
env.set("ACCESS_READ", ACCESS_READ); | ||
env.set("ACCESS_WRITE", ACCESS_WRITE); | ||
env.set("ACCESS_RW", ACCESS_READ|ACCESS_WRITE); | ||
|
||
env.set("LAYOUT_ACCELERATION", VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR); | ||
env.set("LAYOUT_UNIFORM_BUFFER", VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER); | ||
env.set("LAYOUT_STORAGE_BUFFER", VK_DESCRIPTOR_TYPE_STORAGE_BUFFER); | ||
env.set("LAYOUT_STORAGE_IMAGE", VK_DESCRIPTOR_TYPE_STORAGE_IMAGE); | ||
env.set("LAYOUT_IMAGE_SAMPLER", VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER); | ||
} | ||
|
||
public static void addWorldConstants(LuaValue env) { | ||
var world = MinecraftClient.getInstance().world; | ||
if (world == null) { | ||
//If there is no world, cannot add world constants | ||
return; | ||
} | ||
/* | ||
var rm = world.getRegistryManager(); | ||
{ | ||
var blockRegistry = rm.get(RegistryKeys.BLOCK); | ||
for (var blockEntry : blockRegistry.getEntrySet()) { | ||
blockRegistry.getEntry(blockEntry.getKey()).get().isIn(TagK) | ||
} | ||
} | ||
var biomes = rm.get(RegistryKeys.BIOME).getEntrySet(); | ||
*/ | ||
} | ||
|
||
public static void addConstants(LuaValue env) { | ||
addVkConstants(env); | ||
addWorldConstants(env); | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
src/main/java/me/cortex/vulkanite/client/rendering/srp/lua/LuaShaderPropertiesBuilder.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 me.cortex.vulkanite.client.rendering.srp.lua; | ||
|
||
public class LuaShaderPropertiesBuilder { | ||
|
||
} |
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
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
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