Skip to content

Commit

Permalink
nvapi-d3d12: Implement EmitRaytracingOpacityMicromapArrayPostbuildInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Saancreed committed May 19, 2023
1 parent a336e5d commit 3990a6b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/nvapi_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,28 @@ extern "C" {
return NoImplementation(n);
}

NvAPI_Status __cdecl NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo(ID3D12GraphicsCommandList4* pCommandList, const NVAPI_EMIT_RAYTRACING_OPACITY_MICROMAP_ARRAY_POSTBUILD_INFO_PARAMS* pParams) {
constexpr auto n = __func__;
static bool alreadyLoggedOk = false;

if (pCommandList == nullptr || pParams == nullptr)
return InvalidArgument(n);

Com<ID3D12GraphicsCommandListExt1> pCommandListExt;
if (!FAILED(pCommandList->QueryInterface(IID_PPV_ARGS(&pCommandListExt)))) {
auto result = static_cast<NvAPI_Status>(pCommandListExt->EmitRaytracingOpacityMicromapArrayPostbuildInfo(pParams));

if (result == NVAPI_OK) {
return Ok(n, alreadyLoggedOk);
} else {
log::write(str::format(n, ": ", result));
return result;
}
}

return NoImplementation(n);
}

NvAPI_Status __cdecl NvAPI_D3D12_BuildRaytracingAccelerationStructureEx(ID3D12GraphicsCommandList4* pCommandList, const NVAPI_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_EX_PARAMS* pParams) {
constexpr auto n = __func__;
static bool alreadyLoggedOk = false;
Expand Down
1 change: 1 addition & 0 deletions src/nvapi_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ extern "C" {
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D12_BuildRaytracingOpacityMicromapArray)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D12_BuildRaytracingAccelerationStructureEx)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_GetObjectHandleForResource)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_SetResourceHint)
Expand Down

0 comments on commit 3990a6b

Please sign in to comment.