Skip to content

Fix: include NRIRayTracing.h in NRIWrapperVK.h - #260

Open
MaxFreedomPollard wants to merge 1 commit into
NVIDIA-RTX:mainfrom
MaxFreedomPollard:fix-wrapper-vk-raytracing-include
Open

MaxFreedomPollard wants to merge 1 commit into
NVIDIA-RTX:mainfrom
MaxFreedomPollard:fix-wrapper-vk-raytracing-include

Conversation

@MaxFreedomPollard

Copy link
Copy Markdown

NRIWrapperVK.h does not compile unless NRIRayTracing.h was included before it:

#include "NRI.h"
#include "Extensions/NRIWrapperVK.h"
Include/Extensions/NRIWrapperVK.h:110:9: error: unknown type name 'AccelerationStructureBits'; did you mean 'AccelerationStructure'?
  110 |     Nri(AccelerationStructureBits) flags;

AccelerationStructureVKDesc::flags is an AccelerationStructureBits, which is declared in NRIRayTracing.h. NRIWrapperD3D12.h already includes that header, so this does the same for the VK wrapper. The NriForwardStruct(AccelerationStructure) that stood in for the include is no longer needed. It was also a second typedef of the same name in C whenever both headers were included, which -std=c99 -pedantic warns about.

Checked with clang: the snippet above now compiles as C++17 and as C11 with -Wall -Wextra -Werror, in either include order, and every header in Include/Extensions compiles on its own after NRI.h.

AccelerationStructureVKDesc uses AccelerationStructureBits, which is declared in NRIRayTracing.h, so the header only compiled when NRIRayTracing.h happened to be included first. Include it like NRIWrapperD3D12.h does, and drop the forward declaration that stood in for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant