Fix GetNativePtr on Vulkan

This commit is contained in:
Wojciech Figat
2022-12-14 16:16:43 +01:00
parent 79f4dfcaab
commit 63e7fb85ec
4 changed files with 6 additions and 3 deletions

View File

@@ -783,7 +783,7 @@ void GPUContextVulkan::EventEnd()
void* GPUContextVulkan::GetNativePtr() const
{
const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer();
return (void*)cmdBuffer;
return (void*)cmdBuffer->GetHandle();
}
bool GPUContextVulkan::IsDepthBufferBinded()

View File

@@ -1486,7 +1486,10 @@ GPUAdapter* GPUDeviceVulkan::GetAdapter() const
void* GPUDeviceVulkan::GetNativePtr() const
{
return static_cast<void*>(Device);
// Return both Instance and Device as pointer to void*[2]
_nativePtr[0] = (void*)Instance;
_nativePtr[1] = (void*)Device;
return _nativePtr;
}
static int32 GetMaxSampleCount(VkSampleCountFlags counts)

View File

@@ -459,6 +459,7 @@ class GPUDeviceVulkan : public GPUDevice
private:
CriticalSection _fenceLock;
mutable void* _nativePtr[2];
Dictionary<RenderTargetLayoutVulkan, RenderPassVulkan*> _renderPasses;
Dictionary<FramebufferVulkan::Key, FramebufferVulkan*> _framebuffers;

View File

@@ -111,7 +111,6 @@ public:
/// <summary>
/// Gets the Vulkan image handle.
/// </summary>
/// <returns>The image handle.</returns>
FORCE_INLINE VkImage GetHandle() const
{
return _image;