Coder Social home page Coder Social logo

microsoft / directx-headers Goto Github PK

View Code? Open in Web Editor NEW
527.0 27.0 148.0 18.31 MB

Official DirectX headers available under an open source license

Home Page: https://devblogs.microsoft.com/directx/

License: MIT License

CMake 0.29% C 73.97% C++ 25.62% Meson 0.12%
microsoft directx directx12 d3d12 wsl

directx-headers's Introduction

DirectX Headers

This repository hosts the official Direct3D 12 headers. These headers are made available under the MIT license rather than the traditional Windows SDK license.

Additionally, this repository hosts several helpers for using these headers.

Make sure that you visit the DirectX Landing Page for more resources for DirectX developers.

Directory Structure

  • /: Build files are available here for quick integration. CMake is provided, and can be referenced either via subdirectory() or after installation to a system location. Meson is also available for inclusion as a subproject/wrap.
  • /include/directx: These files are the core headers for using D3D12, plus d3dx12.h, which is a helper and does not cross the boundaries of the D3D12 API.
  • /include/wsl: These files are provided as a shim to be able to include the D3D12 headers from a Linux build environment, without requiring the rest of the Windows SDK.
  • /include/dxguids: This header allows an application to use uuidof<T>() consistently between Windows and WSL, instead of __uuidof().
  • /src/dxguids.cpp: This cpp file can be used as a replacement for linking against dxguid.lib on Windows, and as a convenient translation unit to define GUIDs without multiple definitions for WSL.
  • /test: Simple CMake/Meson projects for validating the headers can be included in a given environment

Use on Windows

Note that these headers may conflict with the headers from the Windows SDK, depending on include ordering. These headers should be added to the include directory list before the SDK, and should be included before other graphics headers (e.g. d3d11.h) from the Windows SDK. Otherwise, the corresponding header from the Windows SDK may be included first, and will define the include guards which prevents these headers from being used.

Use on WSL

Note: WSL support is not intended for general purpose application development. At this time, the only recommended usage is for frameworks wishing to provide hardware acceleration for a Linux graphics/compute API in a WSL2 virtualization environment.

Note: WSL support is only available for 64-bit binaries.

The headers in the /include/wsl directory provide alternative definitions to macros and typedefs normally found in the Windows SDK. For the most part, they should be straightforward, but there are a couple to call attention to:

Type Reason
LONG/ULONG On 64-bit Windows, a long is 4 bytes, but on Linux it is typically 8 bytes. The D3D12 ABI for WSL uses long and therefore these should be 8 bytes.
WCHAR/WCSTR On Windows, a wchar_t is 2 bytes, but on Linux it is typically 4 bytes. The D3D12 ABI for WSL uses the native 4-byte wchar_t, to enable applications and the runtime to use the system C library to perform string manipulation.

Additionally, APIs taking HANDLE (void*) for Win32 types should instead use reinterpret_cast<HANDLE>(fd) for an appropriate type of file descriptor. For ID3D12Fence::SetEventOnCompletion this should be an eventfd, and for shared resources will be an opaque fd.

Ways to consume

There are various ways to consume the headers in this project:

  • Manually: Just copy the headers somewhere and point your project at them.
  • CMake subproject: Add this entire project as a subdirectory of your larger project, e.g. as a git submodule, and add_subdirectory into it. Use the resulting DirectX-Headers and/or DirectX-Guids targets as a link dependency
  • Installed CMake: After building/installing this project, it can be found through CMake's find_package functionality and will expose the same DirectX-Headers and DirectX-Guids targets.
  • FetchContent CMake (3.11+): Fetch this library using Git and easily add it to your project.
  • Meson subproject/wrap: Add this entire project as a subproject of your larger project, and use subproject or dependency to consume it.
  • Pkg-config: Use Meson to build this project, and the resulting installed package can be found via pkg-config.
  • vcpkg: A vcpkg port has been added.
  • NuGet: Download the DirectX 12 Agility SDK from NuGet.org

Contributions for new mechanisms are welcome.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

directx-headers's People

Contributors

alexgong14 avatar billkris-ms avatar fdwr avatar gdevichms avatar gfxstrand avatar hiimjulien avatar huningxin avatar jacquesvanrhynmsft avatar jenatali avatar jpetermugaas avatar jstoecker avatar kcloudy0717 avatar lygstate avatar marijns95 avatar nikzasel avatar patricevignola avatar rafaelcintron avatar sanithovski avatar shawnhar avatar simco50 avatar sivileri avatar sixshaman avatar stevewhims avatar tiagoshibata avatar walbourn avatar wenxcs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

directx-headers's Issues

Does `IDXGIOutput5::DuplicateOutput1()` take `enum DXGI_OUTDUPL_FLAG` in the `Flags` parameter?

We were investigating where enum DXGI_OUTDUPL_FLAG could be used (with its only known valid flag value DXGI_OUTDUPL_COMPOSITED_UI_CAPTURE_ONLY = 1), or if it was an accidental unused remnant.

@riverar apparently reverse-engineered an example and confirmed my initial hunch that this value is used for Flags in IDXGIOutput5::DuplicateOutput1(). The documentation still suggests that the Flags value "must be zero" however.

Can anyone clear up whether this is true, and if so:

  • Update the documentation;
  • Maybe change the parameter type to directly take DXGI_OUTDUPL_FLAG, so that we don't have to hack this in win32metadata via [AssociatedEnum]?

After all DXGI_OUTDUPL_FLAG is an untyped enum which is assumed to be INT by default, mismatching the UINT ABI of the Flags parameter.


Note also that I'm trying to propagate this flag usage into win32metadata already via microsoft/win32metadata#1911.

Provide `.winmd` (win32metadata) files for the Agility SDK

In order to bind the most recent D3D12 Agility SDK in languages other than C, such as Rust, .winmd metadata files need to be generated for windows-rs to generate proper bindings. According to @mikebattista all the tooling exists and the repo just needs to build/provide them (I think based on .idl or .h files in this repo, by generating and publishing them as part of a GitHub release or inside the NuGet header package?): microsoft/win32metadata#580 (comment)

Clang warnings (as errors)

d3dx12.h(53,5): error : conversion function converting 'CD3DX12_RECT' to its base class 'tagRECT' will never be used [-Werror,-Wclass-conversion]

Getting several of these errors when compiling with Clang on Windows 10, as a workaround I've disabled them via -Wno-class-conversion.

D3DX12.H new BARRIER helpers are in the wrong section of the header

These types:

class CD3DX12_BARRIER_SUBRESOURCE_RANGE : public D3D12_BARRIER_SUBRESOURCE_RANGE
class CD3DX12_GLOBAL_BARRIER : public D3D12_GLOBAL_BARRIER
class CD3DX12_BUFFER_BARRIER : public D3D12_BUFFER_BARRIER
class CD3DX12_TEXTURE_BARRIER : public D3D12_TEXTURE_BARRIER
class CD3DX12_BARRIER_GROUP : public D3D12_BARRIER_GROUP

Are all currently defined in D3DX12.H within the D3DX12_NO_STATE_OBJECT_HELPERS region, which doesn't make much sense as Enhanced Barriers are orthogonal to DXR. I suspect they should be moved up to before the optional parts of the utility header which are there for DXR.

That or you can move this line up to before CD3DX12_BARRIER_SUBRESOURCE_RANGE if it's important to keep the diff minimal for some reason.

#endif // #ifndef D3DX12_NO_STATE_OBJECT_HELPERS

ERROR: /usr/bin/ld: can't find -ld3d12 [compile under ubuntu 18.04]

I compile the repo under ubuntu 18.04, The error message for make is, can you give me some adverse ?

[  6%] Building CXX object CMakeFiles/DirectX-Guids.dir/src/dxguids.cpp.o
[ 12%] Linking CXX static library libDirectX-Guids.a
[ 12%] Built target DirectX-Guids
[ 18%] Building CXX object test/CMakeFiles/DirectX-Headers-Test.dir/test.cpp.o
[ 25%] Linking CXX executable DirectX-Headers-Test
/usr/bin/ld: can't find -ld3d12
collect2: ERROR:ld return 1
test/CMakeFiles/DirectX-Headers-Test.dir/build.make:97: recipe for target 'test/DirectX-Headers-Test' failed
make[2]: *** [test/DirectX-Headers-Test] Error 1
CMakeFiles/Makefile2:198: recipe for target 'test/CMakeFiles/DirectX-Headers-Test.dir/all' failed
make[1]: *** [test/CMakeFiles/DirectX-Headers-Test.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

The cmake info is as addition.

-- The CXX compiler identification is GNU 8.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python: /home/nys/anaconda3/envs/VR/bin/python3.7 (found version "3.7.13") found components: Interpreter 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nys/libs/UVAtlas/DirectX-Headers-main/build

[Agility SDK 1.608.2] missing header file D3D12TokenizedProgramFormat.hpp

Source file src\d3dx12\d3dx12_property_format_table.cpp include header D3D12TokenizedProgramFormat.hpp, but the header does not exist.

Finally, I solved the problem by manually downloading the header files in this repository.

But I hope that similar rookie mistakes will not appear again, thanks.

DxCore Fullscreen Swapchains

https://devblogs.microsoft.com/directx/directx-heart-linux/

There is currently no presentation integration with WSL as WSL is a console only experience today. The D3D12 API can be used for offscreen rendering and compute, but there is no swapchain support to copy pixels directly to the screen (yet 😊).

Now that there is presentation integration with WSL would it be possible to add swapchains to DxCore for fullscreen use?

1.606 D3DX12.H fails to build with MinGW and latest headers

This new construct:

#if defined(_MSC_VER) || !defined(_WIN32)
        virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
#else
        virtual D3D12_RESOURCE_DESC *STDMETHODCALLTYPE GetDesc( 
            D3D12_RESOURCE_DESC * RetVal) = 0;
#endif

Fails to build on MinGW. What is the purpose of this construction?

_MSC_VER is set by MSVC, Intel, and clang/LLVM's cl-like front-end, but it's not set for MinGW.

Furthermore, the 'matching' D3DX12.H doesn't use this construct. so it also fails to build as well with MinGW:

D:/vcpkg/installed/x64-mingw-static/include/directx/d3dx12.h: In constructor 'CD3DX12_VIEWPORT::CD3DX12_VIEWPORT(ID3D12Resource*, UINT, FLOAT, FLOAT, FLOAT, FLOAT)':
D:/vcpkg/installed/x64-mingw-static/include/directx/d3dx12.h:79:45: error: no matching function for call to 'ID3D12Resource::GetDesc()'
   79 |         const auto Desc = pResource->GetDesc();
      |                           ~~~~~~~~~~~~~~~~~~^~

D3DX12SerializeVersionedRootSignature desc_1_2 static sampler to desc_1_0

For MaxVersion D3D_ROOT_SIGNATURE_VERSION_1_0 and pRootSignatureDesc->Version D3D_ROOT_SIGNATURE_VERSION_1_2, it seems D3D12_STATIC_SAMPLER_DESC1 has not been handled.

In D3DX12SerializeVersionedRootSignature of https://github.com/microsoft/DirectX-Headers/blob/main/include/directx/d3dx12_root_signature.h, starting from line 998:

D3D_ROOT_SIGNATURE_VERSION_1_1 and D3D_ROOT_SIGNATURE_VERSION_1_2 (line 1019) are the same path. However, root signature 1.2 includes D3D12_STATIC_SAMPLER_DESC1 for static non-normalized sampler. The current code only assigns the content of desc_1_1.pParameters into pParameters_1_0 for reconstructing a 1.0 signature when 1.1 is not supported. Meanwhile, desc_1_1.pStaticSamplers is directly assigned to CD3DX12_ROOT_SIGNATURE_DESC desc_1_0 (line 1089).

When pRootSignatureDesc->Version is D3D_ROOT_SIGNATURE_VERSION_1_1, desc_1_1.pStaticSamplers is identical to 1.0, which is safe to be reinterpreted as desc_1_0.pStaticSamplers . However, when pRootSignatureDesc->Version is D3D_ROOT_SIGNATURE_VERSION_1_2, desc_1_2 includes D3D12_STATIC_SAMPLER_DESC1 which is not compatible to desc_1_1. desc_1_2.pStaticSamplers should be handled to reconstruct pStaticSamplers_1_0.

I think the purpose of D3DX12SerializeVersionedRootSignature is to handle the compatibility of all root signature versions. Versions 1.2 is now exposed.

Header file name warnings for case

With clang/LLVM at maximum warnings, the complier will complain if your #include case doesn't match the file with -Wnonportable-include-path.

The problem here is in that in include/wsl/stubs/, the case of these two files is all lower-case for the stub:

oaIdl.h
ocIdl.h

but in the Windows 10 SDK they are mix-case:

OAIdl.h
OCIdl.h

The stubs should be updated to use the same case as the Windows SDK so it's possible to write code that avoids this warnings on both platforms at once.

This also means that the headers that use these headers should be updated to use the matching case in d3d12.h, d3d12compatibilty.h, d3d12sdklayers.h, d3d12video.h, and d3dcommon.h.

#include "OAIdl.h"
#include "OCIdl.h"

New D3DX12.H D3D12_BARRIER_SUBRESOURCE_RANGE type generates clang warnings

d3dx12.h(4118,14): warning : parameter 'FirstArraySlice' shadows member inherited from type 'D3D12_BARRIER_SUBRESOURCE_RANGE' [-Wshadow-field] 
d3dx12.h(4119,14): warning : parameter 'NumArraySlices' shadows member inherited from type 'D3D12_BARRIER_SUBRESOURCE_RANGE' [-Wshadow-field] 
d3dx12.h(4120,14): warning : parameter 'FirstPlane' shadows member inherited from type 'D3D12_BARRIER_SUBRESOURCE_RANGE' [-Wshadow-field] 
d3dx12.h(4121,14): warning : parameter 'NumPlanes' shadows member inherited from type 'D3D12_BARRIER_SUBRESOURCE_RANGE' [-Wshadow-field] 

Use of CD3DX12_CPU_DESCRIPTOR_HANDLE in an array can result in static analysis warning

Please see this godbolt output https://godbolt.org/z/ozYG6e

If you create an uninitialized array of CD3DX12_CPU_DESCRIPTOR_HANDLE and then initializing the array in a loop with objects of type D3D12_CPU_DESCRIPTOR_HANDLE, it results in a static analysis error on the usage of the uninitialized array. This does not happen with a non-array.

It actually looks like changing just the custom assignment operator can fix this, if you "= default" the "=" operator, the warning goes away. For context, this warning looks like it was introduced when all the constructors were changed from "{}" (empty implementations) to "= default".

d3dx12.h fails MSVC analysis

Running MSVC static analysis with d3dx12.h results in the following warning:
include\directx\d3dx12.h(2403): warning C6001: Using uninitialized memory '*pParameters_1_0.DescriptorTable.pDescriptorRanges'.

To reproduce with the direct repro:

  1. Generate the .sln with cmake and open it in VS
  2. Open the properties for DirectX-Headers-Test, navigate to Code Analysis -> Microsoft and make sure the project is set to "Microsoft Native Minimum Rules"
  3. Right click DirectX-Headers-Test and run "Analysis and Code Cleanup" -> "Run Code Analysis on DirectX-Headers-Test"

issues with cmake build system

I have two big issues with the cmake build for DirectX-Headers when building for mingw-w64 in MSYS2 (a CygWin derivative).

  1. The CMakeLists.txt file needs to be updated to fix that rpc number issue so libraries such as DirectXTex can be built in mingw. DirectXTex uses CMake's "find_package" and that fails if only Meson was used to build the DirectX-Headers. I have created a patch to fix that issue for CMakeLists.txt and it's simply a line such as "elseif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))" in the "if (NOT WIN32)" block.

  2. The CMakeLists.txt needs to generate a "DirectX-Headers.pc" pkg-config file just like the building with Meson does. That is how Mesa's build script can detect the presence of the DirectX-Headers. and I suspect that other build systems such as Autoconf do something similar with package config files.

Incidentally, I noticed an inconsistency between what is done with Meson and CMake. If you build with mesa, one of the two static libraries is "ibd3dx12-format-properties.a" but if you build with CMake, that file is "libDirectX-Headers.a".

CD3DX12FeatureSupport from d3dx12.h does not compile if D3DX12_NO_STATE_OBJECT_HELPERS is defined

Hello,

I was just trying out the new CD3DX12FeatureSupport helper (which is very useful, so thank you for that!) in our codebase, but I found that if I define D3DX12_NO_STATE_OBJECT_HELPERS before including d3dx12.h I run into compile errors. It looks like <vector> is only included if D3DX12_NO_STATE_OBJECT_HELPERS is not defined, and CD3DX12FeatureSupport uses std::vector and therefore relies on that include.

On a side note, I was defining D3DX12_NO_STATE_OBJECT_HELPERS because we generally do not include std headers in our codebase in order to reduce compile times. It would be really nice if CD3DX12FeatureSupport didn't rely on std::vector for this reason, that way we could continue to avoid taking that as a dependency. Looking at what the class is using std::vector for, it seems to be for storing per-node entries. I think it would probably be ok to use fixed-size arrays for these things since there is already a max of 32 nodes implied by the 32-bit integers used for node masks in the D3D12 API.

Thanks in advance!

Request for the addition of the DirectStorage headers (dstorage.h/dstorageerr.h).

It'd be great if the DirectStorage API headers were included in this repository and under the same license. Today they seem to only be available via nuget and the headers themselves aren't listed in distributable_files.txt so using them from git submodule dependencies (vs needing to use nuget) is tricky.

Specifically native/include/dstorage.h and native/include/dstorageerr.h from
https://nuget.info/packages/Microsoft.Direct3D.DirectStorage/1.2.2

DirectX-Headers-Check-Feature-Support-Test.exe and DirectX-Headers-Test.exe - Segmentation fault

After using CMake with the current git code, I get a "Segmentation fault" from the test programs, DirectX-Headers-Check-Feature-Support-Test.exe and DirectX-Headers-Test.exe . I am running these programs from MSYS's bash shell in Windows 11. The compiler is "gcc.exe (Rev6, Built by MSYS2 project) 13.1.0" but I have also seen this if I use " Clang 16.0.4" with the target, "x86_64-w64-windows-gnu". My video card is as follows:

NVIDIA System Information report created on: 05/28/2023 00:24:52
System name: MARINA

[Display]
Operating System:	Windows 10 Pro, 64-bit
DirectX version:	12.0 
GPU processor:		NVIDIA GeForce RTX 3060 Ti
Driver version:		532.03
Driver Type:		DCH
Direct3D feature level:	12_1
CUDA Cores:		4864 
Resizable BAR		No
Core clock:		1665 MHz 
Memory data rate:	14.00 Gbps
Memory interface:	256-bit 
Memory bandwidth:	448.06 GB/s
Total available graphics memory:	24472 MB
Dedicated video memory:	8192 MB GDDR6
System video memory:	0 MB
Shared system memory:	16280 MB
Video BIOS version:	94.04.46.80.50
IRQ:			Not used
Bus:			PCI Express x16 Gen4
Device Id:		10DE 2489 C9761028
Part Number:		G190 0012

[Components]

nvui.dll		8.17.15.3203		NVIDIA User Experience Driver Component
nvxdplcy.dll		8.17.15.3203		NVIDIA User Experience Driver Component
nvxdbat.dll		8.17.15.3203		NVIDIA User Experience Driver Component
nvxdapix.dll		8.17.15.3203		NVIDIA User Experience Driver Component
NVCPL.DLL		8.17.15.3203		NVIDIA User Experience Driver Component
nvCplUIR.dll		8.1.940.0		NVIDIA Control Panel
nvCplUI.exe		8.1.940.0		NVIDIA Control Panel
nvWSSR.dll		31.0.15.3203		NVIDIA Workstation Server
nvWSS.dll		31.0.15.3203		NVIDIA Workstation Server
nvViTvSR.dll		31.0.15.3203		NVIDIA Video Server
nvViTvS.dll		31.0.15.3203		NVIDIA Video Server
nvLicensingS.dll		6.14.15.3203		NVIDIA Licensing Server
nvDevToolSR.dll		31.0.15.3203		NVIDIA Licensing Server
nvDevToolS.dll		31.0.15.3203		NVIDIA 3D Settings Server
nvDispSR.dll		31.0.15.3203		NVIDIA Display Server
nvDispS.dll		31.0.15.3203		NVIDIA Display Server
PhysX		09.21.0713		NVIDIA PhysX
NVCUDA64.DLL		31.0.15.3203		NVIDIA CUDA 12.1.112 driver
nvGameSR.dll		31.0.15.3203		NVIDIA 3D Settings Server
nvGameS.dll		31.0.15.3203		NVIDIA 3D Settings Server

The funny thing is that the googletest program, Feature-Support-Test.exe, runs without a problem.

Cam't build tests with meson in Linux

When trying to build the tests with meson, I get a problem with d3d12 not found and the tests do NOT build. I'm sure that this is NOT a linux issue because when I build with cmake in Linux, I am able to build and run the tests. Looking at the meson scripts, I have to wonder why we are looking for "d3d12" because I thought we were supposed to create it but I might be missing something.

I'm using Archlinux with wsl2. Here's the build log from my process.

The Meson build system
Version: 1.1.1
Source dir: /home/jpmugaas/arch/directx-headers-git/src/DirectX-Headers
Build dir: /home/jpmugaas/arch/directx-headers-git/src/build
Build type: native build
Project name: DirectX-Headers
Project version: 1.610.0
C++ compiler for the host machine: c++ (gcc 13.1.1 "c++ (GCC) 13.1.1 20230429")
C++ linker for the host machine: c++ ld.bfd 2.40.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library d3d12 found: NO
Library dxcore found: NO
Library gtest found: YES
Library gtest_main found: YES
Build targets in project: 5

DirectX-Headers 1.610.0

  User defined options
    auto_features: enabled
    buildtype    : plain
    libexecdir   : lib
    prefix       : /usr
    sbindir      : bin
    wrap_mode    : nodownload
    b_lto        : false
    b_pie        : true
    build-test   : true

Found ninja-1.11.1 at /usr/sbin/ninja
Core properties:
  Source dir /home/jpmugaas/arch/directx-headers-git/src/DirectX-Headers
  Build dir  /home/jpmugaas/arch/directx-headers-git/src/build

Main project options:

  Core options                   Current Value                    Possible Values                  Description

  --------------                 -------------                    ---------------                  -----------

  auto_features                  enabled                          [enabled, disabled, auto]        Override value of all 'auto' features
  backend                        ninja                            [ninja, vs, vs2010, vs2012,      Backend to use

                                                                   vs2013, vs2015, vs2017, vs2019,

                                                                   vs2022, xcode, none]

  buildtype                      plain                            [plain, debug, debugoptimized,   Build type to use

                                                                   release, minsize, custom]

  cmake_prefix_path              []                               []                               List of additional prefixes for cmake to search
  debug                          false                            [true, false]                    Enable debug symbols and other information
  default_library                shared                           [shared, static, both]           Default library type

  force_fallback_for             []                               []                               Force fallback for those subprojects
  install_umask                  0022                             [preserve, 0000-0777]            Default umask to apply on permissions of installed files
  layout                         mirror                           [mirror, flat]                   Build directory layout
  optimization                   plain                            [plain, 0, g, 1, 2, 3, s]        Optimization level

  pkg_config_path                []                               []                               List of additional paths for pkg-config to search
  prefer_static                  false                            [true, false]                    Whether to try static linking before shared linking
  strip                          false                            [true, false]                    Strip targets on install
  unity                          off                              [on, off, subprojects]           Unity build

  unity_size                     4                                >=2                              Unity block size

  vsenv                          false                            [true, false]                    Activate Visual Studio environment
  warning_level                  1                                [0, 1, 2, 3, everything]         Compiler warning level to use
  werror                         false                            [true, false]                    Treat warnings as errors
  wrap_mode                      nodownload                       [default, nofallback,            Wrap mode

                                                                   nodownload, forcefallback,

                                                                   nopromote]


  Backend options                Current Value                    Possible Values                  Description

  -----------------              -------------                    ---------------                  -----------

  backend_max_links              0                                >=0                              Maximum number of linker processes to run or 0 for no limit

  Base options                   Current Value                    Possible Values                  Description

  --------------                 -------------                    ---------------                  -----------

  b_asneeded                     true                             [true, false]                    Use -Wl,--as-needed when linking
  b_colorout                     always                           [auto, always, never]            Use colored output

  b_coverage                     false                            [true, false]                    Enable coverage tracking.
  b_lto                          false                            [true, false]                    Use link time optimization
  b_lto_threads                  0                                                                 Use multiple threads for Link Time Optimization
  b_lundef                       true                             [true, false]                    Use -Wl,--no-undefined when linking
  b_ndebug                       false                            [true, false, if-release]        Disable asserts

  b_pch                          true                             [true, false]                    Use precompiled headers
  b_pgo                          off                              [off, generate, use]             Use profile guided optimization
  b_pie                          true                             [true, false]                    Build executables as position independent
  b_sanitize                     none                             [none, address, thread,          Code sanitizer to use

                                                                   undefined, memory, leak,

                                                                   address,undefined]

  b_staticpic                    true                             [true, false]                    Build static libraries as position independent

  Compiler options               Current Value                    Possible Values                  Description

  ------------------             -------------                    ---------------                  -----------

  cpp_args                       [-march=x86-64, -mtune=generic,  []                               Extra arguments passed to the cpp compiler
                                  -O2, -pipe, -fno-plt,

                                  -fexceptions,

                                  -Wp,-D_FORTIFY_SOURCE=2,

                                  -Wformat, -Werror=format-

                                  security, -fstack-clash-

                                  protection, -fcf-protection,

                                  -Wp,-D_GLIBCXX_ASSERTIONS]

  cpp_debugstl                   false                            [true, false]                    STL debug mode

  cpp_eh                         default                          [none, default, a, s, sc]        C++ exception handling type.
  cpp_link_args                  [-Wl,-O1,--sort-common,--as-     []                               Extra arguments passed to the cpp linker
                                  needed,-z,relro,-z,now,

                                  -march=x86-64, -mtune=generic,

                                  -O2, -pipe, -fno-plt,

                                  -fexceptions,

                                  -Wp,-D_FORTIFY_SOURCE=2,

                                  -Wformat, -Werror=format-

                                  security, -fstack-clash-

                                  protection, -fcf-protection,

                                  -Wp,-D_GLIBCXX_ASSERTIONS]

  cpp_rtti                       true                             [true, false]                    Enable RTTI

  cpp_std                        c++14                            [none, c++98, c++03, c++11,      C++ language standard to use
                                                                   c++14, c++17, c++1z, c++2a,

                                                                   c++20, gnu++03, gnu++11,

                                                                   gnu++14, gnu++17, gnu++1z,

                                                                   gnu++2a, gnu++20, c++23,

                                                                   gnu++23]


  pkgconfig module options       Current Value                    Possible Values                  Description

  --------------------------     -------------                    ---------------                  -----------

  pkgconfig.relocatable          false                            [true, false]                    Generate pkgconfig files as relocatable

  Directories                    Current Value                    Possible Values                  Description

  -------------                  -------------                    ---------------                  -----------

  bindir                         bin                                                               Executable directory

  datadir                        share                                                             Data file directory

  includedir                     include                                                           Header file directory

  infodir                        share/info                                                        Info page directory

  libdir                         lib                                                               Library directory

  libexecdir                     lib                                                               Library executable directory
  licensedir                                                                                       Licenses directory

  localedir                      share/locale                                                      Locale data directory

  localstatedir                  /var                                                              Localstate data directory
  mandir                         share/man                                                         Manual page directory

  prefix                         /usr                                                              Installation prefix

  sbindir                        bin                                                               System executable directory
  sharedstatedir                 /var/lib                                                          Architecture-independent data directory
  sysconfdir                     /etc                                                              Sysconf data directory

  Testing options                Current Value                    Possible Values                  Description

  -----------------              -------------                    ---------------                  -----------

  errorlogs                      true                             [true, false]                    Whether to print the logs from failing tests
  stdsplit                       true                             [true, false]                    Split stdout and stderr in test logs

  Project options                Current Value                    Possible Values                  Description

  -----------------              -------------                    ---------------                  -----------

  build-test                     true                             [true, false]                    Build the test

==> Starting check()...
[1/11] Compiling C++ object libDirectX-Guids.a.p/src_dxguids.cpp.o
[2/11] Linking static target libDirectX-Guids.a
[3/11] Compiling C++ object libd3dx12-format-properties.a.p/src_d3dx12_property_format_table.cpp.o
[4/11] Linking static target libd3dx12-format-properties.a
[5/11] Compiling C++ object test/DirectX-Headers-Test.p/test.cpp.o
[6/11] Linking target test/DirectX-Headers-Test
FAILED: test/DirectX-Headers-Test
c++  -o test/DirectX-Headers-Test test/DirectX-Headers-Test.p/test.cpp.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -Wl,--start-group libd3dx12-format-properties.a libDirectX-Guids.a -Wl,--end-group
/usr/sbin/ld: test/DirectX-Headers-Test.p/test.cpp.o: in function `main':
test.cpp:(.text.startup+0x41): undefined reference to `DXCoreCreateAdapterFactory'
/usr/sbin/ld: test.cpp:(.text.startup+0xae): undefined reference to `D3D12CreateDevice'
collect2: error: ld returned 1 exit status
[7/11] Compiling C++ object test/DirectX-Headers-Check-Feature-Support-Test.p/feature_check_test.cpp.o
[8/11] Compiling C++ object googletest/Feature-Support-Test.p/feature_support_test.cpp.o
ninja: build stopped: subcommand failed.

D3DX12.H emits a -Wreserved-identifier warning with clang v13

Officially _ followed by a capital letter is reserved by the C++ Standard for implementors of the compiler and library. Clang v13 adds a new warning to detect this case.

d3dx12.h(2466,41): warning: identifier '_Type' is reserved because it starts with '_' followed by a capital letter [-Wreserved-identifier]
    D3D12_PIPELINE_STATE_SUBOBJECT_TYPE _Type;
                                        ^
d3dx12.h(2467,21): warning: identifier '_Inner' is reserved because it starts with '_' followed by a capital letter [-Wreserved-identifier]
    InnerStructType _Inner;

some headers are marked 'All rights reserved'

Hi

I've packaged this for Debian & Ubuntu, but the package got rejected by the archive admins due to some headers being marked with "© All rights reserved". This is considered to override the top-level LICENSE and as such makes the package not-distributable.

The headers are:
include/directx/{dxgiformat.h,d3d12shader.h,dxcore.h,dxgicommon.h,dxcore_interface.h,d3dx12.h}

12_2 feature undeclared

During compilation it points to d3dx12.h with following error:
1>C:\projects\DirectX-Headers\include\directx\d3dx12.h(4822,9): error C2065: 'D3D_FEATURE_LEVEL_12_2': undeclared identifier

Trying to use d3dx12_property_format_table.cpp from Agility SDK not easy

So I just spotted this project and it made me go look at what it had, spotting firstly the DXGI formats to names mapping that I'd part implemented myself, so thought I'd switch.

With the Agility SDK already in use the easiest way to use 'd3dx12_property_format_table.cpp' seems to be to #include it into another CPP file, but then it tries to bring in the .h file without specifying the d3dx12 folder it's located in, the Agility SDK doesn't add that subfolder to the include paths directly so we get a missing header.

So can the CPP include the file with <d3dx12\d3dx12_property_format_table.h> or is there a better way to use this that won't require manual editing of project files when we come to move to a newer Agility SDK?

Thanks

Unused variables in d3dx12_property_format_table.cpp

I see three unused variables:

d3dx12_property_format_table.cpp(261,23): warning : unused variable 'D3DFCS_R10G10B10A2' [-Wunused-const-variable]
d3dx12_property_format_table.cpp(261,23): warning : constexpr DXGI_FORMAT D3DFCS_R10G10B10A2[] =
d3dx12_property_format_table.cpp(261,23): warning :                       ^
d3dx12_property_format_table.cpp(430,23): warning : unused variable 'D3DFCS_B8G8R8A8' [-Wunused-const-variable]
d3dx12_property_format_table.cpp(430,23): warning : constexpr DXGI_FORMAT D3DFCS_B8G8R8A8[] =
d3dx12_property_format_table.cpp(430,23): warning :                       ^
d3dx12_property_format_table.cpp(436,23): warning : unused variable 'D3DFCS_B8G8R8X8' [-Wunused-const-variable]
d3dx12_property_format_table.cpp(436,23): warning : constexpr DXGI_FORMAT D3DFCS_B8G8R8X8[] =
d3dx12_property_format_table.cpp(436,23): warning :      
d3dx12_property_format_table.cpp(436,23): warning : 3 warnings generated.

These cause build errors when certain build warnings are turned on. It would be nice if I didn't have to modify the code (or disable warnings) to build with these warnings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.