Skip to content

Commit

Permalink
Bumped API version to 256001 + minor updates to OpenXR
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Dec 16, 2024
1 parent 6d44392 commit b894723
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Graphics/GraphicsEngine/interface/APIInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/// \file
/// Diligent API information

#define DILIGENT_API_VERSION 256000
#define DILIGENT_API_VERSION 256001

#include "../../../Primitives/interface/BasicTypes.h"

Expand Down
10 changes: 9 additions & 1 deletion Graphics/GraphicsEngine/src/EngineFactoryBase.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 Diligent Graphics LLC
* Copyright 2019-2024 Diligent Graphics LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -85,6 +85,14 @@ void VerifyEngineCreateInfo(const EngineCreateInfo& EngineCI, const GraphicsAdap
LOG_ERROR_AND_THROW("Unknown queue priority");
}
}

if (EngineCI.pXRAttribs != nullptr && EngineCI.pXRAttribs->Instance != 0)
{
if (EngineCI.pXRAttribs->GetInstanceProcAddr == nullptr)
{
LOG_ERROR_AND_THROW("pXRAttribs->GetInstanceProcAddr must not be null if pXRAttribs->Instance is not null");
}
}
}

} // namespace Diligent
2 changes: 1 addition & 1 deletion Graphics/GraphicsEngineD3D11/src/EngineFactoryD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void GetOpenXRAdapterRequirements(const OpenXRAttribs& XR, LUID& AdapterL
return;

if (XR.GetInstanceProcAddr == nullptr)
LOG_ERROR_AND_THROW("xrGetInstanceProcAddr must not be null");
LOG_ERROR_AND_THROW("GetInstanceProcAddr must not be null");

XrInstance xrInstance = XR_NULL_HANDLE;
static_assert(sizeof(xrInstance) == sizeof(XR.Instance), "XrInstance size mismatch");
Expand Down
2 changes: 1 addition & 1 deletion Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void GetOpenXRAdapterRequirements(const OpenXRAttribs& XR, LUID& AdapterL
return;

if (XR.GetInstanceProcAddr == nullptr)
LOG_ERROR_AND_THROW("xrGetInstanceProcAddr must not be null");
LOG_ERROR_AND_THROW("GetInstanceProcAddr must not be null");

XrInstance xrInstance = XR_NULL_HANDLE;
static_assert(sizeof(xrInstance) == sizeof(XR.Instance), "XrInstance size mismatch");
Expand Down
2 changes: 1 addition & 1 deletion Graphics/GraphicsEngineOpenGL/include/OpenXR_GLHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static Version GetOpenXRRequiredGLVersion(const OpenXRAttribs* pXR) noexcept(fal
return {};

if (pXR->GetInstanceProcAddr == nullptr)
LOG_ERROR_AND_THROW("xrGetInstanceProcAddr must not be null");
LOG_ERROR_AND_THROW("GetInstanceProcAddr must not be null");

XrInstance xrInstance = XR_NULL_HANDLE;
static_assert(sizeof(xrInstance) == sizeof(pXR->Instance), "XrInstance size mismatch");
Expand Down
3 changes: 2 additions & 1 deletion Graphics/GraphicsTools/src/OpenXRUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void AllocateOpenXRSwapchainImageDataGL(Uint32 ImageCount,
void GetOpenXRSwapchainImageGL(IRenderDevice* pDevice,
const XrSwapchainImageBaseHeader* ImageData,
Uint32 ImageIndex,
const TextureDesc& TexDesc,
ITexture** ppImage);
#endif

Expand Down Expand Up @@ -229,7 +230,7 @@ void GetOpenXRSwapchainImage(IRenderDevice* pDevice,
#if GL_SUPPORTED || GLES_SUPPORTED
case RENDER_DEVICE_TYPE_GL:
case RENDER_DEVICE_TYPE_GLES:
GetOpenXRSwapchainImageGL(pDevice, ImageData, ImageIndex, ppImage);
GetOpenXRSwapchainImageGL(pDevice, ImageData, ImageIndex, TexDesc, ppImage);
break;
#endif

Expand Down
9 changes: 9 additions & 0 deletions ReleaseHistory.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Current progress

* Enabled OpenXR (API256001)
* Added `OpenXRAttribs` struct and `pXRAttribs` member to `EngineCreateInfo` struct
* Added `NativeGLContextAttribsWin32` and `NativeGLContextAttribsAndroid` structs and
`IRenderDeviceGL::GetNativeGLContextAttribs` method
* Added OpenXR utility functions (`GetOpenXRGraphicsBinding`, `DestroyOpenXRDebugUtilsMessenger`,
`AllocateOpenXRSwapchainImageData`, and `GetOpenXRSwapchainImage`

## v.2.5.6

* Implemented WebGPU backend
Expand Down

0 comments on commit b894723

Please sign in to comment.