bugfix(textureloader): Fix faulty texture reduction implementations#2789
bugfix(textureloader): Fix faulty texture reduction implementations#2789xezon wants to merge 3 commits into
Conversation
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp | Refactors texture reduction into shared helpers applied across all three load task classes; a post-Validate Width mutation breaks the Width>>Reduction invariant used in Load_Compressed_Mipmap for hardware-oversized textures. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Begin_Compressed_Load] --> B[Get_Texture_Information]
B --> C[Width = orig_width]
C --> D[Validate_Texture_Size Width - may clamp Width]
D --> E[Apply_Reduction from orig_width sets Reduction]
E --> F[D3D Texture at reduced_width = orig_width >> Reduction]
F --> G[Load_Compressed_Mipmap]
G --> H[width = Width >> Reduction]
H --> I{Width == orig_width?}
I -->|Yes| J[CORRECT: width = reduced_width]
I -->|No - hardware clamped| K[WRONG: width != reduced_width]
Reviews (3): Last reviewed commit: "bugfix(textureloader): Fix faulty implem..." | Re-trigger Greptile
…TextureLoadTaskClass::Begin_Uncompressed_Load() (#2789)
280b6b4 to
fd662d0
Compare
fd662d0 to
f0e9d84
Compare
Merge with Rebase
This change attempts to fix the faulty implementations related to texture reduction.
It has 3 commits:
The first commit removes some dead code, streamlines some variable names and simplifies some code related to texture reduction in the 3 texture load classes:
TextureLoadTaskClass,CubeTextureLoadTaskClass,VolumeTextureLoadTaskClassThe second commit removes the texture reduction code from
TextureLoadTaskClass::Begin_Uncompressed_Loadbecause the reduction was always 0 as far as I could see and the game never reduced TGA texture size.The third commit fixes and streamlines the texture reduction code in
TextureLoadTaskClass::Begin_Compressed_Load,CubeTextureLoadTaskClass::Begin_Compressed_Load,VolumeTextureLoadTaskClass::Begin_Compressed_Load. The former logic was incoherent and nonsensical. The new logic does work in so far that the binary stream texture in Generals would render correctly with an auto reduction to the lowest mip to satisfy the original 1:8 texture aspect ratio limit. No new issues have been observed. Texture reduction from Options Menu also still works.TODO