Skip to content

GS/HW: Improve texture hazard handling + fix CSBW typo#14455

Open
refractionpcsx2 wants to merge 9 commits into
masterfrom
gs_avoidharzardcopy
Open

GS/HW: Improve texture hazard handling + fix CSBW typo#14455
refractionpcsx2 wants to merge 9 commits into
masterfrom
gs_avoidharzardcopy

Conversation

@refractionpcsx2
Copy link
Copy Markdown
Member

@refractionpcsx2 refractionpcsx2 commented May 16, 2026

Description of Changes

Reduce hazard copies where they are not required and fix a typo in the SW renderer drop back.

Rationale behind Changes

Hazard checks were only checking if the texture and target were pointing to the same place, they didn't actually check if it was reading and writing from the same place, if they aren't then there's no need to create a hazard copy as the data won't change, this will cut down a bunch of copies (as seen below). Also fixed a typo in the rect calculation for readbacks in the Software renderer dropback (CSBW), whoops.

Suggested Testing Steps

Test the performance of any of the games listed vs master. Upscaling will show a larger difference.
Fixes #14296

Did you use AI to help find, test, or implement this issue or feature?

I used AI to extract the list from the dump run results that you can see below, I have no reason to believe this is incorrect (and is just for demonstrative purposes)

Highlight number of copies reduced on the following dumps:

-777	Bakusou Dekotora Densetsu - Otoko Hanamichi Yume Roman_SLPM-65234
-448	Zettai Zetsumei Toshi 2 - Itetsuita Kioku-tachi_SLPS-25606_20251105164821
-176	Haunting Ground_SLUS-21075_20220807194320
-160	Syphon Filter - Dark Mirror_SCUS-97362_20240610050046
-139	Blokus Club with Bumpy Trot_SLPS-20443_20251105235531
-139	PachiPara 12 - Ooumi to Natsu no Omoide_SLPS-25574_20251105155128
-139	PachiPara 13 - Super Umi to PachiPro Fu-unroku_SLPS-25682_20251105154553
-139	PachiPara 14 - Kaze to Kumo to Super Umi in Okinawa_SLPS-25787_20251105160122
-139	Steambot_Chronicles_SLUS-21344_20230511114115
-138	hitmancontracts_l3_bjarkov
-138	LEGO Racers 2_SLUS-20042
-137	hitman (this is Blood Money)
-130	Jak X - Combat Racing_SCUS-97429_20250526073932
-127	LEGO Dome Racers_SLES-51303_20230717193026
-114	Juiced_SLUS-20872_20230505163642
-69	007 russia half screen
-67	Minority_Report_-_Everybody_Runs_SLUS-20331_20221022205359
-66	007 - From Russia with Love_SLUS-21282_20231202212313
-66	Syphon_Filter_-_Logans_Shadow_SCUS-97584_20240104192224
-45	FordRacing2CarShadow
-40	Charlie and the Chocolate Factory_SLES-53386_20250214214241
-38	Power_Drome_SLUS-20978_20240617182239
-32	Knight Rider - The Game_SLES-51011_20230301100135
-28	The_Godfather_SLUS-21385_20240206091914
-26	The Bigs 2_SLUS-21860_20250303214104
-25	Need for Speed - Undercover_SLUS-21801_20240712020737
-24	Indiana_Jones_and_the_Emperors_Tomb_SLUS-20508_20230206223913
-24	Killzone_SCES-52004_20240617170050
-24	Prince of Persia - Sands of Time_SLUS-20743_20250528185119

@refractionpcsx2
Copy link
Copy Markdown
Member Author

Marking as draft, as multidraw needs the copy rect correcting to encompass the read and write, and there is a vulkan validation error which needs looking in to as for the format for the VK_IMAGE is incorrrect.

@TJnotJT
Copy link
Copy Markdown
Contributor

TJnotJT commented May 17, 2026

For the VK validation errors, they occur on master also so it's likely a pre-existing issue exposed by the PR.

#14466 was opened to fix it.

@lightningterror lightningterror force-pushed the gs_avoidharzardcopy branch 5 times, most recently from 0231158 to 8be34a7 Compare May 18, 2026 08:36
@refractionpcsx2 refractionpcsx2 force-pushed the gs_avoidharzardcopy branch 3 times, most recently from 7be169c to 97970ee Compare May 18, 2026 12:32
@refractionpcsx2 refractionpcsx2 changed the title GS/HW: Avoid hazard copy if read and draw don't overlap + fix CSBW typo GS/HW: Improve texture hazard handling + fix CSBW typo May 18, 2026
@refractionpcsx2 refractionpcsx2 marked this pull request as ready for review May 18, 2026 12:43
@refractionpcsx2
Copy link
Copy Markdown
Member Author

I believe this is now ready (pending any further bugs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Catwoman wrong drawarea size on HW renderers

4 participants