Skip to content

GS: Unify HW texture caches#5087

Merged
TellowKrinkle merged 9 commits into
PCSX2:masterfrom
TellowKrinkle:SingleTextureCache
Dec 9, 2021
Merged

GS: Unify HW texture caches#5087
TellowKrinkle merged 9 commits into
PCSX2:masterfrom
TellowKrinkle:SingleTextureCache

Conversation

@TellowKrinkle

Copy link
Copy Markdown
Member

Description of Changes

  • Converts a number enums to enum classes, with arguments switching to typed values instead of int
  • Stores a known enum in the format field of textures, removing issues where e.g. no one outside of GSDeviceOGL could actually understand what the format of a GSTextureOGL meant even though they could read it. Now anyone can ask a GSTexture* for its format and understand what it is.
  • Adds a DownloadTexture and an optional DownloadTextureConvert method to GSDevice, which downloads a texture and maps it to CPU memory
  • Uses the above changes to add generic, shared versions of all the virtual GSTextureCache methods to GSTextureCache and get rid of the separate subclasses per subclass of GSDevice
  • Renames convert shaders to not be ps_convert## because it's impossible to figure out what's what when only looking at the list of shaders

Rationale behind Changes

Reduce per-renderer code so that adding a new renderer doesn't add as much maintenance cost

Suggested Testing Steps

Make sure renderers still work

Comment thread pcsx2/GS/Renderers/OpenGL/GSRendererOGL.cpp Outdated
Comment thread pcsx2/GS/Renderers/HW/GSTextureCache.cpp Outdated
@JordanTheToaster

Copy link
Copy Markdown
Member

Tested with my selection of games on both DX11 and OpenGL and both functioned correctly with no issues I could observe.

@refractionpcsx2

refractionpcsx2 commented Dec 9, 2021

Copy link
Copy Markdown
Member

Ran it through a bunch of gsdumps on DX and OGL, looks good to me :)

@lightningterror lightningterror left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran through some dumps, everything seemed fine.

@TellowKrinkle TellowKrinkle merged commit 6445562 into PCSX2:master Dec 9, 2021
@TellowKrinkle TellowKrinkle deleted the SingleTextureCache branch December 9, 2021 11:26
vec2 TC_OffsetHack;

vec3 pad1_cb21;
vec3 pad2_cb21;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we have 6 total free vectors, this can be optimized.

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.

4 participants