Skip to content

Commit

Permalink
Minor update:
Browse files Browse the repository at this point in the history
- NRI: added clarifications to the headers
- VK: VK headers updated to v1.3.283
  • Loading branch information
dzhdanNV committed May 19, 2024
1 parent f11d4c5 commit 097ece9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "External/vulkan"]
path = External/vulkan
url = https://github.com/KhronosGroup/Vulkan-Headers.git
branch = origin/vulkan-sdk-1.3.280
branch = origin/vulkan-sdk-1.3.283
update = merge
[submodule "External/nvapi"]
path = External/nvapi
Expand Down
1 change: 1 addition & 0 deletions Include/Extensions/NRIStreamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ NRI_STRUCT(StreamerInterface)
NRI_NAME(Result) (NRI_CALL *CopyStreamerUpdateRequests)(NRI_NAME_REF(Streamer) streamer);

// (DEVICE) Copy data to destinations (if any), barriers are externally controlled. Must be called after "CopyStreamerUpdateRequests"
// WARNING: D3D12 can silently promote a resource state to COPY_DESTINATION!
void (NRI_CALL *CmdUploadStreamerUpdateRequests)(NRI_NAME_REF(CommandBuffer) commandBuffer, NRI_NAME_REF(Streamer) streamer);
};

Expand Down
38 changes: 21 additions & 17 deletions Include/NRI.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ NRI_STRUCT(CoreInterface)
NRI_NAME(Result) (NRI_CALL *CreateCommandAllocator)(const NRI_NAME_REF(CommandQueue) commandQueue, NRI_NAME_REF(CommandAllocator*) commandAllocator);
NRI_NAME(Result) (NRI_CALL *CreateCommandBuffer)(NRI_NAME_REF(CommandAllocator) commandAllocator, NRI_NAME_REF(CommandBuffer*) commandBuffer);
NRI_NAME(Result) (NRI_CALL *CreateDescriptorPool)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(DescriptorPoolDesc) descriptorPoolDesc, NRI_NAME_REF(DescriptorPool*) descriptorPool);
NRI_NAME(Result) (NRI_CALL *CreateBuffer)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(BufferDesc) bufferDesc, NRI_NAME_REF(Buffer*) buffer);
NRI_NAME(Result) (NRI_CALL *CreateTexture)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(TextureDesc) textureDesc, NRI_NAME_REF(Texture*) texture);
NRI_NAME(Result) (NRI_CALL *CreateBuffer)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(BufferDesc) bufferDesc, NRI_NAME_REF(Buffer*) buffer); // requires "BindBufferMemory"
NRI_NAME(Result) (NRI_CALL *CreateTexture)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(TextureDesc) textureDesc, NRI_NAME_REF(Texture*) texture); // requires "BindTextureMemory"
NRI_NAME(Result) (NRI_CALL *CreateBufferView)(const NRI_NAME_REF(BufferViewDesc) bufferViewDesc, NRI_NAME_REF(Descriptor*) bufferView);
NRI_NAME(Result) (NRI_CALL *CreateTexture1DView)(const NRI_NAME_REF(Texture1DViewDesc) textureViewDesc, NRI_NAME_REF(Descriptor*) textureView);
NRI_NAME(Result) (NRI_CALL *CreateTexture2DView)(const NRI_NAME_REF(Texture2DViewDesc) textureViewDesc, NRI_NAME_REF(Descriptor*) textureView);
Expand Down Expand Up @@ -137,11 +137,11 @@ NRI_STRUCT(CoreInterface)

// Draw indirect:
// - drawNum = min(drawNum, countBuffer ? countBuffer[countBufferOffset] : INF)
// - CmdDrawIndirect: "buffer" contains "Draw(Base)Desc" commands
// - CmdDrawIndexedIndirect: "buffer" contains "DrawIndexed(Base)Desc" commands
// - "CmdDrawIndirect": "buffer" contains "Draw(Base)Desc" commands
// - "CmdDrawIndexedIndirect": "buffer" contains "DrawIndexed(Base)Desc" commands
// - see "Modified draw command signatures"
void (NRI_CALL *CmdDrawIndirect)(NRI_NAME_REF(CommandBuffer) commandBuffer, const NRI_NAME_REF(Buffer) buffer, uint64_t offset, uint32_t drawNum, uint32_t stride, const NRI_NAME(Buffer)* countBuffer, uint64_t countBufferOffset);
void (NRI_CALL *CmdDrawIndexedIndirect)(NRI_NAME_REF(CommandBuffer) commandBuffer, const NRI_NAME_REF(Buffer) buffer, uint64_t offset, uint32_t drawNum, uint32_t stride, const NRI_NAME(Buffer)* countBuffer, uint64_t countBufferOffset);
void (NRI_CALL *CmdDrawIndexedIndirect)(NRI_NAME_REF(CommandBuffer) commandBuffer, const NRI_NAME_REF(Buffer) buffer, uint64_t offset, uint32_t drawNum, uint32_t stride, const NRI_NAME(Buffer)* countBuffer, uint64_t countBufferOffset);
// }
void (NRI_CALL *CmdEndRendering)(NRI_NAME_REF(CommandBuffer) commandBuffer);

Expand Down Expand Up @@ -196,26 +196,30 @@ NRI_STRUCT(CoreInterface)

