Skip to content

Render commands and friends#1830

Open
universalconquistador wants to merge 19 commits into
aers:mainfrom
universalconquistador:render-commands-and-friends
Open

Render commands and friends#1830
universalconquistador wants to merge 19 commits into
aers:mainfrom
universalconquistador:render-commands-and-friends

Conversation

@universalconquistador
Copy link
Copy Markdown
Contributor

A few different rendering things in support of under-UI overlay drawing:

  • Initial ThreadLocals support. Feel free to suggest any changes to how it's presented in ClientStructs.
  • Adds the Context for generating and enqueueing render commands
  • Adds lots of stuff to ImmediateContext where the render commands are processed
  • Adds structs to help with bitfield rendering states
  • Adds AtkServer that turns UI draw commands into render commands
  • Adds Texture fields for getting the render target view / depth stencil view

[MemberFunction("48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 54 41 56 41 57 48 83 EC 50 44 8B 05")]
public partial ulong Draw(bool unk);

[MemberFunction("E9 ?? ?? ?? ?? CC CC CC CC CC CC CC CC CC CC 48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 7C 24 ?? 41 56")]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I realize this is a terrible signature, let me know if you have any better ideas for how to do this!

@github-actions github-actions Bot added the breaking change PR contains breaking changes and wont be merged before a new patch label May 14, 2026
@universalconquistador
Copy link
Copy Markdown
Contributor Author

Breaking Changes

Member exists in left but not in right

FFXIVClientStructs.FFXIV.Client.Graphics.Kernel: 2

RenderCommandScissorsRect: 4

  • int Left
  • int Top
  • int Right
  • int Bottom

RenderCommandClearDepth: 2

  • float ClearType
  • int ClearCheck

I believe basically none of these changed render command fields were correct? So I think we're good to make these breaking changes.


[StructLayout(LayoutKind.Explicit, Size = 0x40)]
public unsafe struct TextureMipRenderTarget {
[FieldOffset(0x00)] public void* D3D11RenderTargetViewOrDepthStencilView; // ID3D11RenderTargetView(1?) or ID3D11DepthStencilView(1?)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet we could use a CExporterUnion here to present both the ID3D11RenderTargetView* and the ID3D11DepthStencilView*

Comment thread FFXIVClientStructs/FFXIV/Client/Graphics/Render/RenderTargetManager.cs Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/UI/UIModule.cs Outdated
Copy link
Copy Markdown
Collaborator

@Haselnussbomber Haselnussbomber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed some changes, but other than that it looks fine to me.

public static partial Device* Instance();

[FieldOffset(0x8)] public void* ContextArray; // Client::Graphics::Kernel::Context array
[FieldOffset(0x8)] public void* ContextArray; // TODO: We have a struct for this now (breaking change)
Copy link
Copy Markdown
Collaborator

@Haselnussbomber Haselnussbomber May 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a note, I would have no idea what to change this to. I guess Context* something?
Would rather add a Span for that if the size is constant and the length is known.

@github-actions
Copy link
Copy Markdown
Contributor

Breaking Changes

Member exists in left but not in right

FFXIVClientStructs.FFXIV.Client.Graphics.Kernel: 1

RenderCommandClearDepth: 1

  • int ClearStencil

Comment on lines +87 to +91
[MemberFunction("E8 ?? ?? ?? ?? 48 8B 7B 18 45 33 FF")]
public partial void ProcessCommands(RenderCommandBufferGroup* renderCommands, uint renderCommandCount);

[MemberFunction("E8 ?? ?? ?? ?? 48 8B 7B 18 45 33 FF")]
public partial void PreprocessCommands(RenderCommandBufferGroup* renderCommands, uint renderCommandCount);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Process and Preprocess have the same sig?

public partial void* AllocateCommand(ulong size);

[MemberFunction("4C 8B C9 4D 8D 50 0F")]
public partial void* AllocateSpecificCommand(int commandType, ulong size);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should commandType use the enum?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PR contains breaking changes and wont be merged before a new patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants