Render commands and friends#1830
Conversation
| [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")] |
There was a problem hiding this comment.
Yes I realize this is a terrible signature, let me know if you have any better ideas for how to do this!
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?) |
There was a problem hiding this comment.
I bet we could use a CExporterUnion here to present both the ID3D11RenderTargetView* and the ID3D11DepthStencilView*
Haselnussbomber
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I have no idea what the length is, whether it's fixed size or not, and where the contexts come from. I didn't look into it because it wasn't critical for what I was doing; any function you hook that does drawing is going to have a thread-local context nice and ready to be used.
There was a problem hiding this comment.
If you want to add it, its max length is 16. The actual length is stored in 0x68.
DeviceDX11_Initialize:
v7 = 16;
*(_QWORD *)(v3 + 0xC0) = (v4 >> 1) & 0x7FFFFFFFFFFFFFF0i64;
if ( *((_DWORD *)a2 + 2) < 16u )
v7 = *((_DWORD *)a2 + 2);
*(_DWORD *)(v3 + 0x68) = v7;
| [FieldOffset(0x10)] public ShaderCodeResourceHandle* PrimitiveUIVSResource; | ||
| [FieldOffset(0x18)] internal ShaderCodeResourceHandle* _primitiveUIVSResource_2; | ||
| [FieldOffset(0x20)] internal ShaderCodeResourceHandle* _primitiveUIVSResource_3; | ||
| [FieldOffset(0x28)] internal ShaderCodeResourceHandle* _primitiveUIVSResource_4; |
There was a problem hiding this comment.
Should this use a FixedSizeArray like GBuffers?
There was a problem hiding this comment.
Those are all the same shaderresourcehandle, I'm not really sure whether they are treated like an array. But if someone really cares one way or another I could change it.
There was a problem hiding this comment.
I misunderstood; I didn't realize they were all pointing to the same shader handle. I think it makes sense to do it this way since I guess they are useless padding.
| [FieldOffset(0xE8)] public VertexShader* PrimitiveUIVS; | ||
| [FieldOffset(0xF0)] internal VertexShader* _primitiveUIVS_2; | ||
| [FieldOffset(0xF8)] internal VertexShader* _primitiveUIVS_3; | ||
| [FieldOffset(0x100)] internal VertexShader* _primitiveUIVS_4; |
There was a problem hiding this comment.
Those are all the same VertexShader*, I'm not really sure whether they are treated like an array. But if someone really cares one way or another I could change it.
sourpuh
left a comment
There was a problem hiding this comment.
Just a few changes and LGTM
| [FieldOffset(0x10)] public ShaderCodeResourceHandle* PrimitiveUIVSResource; | ||
| [FieldOffset(0x18)] internal ShaderCodeResourceHandle* _primitiveUIVSResource_2; | ||
| [FieldOffset(0x20)] internal ShaderCodeResourceHandle* _primitiveUIVSResource_3; | ||
| [FieldOffset(0x28)] internal ShaderCodeResourceHandle* _primitiveUIVSResource_4; |
There was a problem hiding this comment.
I misunderstood; I didn't realize they were all pointing to the same shader handle. I think it makes sense to do it this way since I guess they are useless padding.
A few different rendering things in support of under-UI overlay drawing: