Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes to NRI Wrapper, Add external descriptor heap to D3D12 wrapper #77

Merged
merged 1 commit into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Include/Extensions/NRIWrapperD3D11.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ NRI_STRUCT(CommandBufferD3D11Desc)
NRI_STRUCT(BufferD3D11Desc)
{
ID3D11Resource* d3d11Resource;
const NRI_NAME(BufferDesc)* bufferDesc;
};

NRI_STRUCT(TextureD3D11Desc)
{
ID3D11Resource* d3d11Resource;
const NRI_NAME(TextureDesc)* textureDesc;
};

NRI_STRUCT(WrapperD3D11Interface)
Expand Down
13 changes: 12 additions & 1 deletion Include/Extensions/NRIWrapperD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
#include "NRIDeviceCreation.h"

NRI_FORWARD_STRUCT(ID3D12Heap);
NRI_FORWARD_STRUCT(D3D12_HEAP_DESC);
NRI_FORWARD_STRUCT(ID3D12DescriptorHeap);
NRI_FORWARD_STRUCT(ID3D12Device);
NRI_FORWARD_STRUCT(ID3D12Resource);
NRI_FORWARD_STRUCT(ID3D12CommandQueue);
NRI_FORWARD_STRUCT(ID3D12CommandAllocator);
NRI_FORWARD_STRUCT(ID3D12GraphicsCommandList);
NRI_FORWARD_STRUCT(D3D12_HEAP_DESC);

NRI_NAMESPACE_BEGIN

Expand All @@ -36,15 +37,24 @@ NRI_STRUCT(CommandBufferD3D12Desc)
ID3D12CommandAllocator* d3d12CommandAllocator;
};

NRI_STRUCT(DescriptorPoolD3D12Desc)
{
ID3D12DescriptorHeap* d3d12ResourceDescriptorHeap;
ID3D12DescriptorHeap* d3d12SamplerDescriptorHeap;
uint32_t descriptorSetMaxNum;
};

NRI_STRUCT(BufferD3D12Desc)
{
ID3D12Resource* d3d12Resource;
const NRI_NAME(BufferDesc)* bufferDesc;
uint32_t structureStride;
};

NRI_STRUCT(TextureD3D12Desc)
{
ID3D12Resource* d3d12Resource;
const NRI_NAME(TextureDesc)* textureDesc;
};

NRI_STRUCT(MemoryD3D12Desc)
Expand All @@ -63,6 +73,7 @@ NRI_STRUCT(AccelerationStructureD3D12Desc)
NRI_STRUCT(WrapperD3D12Interface)
{
NRI_NAME(Result) (NRI_CALL *CreateCommandBufferD3D12)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(CommandBufferD3D12Desc) commandBufferD3D12Desc, NRI_NAME_REF(CommandBuffer*) commandBuffer);
NRI_NAME(Result) (NRI_CALL *CreateDescriptorPoolD3D12)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(DescriptorPoolD3D12Desc) descriptorPoolD3D12Desc, NRI_NAME_REF(DescriptorPool*) descriptorPool);
NRI_NAME(Result) (NRI_CALL *CreateBufferD3D12)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(BufferD3D12Desc) bufferD3D12Desc, NRI_NAME_REF(Buffer*) buffer);
NRI_NAME(Result) (NRI_CALL *CreateTextureD3D12)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(TextureD3D12Desc) textureD3D12Desc, NRI_NAME_REF(Texture*) texture);
NRI_NAME(Result) (NRI_CALL *CreateMemoryD3D12)(NRI_NAME_REF(Device) device, const NRI_NAME_REF(MemoryD3D12Desc) memoryD3D12Desc, NRI_NAME_REF(Memory*) memory);
Expand Down
1 change: 1 addition & 0 deletions Include/Extensions/NRIWrapperVK.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ NRI_STRUCT(TextureVKDesc)
NRI_STRUCT(MemoryVKDesc)
{
NRIVkDeviceMemory vkDeviceMemory;
void* vkMappedMemory;
uint64_t size;
uint32_t memoryTypeIndex;
};
Expand Down
4 changes: 1 addition & 3 deletions Source/D3D11/BufferD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ Result BufferD3D11::Create(const MemoryD3D11& memory) {
}

Result BufferD3D11::Create(const BufferD3D11Desc& bufferDesc) {
if (!GetBufferDesc(bufferDesc, m_Desc))
return Result::INVALID_ARGUMENT;

ID3D11Buffer* buffer = (ID3D11Buffer*)bufferDesc.d3d11Resource;
m_Buffer = buffer;
m_Desc = *bufferDesc.bufferDesc;

D3D11_BUFFER_DESC desc = {};
buffer->GetDesc(&desc);
Expand Down
10 changes: 7 additions & 3 deletions Source/D3D11/TextureD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ Result TextureD3D11::Create(const MemoryD3D11* memory) {
}

Result TextureD3D11::Create(const TextureD3D11Desc& textureDesc) {
if (!GetTextureDesc(textureDesc, m_Desc))
return Result::INVALID_ARGUMENT;

if (!textureDesc.textureDesc) {
if (!GetTextureDesc(textureDesc, m_Desc))
return Result::INVALID_ARGUMENT;
} else {
m_Desc = *textureDesc.textureDesc;
}
m_Texture = textureDesc.d3d11Resource;
m_Desc = *textureDesc.textureDesc;

return Result::SUCCESS;
}
Expand Down
4 changes: 1 addition & 3 deletions Source/D3D12/BufferD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ Result BufferD3D12::Create(const BufferDesc& bufferDesc) {
}

Result BufferD3D12::Create(const BufferD3D12Desc& bufferDesc) {
if (!GetBufferDesc(bufferDesc, m_Desc))
return Result::INVALID_ARGUMENT;

m_Desc = *bufferDesc.bufferDesc;
m_Buffer = (ID3D12ResourceBest*)bufferDesc.d3d12Resource;

return Result::SUCCESS;
Expand Down
28 changes: 28 additions & 0 deletions Source/D3D12/DescriptorPoolD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,34 @@ Result DescriptorPoolD3D12::Create(const DescriptorPoolDesc& descriptorPoolDesc)
return Result::SUCCESS;
}

Result DescriptorPoolD3D12::Create(const DescriptorPoolD3D12Desc& descriptorPoolDesc) {
static_assert(static_cast<size_t>(DescriptorHeapType::MAX_NUM) == 2, "DescriptorHeapType::MAX_NUM != 2");
static_assert(static_cast<uint32_t>(DescriptorHeapType::RESOURCE) == 0, "DescriptorHeapType::RESOURCE != 0");
static_assert(static_cast<uint32_t>(DescriptorHeapType::SAMPLER) == 1, "DescriptorHeapType::SAMPLER != 1");

const std::array<ID3D12DescriptorHeap*, DescriptorHeapType::MAX_NUM> descriptorHeaps = {
descriptorPoolDesc.d3d12ResourceDescriptorHeap,
descriptorPoolDesc.d3d12SamplerDescriptorHeap
};

for (uint32_t i = 0; i < DescriptorHeapType::MAX_NUM; i++) {
if (descriptorHeaps[i]) {
D3D12_DESCRIPTOR_HEAP_DESC desc = descriptorHeaps[i]->GetDesc();
m_DescriptorHeapDescs[i].descriptorHeap = descriptorHeaps[i];
m_DescriptorHeapDescs[i].descriptorPointerCPU = descriptorHeaps[i]->GetCPUDescriptorHandleForHeapStart().ptr;
m_DescriptorHeapDescs[i].descriptorPointerGPU = descriptorHeaps[i]->GetGPUDescriptorHandleForHeapStart().ptr;
m_DescriptorHeapDescs[i].descriptorSize = m_Device->GetDescriptorHandleIncrementSize(desc.Type);

m_DescriptorHeaps[m_DescriptorHeapNum] = descriptorHeaps[i];
m_DescriptorHeapNum++;
}
}

m_DescriptorSets.resize(descriptorPoolDesc.descriptorSetMaxNum, DescriptorSetD3D12(*this));

return Result::SUCCESS;
}

void DescriptorPoolD3D12::Bind(ID3D12GraphicsCommandList* graphicsCommandList) const {
graphicsCommandList->SetDescriptorHeaps(m_DescriptorHeapNum, m_DescriptorHeaps.data());
}
Expand Down
2 changes: 2 additions & 0 deletions Source/D3D12/DescriptorPoolD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ struct DescriptorPoolD3D12 {
}

Result Create(const DescriptorPoolDesc& descriptorPoolDesc);
Result Create(const DescriptorPoolD3D12Desc& descriptorPoolDesc);

void Bind(ID3D12GraphicsCommandList* graphicsCommandList) const;
uint32_t AllocateDescriptors(DescriptorHeapType descriptorHeapType, uint32_t descriptorNum);
DescriptorPointerCPU GetDescriptorPointerCPU(DescriptorHeapType descriptorHeapType, uint32_t offset) const;
Expand Down
4 changes: 4 additions & 0 deletions Source/D3D12/DeviceD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,10 @@ inline Result DeviceD3D12::CreateCommandBuffer(const CommandBufferD3D12Desc& com
return CreateImplementation<CommandBufferD3D12>(commandBuffer, commandBufferDesc);
}

inline Result DeviceD3D12::CreateDescriptorPool(const DescriptorPoolD3D12Desc& descriptorPoolD3D12Desc, DescriptorPool*& descriptorPool) {
return CreateImplementation<DescriptorPoolD3D12>(descriptorPool, descriptorPoolD3D12Desc);
}

Result DeviceD3D12::CreateBuffer(const BufferD3D12Desc& bufferDesc, Buffer*& buffer) { // TODO: not inline
return CreateImplementation<BufferD3D12>(buffer, bufferDesc);
}
Expand Down
1 change: 1 addition & 0 deletions Source/D3D12/DeviceD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ struct DeviceD3D12 final : public DeviceBase {
Result CreateFence(uint64_t initialValue, Fence*& fence);
Result CreateQueryPool(const QueryPoolDesc& queryPoolDesc, QueryPool*& queryPool);
Result CreateCommandBuffer(const CommandBufferD3D12Desc& commandBufferDesc, CommandBuffer*& commandBuffer);
Result CreateDescriptorPool(const DescriptorPoolD3D12Desc& descriptorPoolD3D12Desc, DescriptorPool*& descriptorPool);
Result CreateBuffer(const BufferD3D12Desc& bufferDesc, Buffer*& buffer);
Result CreateTexture(const TextureD3D12Desc& textureDesc, Texture*& texture);
Result CreateMemory(const MemoryD3D12Desc& memoryDesc, Memory*& memory);
Expand Down
5 changes: 5 additions & 0 deletions Source/D3D12/DeviceD3D12.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ static Result NRI_CALL CreateCommandBuffer(Device& device, const CommandBufferD3
return ((DeviceD3D12&)device).CreateCommandBuffer(commandBufferD3D12Desc, commandBuffer);
}

static Result NRI_CALL CreateDescriptorPool(Device& device, const DescriptorPoolD3D12Desc& descriptorPoolD3D12Desc, DescriptorPool*& descriptorPool) {
return ((DeviceD3D12&)device).CreateDescriptorPool(descriptorPoolD3D12Desc, descriptorPool);
}

static Result NRI_CALL CreateBuffer(Device& device, const BufferD3D12Desc& bufferD3D12Desc, Buffer*& buffer) {
return ((DeviceD3D12&)device).CreateBuffer(bufferD3D12Desc, buffer);
}
Expand All @@ -303,6 +307,7 @@ static Result NRI_CALL CreateAccelerationStructure(Device& device, const Acceler
Result DeviceD3D12::FillFunctionTable(WrapperD3D12Interface& wrapperD3D12Interface) const {
wrapperD3D12Interface = {};
wrapperD3D12Interface.CreateCommandBufferD3D12 = ::CreateCommandBuffer;
wrapperD3D12Interface.CreateDescriptorPoolD3D12 = ::CreateDescriptorPool;
wrapperD3D12Interface.CreateBufferD3D12 = ::CreateBuffer;
wrapperD3D12Interface.CreateTextureD3D12 = ::CreateTexture;
wrapperD3D12Interface.CreateMemoryD3D12 = ::CreateMemory;
Expand Down
22 changes: 0 additions & 22 deletions Source/D3D12/SharedD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,28 +394,6 @@ bool nri::GetTextureDesc(const TextureD3D12Desc& textureD3D12Desc, TextureDesc&
return true;
}

bool nri::GetBufferDesc(const BufferD3D12Desc& bufferD3D12Desc, BufferDesc& bufferDesc) {
bufferDesc = {};

ID3D12Resource* resource = bufferD3D12Desc.d3d12Resource;
if (!resource)
return false;

D3D12_RESOURCE_DESC desc = resource->GetDesc();
if (desc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER)
return false;

bufferDesc.size = desc.Width;
bufferDesc.structureStride = bufferD3D12Desc.structureStride;

if (!(desc.Flags & D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE))
bufferDesc.usageMask |= BufferUsageBits::SHADER_RESOURCE;
if (desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS)
bufferDesc.usageMask |= BufferUsageBits::SHADER_RESOURCE_STORAGE;

return true;
}

D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE nri::GetAccelerationStructureType(AccelerationStructureType accelerationStructureType) {
static_assert(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL == (uint32_t)AccelerationStructureType::TOP_LEVEL, "Unsupported AccelerationStructureType.");
static_assert(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL == (uint32_t)AccelerationStructureType::BOTTOM_LEVEL, "Unsupported AccelerationStructureType.");
Expand Down
1 change: 0 additions & 1 deletion Source/D3D12/SharedD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ bool RequiresDedicatedAllocation(MemoryType memoryType);
void ConvertGeometryDescs(D3D12_RAYTRACING_GEOMETRY_DESC* geometryDescs, const GeometryObject* geometryObjects, uint32_t geometryObjectNum);
void ConvertRects(D3D12_RECT* rectsD3D12, const Rect* rects, uint32_t rectNum);
bool GetTextureDesc(const TextureD3D12Desc& textureD3D12Desc, TextureDesc& textureDesc);
bool GetBufferDesc(const BufferD3D12Desc& bufferD3D12Desc, BufferDesc& bufferDesc);
uint64_t GetMemorySizeD3D12(const MemoryD3D12Desc& memoryD3D12Desc);

D3D12_FILTER GetFilterIsotropic(Filter mip, Filter magnification, Filter minification, FilterExt filterExt, bool useComparison);
Expand Down
12 changes: 8 additions & 4 deletions Source/D3D12/TextureD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ Result TextureD3D12::Create(const TextureDesc& textureDesc) {
}

Result TextureD3D12::Create(const TextureD3D12Desc& textureDesc) {
if (!GetTextureDesc(textureDesc, m_Desc))
return Result::INVALID_ARGUMENT;
if (!textureDesc.textureDesc) {
if (!GetTextureDesc(textureDesc, m_Desc))
return Result::INVALID_ARGUMENT;
} else {
m_Desc = *textureDesc.textureDesc;
}

m_Texture = (ID3D12ResourceBest*)textureDesc.d3d12Resource;

Expand All @@ -56,8 +60,8 @@ Result TextureD3D12::BindMemory(const MemoryD3D12* memory, uint64_t offset) {
DXGI_FORMAT* castableFormats = nullptr; // TODO: add castable formats, see options12.RelaxedFormatCastingSupported

if (memory->RequiresDedicatedAllocation()) {
HRESULT hr = m_Device->CreateCommittedResource3(&heapDesc.Properties, heapDesc.Flags, &desc1, initialLayout,
isRenderableSurface ? &clearValue : nullptr, nullptr, castableFormatNum, castableFormats, IID_PPV_ARGS(&m_Texture));
HRESULT hr = m_Device->CreateCommittedResource3(&heapDesc.Properties, heapDesc.Flags, &desc1, initialLayout, isRenderableSurface ? &clearValue : nullptr, nullptr,
castableFormatNum, castableFormats, IID_PPV_ARGS(&m_Texture));
RETURN_ON_BAD_HRESULT(&m_Device, hr, "ID3D12Device10::CreateCommittedResource3()");
} else {
HRESULT hr = m_Device->CreatePlacedResource2(
Expand Down
3 changes: 2 additions & 1 deletion Source/VK/MemoryVK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ Result MemoryVK::Create(const MemoryVKDesc& memoryDesc) {
RETURN_ON_FAILURE(&m_Device, found, Result::INVALID_ARGUMENT, "Can't find memory by index");

m_Handle = (VkDeviceMemory)memoryDesc.vkDeviceMemory;
m_MappedMemory = (uint8_t*)memoryDesc.vkMappedMemory;
const MemoryTypeInfo& memoryTypeInfo = unpack.info;

const auto& vk = m_Device.GetDispatchTable();
if (IsHostVisibleMemory(memoryTypeInfo.memoryLocation)) {
if (!m_MappedMemory && IsHostVisibleMemory(memoryTypeInfo.memoryLocation)) {
VkResult result = vk.MapMemory(m_Device, m_Handle, 0, memoryDesc.size, 0, (void**)&m_MappedMemory);
RETURN_ON_FAILURE(&m_Device, result == VK_SUCCESS, GetReturnCode(result), "vkMapMemory returned %d", (int32_t)result);
}
Expand Down
23 changes: 21 additions & 2 deletions Source/Validation/DeviceVal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ Result DeviceVal::CreateCommandBufferD3D11(const CommandBufferD3D11Desc& command

Result DeviceVal::CreateBufferD3D11(const BufferD3D11Desc& bufferDesc, Buffer*& buffer) {
RETURN_ON_FAILURE(this, bufferDesc.d3d11Resource != nullptr, Result::INVALID_ARGUMENT, "CreateBufferD3D11: 'bufferDesc.d3d11Resource' is NULL");
RETURN_ON_FAILURE(this, bufferDesc.bufferDesc != nullptr, Result::INVALID_ARGUMENT, "CreateBufferD3D11: 'bufferDesc.bufferDesc' is NULL");

Buffer* bufferImpl = nullptr;
const Result result = m_WrapperD3D11API.CreateBufferD3D11(m_Device, bufferDesc, bufferImpl);
Expand Down Expand Up @@ -997,8 +998,26 @@ Result DeviceVal::CreateCommandBufferD3D12(const CommandBufferD3D12Desc& command
return result;
}

Result DeviceVal::CreateDescriptorPoolD3D12(const DescriptorPoolD3D12Desc& descriptorPoolD3D12Desc, DescriptorPool*& descriptorPool) {
RETURN_ON_FAILURE(this, descriptorPoolD3D12Desc.d3d12ResourceDescriptorHeap == nullptr && descriptorPoolD3D12Desc.d3d12ResourceDescriptorHeap == nullptr,
Result::INVALID_ARGUMENT,
"CreateDescriptorPoolD3D12: 'descriptorPoolD3D12Desc.d3d12ResourceDescriptorHeap' and 'descriptorPoolD3D12Desc.d3d12ResourceDescriptorHeap' are NULL");

DescriptorPool* descriptorPoolImpl = nullptr;
const Result result = m_WrapperD3D12API.CreateDescriptorPoolD3D12(m_Device, descriptorPoolD3D12Desc, descriptorPoolImpl);

if (result == Result::SUCCESS) {
RETURN_ON_FAILURE(this, descriptorPoolImpl != nullptr, Result::FAILURE, "CreateDescriptorPoolD3D12: 'impl' is NULL");

descriptorPool = (DescriptorPool*)Allocate<DescriptorPoolVal>(GetStdAllocator(), *this, descriptorPoolImpl, descriptorPoolD3D12Desc.descriptorSetMaxNum);
}

return result;
}

Result DeviceVal::CreateBufferD3D12(const BufferD3D12Desc& bufferDesc, Buffer*& buffer) {
RETURN_ON_FAILURE(this, bufferDesc.d3d12Resource != nullptr, Result::INVALID_ARGUMENT, "CreateBufferD3D12: 'bufferDesc.d3d12Resource' is NULL");
RETURN_ON_FAILURE(this, bufferDesc.bufferDesc != nullptr, Result::INVALID_ARGUMENT, "CreateBufferD3D12: 'bufferDesc.bufferDesc' is NULL");

Buffer* bufferImpl = nullptr;
const Result result = m_WrapperD3D12API.CreateBufferD3D12(m_Device, bufferDesc, bufferImpl);
Expand Down Expand Up @@ -1028,8 +1047,8 @@ Result DeviceVal::CreateTextureD3D12(const TextureD3D12Desc& textureDesc, Textur
}

Result DeviceVal::CreateMemoryD3D12(const MemoryD3D12Desc& memoryDesc, Memory*& memory) {
RETURN_ON_FAILURE(
this, (memoryDesc.d3d12Heap != nullptr || memoryDesc.d3d12HeapDesc != nullptr), Result::INVALID_ARGUMENT, "CreateMemoryD3D12: 'memoryDesc.d3d12Heap' is NULL");
RETURN_ON_FAILURE(this, (memoryDesc.d3d12Heap != nullptr || memoryDesc.d3d12HeapDesc != nullptr), Result::INVALID_ARGUMENT,
"CreateMemoryD3D12: 'memoryDesc.d3d12Heap' or 'memoryDesc.d3d12HeapDesc' is NULL");

Memory* memoryImpl = nullptr;
const Result result = m_WrapperD3D12API.CreateMemoryD3D12(m_Device, memoryDesc, memoryImpl);
Expand Down
1 change: 1 addition & 0 deletions Source/Validation/DeviceVal.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct DeviceVal final : public DeviceBase {
Result CreateTextureD3D11(const TextureD3D11Desc& textureDesc, Texture*& texture);

Result CreateCommandBufferD3D12(const CommandBufferD3D12Desc& commandBufferDesc, CommandBuffer*& commandBuffer);
Result CreateDescriptorPoolD3D12(const DescriptorPoolD3D12Desc& descriptorPoolD3D12Desc, DescriptorPool*& descriptorPool);
Result CreateBufferD3D12(const BufferD3D12Desc& bufferDesc, Buffer*& buffer);
Result CreateTextureD3D12(const TextureD3D12Desc& textureDesc, Texture*& texture);
Result CreateMemoryD3D12(const MemoryD3D12Desc& memoryDesc, Memory*& memory);
Expand Down
5 changes: 5 additions & 0 deletions Source/Validation/DeviceVal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ static Result NRI_CALL CreateCommandBufferD3D12(Device& device, const CommandBuf
return ((DeviceVal&)device).CreateCommandBufferD3D12(commandBufferD3D12Desc, commandBuffer);
}

static Result NRI_CALL CreateDescriptorPoolD3D12(Device& device, const DescriptorPoolD3D12Desc& descriptorPoolD3D12Desc, DescriptorPool*& descriptorPool) {
return ((DeviceVal&)device).CreateDescriptorPoolD3D12(descriptorPoolD3D12Desc, descriptorPool);
}

static Result NRI_CALL CreateBufferD3D12(Device& device, const BufferD3D12Desc& bufferD3D12Desc, Buffer*& buffer) {
return ((DeviceVal&)device).CreateBufferD3D12(bufferD3D12Desc, buffer);
}
Expand All @@ -341,6 +345,7 @@ Result DeviceVal::FillFunctionTable(WrapperD3D12Interface& wrapperD3D12Interface
return Result::UNSUPPORTED;

wrapperD3D12Interface.CreateCommandBufferD3D12 = ::CreateCommandBufferD3D12;
wrapperD3D12Interface.CreateDescriptorPoolD3D12 = ::CreateDescriptorPoolD3D12;
wrapperD3D12Interface.CreateBufferD3D12 = ::CreateBufferD3D12;
wrapperD3D12Interface.CreateTextureD3D12 = ::CreateTextureD3D12;
wrapperD3D12Interface.CreateMemoryD3D12 = ::CreateMemoryD3D12;
Expand Down
Loading