fix annoying bug with pool allocator getting assigned to logger arrays
This commit is contained in:
parent
1c8f9bc46e
commit
4d9e175172
@ -24,4 +24,4 @@ VK_KHR_deferred_host_operations
|
|||||||
VK_KHR_acceleration_structure
|
VK_KHR_acceleration_structure
|
||||||
VK_KHR_ray_query
|
VK_KHR_ray_query
|
||||||
|
|
||||||
BLAS Compaction: 1.9MB -> 0.6MB (1.2MB saved, 66.1% smaller)
|
BLAS Compaction: 2.1MB -> 0.7MB (1.4MB saved, 66.1% smaller)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
master_volume 1
|
master_volume 1
|
||||||
music_volume 1
|
music_volume 0.5
|
||||||
sfx_volume 1
|
sfx_volume 1
|
||||||
fullscreen 0
|
fullscreen 0
|
||||||
|
|||||||
@ -49,7 +49,7 @@ g_asset_manager : Asset_Manager;
|
|||||||
|
|
||||||
#load "rdm_loader.jai";
|
#load "rdm_loader.jai";
|
||||||
|
|
||||||
MAX_FILE_SIZE :: 200_000_000;
|
MAX_FILE_SIZE :: 600_000_000;
|
||||||
RDM_ATLAS_MAX_BYTES :: 4096 * 4096 * 4 * 4 + size_of(RDM_File_Header);
|
RDM_ATLAS_MAX_BYTES :: 4096 * 4096 * 4 * 4 + size_of(RDM_File_Header);
|
||||||
RDM_LOOKUP_MAX_BYTES :: 512 * 512 * 4 * 4 + size_of(RDM_File_Header);
|
RDM_LOOKUP_MAX_BYTES :: 512 * 512 * 4 * 4 + size_of(RDM_File_Header);
|
||||||
|
|
||||||
|
|||||||
@ -135,7 +135,7 @@ tick_console :: () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console_add_output_line :: (s: string) {
|
console_add_output_line :: (s: string) {
|
||||||
array_add(*console_report, s);
|
array_add(*console_report, s);
|
||||||
while console_report.count > MAX_REPORT_ROWS {
|
while console_report.count > MAX_REPORT_ROWS {
|
||||||
array_ordered_remove_by_index(*console_report, 0);
|
array_ordered_remove_by_index(*console_report, 0);
|
||||||
|
|||||||
@ -32,7 +32,7 @@ RDM_Chunk_Bake :: struct {
|
|||||||
entries: [..]RDM_Atlas_Entry;
|
entries: [..]RDM_Atlas_Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
RDM_ATLAS_SIZE :: 4096;
|
RDM_ATLAS_SIZE :: 4096 * 2;
|
||||||
RDM_LOOKUP_SIZE :: 512; // 512x512 = 32*32*32*8 = 262144 texels
|
RDM_LOOKUP_SIZE :: 512; // 512x512 = 32*32*32*8 = 262144 texels
|
||||||
|
|
||||||
rdm_chunk_bakes : Table(Chunk_Key, RDM_Chunk_Bake, chunk_key_hash, chunk_key_compare);
|
rdm_chunk_bakes : Table(Chunk_Key, RDM_Chunk_Bake, chunk_key_hash, chunk_key_compare);
|
||||||
@ -377,6 +377,7 @@ rdm_bake_finish :: () {
|
|||||||
lookup_bytes :: lookup_texels * 4 * size_of(float);
|
lookup_bytes :: lookup_texels * 4 * size_of(float);
|
||||||
|
|
||||||
for chunk_key: bake_chunk_keys {
|
for chunk_key: bake_chunk_keys {
|
||||||
|
print("Handling chunk key: %\n", chunk_key);
|
||||||
bake := table_find_pointer(*rdm_chunk_bakes, chunk_key);
|
bake := table_find_pointer(*rdm_chunk_bakes, chunk_key);
|
||||||
if bake == null || bake.entries.count == 0 then continue;
|
if bake == null || bake.entries.count == 0 then continue;
|
||||||
|
|
||||||
@ -620,6 +621,7 @@ rdm_save_all_chunks_to_disk :: () {
|
|||||||
world_name := curworld.world.name;
|
world_name := curworld.world.name;
|
||||||
|
|
||||||
for *bake, chunk_key: rdm_chunk_bakes {
|
for *bake, chunk_key: rdm_chunk_bakes {
|
||||||
|
print("Processing chunk....\n");
|
||||||
if bake.entries.count == 0 then continue;
|
if bake.entries.count == 0 then continue;
|
||||||
|
|
||||||
// Save atlas.
|
// Save atlas.
|
||||||
|
|||||||
@ -17,7 +17,9 @@ _emit :: (level: Log_Level, message: string) {
|
|||||||
else ifx level == .ERROR then "[ERROR] "
|
else ifx level == .ERROR then "[ERROR] "
|
||||||
else "[INFO] ";
|
else "[INFO] ";
|
||||||
|
|
||||||
push_allocator(default_context.allocator);
|
// We need to protect the logger from custom allocators since we don't
|
||||||
|
// want those meddling with our log row allocation!
|
||||||
|
push_allocator(default_allocator);
|
||||||
line := copy_string(tprint("%1%2", prefix, message));
|
line := copy_string(tprint("%1%2", prefix, message));
|
||||||
print("%\n", line);
|
print("%\n", line);
|
||||||
console_add_output_line(line);
|
console_add_output_line(line);
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
#load "../main.jai";
|
#load "../main.jai";
|
||||||
|
|
||||||
default_context: #Context;
|
default_context: #Context;
|
||||||
|
default_allocator: Allocator;
|
||||||
|
|
||||||
temporary_storage: Temporary_Storage;
|
temporary_storage: Temporary_Storage;
|
||||||
temporary_storage_data: [TEMPORARY_STORAGE_SIZE] u8 #align 64;
|
temporary_storage_data: [TEMPORARY_STORAGE_SIZE] u8 #align 64;
|
||||||
@ -23,6 +24,7 @@ sapp_init :: () {
|
|||||||
temporary_storage.size = temporary_storage_data.count;
|
temporary_storage.size = temporary_storage_data.count;
|
||||||
temporary_storage.original_data = temporary_storage_data.data;
|
temporary_storage.original_data = temporary_storage_data.data;
|
||||||
temporary_storage.original_size = temporary_storage_data.count;
|
temporary_storage.original_size = temporary_storage_data.count;
|
||||||
|
default_allocator = default_context.allocator;
|
||||||
|
|
||||||
push_context default_context {
|
push_context default_context {
|
||||||
context.logger = logger;
|
context.logger = logger;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user