Skip to content
Merged
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
10 changes: 9 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
* text=auto
* text=auto eol=lf
*.bmp binary
*.dll binary
*.dxbc binary
*.ico binary
*.jpg binary
*.lib binary
*.png binary
*.webp binary
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
LIB: ${{ github.workspace }}\lib

jobs:
format:
Expand Down Expand Up @@ -69,3 +70,16 @@ jobs:
- run: cargo build --profile dist --locked --no-default-features --bin alkahest-prebl
- run: Copy-Item lib\SDL3.dll target\dist\SDL3.dll
- run: target\dist\alkahest-prebl.exe --version
- name: Assemble test build
if: github.ref == 'refs/heads/main'
shell: pwsh
run: |
New-Item -ItemType Directory target\package
Copy-Item target\dist\alkahest-prebl.exe,target\dist\SDL3.dll,LICENSE,THIRD_PARTY_NOTICES.md target\package\
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: github.ref == 'refs/heads/main'
with:
name: alkahest-sunrise-windows-x64-${{ github.sha }}
path: target/package
if-no-files-found: error
retention-days: 14
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
</p>

# Project Sunrise — Alkahest Pre-BL
> **This repository is a fork of [Alkahest](https://github.com/cohaereo/alkahest), created by [cohaereo](https://github.com/cohaereo/cohaereo). Project Sunrise would not exist without cohaereo's original architecture, renderer, tooling, and years of work. This fork builds on that foundation for preserved Shadowkeep / Season of Arrivals package support.**


Alkahest Pre-BL is a Windows desktop map viewer and research renderer for
user-supplied Destiny 2 Shadowkeep / Season of Arrivals package files. It lets
Expand Down Expand Up @@ -95,8 +97,10 @@ GitHub artifact provenance before a draft release is created.
- **Promotional identity and artwork:** Solus —
[YouTube](https://youtube.com/@solus-yt) ·
[X / Twitter](https://x.com/solus_yt).
- **Renderer foundation:** [Alkahest](https://github.com/cohaereo/alkahest)
and its contributors.
- **Upstream author and renderer foundation:** [cohaereo](https://github.com/cohaereo/cohaereo),
creator of [Alkahest](https://github.com/cohaereo/alkahest). Project Sunrise
is a fork and would not exist without his work. Additional credit belongs to
Alkahest's contributors.

## Data and affiliation

Expand Down
14 changes: 11 additions & 3 deletions crates/render/src/renderer/submit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ impl Renderer {
let sky_illumination = 0.03 + 0.97 * daylight;
let externs = self.externs.read();
let target_pixel_to_world = externs.view.target_pixel_to_world;
let camera_position = externs.view.position;
let sky_state = ShadowkeepSkyState::from_externs(&externs);
let include_sun = debug_pipeline.is_none_or(|pipeline| pipeline.has_sun());
let sun_color = if include_sun {
Expand All @@ -1155,7 +1156,7 @@ impl Renderer {
cmd,
&ShadowkeepSkyConstants {
target_pixel_to_world,
camera_position: self.externs.read().view.position,
camera_position,
sun_direction,
zenith_color: sky_state.zenith * sky_illumination,
horizon_color: sky_state.horizon * sky_illumination,
Expand Down Expand Up @@ -2438,7 +2439,8 @@ impl Renderer {
fn prepare_externs(&self, cmd: &mut CommandList, view: &View) {
let fb_res = view.framebuffer_resolution();

let misc = &self.frame_packet.read().misc;
let frame_packet = self.frame_packet.read();
let misc = &frame_packet.misc;

// let cam_view = Mat4::from_cols(
// [-0.962532818, -0.027713167, -0.269745320, 0.000000000].into(),
Expand Down Expand Up @@ -2647,6 +2649,11 @@ impl Renderer {
ext.atmosphere.unk1e8 = ext.get_global_channel_by_id(0xe685c537).x;
ext.atmosphere.unk1ec = ext.get_global_channel_by_id(0xe4a1bf60).x;
}
// Release both frame-state guards before helpers reacquire them below.
// parking_lot locks are not reentrant; retaining `ext` here deadlocks
// the first rendered frame after a map finishes loading.
drop(ext);
drop(frame_packet);

// The current fixed 37-register transparent setup belongs to the
// post-BL scope layout. Shadowkeep owns a shorter, differently laid
Expand Down Expand Up @@ -2747,8 +2754,9 @@ impl Renderer {

fn prepare_main_view_externs(&self, view: &MainView) {
let fb_res = view.surfaces.framebuffer_resolution();
let frame_packet = self.frame_packet.read();
let misc = &frame_packet.misc;
let mut ext = self.externs.write();
let misc = &self.frame_packet.read().misc;

// ext.deferred.gbuffer_resolution_scale_offset =
// vec4(fb_res.0 as f32, fb_res.1 as f32, 0.0, 0.0);
Expand Down
24 changes: 21 additions & 3 deletions src/world/shadowkeep_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2878,7 +2878,7 @@ pub fn load_shadowkeep_map_into_world(
report.sky_object_color_stage_mask |= color_stages.bits();
report.sky_object_deferred_stage_mask |= deferred_stages.bits();
if !deferred_stages.is_empty() {
tracing::info!(
tracing::debug!(
collection = %collection_tag,
model = %model_tag,
deferred_stage_mask = format_args!("0x{:08X}", deferred_stages.bits()),
Expand Down Expand Up @@ -2933,7 +2933,7 @@ pub fn load_shadowkeep_map_into_world(
progress
.visual_resources_loaded
.fetch_add(1, Ordering::Relaxed);
tracing::info!(
tracing::debug!(
collection = %collection_tag,
origin = candidate.sources.label(),
index,
Expand Down Expand Up @@ -2995,7 +2995,25 @@ pub fn load_shadowkeep_map_into_world(
.reduce(|left, right| left.union(&right));
report.inspection = inspection.finalize();
report.inspection.validate(&world)?;
debug_assert!(report.entity_resource_accounting_is_complete());
if !report.entity_resource_accounting_is_complete() {
tracing::error!(
entity_resource_class_counts = ?report.entity_resource_class_counts,
loaded_entity_resource_classes = ?report.loaded_entity_resource_classes,
deferred_entity_resource_classes = ?report.deferred_entity_resource_classes,
failed_entity_resource_classes = ?report.failed_entity_resource_classes,
"Shadowkeep entity-resource accounting is incomplete"
);
report.diagnostic(
progress,
MapLoadDiagnostic {
table: tag,
entry_offset: 0,
resource_class: 0,
error: "internal entity-resource accounting is incomplete; the map was retained"
.to_owned(),
},
);
}
tracing::info!(
map = %tag,
scenario = ?report.scenario,
Expand Down
Loading