Compare commits

...
3 Commits
10 changed files with 121 additions and 15 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]"
+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;