Skip to content

Feature(GPU): Texture dumper and replacer#333

Open
Graine25 wants to merge 5 commits intorexglue:developmentfrom
Graine25:tex-dump
Open

Feature(GPU): Texture dumper and replacer#333
Graine25 wants to merge 5 commits intorexglue:developmentfrom
Graine25:tex-dump

Conversation

@Graine25
Copy link
Copy Markdown
Member

@Graine25 Graine25 commented May 8, 2026

This feature adds a texture dump and replacement system that identifies guest textures by a stable content hash, dumps them to textures/dump, and loads user-authored replacements from textures/replace. When enabled through CVars, matching replacements are decoded to RGBA8 and injected into the D3D12 texture cache in place of the original guest texture.

  • build(thirdparty): expose stb_image target - Adds stb_image as an available third-party target and updates install handling so the replacement pipeline can decode image files, especially PNG replacements, without embedding a separate image dependency path.

  • a8517da feat(gpu): add texture replacement pipeline - Introduces the core replacement/dumper module under graphics/pipeline/texture. This adds hashing, replacement directory scanning, PNG/DDS loading, DDS dumping, guest texture untiling/endian conversion for dumps, and the filesystem layout: textures/dump for generated assets and textures/replace for user-provided replacements.

  • 7a90eaa feat(gpu): inject replacement textures - Wires the replacement pipeline into the texture cache and D3D12 upload path. It hashes guest texture contents, looks up matching replacement files, adjusts the texture key for RGBA8 replacement uploads, preserves the original guest layout for memory watches, and keeps temporary upload buffers alive until the GPU has finished using them.

  • feat(gpu): add texture replacement cvars - This commit adds the user-facing controls for the texture edit feature: texture_dump_enabled, texture_replace_enabled, and texture_folder. Dumping and replacement are now gated by CVars, and texture_folder lets users choose a custom root directory for dump/ and replace/ instead of always using <executable folder>/textures.

More effort can be made to implement this into Vulkan as well as adjusting for more DDS formats or even PNG's, but this has mostly been optmized for D3D12. Almost all work is @SolarCookies. Addresses issue #294

Co-authored-by: SolarCookies <SolarCookies@users.noreply.github.com>
@Graine25 Graine25 requested review from SolarCookies and tomcl7 May 8, 2026 06:33
@tomcl7 tomcl7 self-assigned this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants