Skip to content

refactor(ww3d2): Route fill mode and color write mask via Renderer - #3703

Draft
bobtista wants to merge 17 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-fill-color-write
Draft

bobtista wants to merge 17 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-fill-color-write

Conversation

@bobtista

Copy link
Copy Markdown

Follow up for #2613
Merge after #3700

This change routes the fill mode and color write mask through Renderer.

Renderer.h gets RenderFillMode and RenderColorWrite enums. The DX8 backend translates each value to its D3D constant.

The save and restore blocks in W3DScene and W3DVolumetricShadow read the color write mask from the device. They stay as they are and move with the stencil shadow change.

Testing

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds Renderer capability and rendering APIs with a DX8 backend implementation. Engine, library, and tool code now routes selected rendering operations and capability queries through Renderer. The shader manager also changes render-target initialization for multisampled targets and failed target selection.

Changes

Renderer Interface Migration

Layer / File(s) Summary
Renderer contract and DX8 backend
Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
Adds Renderer capability queries and rendering methods. The DX8 backend forwards operations to DX8Wrapper and converts fill modes, color masks, and draw parameters.
Capability and format queries
Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp, Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp, Core/Libraries/Source/WWVegas/WW3D2/{texture.cpp,textureloader.cpp,ww3dformat.cpp,dx8renderer.cpp,meshmdl.cpp,statistics.cpp}, Generals/Code/Libraries/Source/WWVegas/WW3D2/{decalmsh.cpp,meshmatdesc.cpp}, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp
Capability and format checks use Renderer queries. Existing format fallback orders and stated conditions remain unchanged.
WW3D rendering and state submission
Core/Libraries/Source/WWVegas/WW3D2/*, Generals/Code/Libraries/Source/WWVegas/WW3D2/*, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/*
Rendering code uses Renderer for selected state, texture, buffer, transform, lighting, and draw operations. Existing sorting paths remain in place where described.
Game rendering paths
Core/GameEngineDevice/Source/W3DDevice/GameClient/*, Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/*, GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/*
Terrain, water, effects, shadows, and scene rendering use Renderer for selected operations. The shader manager changes render-target initialization behavior for multisampled targets and target-selection failures.
Rendering in tools
Core/Tools/W3DView/ScreenCursor.cpp, Generals/Code/Tools/WorldBuilder/src/{DrawObject.cpp,ObjectPreview.cpp}, GeneralsMD/Code/Tools/WorldBuilder/src/{DrawObject.cpp,ObjectPreview.cpp}
W3DView and WorldBuilder route selected rendering operations and preview render-target selection through Renderer.

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

Change: Refactor

Suggested labels: Refactor, Rendering, Gen, ZH

Suggested reviewers: xezon

Merge Risk: Minimal · up to b9e86

This change routes rendering state, drawing and capability queries through a renderer interface while keeping the DX8 behavior. No concrete defect was found, so merge risk looks minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: fill mode and color write mask are routed through the new Renderer API in the ww3d2 library. The raw summary confirms that Renderer.h adds RenderFillMode and RenderCol…
Description check Passed The description states that the PR routes fill mode and color write mask through Renderer, adds the RenderFillMode and RenderColorWrite enums to Renderer.h, and explains that the DX8 backend maps them…
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.
Full details: Title check

Explanation

The title names the main change: fill mode and color write mask are routed through the new Renderer API in the ww3d2 library. The raw summary confirms that Renderer.h adds RenderFillMode and RenderColorWrite enums, that scene.cpp and ww3d.cpp call Renderer::Set_Fill_Mode, and that the DX8 backend translates the values. The title is specific and matches the changeset, though the changeset also covers many other Renderer routing changes.

Full details: Description check

Explanation

The description states that the PR routes fill mode and color write mask through Renderer, adds the RenderFillMode and RenderColorWrite enums to Renderer.h, and explains that the DX8 backend maps them to D3D constants. This matches the raw summary of the changeset. It also gives build and replay testing notes.

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96cdf1e6-fb36-41f2-8258-305dd74113b8
Commits

Reviewing files that changed from the base of the PR and between 7699e22 and b9e8616.

Files selected for processing: 10

  • Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Renderer.h
  • Core/Libraries/Source/WWVegas/WW3D2/meshmdl.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/texproject.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.

@bobtista
bobtista force-pushed the bobtista/refactor/route-fill-color-write branch from 7699e22 to b9e8616 Compare November 20, 2026 01:16
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