Skip to content

Commit 220e701

Browse files
committed
Fix MARATHON_RECOMP define in compile_shader
1 parent 1be1571 commit 220e701

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

MarathonRecomp/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ function(compile_shader FILE_PATH TARGET_NAME)
446446
if (MARATHON_RECOMP_METAL)
447447
add_custom_command(
448448
OUTPUT ${MSL_FILE_PATH}.ir
449-
COMMAND ${XCRUN_TOOL} -sdk macosx metal -o ${MSL_FILE_PATH}.ir -c ${MSL_FILE_PATH} -D__air__ -frecord-sources -gline-tables-only
449+
COMMAND ${XCRUN_TOOL} -sdk macosx metal -o ${MSL_FILE_PATH}.ir -c ${MSL_FILE_PATH} -D__air__ -DMARATHON_RECOMP -frecord-sources -gline-tables-only
450450
DEPENDS ${MSL_FILE_PATH}
451451
)
452452
add_custom_command(
@@ -459,25 +459,25 @@ function(compile_shader FILE_PATH TARGET_NAME)
459459
if (MARATHON_RECOMP_D3D12)
460460
add_custom_command(
461461
OUTPUT ${HLSL_FILE_PATH}.dxil.h
462-
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
462+
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
463463
DEPENDS ${HLSL_FILE_PATH}
464464
)
465465
target_sources(MarathonRecomp PRIVATE ${HLSL_FILE_PATH}.dxil.h)
466466
endif()
467467
add_custom_command(
468468
OUTPUT ${HLSL_FILE_PATH}.spirv.h
469-
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
469+
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
470470
DEPENDS ${HLSL_FILE_PATH}
471471
)
472472
target_sources(MarathonRecomp PRIVATE ${HLSL_FILE_PATH}.spirv.h)
473473
endfunction()
474474

475475
function(compile_vertex_shader FILE_PATH)
476-
compile_shader(${FILE_PATH} vs_6_0 -fvk-invert-y -DMARATHON_RECOMP)
476+
compile_shader(${FILE_PATH} vs_6_0 -fvk-invert-y)
477477
endfunction()
478478

479479
function(compile_pixel_shader FILE_PATH)
480-
compile_shader(${FILE_PATH} ps_6_0 -DMARATHON_RECOMP)
480+
compile_shader(${FILE_PATH} ps_6_0)
481481
endfunction()
482482

483483
compile_pixel_shader(blend_color_alpha_ps)

MarathonRecomp/gpu/shader/hlsl/conditional_survey_ps.hlsl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#include "../../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
22

3+
#ifndef __spirv__
4+
5+
cbuffer SharedConstants : register(b2, space4)
6+
{
7+
DEFINE_SHARED_CONSTANTS();
8+
};
9+
10+
#endif
11+
312
[earlydepthstencil]
413
float4 shaderMain() : SV_Target
514
{

0 commit comments

Comments
 (0)