Repository navigation
DXGI adapter identity, and NVAPI's ray tracing entry points - #346
Merged
Merged
Conversation
…system and revision An adapter reported device ID 0 unless dxgi.customDeviceId named one, whatever its vendor: AMD's by default, NVIDIA's with NVEXT or dxgi.customVendorId. Applications look the vendor and device up in tables of PC GPUs, where 0 is in none, and MetalSharp's DLSS setup (src/nvngx/signing/README.md) has to name NVIDIA's RTX 4080, 2704, for a device at all. The device is now one of the vendor's where the configuration names none: NVIDIA's RTX 4080 (10de:2704), and the other vendors' of its class, AMD's RX 7900 XTX (1002:744c) and Intel's Arc A770 (8086:56a0); Apple's vendor, which has no PCI devices, keeps 0. dxgi.customSubSysId (up to eight hex digits) and dxgi.customRevision (up to two) set the subsystem and revision, which stay 0 without them or when they are not such a number. The options reach the environment through MULLION_CONFIG, as every option does. mullion.conf documents both and the defaults. dxgi_adapter_identity checks GetDesc, GetDesc1 and GetDesc3 in a process for each of ten configurations: the defaults, NVEXT, each vendor, a named device, a subsystem, revision and name, and values that are not numbers of their digits. Without the change it fails eight of the ten cases (device 0 for AMD, NVIDIA and Intel, subsystem and revision 0); with it it passes as every family under validation, three times each.
…builds are answered NvAPI_D3D12_GetRaytracingCaps, NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx and NvAPI_D3D12_BuildRaytracingAccelerationStructureEx were not there, and QueryInterface gave no function for them. Engines that use NVIDIA's ray tracing extensions query the caps before they choose a build path, and build through the Ex functions with NVAPI's geometry descriptions. The caps of every type are its CAP_NONE: no NVIDIA shader extension is lowered, so thread reordering is the no-op the header gives that value, and there are no opacity or displacement micromaps, cluster operations, partitioned top-level structures, spheres or linear swept spheres. A size other than the caps' is INVALID_ARGUMENT, an unknown type too, and a null pointer INVALID_POINTER (nvapi.h). The Ex prebuild information and build are "an extension of" ID3D12Device5's and ID3D12GraphicsCommandList4's: triangle and box geometries, in an array a stride apart or by pointer, and top-level structures are converted to Direct3D's inputs, whose build flags have the same values, and go to the device's and list's own calls, post-build information included. A geometry of micromaps, spheres or linear swept spheres and the build flags of micromaps and data access are NOT_SUPPORTED, as the caps say none of them is there; a count of post-build descriptions without them is INVALID_COMBINATION and another structure version INCOMPATIBLE_STRUCT_VERSION. Instances keep their flags, of which Metal's instances take the four Direct3D defines. nvapi_raytracing builds the ray tracing tests' scene (d3d12_rays.hpp) through NVAPI and traces it with ray queries against the CPU caster, compares the prebuild sizes and the compacted size with Direct3D's, and checks the caps and the refusals. Without the change it fails with no function for the three; with it it passes as every family, three times each.
This was referenced Nov 22, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The adapter's identity, and NVAPI's ray tracing entry points. Split out of #341, with the same commits.
What changes
dxgi.customSubSysIdanddxgi.customRevisionare new.dxgi_adapter_identity: 8 of 10 configurations wrong before.NvAPI_D3D12_GetRaytracingCapsreports nothing beyond D3D12's.NvAPI_D3D12_BuildRaytracingAccelerationStructureExand..._GetRaytracingAccelerationStructurePrebuildInfoExforward plain builds to D3D12's, and refuse micromaps, spheres and their flags withNVAPI_NOT_SUPPORTED.nvapi_raytracingis new; before, the entry points were missing.Evidence
Mac mini, Apple M6, macOS 27.3. MetalSharp Wine 8.0 (arm64 with FEX), copied with
--clone. ARM64EC build with-Denable_nvngx=true -Denable_nvapi=true -Denable_tests=true.tests/run.py --family nativewithdxgi_adapter nvapi: 7 passed, 0 failed.main.dxgi_adapter_identitypassed on every default family with--validate --repeat 2, andnvapi_raytracingpassed there without validation (below).Not run
nvapi_raytracingfails under--validateon every family where ray queries do onmain(Metal's "Invalid load in 'device' or 'constant' address space"). It passes without validation.src/nvapi/nvapi.cppdoes not build onmain(anEnumDisplayMonitorslambda). x86_64 was not built.