Skip to content

Commit

Permalink
sync on 2024/12/03, rev 8486c81d97afccec3ee17945750171fbd2fc5c14
Browse files Browse the repository at this point in the history
  • Loading branch information
NicSavichev committed Dec 3, 2024
1 parent 71bd5f7 commit ceec759
Show file tree
Hide file tree
Showing 44 changed files with 2,942 additions and 430 deletions.
2 changes: 1 addition & 1 deletion DagorEngine.rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
93442a8e07574323ca76a3089cb84980bd4e422a
8486c81d97afccec3ee17945750171fbd2fc5c14
4 changes: 1 addition & 3 deletions build_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ call compile_all_prog_vromfs.cmd
cd shaders
call compile_shaders_dx11.bat
call compile_shaders_tools.bat
cd ..\..\develop\gameBase
call create_vfsroms.bat
cd ..\gui
cd ..\..\develop\gui
call build_ui.cmd
popd
pushd outerSpace\prog\utils\dev_launcher
Expand Down
3 changes: 0 additions & 3 deletions build_all_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ popd
pushd gameBase
../../../tools/dagor_cdk/linux-$ARCH/vromfsPacker-dev mk.vromfs.blk -quiet -addpath:.
popd
pushd ../develop/gameBase
../../../tools/dagor_cdk/linux-$ARCH/vromfsPacker-dev gamedata.vromfs.blk -quiet
popd
popd
pushd outerSpace/develop/gui
../../../tools/dagor_cdk/linux-$ARCH/vromfsPacker-dev input.vromfs.blk -quiet
Expand Down
3 changes: 0 additions & 3 deletions build_all_macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ popd
pushd gameBase
../../../tools/dagor_cdk/macOS-x86_64/vromfsPacker-dev mk.vromfs.blk -quiet -addpath:.
popd
pushd ../develop/gameBase
../../../tools/dagor_cdk/macOS-x86_64/vromfsPacker-dev gamedata.vromfs.blk -quiet
popd
popd
pushd outerSpace/develop/gui
../../../tools/dagor_cdk/macOS-x86_64/vromfsPacker-dev input.vromfs.blk -quiet
Expand Down
12 changes: 5 additions & 7 deletions outerSpace/prog/jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@ if $(Dedicated) = no {
daNetGameLibs/render_debug
;
}
if $(FmodStudio) != src && $(HaveSound) != no {
AddLibs += $(FmodStaticLibs) ;
for dll in $(FmodStudioSharedLibs) {
BundleCopy += @$(dll) $(dll:D=) ;
#ALWAYS $(dll) ;
}
}

if $(HaveRenderer) = yes {
gamePulls += framework_blurred_ui_pull ;
Expand Down Expand Up @@ -237,6 +230,11 @@ if $(Dedicated) != yes {
}
}

if $(FmodStudio) != src && $(HaveSound) != no {
AddLibs += $(FmodStaticLibs) ;
if $(Platform) != macOS { for dll in $(FmodStudioSharedLibs) { BundleCopy += @$(dll) $(dll:D=) ; } }
}

