Skip to content

Render: dead stubs - #27

Merged
ivan-ushakov merged 2 commits into
crossplatformfrom
cleanup/render-dead-stubs
Jul 25, 2026
Merged

Render: dead stubs#27
ivan-ushakov merged 2 commits into
crossplatformfrom
cleanup/render-dead-stubs

Conversation

@ivan-ushakov

Copy link
Copy Markdown
Collaborator

No description provided.

ivan-ushakov and others added 2 commits July 25, 2026 23:01
RenderStub.cpp carried link-only bodies for symbols the retired D3D9 backend
used to define. Some are still demanded -- by live code, at that: GrassMap::
BuildGrass wants ColorByNormalRGBA, cTexture::CalcTextureSize wants
GetTextureFormatSize, LensFlareRenderer and cOcclusionSilouette construct a
cOcclusionQuery, GameShell owns an sVideoWrite. Those stay.

These do not. Verified by deleting them and relinking (Debug and RelWithDebInfo,
both clean):

  DrawStrip::Begin/End
  PoolManager, Pool, VertexPool, IndexPool   (the D3D9 tilemap page allocator)
  DrawType::BeginDraw/SetTileColor
  cTileMapRender                             (7 members)
  cD3DRender::LockTexture x2, UnlockTexture, DrawQuad, createRenderTargets,
    deleteRenderTargets, CreateFloatTexture, CreateMirageMap, SetAdvance,
    SetBlendState, SetRenderTarget1

DrawStrip is the one worth a note rather than a silent delete: its Set() is an
inline that writes into a locked cVertexBuffer we do not have, so a body would
leave the pointer garbage. Without one, a new caller now fails at link time
instead of corrupting the heap at run time -- strictly better than the assert
that was there. The comment says so, and says where callers should go instead.

D3DRenderTilemap.h goes with cTileMapRender; nothing else in the file needed it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The header still described the D3D9 backend as "the real renderer", the SDL one
as "Track B", and this file as no-op definitions for a silent renderer on the
platforms D3D could not reach. All three stopped being true when D3D9 was
retired -- which is why the file reads as disposable when it holds the only
CreateIRenderDevice the engine has.

Rewritten to describe the two things actually in it: the renderer's entry point
and backend globals, and the seam retirement could not reach -- portable engine
code that still speaks D3D9 nouns (GetTextureFormatSize, ColorByNormalRGBA,
IDirect3DSurface9* parameters) and still owns classes whose only implementation
was D3D9 (cOcclusionQuery, sVideoWrite, the dynamic buffer family).

It also draws a distinction the old header did not, and that cost time to
rediscover: the cD3DRender:: helpers are unreachable, every call arriving through
the null gb_RenderDevice3D -- but the other bodies DO run and their returns are
consumed. GrassMap::BuildGrass writes ColorByNormalRGBA's result into every bush,
cOcclusionQuery answers IsVisible() = true, GetTextureFormatSize reports 0 bpp.
Answers the game acts on, not silence.

Same pass over the section comments, which framed everything as Windows vs
off-Windows: the samplers, CreateIRenderDevice, RegisterVertexDeclaration,
cSkinVertex, the sPtr bodies.

Comments only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ivan-ushakov
ivan-ushakov merged commit d3de799 into crossplatform Jul 25, 2026
4 checks passed
@ivan-ushakov
ivan-ushakov deleted the cleanup/render-dead-stubs branch July 25, 2026 20:19
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