diff --git a/src/nvapi/nvapi_d3d12_device.cpp b/src/nvapi/nvapi_d3d12_device.cpp index b757556e..387191c8 100644 --- a/src/nvapi/nvapi_d3d12_device.cpp +++ b/src/nvapi/nvapi_d3d12_device.cpp @@ -128,6 +128,11 @@ namespace dxvk { return cubinDevice != nullptr; } + bool NvapiD3d12Device::IsOpacityMicromapSupported(ID3D12Device* device) { + auto ommDevice = GetOmmDevice(device); + return ommDevice != nullptr; + } + std::optional NvapiD3d12Device::SetCreatePipelineStateOptions(ID3D12Device5* device, const NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS* params) { auto ommDevice = GetOmmDevice(device); if (ommDevice == nullptr) diff --git a/src/nvapi/nvapi_d3d12_device.h b/src/nvapi/nvapi_d3d12_device.h index 808f3bae..bb7a33c1 100644 --- a/src/nvapi/nvapi_d3d12_device.h +++ b/src/nvapi/nvapi_d3d12_device.h @@ -29,6 +29,7 @@ namespace dxvk { static bool CaptureUAVInfo(ID3D12Device* device, NVAPI_UAV_INFO* uavInfo); static bool IsFatbinPTXSupported(ID3D12Device* device); + static bool IsOpacityMicromapSupported(ID3D12Device* device); static std::optional SetCreatePipelineStateOptions(ID3D12Device5* device, const NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS* params); static std::optional CheckDriverMatchingIdentifierEx(ID3D12Device5* device, NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS* params); static std::optional GetRaytracingAccelerationStructurePrebuildInfoEx(ID3D12Device5* device, NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS* params); diff --git a/src/nvapi_d3d12.cpp b/src/nvapi_d3d12.cpp index af09cf7f..ce2d9271 100644 --- a/src/nvapi_d3d12.cpp +++ b/src/nvapi_d3d12.cpp @@ -327,12 +327,16 @@ extern "C" { *(NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAPS*)pData = NVAPI_D3D12_RAYTRACING_THREAD_REORDERING_CAP_NONE; break; - case NVAPI_D3D12_RAYTRACING_CAPS_TYPE_OPACITY_MICROMAP: + case NVAPI_D3D12_RAYTRACING_CAPS_TYPE_OPACITY_MICROMAP: { if (dataSize != sizeof(NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAPS)) return InvalidArgument(n); - *(NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAPS*)pData = NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAP_NONE; + *(NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAPS*)pData = NvapiD3d12Device::IsOpacityMicromapSupported(pDevice) + ? NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAP_STANDARD + : NVAPI_D3D12_RAYTRACING_OPACITY_MICROMAP_CAP_NONE; + break; + } case NVAPI_D3D12_RAYTRACING_CAPS_TYPE_DISPLACEMENT_MICROMAP: if (dataSize != sizeof(NVAPI_D3D12_RAYTRACING_DISPLACEMENT_MICROMAP_CAPS))