Skip to content

Commit

Permalink
d3d12: Report OMM as supported if device ext and interface are found
Browse files Browse the repository at this point in the history
  • Loading branch information
Saancreed committed Nov 6, 2024
1 parent 691f3b8 commit 44eb985
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/nvapi/nvapi_d3d12_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ namespace dxvk {
return cubinDevice != nullptr;
}

bool NvapiD3d12Device::IsOpacityMicromapSupported(ID3D12Device* device) {
auto ommDevice = GetOmmDevice(device);
return ommDevice != nullptr;
}

std::optional<NvAPI_Status> NvapiD3d12Device::SetCreatePipelineStateOptions(ID3D12Device5* device, const NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS* params) {
auto ommDevice = GetOmmDevice(device);
if (ommDevice == nullptr)
Expand Down
1 change: 1 addition & 0 deletions src/nvapi/nvapi_d3d12_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<NvAPI_Status> SetCreatePipelineStateOptions(ID3D12Device5* device, const NVAPI_D3D12_SET_CREATE_PIPELINE_STATE_OPTIONS_PARAMS* params);
static std::optional<NvAPI_Status> CheckDriverMatchingIdentifierEx(ID3D12Device5* device, NVAPI_CHECK_DRIVER_MATCHING_IDENTIFIER_EX_PARAMS* params);
static std::optional<NvAPI_Status> GetRaytracingAccelerationStructurePrebuildInfoEx(ID3D12Device5* device, NVAPI_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_EX_PARAMS* params);
Expand Down
8 changes: 6 additions & 2 deletions src/nvapi_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 44eb985

Please sign in to comment.