Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Misinterpretation of "bit" versus "byte" #146

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/me/cortex/nvidium/NvidiumWorldRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ public class NvidiumWorldRenderer {

private final AsyncOcclusionTracker asyncChunkTracker;

//Max memory that the gpu can use to store geometry in mb
//Max memory that the gpu can use to store geometry in MB
private long max_geometry_memory;
private long last_sample_time;

//Note: the reason that asyncChunkTracker is passed in as an already constructed object is cause of the amount of argmuents it takes to construct it
public NvidiumWorldRenderer(AsyncOcclusionTracker asyncChunkTracker) {
int frames = SodiumClientMod.options().advanced.cpuRenderAheadLimit+1;
//32 mb upload buffer
//32 MB upload buffer
this.uploadStream = new UploadingBufferStream(device, 32000000);
//8 mb download buffer
//8 MB download buffer
this.downloadStream = new DownloadTaskStream(device, frames, 8000000);

update_allowed_memory();
Expand Down Expand Up @@ -106,7 +106,7 @@ public void uploadBuildResult(ChunkBuildOutput buildOutput) {
public void addDebugInfo(ArrayList<String> debugInfo) {
debugInfo.add("Using nvidium renderer: "+ Nvidium.MOD_VERSION);
/*
debugInfo.add("Memory limit: " + max_geometry_memory + " mb");
debugInfo.add("Memory limit: " + max_geometry_memory + " MB");
debugInfo.add("Terrain Memory MB: " +);
debugInfo.add(String.format("Fragmentation: %.2f", sectionManager.terrainAreana.getFragmentation()*100));
debugInfo.add("Regions: " + sectionManager.getRegionManager().regionCount() + "/" + sectionManager.getRegionManager().maxRegions());
Expand All @@ -123,8 +123,8 @@ public void addDebugInfo(ArrayList<String> debugInfo) {
private void update_allowed_memory() {
if (Nvidium.config.automatic_memory) {
max_geometry_memory = (glGetInteger(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX) / 1024) + (sectionManager==null?0:sectionManager.terrainAreana.getMemoryUsed()/(1024*1024));
max_geometry_memory -= 1024;//Minus 1gb of vram
max_geometry_memory = Math.max(2048, max_geometry_memory);//Minimum 2 gb of vram
max_geometry_memory -= 1024;//Minus 1 GB of vram
max_geometry_memory = Math.max(2048, max_geometry_memory);//Minimum 2 GB of vram
} else {
max_geometry_memory = Nvidium.config.max_geometry_memory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public static long alignUp(long number, long alignment) {
public final long addr;
public final long size;

//The reason the page size is now 1mb is cause the nv driver doesnt defrag the sparse allocations easily
//The reason the page size is now 1 MB is cause the nv driver doesnt defrag the sparse allocations easily
// meaning smaller pages result in more fragmented memory and not happy for the driver
// 1mb seems to work well
// 1 MB seems to work well
public static final long PAGE_SIZE = 1<<20;//16

public PersistentSparseAddressableBuffer(long size) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/cortex/nvidium/util/BufferArena.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public BufferArena(RenderDevice device, long memory, int vertexFormatSize) {
this.vertexFormatSize = vertexFormatSize;
this.memory_size = memory;
if (Nvidium.SUPPORTS_PERSISTENT_SPARSE_ADDRESSABLE_BUFFER) {
buffer = device.createSparseBuffer(80000000000L);//Create a 80gb buffer
buffer = device.createSparseBuffer(80000000000L);//Create a 80 GB buffer
} else {
buffer = device.createDeviceOnlyMappedBuffer(memory);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/nvidium/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"nvidium.options.max_gpu_memory.tooltip" : "Max gpu memory allowed, will start to cull chunks if this limit is hit",
"nvidium.options.enable_temporal_coherence.name" : "Enables temporal coherence",
"nvidium.options.enable_temporal_coherence.tooltip" : "Removes artifacting when turning around",
"nvidium.options.mb" : "%s Mbs",
"nvidium.options.mb" : "%s MB",
"nvidium.options.translucency_sorting.name" : "Translucency Sorting",
"nvidium.options.translucency_sorting.tooltip" : "Translucency sorting level, each level has different performance impact and visual quality. \nNone:No translucency sorting, no impact, can look quite bad\nSections: Section level translucency sorting, brings translucency to the same level as sodium, minimal impact\nQuads: Incremental sorting, sorts geometry correctly over multiple frames, can cause visual weirdness while sorting",
"nvidium.options.translucency_sorting.none" : "None",
Expand Down