Skip to content

refactor(ww3d2): Route transforms via IRenderBackend - #3419

Draft
bobtista wants to merge 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-transforms
Draft

bobtista wants to merge 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-transforms

Conversation

@bobtista

@bobtista bobtista commented Oct 4, 2026 •

Copy link
Copy Markdown

Set_Transform and Get_Transform take a D3DTRANSFORMSTATETYPE, so every caller names a D3D enum.

Now IRenderBackend has Set_Transform, Get_Transform, Set_World_Identity, Set_View_Identity and Set_Projection_Transform_With_Z_Bias, with a RenderBackendTransform enum for world, view and projection. DX8Backend maps it to the D3D value and asserts on an unknown one. The texture matrix calls in mapper.cpp and matrixmapper.cpp stay on DX8Wrapper, because they come together with texture stage state that is not routed. camera.cpp no longer uses DX8Wrapper and drops its include.

Todo:

  • Build win32, including W3DView and WorldBuilder
  • Load two skirmish saves and the shell map, open W3DView through its device dialog, and open WorldBuilder. Same result as main
  • Replicate to Generals

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 38ef601e-e3ae-4bf6-972a-e782acc4a702
📥 Commits

Reviewing files that changed from the base of the PR and between f8ba7eb and 17b15da.

📒 Files selected for processing (44)
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSnow.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.h
  • Core/Libraries/Source/WWVegas/WW3D2/IRenderBackend.h
  • Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h
  • Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
  • Core/Tools/W3DView/GammaDialog.cpp
  • Core/Tools/W3DView/MainFrm.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DStatusCircle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/linegrp.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mapper.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


Walkthrough

The change expands the render-backend interface and DX8 implementation with device, display, and transform operations. WW3D, rendering-library code, game rendering, and WorldBuilder route selected operations through the active backend. River water rendering also changes how it computes vertex colors.

Changes

Render backend migration

Layer / File(s) Summary
Backend contract and DX8 implementation
Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.*, Core/Libraries/Source/WWVegas/WW3D2/IRenderBackend.h, Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h
The backend interface adds device, resolution, format, and transform methods. DX8Backend implements these operations by forwarding to DX8Wrapper.
WW3D queries, camera setup, and gamma calls
Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp, Core/Tools/W3DView/GammaDialog.cpp, Core/Tools/W3DView/MainFrm.cpp
WW3D routes device and display queries through the backend. Camera setup uses backend viewport and transform operations. W3DView applies gamma through WW3D::Set_Gamma.
WW3D renderer transform access
Core/Libraries/Source/WWVegas/WW3D2/{dx8renderer,dynamesh,line3d,pointgr,ringobj,seglinerenderer,sortingrenderer,sphereobj,streakRender}.cpp, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/{boxrobj,dazzle,decalmsh,linegrp,mapper,mesh,render2d,scene}.cpp
Rendering objects and helpers use the backend to read, set, and restore transforms. The supplied summaries describe no other changes to their rendering operations.
Game rendering and WorldBuilder integration
Core/GameEngineDevice/Source/W3DDevice/GameClient/*, Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/*, GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/{Shadow/*,W3DInGameUI.cpp,W3DScene.cpp,W3DStatusCircle.cpp}, GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp
Game rendering routes selected transforms, buffer queries, clears, and stencil checks through the backend. River water rendering computes vertex colors using each vertex’s cell shroud level. WorldBuilder routes its listed world-transform updates through the backend.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Suggested reviewers: xezon

Merge Risk: ⚪ Minimal · up to 17b15

No concrete merge-blocking regression was established. The pending skirmish and WorldBuilder smoke tests remain normal validation before release.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 17b15

The inspected changes preserve existing rendering-state ownership and display controls. No introduced security weakness was established, but incomplete caller and runtime coverage leaves some uncertainty around the expanded interface.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The gamma path can affect the local display through either the graphics-device gamma ramp or a desktop-device-context fallback. This display-wide sink is unchanged, and the changed W3DView dialog already reached it directly in the review base; the new dispatch route does not demonstrate increased display authority.

Trust Boundaries and Controls

  • inferred — For the inspected paths, the backend is an in-process rendering abstraction rather than a newly demonstrated authorization boundary. Existing device operations and gamma bounds remain in DX8Wrapper. This supports preserved controls for those paths, not a conclusion about all public callers or unsupported input states.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: routing transform operations through IRenderBackend.
Description check ✅ Passed The description explains the backend transform changes, the DX8Backend mapping, and the remaining DX8Wrapper calls. It is directly related to the changeset.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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