Compare commits

...
6 Commits
53 changed files with 295925 additions and 205422 deletions
+6
View File
@@ -120,10 +120,16 @@ jobs:
secrets: inherit
# Windows
build_windows_deps:
if: github.repository == 'PCSX2/pcsx2'
name: "Windows Dependencies"
uses: ./.github/workflows/windows_deps_build.yml
build_windows_qt:
if: github.repository == 'PCSX2/pcsx2'
needs:
- cut-release
- build_windows_deps
name: "Windows"
uses: ./.github/workflows/windows_build_qt.yml
with:
+10 -4
View File
@@ -9,6 +9,10 @@ on:
- master
jobs:
build_qt_deps:
name: "Dependencies"
uses: ./.github/workflows/windows_deps_build.yml
# MSBUILD
lint_vs_proj_files:
name: Lint VS Project Files
@@ -21,7 +25,7 @@ jobs:
run: .github\workflows\scripts\windows\validate-vs-filters.ps1
build_qt_sse4:
needs: lint_vs_proj_files
needs: [build_qt_deps, lint_vs_proj_files]
name: "SSE4"
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
uses: ./.github/workflows/windows_build_qt.yml
@@ -33,7 +37,7 @@ jobs:
secrets: inherit
build_qt_avx2:
needs: lint_vs_proj_files
needs: [build_qt_deps, lint_vs_proj_files]
name: "AVX2"
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
uses: ./.github/workflows/windows_build_qt.yml
@@ -44,6 +48,7 @@ jobs:
secrets: inherit
build_qt_cmake:
needs: build_qt_deps
name: "CMake"
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
uses: ./.github/workflows/windows_build_qt.yml
@@ -55,7 +60,7 @@ jobs:
secrets: inherit
build_qt_clang_sse4:
needs: lint_vs_proj_files
needs: [build_qt_deps, lint_vs_proj_files]
name: "SSE4"
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
uses: ./.github/workflows/windows_build_qt.yml
@@ -67,7 +72,7 @@ jobs:
secrets: inherit
build_qt_clang_avx2:
needs: lint_vs_proj_files
needs: [build_qt_deps, lint_vs_proj_files]
name: "AVX2"
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
uses: ./.github/workflows/windows_build_qt.yml
@@ -78,6 +83,7 @@ jobs:
secrets: inherit
build_qt_cmake_clang:
needs: build_qt_deps
name: "CMake"
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
uses: ./.github/workflows/windows_build_qt.yml
+2 -7
View File
@@ -50,7 +50,7 @@ jobs:
name: ${{ inputs.jobName }}
runs-on: ${{ inputs.os }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 90
timeout-minutes: 30
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
@@ -124,15 +124,10 @@ jobs:
id: cache-deps
uses: actions/cache@v6
with:
fail-on-cache-miss: true
path: deps
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat', '.github/workflows/scripts/common/*.patch') }}
- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
BUILD_FFMPEG: 1
run: .github/workflows/scripts/windows/build-dependencies.bat
- name: Generate CMake
if: inputs.configuration == 'CMake'
+41
View File
@@ -0,0 +1,41 @@
name: Windows Build Steps - Deps
on:
workflow_call:
inputs:
os:
required: false
type: string
default: windows-2025-vs2026
platform:
required: false
type: string
default: x64
jobs:
build_windows_deps:
name: "Cache Dependencies"
runs-on: ${{ inputs.os }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 90
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Check Dependencies
id: cache-deps
uses: actions/cache@v6
with:
lookup-only: true
path: deps
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat', '.github/workflows/scripts/common/*.patch') }}
- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
BUILD_FFMPEG: 1
run: .github/workflows/scripts/windows/build-dependencies.bat
+38
View File
@@ -7336,6 +7336,44 @@ SCKA-20027:
halfPixelOffset: 2 # Aligns post effects.
nativeScaling: 1 # Fixes post effects.
textureInsideRT: 1 # Fixes post shuffles.
patches:
A3643EB1:
content: |-
comment=Rearranging COP2 ops to avoid macflag bad stuff.
// Solves door problems, possibly other issues later on.
patch=0,EE,0010bc88,word,48468800
patch=0,EE,0010bc8c,word,4BEC682C
patch=0,EE,0010bc94,word,4B8D617D
patch=0,EE,0010bc98,word,4A0002FF
patch=0,EE,0012a358,word,48468800
patch=0,EE,0012a35c,word,4BEC682C
patch=0,EE,0012a364,word,4B8D617D
patch=0,EE,0012a368,word,4A0002FF
patch=0,EE,0012a680,word,48468800
patch=0,EE,0012a684,word,4BEC682C
patch=0,EE,0012a68c,word,4B8D617D
patch=0,EE,0012a690,word,4A0002FF
patch=0,EE,0012aafc,word,48468800
patch=0,EE,0012ab00,word,4BEC682C
patch=0,EE,0012ab04,word,4B8D617D
patch=0,EE,0012ab08,word,4A6D617C
patch=0,EE,0012ab0c,word,4A0002FF
patch=0,EE,001644cc,word,48468800
patch=0,EE,001644d0,word,4BEC682C
patch=0,EE,001644d8,word,4B8D617D
patch=0,EE,001644dc,word,4A0002FF
patch=0,EE,001ae958,word,48468800
patch=0,EE,001ae95c,word,4BEC682C
patch=0,EE,001ae960,word,4BED617D
patch=0,EE,001ae968,word,4A0002FF
patch=0,EE,001bd410,word,48588800
patch=0,EE,001bd41c,word,4A5DEF40
patch=0,EE,001bd62c,word,48588800
patch=0,EE,001bd638,word,4A5DEF40
patch=0,EE,001bd9cc,word,48588800
patch=0,EE,001bd9d8,word,4A5DEF40
patch=0,EE,001bdf90,word,48588800
patch=0,EE,001bdf9c,word,4A5DEF40
SCKA-20028:
name: "이코 [PlayStation 2 BigHit Series]"
name-en: "Ico [PlayStation 2 BigHit Series]"
+2
View File
@@ -1385,6 +1385,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000005e0400008e02000001010000,GPD Win Max 2 6800U Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000007d0400000540000000010000,Gravis Eliminator Pro,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
03000000280400000140000000010000,Gravis GamePad Pro,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
030000007d0400000740000000010000,Gravis Xterminator Force,a:a2,b:b2,x:b4,y:b5,back:b8,guide:b3,start:b9,leftstick:b0,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Linux,
030000008f0e00000610000000010000,GreenAsia Electronics Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux,
030000008f0e00001200000010010000,GreenAsia Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
0500000047532067616d657061640000,GS Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
@@ -1407,6 +1408,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000000d0f00001000000011010000,Hori Fightstick 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
03000000ad1b000003f5000033050000,Hori Fightstick VX,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b8,guide:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux,
030000000d0f00004d00000011010000,Hori Gem Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
030000000d0f0000fb00000011010000,Hori Hatsune Miku 39S,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,guide:b12,leftshoulder:b4,rightshoulder:b5,lefttrigger:b6,righttrigger:b7,leftstick:b10,rightstick:b11,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,platform:Linux,
03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000000d0f00003801000011010000,Hori PC Engine Mini Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,platform:Linux,
030000000d0f00009200000011010000,Hori Pokken Tournament DX Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+7 -3
View File
@@ -1073,9 +1073,10 @@ bool GSDeviceMTL::Create(GSVSyncMode vsync_mode, bool allow_present_throttle)
// Init metal stuff
m_fn_constants = MRCTransfer([MTLFunctionConstantValues new]);
setFnConstantB(m_fn_constants, m_features.framebuffer_fetch, GSMTLConstantIndex_FRAMEBUFFER_FETCH);
setFnConstantB(m_fn_constants, m_features.depth_feedback, GSMTLConstantIndex_DEPTH_FEEDBACK);
setFnConstantB(m_fn_constants, m_dev.features.rov_requires_r32, GSMTLConstantIndex_ROV_NEEDS_R32);
setFnConstantB(m_fn_constants, m_features.framebuffer_fetch, GSMTLConstantIndex_FRAMEBUFFER_FETCH);
setFnConstantB(m_fn_constants, m_features.depth_feedback, GSMTLConstantIndex_DEPTH_FEEDBACK);
setFnConstantB(m_fn_constants, m_dev.features.rov_requires_r32, GSMTLConstantIndex_ROV_NEEDS_R32);
setFnConstantB(m_fn_constants, m_dev.features.broken_shader_depth, GSMTLConstantIndex_BROKEN_SHADER_DEPTH);
m_draw_sync_fence = MRCTransfer([m_dev.dev newFence]);
[m_draw_sync_fence setLabel:@"Draw Sync Fence"];
@@ -2350,6 +2351,9 @@ void GSDeviceMTL::RenderHW(GSHWDrawConfig& config)
if (config.tex && (config.ds == config.tex || config.rt == config.tex))
EndRenderPass(); // Barrier
if (m_dev.features.broken_shader_depth && (config.depth.ztst >= ZTST_GEQUAL || config.depth.zwe))
config.ps.zfloor = true; // Depth must always go through shader (see tfx vs for comment with details)
size_t vertsize = config.nverts * sizeof(*config.verts);
size_t idxsize = config.vs.UseFixedExpandIndexBuffer() ? 0 : (config.nindices * sizeof(*config.indices));
Map allocation = Allocate(m_vertex_upload_buf, vertsize + idxsize);
@@ -37,6 +37,7 @@ struct GSMTLDevice
bool rov : 1;
bool rov_requires_rt : 1;
bool rov_requires_r32 : 1;
bool broken_shader_depth : 1;
MetalVersion shader_version;
int max_texsize;
};
+4 -1
View File
@@ -207,7 +207,7 @@ GSMTLDevice::GSMTLDevice(MRCOwned<id<MTLDevice>> dev)
}
else if ([name containsString:@"Apple"])
{
// No special settings
features.broken_shader_depth = true;
}
else
{
@@ -228,6 +228,9 @@ GSMTLDevice::GSMTLDevice(MRCOwned<id<MTLDevice>> dev)
if (char* env = getenv("MTL_ROV_WITH_RT"))
features.rov_requires_rt = env[0] == '1' || env[0] == 'y' || env[0] == 'Y';
if (char* env = getenv("MTL_SHADER_DEPTH_WORKAROUND"))
features.broken_shader_depth = env[0] == '1' || env[0] == 'y' || env[0] == 'Y';
features.max_texsize = GetMaxTextureSize(dev);
this->dev = std::move(dev);
@@ -166,6 +166,7 @@ enum GSMTLFnConstants
GSMTLConstantIndex_FRAMEBUFFER_FETCH,
GSMTLConstantIndex_DEPTH_FEEDBACK,
GSMTLConstantIndex_ROV_NEEDS_R32,
GSMTLConstantIndex_BROKEN_SHADER_DEPTH,
GSMTLConstantIndex_FST,
GSMTLConstantIndex_IIP,
GSMTLConstantIndex_VS_POINT_SIZE,
+11
View File
@@ -14,6 +14,7 @@ constant uint SHUFFLE_READWRITE = 3;
constant bool HAS_FBFETCH [[function_constant(GSMTLConstantIndex_FRAMEBUFFER_FETCH)]];
constant bool DEPTH_FEEDBACK [[function_constant(GSMTLConstantIndex_DEPTH_FEEDBACK)]];
constant bool ROV_NEEDS_R32 [[function_constant(GSMTLConstantIndex_ROV_NEEDS_R32)]];
constant bool BROKEN_SHADER_DEPTH [[function_constant(GSMTLConstantIndex_BROKEN_SHADER_DEPTH)]];
constant bool FST [[function_constant(GSMTLConstantIndex_FST)]];
constant bool IIP [[function_constant(GSMTLConstantIndex_IIP)]];
constant bool VS_POINT_SIZE [[function_constant(GSMTLConstantIndex_VS_POINT_SIZE)]];
@@ -248,6 +249,14 @@ static MainVSOut vs_main_run(thread const MainVSIn& v, constant GSMTLMainVSUnifo
if (VS_POINT_SIZE)
out.point_size = cb.point_size.x;
// Apple GPUs use slightly different algorithms to calculate the Z they send to the shader vs the Z they use in hardware.
// This breaks a lot of things (the most common is conservative depth rejecting pixels that should have depth equal to current depth but now don't).
// Work around by always routing depth through the shader, and never using hardware depth values.
// To allow us to continue to use [[depth(less)]] optimizations, add a bit in the VS and subtract it off in the FS,
// so that "equal" depth doesn't ever fail a hardware depth test.
if (BROKEN_SHADER_DEPTH)
out.p.z += exp_min32;
return out;
}
@@ -1494,6 +1503,8 @@ struct PSMain
{
MainResult out = {};
float input_z = in.p.z;
if (BROKEN_SHADER_DEPTH)
input_z -= 0x1p-32;
if (PS_ZFLOOR)
input_z = floor(input_z * 0x1p32) * 0x1p-32;