Skip to content

fix(effect): improve ReShade texture compatibility - #76

Draft
kakra wants to merge 6 commits into
ralgar:mainfrom
kakra:fix/effect-texture-compatibility
Draft

kakra wants to merge 6 commits into
ralgar:mainfrom
kakra:fix/effect-texture-compatibility

Conversation

@kakra

@kakra kakra commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Improve compatibility with ReShade effects that rely on initialized internal textures, mipmaps, sRGB texture semantics, and accurate back-buffer metadata.

The implementation aligns vkShade's Vulkan resources more closely with the resource and preprocessor behavior expected by ReShade effects.

Internal textures and mipmaps

Resolve file-backed texture metadata before allocating Vulkan resources and clean up partially constructed images if initialization fails.

Persistent internal textures are initialized before their first use so effects can safely sample temporal history or other resources that have not yet been written.

Allocate the mip levels declared by effects and regenerate their mip chains after writing passes when requested by the effect. File-backed textures receive the same mipmap handling after upload.

Linear and sRGB views

Create compatible linear and sRGB image views where Vulkan permits them.

Sampling, render-target attachment selection, and pipeline formats follow the effect's declared sRGB semantics. This allows effects to distinguish correctly between linear resource access and sRGB conversion without duplicating the underlying image.

Back-buffer metadata

Build on the upstream bit-depth and color-space support introduced by #113.

Replace the limited bit-depth helper with a ReShade-compatible mapping that covers additional packed, floating-point, and high-precision Vulkan formats. Unknown or unsupported formats use the corresponding ReShade fallback instead of being treated as conventional 8-bit or 16-bit back buffers.

Also provide BUFFER_COLOR_FORMAT using ReShade API format values rather than raw Vulkan enums. Linear and sRGB Vulkan variants are normalized to the corresponding typed ReShade format.

The bit-depth and color-format mappings are kept in a focused metadata helper with unit coverage for the supported formats.

Validation

  • Release build succeeds.
  • git diff --check is clean.
  • All seven unit tests pass.
  • Buffer bit-depth and color-space mappings have focused unit coverage.
  • The complete local queue was previously smoke-tested with Euro Truck Simulator 2 under Proton.
  • Deband.fx loads with the expected back-buffer metadata.

@kakra
kakra force-pushed the fix/effect-texture-compatibility branch from 34b9f72 to 40f676f Compare August 25, 2026 20:02
@kakra
kakra marked this pull request as ready for review August 25, 2026 20:05
@kakra
kakra force-pushed the fix/effect-texture-compatibility branch from 40f676f to 7c9f8f0 Compare August 26, 2026 06:33
@kakra
kakra marked this pull request as draft August 26, 2026 20:08
@kakra

kakra commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

On hold until mipmap/color depth surfaced in the main branch.

Match ReShade's back-buffer bit depth semantics for packed, float,
and uncommon presentation formats instead of assuming that every
unhandled format is 8-bit.

Keep the mapping in a focused helper and cover the reference values
and fallback behavior with tests.
Translate the active Vulkan color format to ReShade API values and
normalize sRGB variants before exposing BUFFER_COLOR_FORMAT to effect
preprocessing.
@kakra
kakra force-pushed the fix/effect-texture-compatibility branch from 7c9f8f0 to 87378cb Compare September 20, 2026 11:34
@kakra

kakra commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Rebased the series onto the current main, which now includes #113 and its fix for #107. The branch now builds on that upstream implementation by extending the ReShade-compatible bit-depth mapping and adding BUFFER_COLOR_FORMAT with focused unit coverage. The texture initialization, mipmap, and sRGB-view work remains unchanged. The refreshed branch builds cleanly and all seven tests pass.

This branch has not been deployed

No deployments
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.

1 participant