You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(ww3d2): Route capability queries via Renderer - #3699
Now the capability queries game code uses are on Renderer: Supports_Texture_Format, Supports_DXTC, Supports_Dot3, Supports_Point_Sprites, Supports_NPatches, Supports_Bump_Envmap, Supports_Bump_Envmap_Luminance, Supports_ZBias and Get_Max_Textures_Per_Pass. Each forwards to DX8Caps. shader.cpp, the DX8 buffer classes and the raw D3DCAPS8 reads stay on DX8Wrapper.
Todo:
Build win32, including W3DView and WorldBuilder
Load a skirmish save and the shell map. Same result as main
No actionable comments were generated in the recent review.
Walkthrough
The change adds static rendering and capability APIs to Renderer, implements them in the DX8 backend, and migrates rendering and capability call sites across WW3D, game code, and tools. Existing draw parameters and rendering branches are generally retained. The shader manager also changes render-target handling.
Changes
Renderer API and backend
Layer / File(s)
Summary
Renderer interface and DX8 implementation Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
Renderer adds capability, render-target, state, buffer, draw, light, and fog methods. The DX8 backend forwards these calls to DX8Wrapper; draw parameters that narrow to unsigned short are checked.
WW3D rendering and capability call sites Core/Libraries/Source/WWVegas/WW3D2/*
WW3D code uses Renderer for rendering operations and capability checks, including texture formats, compression, and N-patches. Existing sorting paths and format-selection rules remain.
Game rendering and tools Core/GameEngineDevice/Source/W3DDevice/..., Generals/Code/..., GeneralsMD/Code/..., Core/Tools/..., Generals/Code/Tools/WorldBuilder/..., GeneralsMD/Code/Tools/WorldBuilder/...
Rendering code uses Renderer for state, buffer, texture, draw, light, fog, and render-target operations. Existing conditions, draw inputs, and ordering are retained in the summarized paths.
The default screen filter no longer redirects rendering to a texture in preRender. Render-target initialization skips texture creation when the current surface is multisampled. startRenderToTexture releases render-to-texture resources and returns if setting the render target fails.
This refactor routes capability and rendering calls through Renderer while keeping the same underlying DX8 behavior. No concrete regression was found. Running the skirmish-save and shell-map comparison noted in the PR would be a useful final check before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the game-code capability queries (texture format, DXTC, Dot3, point sprites, N-patches, bump envmap, ZBias, max textures per pass) now go through Renderer instead of D…
Description check
The description names the specific capability queries moved onto Renderer, states that each forwards to DX8Caps, and lists what stays on DX8Wrapper. It also gives build and replication status and a me…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: the game-code capability queries (texture format, DXTC, Dot3, point sprites, N-patches, bump envmap, ZBias, max textures per pass) now go through Renderer instead of DX8Wrapper. The raw summary confirms this across many WW3D2 and GameClient files, so the title is specific and accurate.
Full details: Description check
Explanation
The description names the specific capability queries moved onto Renderer, states that each forwards to DX8Caps, and lists what stays on DX8Wrapper. It also gives build and replication status and a merge dependency. The changeset matches these claims, so the description is on-topic.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now the capability queries game code uses are on
Renderer:Supports_Texture_Format,Supports_DXTC,Supports_Dot3,Supports_Point_Sprites,Supports_NPatches,Supports_Bump_Envmap,Supports_Bump_Envmap_Luminance,Supports_ZBiasandGet_Max_Textures_Per_Pass. Each forwards toDX8Caps.shader.cpp, the DX8 buffer classes and the rawD3DCAPS8reads stay onDX8Wrapper.Todo: