-
Notifications
You must be signed in to change notification settings - Fork 232
Render commands and friends #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
universalconquistador
wants to merge
19
commits into
aers:main
Choose a base branch
from
universalconquistador:render-commands-and-friends
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
81aeda6
Adds client graphics kernel context.
universalconquistador e3c9ef1
Adds ImmediateContext stuff and packed render state structs.
universalconquistador b7f02b8
Adds render target view / depth stencil view access to Textures.
universalconquistador 0f2118f
Adds UI drawing stuff.
universalconquistador 67e25b0
Removes address comment I left in by accident
universalconquistador 9954873
Fixes misnamed ImmediateContext field.
universalconquistador 73525a5
Improves clear rectangle field name.
universalconquistador ab37087
Removes another address comment I left in by mistake.
universalconquistador 265c466
Adds missing force bool to DirectX CExporter type override.
universalconquistador 62e6622
Restores some backwards-compatibility with improved fields.
universalconquistador 0f2f956
Corrects render command rectangles and re-adds obsoleted fields.
universalconquistador 321e11e
Adds packeddepthstencil stencil ref field.
universalconquistador 1bd8e90
Fixes void return type of uimodule draw2d.
universalconquistador 85331c8
Gives public unk's actual names.
universalconquistador f90eec1
Improves comments
universalconquistador c6b57a9
Opinionated style changes
Haselnussbomber 2c5b0f2
Add GenerateInterop to RenderCommandMultiViewport
Haselnussbomber 325e3c5
Fix some return types
Haselnussbomber 3dac72c
Add AtkServer pointer to AtkModule
Haselnussbomber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
FFXIVClientStructs/FFXIV/Client/Graphics/Kernel/Context.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| namespace FFXIVClientStructs.FFXIV.Client.Graphics.Kernel; | ||
|
|
||
| /// <summary> | ||
| /// Records rendering commands to be executed later by the <see cref="ImmediateContext"/>. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Threads have their own Context, accessed via <see cref="ThreadLocals.GraphicsKernelContext"/>. | ||
| /// </remarks> | ||
| [GenerateInterop] | ||
| [StructLayout(LayoutKind.Explicit, Size = 0x2F78)] | ||
| public unsafe partial struct Context { | ||
| [BitField<byte>(nameof(CurrentSubViewIndex), 28, 4)] | ||
| [FieldOffset(0x008)] private uint _flags; | ||
| [FieldOffset(0x00C)] public int ViewIndex; | ||
| [FieldOffset(0x010)] public void* CommandAllocationBase; | ||
|
|
||
| [FieldOffset(0x840)] public ulong CommandAllocationUsedSize; | ||
| [FieldOffset(0x848)] public ulong AllocationBase; | ||
| [FieldOffset(0x850)] public ulong AllocationUsedSize; | ||
|
|
||
| [MemberFunction("4C 8B D1 4C 8D 42 0F")] | ||
| public partial void* AllocateCommand(ulong size); | ||
|
|
||
| [MemberFunction("4C 8B C9 4D 8D 50 0F")] | ||
| public partial void* AllocateSpecificCommand(int commandType, ulong size); | ||
|
|
||
| [MemberFunction("E8 ?? ?? ?? ?? 8B 6E 6C")] | ||
| public partial void PushBackCommand(void* command); | ||
|
|
||
| [MemberFunction("E8 ?? ?? ?? ?? 8D 56 38")] | ||
| public partial void SetRenderTargets(int renderTargetCount, Texture** renderTargetTextures, Texture* depthStencilTexture, short a4, short a5, short a6, short a7); // last params believed to be a rectangle | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
FFXIVClientStructs/FFXIV/Client/Graphics/Kernel/PackedBlendStateDesc.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| namespace FFXIVClientStructs.FFXIV.Client.Graphics.Kernel; | ||
|
|
||
| /// <summary> | ||
| /// Contains blending configuration for the renderer. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Rather than manage a bunch of pointers to blend state objects, render commands accept a | ||
| /// description of the desired blend state packed into 32 bits, which is copied around | ||
| /// by value and eventually a real D3D blend state object is created within the | ||
| /// <see cref="ImmediateContext"/> as needed. | ||
| /// </remarks> | ||
| [GenerateInterop] | ||
| [StructLayout(LayoutKind.Explicit, Size = 0x04)] | ||
| public unsafe partial struct PackedBlendStateDesc { | ||
|
|
||
| // E (BlendEnabled) | ||
| // OOO (BlendOpMinusOne) | ||
| // SSSS (SrcBlendMinusOne) | ||
| // DDDD (DestBlendMinusOne) | ||
| // ooo (BlendOpAlphaMinusOne) | ||
| // sss s (SrcBlendAlphaMinusOne) | ||
| // ddd d (DestBlendAlphaMinusOne) | ||
| // MMM M (RenderTargetWriteMask) | ||
| // ---- - (--masked out--) | ||
| // xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx | ||
| [BitField<bool>(nameof(BlendEnable), 0, 1)] | ||
| [BitField<byte>(nameof(BlendOpMinusOne), 1, 3)] | ||
| [BitField<byte>(nameof(SrcBlendMinusOne), 4, 4)] | ||
| [BitField<byte>(nameof(DestBlendMinusOne), 8, 4)] | ||
| [BitField<byte>(nameof(BlendOpAlphaMinusOne), 12, 3)] | ||
| [BitField<byte>(nameof(SrcBlendAlphaMinusOne), 15, 4)] | ||
| [BitField<byte>(nameof(DestBlendAlphaMinusOne), 19, 4)] | ||
| [BitField<byte>(nameof(RenderTargetWriteMask), 23, 4)] | ||
| [FieldOffset(0x00)] internal uint _value; | ||
|
|
||
| // D3D11_BLEND_OP | ||
| private partial byte BlendOpMinusOne { get; set; } | ||
| public byte BlendOp { | ||
| get => (byte)(BlendOpMinusOne + 1); | ||
| set => BlendOpMinusOne = (byte)(value - 1); | ||
| } | ||
|
|
||
| // D3D11_BLEND | ||
| private partial byte SrcBlendMinusOne { get; set; } | ||
| public byte SrcBlend { | ||
| get => (byte)(SrcBlendMinusOne + 1); | ||
| set => SrcBlendMinusOne = (byte)(value - 1); | ||
| } | ||
|
|
||
| // D3D11_BLEND | ||
| private partial byte DestBlendMinusOne { get; set; } | ||
| public byte DestBlend { | ||
| get => (byte)(DestBlendMinusOne + 1); | ||
| set => DestBlendMinusOne = (byte)(value - 1); | ||
| } | ||
|
|
||
| // D3D11_BLEND_OP | ||
| private partial byte BlendOpAlphaMinusOne { get; set; } | ||
| public byte BlendOpAlpha { | ||
| get => (byte)(BlendOpAlphaMinusOne + 1); | ||
| set => BlendOpAlphaMinusOne = (byte)(value - 1); | ||
| } | ||
|
|
||
| // D3D11_BLEND | ||
| private partial byte SrcBlendAlphaMinusOne { get; set; } | ||
| public byte SrcBlendAlpha { | ||
| get => (byte)(SrcBlendAlphaMinusOne + 1); | ||
| set => SrcBlendAlphaMinusOne = (byte)(value - 1); | ||
| } | ||
|
|
||
| // D3D11_BLEND | ||
| private partial byte DestBlendAlphaMinusOne { get; set; } | ||
| public byte DestBlendAlpha { | ||
| get => (byte)(DestBlendAlphaMinusOne + 1); | ||
| set => DestBlendAlphaMinusOne = (byte)(value - 1); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.