if $(Platform) in windows && $(Dedicated) != yes && $(CheckOnly) != yes {
local rc = platform/$(Platform)/$(Game).rc ;
if [ GLOB $(Root)/$(Location)/$(rc:D) : $(rc:D=) ] { Sources += $(rc) ; } else { Echo Skip missing $(rc) ; }
Expand Down
7 changes: 7 additions & 0 deletions prog/daNetGame/shaders/rendinst.hlsli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef RENDINST_HLSLI_INCLUDED
#define RENDINST_HLSLI_INCLUDED

#define INST_OFFSET_FLAG_USE_INDIRECTION (1u << 31u)
#define INST_OFFSET_MASK_VALUE (0x7FFFFFFFu)

#endif // RENDINST_HLSLI_INCLUDED
28 changes: 27 additions & 1 deletion prog/daNetGame/shaders/rendinst_inc.dshl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include "rotation_palette_inc.dshl"
include "paint_details_inc.dshl"

hlsl { #define RENDINST_FLOAT_POS 1 } // for debug switching between floats and halfs
hlsl { #include "rendinst.hlsli" }

int rendinst_use_cell_sbuffer = 0 always_referenced;
interval rendinst_use_cell_sbuffer: off < 1, on;
Expand All @@ -22,6 +23,7 @@ int useBboxInCbuffer = 1 always_referenced;
int rendinst_perinst_buff_no = 6 always_referenced;
int rendinst_instance_buff_no = 5 always_referenced;
int per_instance_data_no = 14;
int ri_additional_instance_offsets_data_no = 15;
int ri_vertex_data_no = 12 always_referenced;

buffer impostor_data_buffer;
Expand Down Expand Up @@ -115,7 +117,23 @@ macro RENDINST_INSTANCING()
##if rendinst_render_type == ri_ex_only
#define INST_OFFSET_GETTER 0
##else
#define INST_OFFSET_GETTER get_immediate_dword_0()
uint inst_offset_getter()
{
uint val = get_immediate_dword_0();

##if hardware.dx11 || hardware.dx12
// Only needed, if startInstanceLocation is not used.
BRANCH
if (val & INST_OFFSET_FLAG_USE_INDIRECTION)
{
// Additional indirection for GPU-generated offsets.
return 4 * loadBuffer(ri_additional_instance_offsets, val & INST_OFFSET_MASK_VALUE);
}
##endif

return val;
}
#define INST_OFFSET_GETTER inst_offset_getter()
##endif
#endif

Expand Down Expand Up @@ -384,6 +402,14 @@ macro RENDINST_SCENE_COMMON()
impostor_data_buffer@buf = impostor_data_buffer hlsl {
Buffer<float4> impostor_data_buffer@buf;
};

if (hardware.dx11 || hardware.dx12)
{
ri_additional_instance_offsets@buf : register(ri_additional_instance_offsets_data_no)
hlsl {
ByteAddressBuffer ri_additional_instance_offsets@buf;
}
}
}
(ps) {
impostor_data_buffer@buf = impostor_data_buffer hlsl {
Expand Down
2 changes: 2 additions & 0 deletions prog/daNetGameLibs/daGdp/_shaders.blk
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
file:t = "daGdp/shaders/dagdp_dynamic.dshl"
file:t = "daGdp/shaders/dagdp_heightmap.dshl"
file:t = "daGdp/shaders/dagdp_volume.dshl"
file:t = "daGdp/shaders/dagdp_riex.dshl"
8 changes: 4 additions & 4 deletions prog/daNetGameLibs/daGdp/debug/globalManagerDebugES.cpp.inl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ void GlobalManager::imgui()
for (int viewIndex = 0; viewIndex < views.size(); ++viewIndex)
{
const auto &builder = debug.builders[viewIndex];
const auto &view = views[viewIndex];
maxInstances += builder.maxInstancesPerViewport * view.info.maxViewports;
maxInstances += builder.totalMaxInstances;
}

uint64_t reservedBytes = maxInstances * sizeof(PerInstanceData);
Expand All @@ -47,8 +46,9 @@ void GlobalManager::imgui()
ImGui::BulletText("View kind: %d", static_cast<int>(eastl::to_underlying(view.info.kind)));
ImGui::BulletText("View max draw distance: %f", view.info.maxDrawDistance);
ImGui::BulletText("Max viewports: %" PRIu32, view.info.maxViewports);
ImGui::BulletText("Max instances %" PRIu32, builder.maxInstancesPerViewport * view.info.maxViewports);
ImGui::BulletText("Max instances per viewport: %" PRIu32, builder.maxInstancesPerViewport);
ImGui::BulletText("Total max instances %" PRIu32, builder.totalMaxInstances);
ImGui::BulletText("Max static instances per viewport: %" PRIu32, builder.maxStaticInstancesPerViewport);
ImGui::BulletText("Max dynamic instances: %" PRIu32, builder.dynamicInstanceRegion.maxCount);
ImGui::BulletText("Renderables: %" PRIu32, builder.numRenderables);

ImGui::TreePop();
Expand Down
8 changes: 7 additions & 1 deletion prog/daNetGameLibs/daGdp/render/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,20 @@ struct RulesBuilder
dag::VectorMap<ecs::EntityId, ObjectGroupInfo> objectGroups;
dag::VectorMap<ecs::EntityId, PlacerInfo> placers;
RenderableId nextRenderableId = 0;
uint32_t maxObjects = 0; // 0 means no limit.
};

struct ViewBuilder
{
dag::RelocatableFixedVector<uint32_t, 64> renderablesMaxInstances;
dag::RelocatableFixedVector<InstanceRegion, 64> renderablesInstanceRegions;
uint32_t maxInstancesPerViewport = 0;
uint32_t totalMaxInstances = 0; // static for all viewports, and dynamic.
uint32_t maxStaticInstancesPerViewport = 0;
uint32_t numRenderables = 0;
bool hasDynamicPlacers = false;

// Additional, GPU-suballocated memory. Located directly after static regions.
InstanceRegion dynamicInstanceRegion = {};
};

enum class ViewKind
Expand Down
Loading

0 comments on commit ceec759

Please sign in to comment.