refactor(water): replace hardcoded offset#1728
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
…leWaterTAA - Updated CommonLibSSE-NG to include enableWaterTAA in UNK_BSImagespaceShaderISTemporalAA - Replaced hardcoded offset (0x38LL) with proper member access - Added structure size assertion for safety - Improves maintainability and reduces fragility across game versions Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
alandtse
left a comment
There was a problem hiding this comment.
There's a strange spare root file here. Also, are you saying Commonlib already has this structure or does it need to have it PRed?
…module - Removed _codeql_detected_source_root symlink (build artifact) - Reverted CommonLibSSE-NG submodule to original commit - Defined ExtendedTemporalAAStruct locally in Upscaling.cpp - Added TODO comment to contribute structure to CommonLibVR upstream - Structure now lives in this repo until it can be PRed to alandtse/CommonLibVR Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
Fixed in f865286:
The extended structure is now defined locally in |
- Updated Main_PostProcessing hook to use ExtendedTemporalAAStruct - All accesses to taaEnabled now use the same structured approach - Improves code consistency and maintainability Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
- Added pad39[7] to ensure structure is exactly 0x40 bytes - Fixes static_assert validation - Structure size now matches memory layout requirements Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
…ISTemporalAA::enableWaterTAA Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
The code used a hardcoded
0x38offset to accessenableWaterTAAin theBSImagespaceShaderISTemporalAAstructure, which is fragile across game updates and versions.Changes
Upscaling.cpp
ExtendedTemporalAAStructdefinition that extends CommonLib's partialUNK_BSImagespaceShaderISTemporalAAstructureenableWaterTAAat offset 0x38 with full memory layoutConfigureTAA()andMain_PostProcessing::thunk()to use structured access viareinterpret_caststatic_assert(sizeof(...) == 0x40)to verify layoutStructure Layout
Members at 0x20-0x30 remain as placeholders pending further reverse engineering work.
Implementation Notes
The structure extension is defined locally in this repository rather than in CommonLibSSE-NG. This avoids dependency on unpushed submodule commits while still providing the benefits of structured access. The structure should be contributed upstream to alandtse/CommonLibVR in a future PR, at which point the local definition can be removed.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.