From 220e7010fe6e1d35b3ccb54b7c5ce514b034cac6 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Wed, 20 May 2026 14:26:41 -0700 Subject: [PATCH] Fix MARATHON_RECOMP define in compile_shader --- MarathonRecomp/CMakeLists.txt | 10 +++++----- .../gpu/shader/hlsl/conditional_survey_ps.hlsl | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/MarathonRecomp/CMakeLists.txt b/MarathonRecomp/CMakeLists.txt index 1399812e..fd622cee 100644 --- a/MarathonRecomp/CMakeLists.txt +++ b/MarathonRecomp/CMakeLists.txt @@ -446,7 +446,7 @@ function(compile_shader FILE_PATH TARGET_NAME) if (MARATHON_RECOMP_METAL) add_custom_command( OUTPUT ${MSL_FILE_PATH}.ir - COMMAND ${XCRUN_TOOL} -sdk macosx metal -o ${MSL_FILE_PATH}.ir -c ${MSL_FILE_PATH} -D__air__ -frecord-sources -gline-tables-only + COMMAND ${XCRUN_TOOL} -sdk macosx metal -o ${MSL_FILE_PATH}.ir -c ${MSL_FILE_PATH} -D__air__ -DMARATHON_RECOMP -frecord-sources -gline-tables-only DEPENDS ${MSL_FILE_PATH} ) add_custom_command( @@ -459,25 +459,25 @@ function(compile_shader FILE_PATH TARGET_NAME) if (MARATHON_RECOMP_D3D12) add_custom_command( OUTPUT ${HLSL_FILE_PATH}.dxil.h - COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -E shaderMain -Fh ${HLSL_FILE_PATH}.dxil.h ${HLSL_FILE_PATH} -Vn g_${HLSL_NAME}_dxil + COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -DMARATHON_RECOMP -E shaderMain -Fh ${HLSL_FILE_PATH}.dxil.h ${HLSL_FILE_PATH} -Vn g_${HLSL_NAME}_dxil DEPENDS ${HLSL_FILE_PATH} ) target_sources(MarathonRecomp PRIVATE ${HLSL_FILE_PATH}.dxil.h) endif() add_custom_command( OUTPUT ${HLSL_FILE_PATH}.spirv.h - COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -spirv -fvk-use-dx-layout ${ARGN} -E shaderMain -Fh ${HLSL_FILE_PATH}.spirv.h ${HLSL_FILE_PATH} -Vn g_${HLSL_NAME}_spirv + COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -spirv -fvk-use-dx-layout ${ARGN} -DMARATHON_RECOMP -E shaderMain -Fh ${HLSL_FILE_PATH}.spirv.h ${HLSL_FILE_PATH} -Vn g_${HLSL_NAME}_spirv DEPENDS ${HLSL_FILE_PATH} ) target_sources(MarathonRecomp PRIVATE ${HLSL_FILE_PATH}.spirv.h) endfunction() function(compile_vertex_shader FILE_PATH) - compile_shader(${FILE_PATH} vs_6_0 -fvk-invert-y -DMARATHON_RECOMP) + compile_shader(${FILE_PATH} vs_6_0 -fvk-invert-y) endfunction() function(compile_pixel_shader FILE_PATH) - compile_shader(${FILE_PATH} ps_6_0 -DMARATHON_RECOMP) + compile_shader(${FILE_PATH} ps_6_0) endfunction() compile_pixel_shader(blend_color_alpha_ps) diff --git a/MarathonRecomp/gpu/shader/hlsl/conditional_survey_ps.hlsl b/MarathonRecomp/gpu/shader/hlsl/conditional_survey_ps.hlsl index 64a30a6f..2c8b1241 100644 --- a/MarathonRecomp/gpu/shader/hlsl/conditional_survey_ps.hlsl +++ b/MarathonRecomp/gpu/shader/hlsl/conditional_survey_ps.hlsl @@ -1,5 +1,14 @@ #include "../../../../tools/XenosRecomp/XenosRecomp/shader_common.h" +#ifndef __spirv__ + +cbuffer SharedConstants : register(b2, space4) +{ + DEFINE_SHARED_CONSTANTS(); +}; + +#endif + [earlydepthstencil] float4 shaderMain() : SV_Target {