microsoft / microsoft/win32metadata

D3D_COMPILE_STANDARD_FILE_INCLUDE, incorrect constant type

Open
#1,797 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

Metadata currently has
```csharp
public const uint D3D_COMPILE_STANDARD_FILE_INCLUDE = 1u;
```

Headers (d3dcompiler.h):
```cpp
// D3D_COMPILE_STANDARD_FILE_INCLUDE can be passed for pInclude in any
// API and indicates that a simple default include handler should be
// used. The include handler will include files relative to the
// current directory and files relative to the directory of the initial source
// file. When used with APIs like D3DCompile pSourceName must be a
// file name and the initial relative directory will be derived from it.
#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude*)(UINT_PTR)1)
```

UINT_PTR is 32-bit/64-bit depending on target arch.

We could probably do better and associate it with `(ID3DInclude*)1` and it should slot in nicely with existing `D3DCompileFromFile(..., _In_opt_ ID3DInclude* pInclude, ...)`

Contributor guide

Open the contributing guide

Research direction

Start with the D3D_COMPILE_STANDARD_FILE_INCLUDE definition in d3dcompiler.h and compare it with the metadata declaration and the D3DCompileFromFile pInclude parameter. Update the metadata so the constant uses the pointer-sized ID3DInclude representation described by the header, then verify the generated API type on both 32-bit and 64-bit targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
api, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.