Skip to content

Commit 30ac1da

Browse files
authored
Add functions for openVR integration (#931)
* Add functions for openVR integration * Update wiGraphicsDevice_DX12.h * Update wiGraphicsDevice_DX12.cpp * Update wiGraphicsDevice_Vulkan.h * Update wiGraphicsDevice_Vulkan.cpp
1 parent 7b83a1e commit 30ac1da

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

WickedEngine/wiGraphicsDevice_DX12.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7887,7 +7887,14 @@ std::mutex queue_locker;
78877887
PIXSetMarker(commandlist.GetGraphicsCommandList(), 0xFFFF0000, text);
78887888
}
78897889
}
7890-
7890+
ID3D12Resource* GraphicsDevice_DX12::GetTextureInternalResource(const Texture* texture)
7891+
{
7892+
return to_internal(texture)->resource.Get();
7893+
}
7894+
ID3D12CommandQueue* GraphicsDevice_DX12::GetGraphicsCommandQueue()
7895+
{
7896+
return queues[QUEUE_GRAPHICS].queue.Get();
7897+
}
78917898
}
78927899

78937900
#endif // WICKEDENGINE_BUILD_DX12

WickedEngine/wiGraphicsDevice_DX12.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,9 @@ namespace wi::graphics
430430
return GetCommandList(cmd).frame_allocators[GetBufferIndex()];
431431
}
432432

433+
ID3D12Resource* GetTextureInternalResource(const Texture* texture);
434+
ID3D12CommandQueue* GetGraphicsCommandQueue();
435+
433436
struct DescriptorHeapGPU
434437
{
435438
D3D12_DESCRIPTOR_HEAP_DESC heapDesc = {};

WickedEngine/wiGraphicsDevice_Vulkan.cpp

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2435,6 +2435,10 @@ using namespace vulkan_internal;
24352435
{
24362436
instanceExtensions.push_back(VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME);
24372437
}
2438+
else if (strcmp(availableExtension.extensionName, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0)
2439+
{
2440+
instanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
2441+
}
24382442
}
24392443

24402444
instanceExtensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
@@ -9334,7 +9338,30 @@ using namespace vulkan_internal;
93349338
label.color[3] = 1.0f;
93359339
vkCmdInsertDebugUtilsLabelEXT(commandlist.GetCommandBuffer(), &label);
93369340
}
9337-
9341+
VkDevice GraphicsDevice_Vulkan::GetDevice()
9342+
{
9343+
return device;
9344+
}
9345+
VkImage GraphicsDevice_Vulkan::GetTextureInternalResource(const Texture* texture)
9346+
{
9347+
return to_internal(texture)->resource;
9348+
}
9349+
VkPhysicalDevice GraphicsDevice_Vulkan::GetPhysicalDevice()
9350+
{
9351+
return physicalDevice;
9352+
}
9353+
VkInstance GraphicsDevice_Vulkan::GetInstance()
9354+
{
9355+
return instance;
9356+
}
9357+
VkQueue GraphicsDevice_Vulkan::GetGraphicsCommandQueue()
9358+
{
9359+
return queues[QUEUE_GRAPHICS].queue;
9360+
}
9361+
uint32_t GraphicsDevice_Vulkan::GetGraphicsFamilyIndex()
9362+
{
9363+
return graphicsFamily;
9364+
}
93389365
}
93399366

93409367
#endif // WICKEDENGINE_BUILD_VULKAN

WickedEngine/wiGraphicsDevice_Vulkan.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,13 @@ namespace wi::graphics
461461
return GetCommandList(cmd).frame_allocators[GetBufferIndex()];
462462
}
463463

464+
VkDevice GetDevice();
465+
VkImage GetTextureInternalResource(const Texture* texture);
466+
VkPhysicalDevice GetPhysicalDevice();
467+
VkInstance GetInstance();
468+
VkQueue GetGraphicsCommandQueue();
469+
uint32_t GetGraphicsFamilyIndex();
470+
464471
struct AllocationHandler
465472
{
466473
VmaAllocator allocator = VK_NULL_HANDLE;

0 commit comments

Comments
 (0)