Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4036577
Add native gfx1013 DXIL compiler, replay CLI and source-built fixtures
R0Y00 Nov 26, 2026
cd752a8
shader: draw a per-vertex VCC across a vertex-stage join (Refs #2906)…
Not-Saii Nov 26, 2026
ee76dfa
runtime: bring XMem page-run fixes into cpp-migration (#2918)
sydney-0o Nov 26, 2026
16099d7
shader: lower v_pack_b32_f16 in the direct C++ DXIL path (#2917)
Ybucaille Nov 26, 2026
7f951fd
Revert "runtime: bring XMem page-run fixes into cpp-migration (#2918)…
MasterDomino Nov 26, 2026
e4523d9
tests: expect the decoder's refusal for the invalid word in native_wa…
JB2WIN Nov 26, 2026
e97c5c7
shader: emit !llvm.ident in direct DXIL modules for AMD PSO creation …
consolelogkyo Nov 26, 2026
7beb331
shader: read requests at the runtime's revision 28 in compile_dxil (#…
Miffedrandir Nov 26, 2026
1cd48bd
shader: lower DPP16 quad_perm in the direct C++ compute path (#2936) …
Leyukaka Nov 26, 2026
a990f32
shader: restore compilation of LDS replay requests (#2941)
sydney-0o Nov 26, 2026
c2f6d3d
ci: exercise native DXIL on pull requests into cpp-migration (#2942)
sydney-0o Nov 26, 2026
ea07313
shader: vote a quad-complete EXEC for WQM EXECZ branches in native pi…
roansystemlabs Nov 26, 2026
641add9
shader: lower v_readlane_b32 and v_writelane_b32 in the direct C++ co…
Leyukaka Nov 26, 2026
49e0e36
shader: accept inline, literal and SGPR-pair values in direct C++ 64-…
Leyukaka Nov 26, 2026
e367010
shader: consume startup requests and publish runtime cache entries in…
consolelogkyo Nov 26, 2026
f934df5
shader: lower s_bfm_b64, s_cselect_b64 and s_not_b64 in the direct C+…
Leyukaka Nov 26, 2026
b260984
runtime: translate slot 67 compute requests in the stand-in (#2958)
Not-Saii Nov 27, 2026
8946fb1
shader: lower binary16 add, sub, subrev and mul in direct compute (#2…
SimSalabimse Nov 27, 2026
0b1456c
shader: lower root-pointer global_load_dword in the direct C++ comput…
legacy-code-archaeologist Nov 27, 2026
78a071c
shader: accept byte-window buffer descriptors for stores in the direc…
Leyukaka Nov 27, 2026
2b678fd
shader: lower image_gather4_c_lz in the direct C++ image path (#2971)
legacy-code-archaeologist Nov 27, 2026
7bcff28
shader: lower the SDWA forms of binary16 add, sub, subrev and mul in …
Leyukaka Nov 27, 2026
05438d6
native: capture and replay view types for GPU-selected global SRV slo…
JB2WIN Nov 27, 2026
4ff5e36
tooling: write .fail diagnostics and add read-only --refusals summary…
stan495 Nov 27, 2026
b69c111
shader: lower the SAD operations in the direct C++ compute path (#2990)
legacy-code-archaeologist Nov 27, 2026
c6908cc
shader: lower v_ashrrev_i64 and v_mad_i32_i24 in the direct C++ compu…
legacy-code-archaeologist Nov 27, 2026
79a8db6
tooling: add --watch mode to compile_dxil for live startup shader req…
stan495 Nov 27, 2026
e0d8375
shader: resolve and cache RTV variant requests in compile_dxil --requ…
Not-Saii Nov 27, 2026
24d9260
shader: lower v_alignbit_b32, v_alignbyte_b32 and v_bfm_b32 in the di…
legacy-code-archaeologist Nov 27, 2026
4701650
shader: lower v_cvt_pk_u16_u32 and v_cvt_pk_i16_i32 in the direct C++…
legacy-code-archaeologist Nov 27, 2026
af6d255
shader: lower v_cvt_pk_u8_f32 in the direct C++ compute path (#2998)
legacy-code-archaeologist Nov 27, 2026
999e17c
tooling: support .rtv variant requests in compile_dxil --watch and --…
stan495 Nov 27, 2026
1507f0e
native: read the byte-address rewrite of a GPU-selected heap descript…
JB2WIN Nov 27, 2026
f6cdee1
shader: keep D[31:16] in the direct path's binary16 add, sub, subrev …
archielcqp-a11y Nov 27, 2026
b8f4925
Merge main into cpp-migration
codex Nov 27, 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
10 changes: 9 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [main, cpp-migration]
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -496,6 +496,14 @@ jobs:
ctest --preset dev --no-tests=error --parallel 4 -E '_hardware$' --output-junit "$PWD/out/test-results.xml"
}
exit $LASTEXITCODE
- name: Check native DXIL generation on migration pull requests
if: github.base_ref == 'cpp-migration'
shell: pwsh
run: |
.\tools\dev.ps1
cmake --build --preset dev --target compile_dxil
if ($LASTEXITCODE) { exit $LASTEXITCODE }
ctest --preset dev --no-tests=error -R '^native_dxil_llvm_ident_controls$'
- name: Require the SPIR-V bridge WARP tests
if: ${{ !cancelled() }}
shell: pwsh
Expand Down
142 changes: 142 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@ project(Xbox2Windows LANGUAGES CXX)

enable_testing()

if(WIN32)
include(CheckIncludeFiles)
check_include_files("windows.h;dxcapi.h" X2W_HAVE_DXCAPI LANGUAGE CXX)
if(X2W_HAVE_DXCAPI)
add_library(x2w_shader_compiler STATIC src/gfx1013_pixel.cpp src/gfx1013_compute_clear.cpp
src/shader_compute_request.cpp src/guest_shader_container.cpp src/gfx1013_isa.cpp src/direct_compute_cache.cpp src/gfx1013_compute_native.cpp src/native_compute_pipeline.cpp
src/gfx1013_compute_ir.cpp src/gfx1013_sampled_pixel.cpp src/gfx1013_vertex_id.cpp src/gfx1013_rect_geometry.cpp src/shader_dxil_compiler.cpp)
set(native_shader_revision "")
foreach(source gfx1013_compute_native.cpp gfx1013_compute_native.h gfx1013_compute_opcodes.inl gfx1013_graphics_wqm.inl
gfx1013_isa_tables.inl gfx1013_isa.cpp gfx1013_isa.h gfx1013_compute_alu.inl gfx1013_direct_compute.inl gfx1013_compute_ir.cpp gfx1013_compute_ir.h
gfx1013_compute_mtbuf.inl gfx1013_direct_graphics.inl gfx1013_rect_geometry.cpp guest_shader_container.cpp guest_shader_container.h
dxil_module.h direct_compute_cache.cpp direct_compute_cache.h
shader_compute_request.cpp shader_compute_request.h startup_stubs/inflate.h)
set(native_shader_file "${CMAKE_CURRENT_SOURCE_DIR}/src/${source}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${native_shader_file}")
file(SHA256 "${native_shader_file}" native_shader_part)
string(APPEND native_shader_revision "${native_shader_part}")
endforeach()
string(SHA256 native_shader_revision "${native_shader_revision}")
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/native_shader_revision.h"
CONTENT "#define X2W_NATIVE_SHADER_REVISION \"${native_shader_revision}\"\n")
target_include_directories(x2w_shader_compiler PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated")
target_include_directories(x2w_shader_compiler PUBLIC src)
target_compile_features(x2w_shader_compiler PUBLIC cxx_std_17)
target_link_libraries(x2w_shader_compiler PRIVATE bcrypt d3d12)
add_executable(compile_dxil tools/startup/compile_dxil.cpp)
target_link_libraries(compile_dxil PRIVATE x2w_shader_compiler)
set_target_properties(compile_dxil x2w_shader_compiler PROPERTIES
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif()

# Python never caches the bytecode of the script it is started with, so every start of a big
# tests/<name>.py recompiled it. tests/pyc_main.py <name> runs that file through the import system,
# which reuses a valid .pyc. The add_test calls below keep naming the script; this wrapper swaps in
Expand Down Expand Up @@ -399,6 +431,12 @@ set_target_properties(d3d12_xs_shim PROPERTIES OUTPUT_NAME d3d12_xs)
target_include_directories(d3d12_xs_shim PRIVATE src)
target_compile_features(d3d12_xs_shim PRIVATE cxx_std_17)
target_link_libraries(d3d12_xs_shim PRIVATE d3d12)
# X2W_NATIVE_SHADERS: the stand-in translates slot 67 compute requests in-process
# (src/startup_stubs/d3d12_compute_dispatch.inl). Both use the static CRT.
if(TARGET x2w_shader_compiler)
target_link_libraries(d3d12_xs_shim PRIVATE x2w_shader_compiler)
target_compile_definitions(d3d12_xs_shim PRIVATE X2W_NATIVE_SHADERS)
endif()
# The creation-IID gate and refusal text of D3D12XboxCreateDevice (src/d3d12x_device_slots.h),
# without a device. The mutated run is the negative control.
add_executable(d3d12x_device_slots_check tests/d3d12x_device_slots_check.cpp src/d3d12x_device_slots.cpp)
Expand Down Expand Up @@ -1818,6 +1856,110 @@ foreach(backend IN ITEMS warp hardware)
ENVIRONMENT "X2W_MESH86_FIXTURE_XMEM=$<TARGET_FILE:xmem_shim>")
endforeach()
get_filename_component(DXC_BIN_DIR "${DXC_EXECUTABLE}" DIRECTORY)

if(TARGET compile_dxil AND EXISTS "${DXC_BIN_DIR}/dxcompiler.dll" AND EXISTS "${DXC_BIN_DIR}/dxil.dll")
add_executable(native_store_replay tests/native_store_replay.cpp tests/desktop_gpu.cpp)
target_include_directories(native_store_replay PRIVATE src tests)
target_link_libraries(native_store_replay PRIVATE x2w_shader_compiler d3d12 dxgi d3dcompiler)
set_property(TARGET native_store_replay PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_test(NAME native_scalar_lds_hardware COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_scalar_lds_check.py" "$<TARGET_FILE:native_store_replay>" "${DXC_BIN_DIR}")
set_tests_properties(native_scalar_lds_hardware PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
add_test(NAME native_adjacent_srv_hardware COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_adjacent_srv_check.py" "$<TARGET_FILE:native_store_replay>" "${DXC_BIN_DIR}")
set_tests_properties(native_adjacent_srv_hardware PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
add_test(NAME native_mtbuf_hardware COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_mtbuf_check.py" "$<TARGET_FILE:compile_dxil>" "$<TARGET_FILE:native_store_replay>" "${DXC_BIN_DIR}")
set_tests_properties(native_mtbuf_hardware PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
add_test(NAME native_indexed_atomic_hardware COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_indexed_atomic_check.py" "$<TARGET_FILE:compile_dxil>" "$<TARGET_FILE:native_store_replay>" "${DXC_BIN_DIR}")
set_tests_properties(native_indexed_atomic_hardware PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
add_executable(native_wave_request_gpu tests/native_wave_request_gpu.cpp tests/native_compute_grid.cpp tests/native_half_grid.cpp tests/desktop_gpu.cpp)
target_link_libraries(native_wave_request_gpu PRIVATE x2w_shader_compiler d3d12 dxgi)
set_target_properties(native_wave_request_gpu PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_test(NAME native_wave_request_hardware COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_wave_request_check.py" "$<TARGET_FILE:compile_dxil>"
"$<TARGET_FILE:native_wave_request_gpu>" "${DXC_BIN_DIR}")
set_tests_properties(native_wave_request_hardware PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
add_executable(native_lds_gpu tests/native_lds_gpu.cpp tests/desktop_gpu.cpp)
target_link_libraries(native_lds_gpu PRIVATE x2w_shader_compiler d3d12 dxgi)
set_target_properties(native_lds_gpu PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_executable(native_sampled_pixel_gpu tests/native_sampled_pixel_gpu.cpp tests/desktop_gpu.cpp)
add_executable(native_buffered_vertex_gpu tests/native_buffered_vertex_gpu.cpp tests/desktop_gpu.cpp)
target_link_libraries(native_buffered_vertex_gpu PRIVATE x2w_shader_compiler d3d12 dxgi)
set_target_properties(native_buffered_vertex_gpu PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_link_libraries(native_sampled_pixel_gpu PRIVATE x2w_shader_compiler d3d12 dxgi)
set_target_properties(native_sampled_pixel_gpu PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_test(NAME native_sampled_replay COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_SOURCE_DIR}/tests/native_sampled_replay_check.py"
"$<TARGET_FILE:native_sampled_pixel_gpu>" "$<TARGET_FILE:compile_dxil>" "${DXC_BIN_DIR}")
foreach(backend IN ITEMS warp hardware)
add_test(NAME native_buffered_vertex_${backend} COMMAND native_buffered_vertex_gpu ${backend} "${DXC_BIN_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}/native-buffered-${backend}")
set_tests_properties(native_buffered_vertex_${backend} PROPERTIES SKIP_RETURN_CODE 77)
add_test(NAME native_sampled_pixel_${backend} COMMAND native_sampled_pixel_gpu ${backend} "${DXC_BIN_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}/native-sampled-${backend}")
set_tests_properties(native_sampled_pixel_${backend} PROPERTIES SKIP_RETURN_CODE 77)
add_test(NAME native_lds_${backend} COMMAND native_lds_gpu ${backend} "${DXC_BIN_DIR}"
"${CMAKE_SOURCE_DIR}/tests/native_lds_gpu.hlsl" "${CMAKE_CURRENT_BINARY_DIR}/native-lds-${backend}")
set_tests_properties(native_lds_${backend} PROPERTIES SKIP_RETURN_CODE 77)
endforeach()
add_test(NAME native_lds_control_flow COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_lds_control_flow_check.py")
add_test(NAME native_compute_clear COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_compute_clear_check.py" "$<TARGET_FILE:compile_dxil>" "${DXC_BIN_DIR}")
add_test(NAME native_compute_raw_root COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_compute_raw_root_check.py" "$<TARGET_FILE:compile_dxil>" "${DXC_BIN_DIR}")
add_test(NAME native_direct_container
COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_SOURCE_DIR}/tests/native_direct_container_check.py"
"$<TARGET_FILE:compile_dxil>" "${DXC_BIN_DIR}")
add_test(NAME native_dpp_mirror_hardware COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_dpp_mirror_check.py" "$<TARGET_FILE:compile_dxil>"
"$<TARGET_FILE:native_store_replay>" "$<TARGET_FILE:offscreen_check>" "${DXC_BIN_DIR}")
set_tests_properties(native_dpp_mirror_hardware PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
add_test(NAME native_graphics_wqm_hardware COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_graphics_wqm_check.py" "$<TARGET_FILE:compile_dxil>"
"$<TARGET_FILE:offscreen_check>" "${DXC_BIN_DIR}")
set_tests_properties(native_graphics_wqm_hardware PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
add_test(NAME native_graphics_interface_library
COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_SOURCE_DIR}/tests/native_graphics_interface_library_check.py"
"$<TARGET_FILE:compile_dxil>" "${DXC_BIN_DIR}")
add_executable(native_recording_check tests/native_recording_check.cpp)
target_include_directories(native_recording_check PRIVATE src)
target_compile_features(native_recording_check PRIVATE cxx_std_17)
target_link_libraries(native_recording_check PRIVATE x2w_shader_compiler dxgi d3d12)
set_property(TARGET native_recording_check PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_test(NAME native_comparison_pso_warp COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_direct_container_check.py" --sampler-pso
"${DXC_BIN_DIR}" "$<TARGET_FILE:native_recording_check>")
set_tests_properties(native_comparison_pso_warp PROPERTIES SKIP_RETURN_CODE 77)
add_test(NAME native_graphics_comparison_pso_warp COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_direct_container_check.py" --graphics-sampler-pso
"${DXC_BIN_DIR}" "$<TARGET_FILE:native_recording_check>")
set_tests_properties(native_graphics_comparison_pso_warp PROPERTIES SKIP_RETURN_CODE 77)
# Cycle 1 of the global SRV work: ResourceDescriptorHeap[index] from a native DXIL module against a DXC reference.
add_executable(native_heap_handle_probe tests/native_heap_handle_probe.cpp)
target_include_directories(native_heap_handle_probe PRIVATE src)
target_compile_features(native_heap_handle_probe PRIVATE cxx_std_17)
target_link_libraries(native_heap_handle_probe PRIVATE x2w_shader_compiler dxgi d3d12)
set_property(TARGET native_heap_handle_probe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
foreach(adapter IN ITEMS warp hardware)
add_test(NAME native_heap_handle_probe_${adapter} COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_heap_handle_probe_check.py" "$<TARGET_FILE:native_heap_handle_probe>"
"${DXC_BIN_DIR}" ${adapter})
set_tests_properties(native_heap_handle_probe_${adapter} PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 120)
endforeach()
add_test(NAME native_recording_pages_warp COMMAND native_recording_check)
add_test(NAME native_dispatch_states_warp COMMAND native_recording_check --subresources)
set_tests_properties(native_dispatch_states_warp PROPERTIES SKIP_RETURN_CODE 77)
set_tests_properties(native_recording_pages_warp PROPERTIES SKIP_RETURN_CODE 77)
add_test(NAME native_rectangle_pso_warp COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/native_direct_container_check.py" --rect-pso
"$<TARGET_FILE:compile_dxil>" "${DXC_BIN_DIR}" "$<TARGET_FILE:native_recording_check>")
set_tests_properties(native_rectangle_pso_warp PROPERTIES SKIP_RETURN_CODE 77)
add_test(NAME native_pixel_dxil
COMMAND "${INTAKE_PYTHON}" -B "${CMAKE_SOURCE_DIR}/tests/native_pixel_dxil_check.py"
"$<TARGET_FILE:compile_dxil>" "${DXC_BIN_DIR}")
endif()
target_compile_definitions(root_probe PRIVATE SDK_DXC_DIR=L"${DXC_BIN_DIR}/")
add_executable(offscreen_check tests/offscreen_check.cpp tests/compute_check.cpp tests/dxr_check.cpp tests/buffer_ops.cpp
tests/descriptor_heap_paging.cpp)
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Start with the [first build](README.md#first-build). Create the Python environme

On pull requests, `Build and test on Windows` builds the smoke-test targets with `cmake --build --preset pr` and runs `ctest --preset pr --no-tests=error`. The preset selects tests for CPU translation, PE startup, memory, archive decoding and WARP rendering, including the SPIR-V bridge checks. The bridge checks can skip locally if their tools are missing; hosted CI installs the pinned tools and requires the WARP bridge checks to pass. For a strict local run, run [the pinned tool setup](tools/setup-spirv-tools.ps1) (`.\tools\setup-spirv-tools.ps1` in PowerShell) before configuring or reconfiguring, then set `$env:X2W_REQUIRE_SPIRV_TOOLS = '1'` before running CTest. Run the tests for your specific change locally and include their results in the PR.

Pull requests into `cpp-migration` also build `compile_dxil` and run `native_dxil_llvm_ident_controls` on Windows to check direct DXIL generation.

On `main` and manual runs, CI runs the full non-hardware suites in Debug and Release (/O2), generates the coverage chart and smoke-tests the standalone GPU package. To check a branch in both configurations before merge, select it under **Actions → Windows checks → Run workflow**. The Ubuntu jobs assemble gfx1013 fixtures with LLVM 15 and run the platform-independent Python checks. [CI workflow](.github/workflows/windows.yml)

Contributors supply physical GPU coverage. Record the commit, adapter and driver, Windows version, test names and debug-layer status. Include the feature tier or wave width when relevant. Report capability skips separately from passes and failures. [Non-Windows host guide](docs/non-windows-hosts.md)
Expand Down
Loading
Loading