Skip to content

refactor(w3d): Create pixel shaders from precompiled tokens - #3650

Merged
xezon merged 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/d3dx-assemble-shader
Nov 5, 2026
Merged

xezon merged 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/d3dx-assemble-shader

Conversation

@bobtista

@bobtista bobtista commented Nov 3, 2026

Copy link
Copy Markdown

WaterRenderObjClass::ReAcquireResources and W3DProfilerFrameCapture::Capture assemble their pixel shaders from text at runtime with D3DXAssembleShader, which pulls in D3DX.

Now the shaders are created from token arrays, with the assembly next to each line. The instruction tokens are identical to the D3DXAssembleShader output for the original text. The assembler only adds a version comment block, which the runtime ignores.

Todo:

  • Build win32 and vc6
  • Compare the tokens with the D3DXAssembleShader output

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Profiler frame capture and water resource setup now create pixel shaders from embedded instruction arrays instead of assembling shader source at runtime with D3DX.

Changes

Pixel shader bytecode migration

Layer / File(s) Summary
Profiler frame capture shader
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DProfilerFrameCapture.cpp
Frame capture passes an embedded instruction array to CreatePixelShader. The D3DX include, assembly path, and compiled-buffer handling are removed.
Water resource shaders
Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
River, standard-water, and trapezoid-water shaders use embedded instruction arrays with CreatePixelShader.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Possibly related PRs

Suggested labels: Refactor

Suggested reviewers: stephanmeesters, xezon

Merge Risk: Minimal · up to b2bdb

No actionable merge-blocking issue is established for the embedded shader migration. Mergeability remains subject to normal build and rendering checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Description check Passed The description is directly related to the changeset. It explains the removal of D3DXAssembleShader, the use of token arrays, and the reported validation steps.
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 "refactor(w3d): Create pixel shaders from precompiled tokens" matches the main change. The PR replaces runtime D3DX shader assembly with precompiled pixel shader token arrays in W3DWater.cpp…
Full details: Title check

Explanation

The title "refactor(w3d): Create pixel shaders from precompiled tokens" matches the main change. The PR replaces runtime D3DX shader assembly with precompiled pixel shader token arrays in W3DWater.cpp and W3DProfilerFrameCapture.cpp. The title names the refactor, the W3D module, and the token-based shader creation. It is specific and concise, and it fits the 7-word, single-sentence style the check expects.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
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: 9f2c93b6-7f58-4f5e-9350-160d1663d67b
Commits

Reviewing files that changed from the base of the PR and between 0422afd and b2bdb20.

Files selected for processing: 2
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DProfilerFrameCapture.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp

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

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Replaces runtime shader assembly with fixed token arrays for water rendering and profiler frame capture.

  • Profiler captures create their channel-swizzle shader from fixed tokens.
  • Water rendering creates its three pixel shaders from fixed tokens.

Reviews (2) · Last reviewed commit: "refactor(w3d): Use SDK macros for the pi..." · Reviewed by Greptile

@bobtista bobtista changed the title refactor(w3d): Use precompiled pixel shader tokens instead of D3DX refactor(w3d): Create pixel shaders from precompiled tokens Nov 3, 2026
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing Rendering Is Rendering related labels Nov 5, 2026
@xezon
xezon merged commit 8513575 into TheSuperHackers:main Nov 5, 2026
28 checks passed
gamezerve pushed a commit to gamezerve/Reborn-Omega that referenced this pull request Nov 6, 2026
…Hackers#3650)

To eliminate the dependency on D3DXAssembleShader, which MinGW does not provide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing Rendering Is Rendering related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants