Skip to content
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

D3D12_SHADER_BYTECODE missing NativeArrayInfo #2051

Open
morganbr opened this issue Jan 25, 2025 · 1 comment
Open

D3D12_SHADER_BYTECODE missing NativeArrayInfo #2051

morganbr opened this issue Jan 25, 2025 · 1 comment

Comments

@morganbr
Copy link

D3D12_SHADER_BYTECODE (documented at https://learn.microsoft.com/windows/win32/api/d3d12/ns-d3d12-d3d12_shader_bytecode) is missing NativeArrayInfoAttribute on pShaderBytecode. It should use BytecodeLength as a length.

@MarijnS95
Copy link
Contributor

MarijnS95 commented Jan 31, 2025

It already has some form of annotation in IDL, _Field_size_bytes_full_:

typedef struct D3D12_SHADER_BYTECODE
{
[annotation("_Field_size_bytes_full_(BytecodeLength)")] const void* pShaderBytecode;
SIZE_T BytecodeLength;
} D3D12_SHADER_BYTECODE;

But that doesn't seem to be parsed, as ILSpy for a Windows.Win32.winmd generated from that file shows:

[Documentation("https://learn.microsoft.com/windows/win32/api/d3d12/ns-d3d12-d3d12_shader_bytecode")]
public struct D3D12_SHADER_BYTECODE
{
	[Const]
	public unsafe void* pShaderBytecode;

	public UIntPtr BytecodeLength;
}

Perhaps the tooling needs to be updated to support this source attribute.

Alternatively we could have something manual in emitter.settings.rsp:

D3D12_SHADER_BYTECODE::pShaderBytecode=[NativeArrayInfo(CountParamIndex = 1)]

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

No branches or pull requests

2 participants