Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f9e32e3
sdk: add memexport tracing
NeverCookFirst Sep 29, 2026
7fa5d1e
sdk: trace resolve readback stalls
NeverCookFirst Sep 29, 2026
ed788ae
gpu: add LEGO shader AOT pipeline
NeverCookFirst Sep 29, 2026
60902d9
gpu: bootstrap native D3D12 device
NeverCookFirst Sep 29, 2026
abc6a35
gpu: map Sep13 D3D functions
NeverCookFirst Sep 29, 2026
879eaa6
gpu: add native shader resource lifecycle
NeverCookFirst Sep 29, 2026
0911a43
gpu: add native vertex and index buffers
NeverCookFirst Sep 29, 2026
7e80a23
gpu: add native texture resource lifecycle
NeverCookFirst Sep 29, 2026
a206874
gpu: shadow native draw bindings
NeverCookFirst Sep 29, 2026
b0b7f25
gpu: compile native vertex declarations
NeverCookFirst Sep 29, 2026
462c430
gpu: add native bindless pipeline layout
NeverCookFirst Sep 29, 2026
9513adb
gpu: cache native render framebuffers
NeverCookFirst Sep 29, 2026
d629afb
gpu: add native frame-ring present path
NeverCookFirst Sep 29, 2026
686b40f
gpu: upload texture mirrors through frame ring
NeverCookFirst Sep 29, 2026
b9643aa
gpu: execute native draws and present resolved frames
NeverCookFirst Sep 29, 2026
8fa8798
Preserve native GPU investigations, probes and regression harnesses
NeverCookFirst Oct 3, 2026
c0172a9
Checkpoint integrated native D3D12 renderer and SDK fallback
NeverCookFirst Oct 3, 2026
c376d40
Update resource regression harnesses for depth aliases and portable P…
NeverCookFirst Oct 3, 2026
719f83d
Associate failed and captured native draws with guest shader objects
NeverCookFirst Oct 3, 2026
0885237
Verify captured placement shaders against production AOT lookup
NeverCookFirst Oct 3, 2026
460e670
Include the main shader bank in captured lookup verification
NeverCookFirst Oct 3, 2026
2b560c4
Preserve native presentation aspect ratio across window sizes
NeverCookFirst Oct 3, 2026
4c43b28
Preserve alpha when correcting native color-resolve swizzles
NeverCookFirst Oct 3, 2026
f08fee0
Add audited opt-in generation caching for native buffer uploads
NeverCookFirst Oct 3, 2026
72ca532
Record consecutive-frame evidence of the Enter color swap
NeverCookFirst Oct 3, 2026
84be59f
Fuse aligned packed-vertex conversion into write-only uploads
NeverCookFirst Oct 3, 2026
a0bb176
Document portrait reference anchors and native upload measurements
NeverCookFirst Oct 3, 2026
395d369
Record remaining renderer validation and the no-launch constraint
NeverCookFirst Oct 3, 2026
345f805
Trace portrait mask identity through native texture draws
NeverCookFirst Oct 4, 2026
2e28b8c
Attribute native frame waits and report frame-time tails
NeverCookFirst Oct 4, 2026
dd8f4ea
Record native 1080p target and prepare monitor-two probes
NeverCookFirst Oct 4, 2026
5c6ca10
Follow active inline D3D header in portrait texture trace
NeverCookFirst Oct 4, 2026
5492353
Use monitor three for authorized native probes
NeverCookFirst Oct 4, 2026
98c2f36
Correct portrait backend from actual asset binding path
NeverCookFirst Oct 4, 2026
d16069d
Trace rejected portrait draws and document expanded world shader cove…
NeverCookFirst Oct 4, 2026
1e56230
Handle Alt Enter borderless toggle in game app
NeverCookFirst Oct 4, 2026
d95e918
Integrate explicit mip level translation with matching native constants
NeverCookFirst Oct 4, 2026
50606ed
Roll back explicit LOD integration after failed LOTR visual test
NeverCookFirst Oct 4, 2026
abb1c75
Correct native texture channels and DXT3A; add offline GPU oracle and…
NeverCookFirst Oct 4, 2026
cbd2c39
Prepare isolated texture gradient translation and audit affected LOTR…
NeverCookFirst Oct 4, 2026
c62dcb8
Record monitor-3 capture and repair bounded scene rearming and alias …
NeverCookFirst Oct 4, 2026
6834b23
Record gradient archive integration and five captured placement shaders
NeverCookFirst Oct 4, 2026
f1ddad6
Prepare native renderer draft for collaboration and portable helper c…
NeverCookFirst Oct 6, 2026
d94c2fd
Record verified Ubuntu portable checks and published draft handoff
NeverCookFirst Oct 6, 2026
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
18 changes: 18 additions & 0 deletions .github/workflows/native-gpu-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Native GPU portable checks
on:
pull_request:
push:
branches: [codex/native-renderer]
permissions:
contents: read
jobs:
portable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure asset-free checks
run: cmake -S tools/gpu-aot -B native-checks -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build native-checks --parallel 2
- name: Test
run: ctest --test-dir native-checks --output-on-failure
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
!/rexglue-sdk
!/DimensionsModManager
!/DimensionsSaveConverter
!/thirdparty/
!/thirdparty/plume
!/thirdparty/miniz/
!/thirdparty/miniz/**
!/thirdparty/zstd/
!/thirdparty/zstd/**
!/xexdump/
!/tools/

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
[submodule "DimensionsSaveConverter"]
path = DimensionsSaveConverter
url = https://github.com/NeverCookFirst/DimensionsSaveConverter.git
[submodule "thirdparty/plume"]
path = thirdparty/plume
url = https://github.com/zolaware/plume.git
305 changes: 305 additions & 0 deletions rexlego/CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions rexlego/src/cheat_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ void Shutdown() {
// menu gets a plain on/off instead of a hex string.
namespace {

constexpr std::string_view kDofPixelShaderHash = "CFEAC7ADB912F8A9";

void ApplyDepthOfField(bool enabled) {
const std::string current = rex::cvar::GetFlagByName("skip_pixel_shaders");
std::string next;
Expand Down
2 changes: 2 additions & 0 deletions rexlego/src/cheat_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
#pragma once

#include <memory>
#include <string_view>

namespace rex::ui {
class ImGuiDialog;
class ImGuiDrawer;
} // namespace rex::ui

namespace legodimensions::cheats {
inline constexpr std::string_view kDofPixelShaderHash = "CFEAC7ADB912F8A9";

// Creates the DEL dialog. The caller owns it; destroying it closes the menu,
// the same way the mod menu and the SDK overlays are toggled. The scanner
Expand Down
7 changes: 7 additions & 0 deletions rexlego/src/gpu/shaders/linked_shader_cache.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Compatibility include for the source emitted by lego_gpu_prelink.
*/

#pragma once

#include "gpu_native/linked_shader_cache.h"
7 changes: 7 additions & 0 deletions rexlego/src/gpu/shaders/shader_cache.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Compatibility include for the source emitted by XenosRecomp.
*/

#pragma once

#include "gpu_native/shader_archive.h"
16 changes: 16 additions & 0 deletions rexlego/src/gpu_native/alpha_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include <cstdint>

namespace legodimensions::gpu_native {
struct NativeAlphaState {
bool enabled;
std::uint32_t function;
float reference;
};
inline NativeAlphaState DecodeNativeAlphaState(std::uint32_t color_control,
float reference) {
// TU23 83FB7E00 / 83FB82C0: enable bit 3, raw Xenos compare bits 0..2.
// 83FB92B8 stores FLOAT BITS unchanged; no integer /255 or /256 mapping.
return {(color_control & 8u) != 0, color_control & 7u, reference};
}
} // namespace legodimensions::gpu_native
24 changes: 24 additions & 0 deletions rexlego/src/gpu_native/blend_state.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once
#include <cstdint>

namespace legodimensions::gpu_native {
struct ColorBlendState {
uint32_t source, destination, operation;
uint32_t alpha_source, alpha_destination, alpha_operation;
bool enabled, supported;
};
constexpr bool SupportedBlendFactor(uint32_t value) {
// Constant alpha for RGB needs a distinct host representation, not silently
// substituting constant RGB. Keep that case explicitly unsupported for now.
return value <= 1 || (value >= 4 && value <= 13) || value == 16;
}
constexpr ColorBlendState DecodeColorBlend(uint32_t control) {
ColorBlendState state{control & 31, (control >> 8) & 31, (control >> 5) & 7,
(control >> 16) & 31, (control >> 24) & 31, (control >> 21) & 7};
state.enabled = (control & 0x1FFF1FFFu) != 0x00010001u;
state.supported = state.operation <= 4 && state.alpha_operation <= 4 &&
SupportedBlendFactor(state.source) && SupportedBlendFactor(state.destination) &&
SupportedBlendFactor(state.alpha_source) && SupportedBlendFactor(state.alpha_destination);
return state;
}
} // namespace legodimensions::gpu_native
21 changes: 21 additions & 0 deletions rexlego/src/gpu_native/buffer_header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once
#include <cstdint>

namespace legodimensions::gpu_native {
struct PlacementBufferInfo {
uint32_t address = 0;
uint32_t size = 0;
uint32_t index_format = 0; // Native convention: 1 = 16-bit, 2 = 32-bit.
};

// TU23 asset headers observed in game.log; matches re:Blue's physical-buffer
// adoption. These are initialized fetch headers, not XGSet*BufferHeader inputs.
constexpr PlacementBufferInfo DecodePlacementBuffer(uint32_t common,
uint32_t fetch_lo, uint32_t fetch_hi, bool index) {
if ((common & 31u) != (index ? 2u : 1u)) return {};
const uint32_t address = fetch_lo & ~3u;
const uint32_t size = fetch_hi & 0x03FFFFFCu;
if (!address || !size || uint64_t(address) + size > 0x100000000ull) return {};
return {address, size, index ? ((common & 0x80000000u) ? 2u : 1u) : 0u};
}
}
19 changes: 19 additions & 0 deletions rexlego/src/gpu_native/buffer_window.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once
#include <cstdint>

namespace legodimensions::gpu_native {
struct VertexBufferWindow { uint32_t offset = 0, length = 0; };
// The rebased index is index-min_index; the upload starts at
// stream_offset+(min_index+original_base_vertex)*stride.
constexpr VertexBufferWindow DrawVertexWindow(uint32_t min_index, uint32_t max_index,
int32_t base_vertex, uint32_t stride, uint32_t stream_offset, uint32_t buffer_length) {
const int64_t first = int64_t(min_index) + base_vertex;
const int64_t last = int64_t(max_index) + base_vertex;
if (!stride || first < 0 || last < first) return {};
const uint64_t offset = uint64_t(stream_offset) + uint64_t(first) * stride;
const uint64_t length = uint64_t(last - first + 1) * stride;
if (offset > buffer_length || length > buffer_length - offset ||
offset % 4 || length % 4) return {};
return {uint32_t(offset), uint32_t(length)};
}
}
Loading
Loading