// Debug name
void (NRI_CALL *SetDeviceDebugName)(NRI_NAME_REF(Device) device, const char* name);
void (NRI_CALL *SetCommandQueueDebugName)(NRI_NAME_REF(CommandQueue) commandQueue, const char* name);
void (NRI_CALL *SetFenceDebugName)(NRI_NAME_REF(Fence) fence, const char* name);
void (NRI_CALL *SetCommandAllocatorDebugName)(NRI_NAME_REF(CommandAllocator) commandAllocator, const char* name);
void (NRI_CALL *SetDescriptorPoolDebugName)(NRI_NAME_REF(DescriptorPool) descriptorPool, const char* name);
void (NRI_CALL *SetDescriptorDebugName)(NRI_NAME_REF(Descriptor) descriptor, const char* name);
void (NRI_CALL *SetPipelineDebugName)(NRI_NAME_REF(Pipeline) pipeline, const char* name);
void (NRI_CALL *SetCommandBufferDebugName)(NRI_NAME_REF(CommandBuffer) commandBuffer, const char* name);

// Debug name - D3D11/D3D12: skipped if called *before* "Bind[X]Memory"
void (NRI_CALL *SetBufferDebugName)(NRI_NAME_REF(Buffer) buffer, const char* name);
void (NRI_CALL *SetTextureDebugName)(NRI_NAME_REF(Texture) texture, const char* name);
void (NRI_CALL *SetDescriptorDebugName)(NRI_NAME_REF(Descriptor) descriptor, const char* name);

// Debug name - D3D11: NOP
void (NRI_CALL *SetCommandQueueDebugName)(NRI_NAME_REF(CommandQueue) commandQueue, const char* name);
void (NRI_CALL *SetCommandAllocatorDebugName)(NRI_NAME_REF(CommandAllocator) commandAllocator, const char* name);
void (NRI_CALL *SetDescriptorPoolDebugName)(NRI_NAME_REF(DescriptorPool) descriptorPool, const char* name);
void (NRI_CALL *SetPipelineLayoutDebugName)(NRI_NAME_REF(PipelineLayout) pipelineLayout, const char* name);
void (NRI_CALL *SetPipelineDebugName)(NRI_NAME_REF(Pipeline) pipeline, const char* name);
void (NRI_CALL *SetQueryPoolDebugName)(NRI_NAME_REF(QueryPool) queryPool, const char* name);
void (NRI_CALL *SetDescriptorSetDebugName)(NRI_NAME_REF(DescriptorSet) descriptorSet, const char* name);
void (NRI_CALL *SetCommandBufferDebugName)(NRI_NAME_REF(CommandBuffer) commandBuffer, const char* name);
void (NRI_CALL *SetMemoryDebugName)(NRI_NAME_REF(Memory) memory, const char* name);

// Native objects
void* (NRI_CALL *GetDeviceNativeObject)(const NRI_NAME_REF(Device) device); // ID3D11Device*, ID3D12Device* or VkDevice
void* (NRI_CALL *GetCommandBufferNativeObject)(const NRI_NAME_REF(CommandBuffer) commandBuffer); // ID3D11DeviceContext*, ID3D12GraphicsCommandList* or VkCommandBuffer
uint64_t (NRI_CALL *GetBufferNativeObject)(const NRI_NAME_REF(Buffer) buffer); // ID3D11Buffer*, ID3D12Resource* or VkBuffer
uint64_t (NRI_CALL *GetTextureNativeObject)(const NRI_NAME_REF(Texture) texture); // ID3D11Resource*, ID3D12Resource* or VkImage
uint64_t (NRI_CALL *GetDescriptorNativeObject)(const NRI_NAME_REF(Descriptor) descriptor); // ID3D11View*, D3D12_CPU_DESCRIPTOR_HANDLE or VkImageView/VkBufferView
// Native objects D3D11 D3D12 VK
void* (NRI_CALL *GetDeviceNativeObject)(const NRI_NAME_REF(Device) device); // ID3D11Device* ID3D12Device* VkDevice
void* (NRI_CALL *GetCommandBufferNativeObject)(const NRI_NAME_REF(CommandBuffer) commandBuffer); // ID3D11DeviceContext* ID3D12GraphicsCommandList* VkCommandBuffer
uint64_t (NRI_CALL *GetBufferNativeObject)(const NRI_NAME_REF(Buffer) buffer); // ID3D11Buffer* ID3D12Resource* VkBuffer
uint64_t (NRI_CALL *GetTextureNativeObject)(const NRI_NAME_REF(Texture) texture); // ID3D11Resource* ID3D12Resource* VkImage
uint64_t (NRI_CALL *GetDescriptorNativeObject)(const NRI_NAME_REF(Descriptor) descriptor); // ID3D11View* D3D12_CPU_DESCRIPTOR_HANDLE VkImageView/VkBufferView
};

NRI_API NRI_NAME(Result) NRI_CALL nriGetInterface(const NRI_NAME_REF(Device) device, const char* interfaceName, size_t interfaceSize, void* interfacePtr);
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/D3DExt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Ext::~Ext() {

void Ext::InitializeNVExt(const nri::DeviceBase* deviceBase, bool isNVAPILoadedInApp, bool isImported) {
if (GetModuleHandleA("renderdoc.dll") != nullptr) {
REPORT_WARNING(deviceBase, "NVAPI is disabled, because RenderDoc library has been loaded.");
REPORT_WARNING(deviceBase, "NVAPI is disabled, because RenderDoc library has been loaded");
return;
}

Expand Down

0 comments on commit 097ece9

Please sign in to comment.