Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Rendering::Headset Class Reference

Owns the OpenXR session, XR swapchain, eye transforms, and per-frame XR submission state. More...

#include <Headset.h>

Collaboration diagram for Engine::Rendering::Headset:

Classes

struct  Eye
 Cached matrices for one eye. More...
struct  ImageBuffer
 Engine-owned Vulkan image, memory, and view tuple. More...
struct  WaitFrameResult
 Result from waitForXrFrame() indicating how the main loop should continue. More...

Public Types

enum class  BeginFrameResult {
  Error ,
  RenderFully ,
  SkipRender ,
  SkipFully ,
  ComputeOnly
}
 Frame-begin outcome returned by XR frame lifecycle functions. More...

Public Member Functions

 Headset (const Core::ApplicationContext *context=nullptr)
 Creates OpenXR session, reference space, render pass, images, swapchain, and eye state.
 ~Headset ()
 Does not release GPU or OpenXR resources; call cleanup() before destruction.
void cleanup ()
 Releases owned Vulkan image buffers, swapchain render targets, render pass, reference space, and session.
void updateViewMatrix ()
 Updates cached eye view and projection matrices from the latest OpenXR eye poses.
WaitFrameResult waitForXrFrame (Rendering::Renderer *renderer)
 First part of frame setup: calls xrWaitFrame. Can be called before previous xrEndFrame completes. Polls events and waits for the next frame to be ready.
BeginFrameResult beginXrFrameAfterWait (uint32_t &swapchainImageIndex)
 Second part of frame setup: calls xrBeginFrame, acquires swapchain image. MUST be called after previous frame's xrEndFrame has completed.
BeginFrameResult beginXrFrame (uint32_t &swapchainImageIndex, Renderer *renderer)
 Runs waitForXrFrame() and beginXrFrameAfterWait() as a single legacy call.
void endXrFrame ()
 Releases the acquired swapchain image and submits projection layers to xrEndFrame().
void endXrFrameNoRender ()
 Ends an OpenXR frame without releasing a swapchain image or submitting projection layers.
void beginXrSession () const
 Begins the OpenXR session for the configured primary view type.
void setSessionStateCallback (std::function< void(XrSessionState)> callback)
 Registers a callback invoked whenever the OpenXR session state changes.
void setInteractionProfileChangedCallback (std::function< void()> callback)
 Registers a callback invoked when the runtime reports an interaction profile change.
VkImage getSwapchainImage (size_t swapchainImageIndex) const
 Returns a borrowed OpenXR swapchain image handle.
std::vector< RenderTarget > getSwapchainRenderTargets ()
 Returns a copy of the swapchain render-target list.
void endXrSession () const
 Ends the active OpenXR session.
void requestExitSession ()
 Requests the XR runtime to exit the session gracefully. This should be called when the application wants to shut down (e.g., window close). The XR runtime will transition through proper states before exiting.
uint32_t getEyeCount () const
 Returns the number of configured XR views.
VkExtent2D getEyeResolution (size_t eyeIndex) const
 Returns the recommended render resolution for an eye.
VkRenderPass getRenderPass () const
 Returns the legacy multiview render pass.
glm::mat4 getEyeViewMatrix (size_t eyeIndex) const
 Returns the world-adjusted view matrix for an eye.
glm::mat4 getRawEyeViewMatrix (size_t eyeIndex) const
 Returns the raw OpenXR view matrix for an eye.
void setPlayerPosition (const glm::vec3 &position)
 Sets the player/play-space world position.
glm::vec3 getPlayerPosition () const
 Returns the current player/play-space world position.
void setPlayerRotation (const glm::quat &rotation)
 Setter for the player/play-space rotation applied around the world origin.
glm::quat getPlayerRotation () const
 Returns the player/play-space rotation.
glm::vec3 transformPlaySpacePosition (const glm::vec3 &position) const
 Converts an OpenXR play-space position into world space.
glm::quat transformPlaySpaceOrientation (const glm::quat &orientation) const
 Converts an OpenXR play-space orientation into world space.
glm::vec3 getHeadsetLocalPosition () const
 Gets the headset's local position relative to the play space origin.
glm::quat getHeadsetLocalOrientation () const
 Gets the headset's local orientation relative to the play space.
glm::vec3 getHeadsetWorldPosition () const
 Gets the headset position after player position/rotation are applied.
glm::quat getHeadsetWorldOrientation () const
 Gets the headset orientation after player rotation is applied.
glm::mat4 getEyeProjectionMatrix (size_t eyeIndex) const
 Gets the projection matrix for an eye.
glm::mat4 getViewProjectionMatrix (size_t eyeIndex) const
 Gets the projection-view matrix for an eye.
XrSpace getReferenceSpace () const
 Returns the OpenXR reference space used for view location and layer submission.
XrSession getSession () const
 Returns the OpenXR session handle.
bool getIsExitRequested () const
 Returns whether OpenXR requested application exit or session shutdown.
XrFrameState getXrFrameState () const
 Returns the latest OpenXR frame state.
const RenderTarget * getRenderTarget (size_t swapchainImageIndex) const
 Returns the render target for a swapchain image.
VkImage getDepthBufferImage () const
 Returns the depth image used by headset rendering.
VkImageView getDepthBufferView () const
 Returns the depth image view used by headset rendering.
VkImage getColorBufferImage () const
 Returns the multisampled color image used by headset rendering.
VkImageView getColorBufferView () const
 Returns the multisampled color image view used by headset rendering.
VkImage getResolveBufferImage () const
 Returns the single-sample resolve image used before XR swapchain tonemapping.
VkImageView getResolveBufferView () const
 Returns the single-sample resolve image view used before XR swapchain tonemapping.
VkFormat getColorFormat () const
 Returns the format used by XR swapchain color attachment views.
VkFormat getSceneColorFormat () const
 Returns the HDR scene color format used for engine-owned color and resolve buffers.

Private Attributes

XrViewState xrViewState = {}
 Validity flags for the latest xrLocateViews() result.
XrFrameState xrFrameState = {}
 State returned by the latest xrWaitFrame() call.
XrSessionState xrSessionState = XR_SESSION_STATE_UNKNOWN
 Current OpenXR session lifecycle state.
bool isExistRequested = false
 True once OpenXR or the application requests session exit.
const Core::ApplicationContext * context = nullptr
 Application context that owns Vulkan and OpenXR handles.
VkRenderPass vkRenderPass = VK_NULL_HANDLE
 Legacy multiview render pass used by framebuffer rendering.
XrSession xrSession = XR_NULL_HANDLE
 OpenXR session created for the application context's system id.
XrSpace xrReferenceSpace = XR_NULL_HANDLE
 Reference space used to locate views and submit layers.
XrReferenceSpaceType xrReferenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL
 Configured reference-space type.
uint32_t eyeCount = 0u
 Number of views reported by the OpenXR runtime.
std::vector< XrViewConfigurationView > eyeImageInfos
 Runtime-recommended image settings per eye.
std::vector< XrView > eyePoses
 Eye poses and fields of view from the latest xrLocateViews() call.
ImageBuffer colorBuffer
 Multisampled HDR color attachment for multiview rendering.
ImageBuffer depthBuffer
 Multisampled depth attachment, also sampled by Hi-Z generation.
ImageBuffer resolveBuffer
 Single-sample HDR resolve target before tonemapping to the XR swapchain.
XrSwapchain xrSwapchain = nullptr
 OpenXR color swapchain submitted to the runtime.
std::unique_ptr< NamedThreadPool > xrWaitThreadPool_
 Thread pool used to timeout xrWaitFrame() safely.
std::function< void(XrSessionState)> sessionStateCallback_
 Invoked on OpenXR session state changes.
std::function< void()> interactionProfileChangedCallback_
 Invoked on OpenXR interaction profile changes.
std::vector< RenderTarget > swapchainRenderTargets
 Render target wrappers for OpenXR swapchain images.
std::vector< XrCompositionLayerProjectionView > eyeRenderInfos
 Projection-layer views submitted to xrEndFrame().
std::vector< Eye > eyes = {}
 Cached eye matrices indexed by zero-based eye index.
XrTime lastUpdateTime = 0
 Reserved timestamp for future pose update tracking.
glm::vec3 playerPosition_ { 0.0f, 0.0f, 0.0f }
 World-space player/play-space offset.
glm::quat playerRotation_ { 1.0f, 0.0f, 0.0f, 0.0f }
 World-space player/play-space rotation.
VkFormat swapchainFormat_ = VK_FORMAT_R8G8B8A8_UNORM
 VkFormat used when creating the OpenXR swapchain.
VkFormat colorFormat_ = VK_FORMAT_R8G8B8A8_UNORM
 VkFormat used for OpenXR swapchain image views.
VkFormat sceneColorFormat_ = VK_FORMAT_R16G16B16A16_SFLOAT
 HDR format for engine-owned scene buffers.
bool useMutableSwapchainFormat_ = false
 True when swapchain views use a different color format.

Detailed Description

Owns the OpenXR session, XR swapchain, eye transforms, and per-frame XR submission state.

Headset creates the OpenXR session from an initialized ApplicationContext, allocates multiview color, depth, resolve, and swapchain views, and exposes frame lifecycle calls used by the renderer.

Definition at line 54 of file Headset.h.

Member Enumeration Documentation

◆ BeginFrameResult

Frame-begin outcome returned by XR frame lifecycle functions.

Enumerator
Error 

An OpenXR error occurred.

RenderFully 

Render this frame normally.

SkipRender 

Skip rendering but still end the OpenXR frame.

SkipFully 

Skip processing the frame without calling xrEndFrame().

ComputeOnly 

Run compute work but skip XR and mesh rendering.

Definition at line 76 of file Headset.h.

Constructor & Destructor Documentation

◆ Headset()

Engine::Rendering::Headset::Headset ( const Core::ApplicationContext * context = nullptr)

Creates OpenXR session, reference space, render pass, images, swapchain, and eye state.

Parameters
contextInitialized application context with Vulkan and OpenXR handles.

References context.

◆ ~Headset()

Engine::Rendering::Headset::~Headset ( )

Does not release GPU or OpenXR resources; call cleanup() before destruction.

Member Function Documentation

◆ beginXrFrame()

BeginFrameResult Engine::Rendering::Headset::beginXrFrame ( uint32_t & swapchainImageIndex,
Renderer * renderer )

Runs waitForXrFrame() and beginXrFrameAfterWait() as a single legacy call.

Parameters
swapchainImageIndexReceives the acquired swapchain image index when rendering proceeds.
rendererRenderer used for state-transition handling.
Returns
Frame-begin result describing whether rendering should proceed.

◆ beginXrFrameAfterWait()

BeginFrameResult Engine::Rendering::Headset::beginXrFrameAfterWait ( uint32_t & swapchainImageIndex)

Second part of frame setup: calls xrBeginFrame, acquires swapchain image. MUST be called after previous frame's xrEndFrame has completed.

Parameters
swapchainImageIndexOutput parameter for the acquired swapchain image index
Returns
BeginFrameResult indicating rendering status

◆ beginXrSession()

void Engine::Rendering::Headset::beginXrSession ( ) const

Begins the OpenXR session for the configured primary view type.

◆ cleanup()

void Engine::Rendering::Headset::cleanup ( )

Releases owned Vulkan image buffers, swapchain render targets, render pass, reference space, and session.

◆ endXrFrame()

void Engine::Rendering::Headset::endXrFrame ( )

Releases the acquired swapchain image and submits projection layers to xrEndFrame().

◆ endXrFrameNoRender()

void Engine::Rendering::Headset::endXrFrameNoRender ( )

Ends an OpenXR frame without releasing a swapchain image or submitting projection layers.

◆ endXrSession()

void Engine::Rendering::Headset::endXrSession ( ) const

Ends the active OpenXR session.

◆ getColorBufferImage()

VkImage Engine::Rendering::Headset::getColorBufferImage ( ) const
inlinenodiscard

Returns the multisampled color image used by headset rendering.

Returns
Multiview color image handle.

Definition at line 421 of file Headset.h.

References colorBuffer.

◆ getColorBufferView()

VkImageView Engine::Rendering::Headset::getColorBufferView ( ) const
inlinenodiscard

Returns the multisampled color image view used by headset rendering.

Returns
Multiview color image view handle.

Definition at line 430 of file Headset.h.

References colorBuffer.

◆ getColorFormat()

VkFormat Engine::Rendering::Headset::getColorFormat ( ) const
inlinenodiscard

Returns the format used by XR swapchain color attachment views.

Returns
Vulkan color view format for the XR swapchain path.

Definition at line 457 of file Headset.h.

References colorFormat_.

◆ getDepthBufferImage()

VkImage Engine::Rendering::Headset::getDepthBufferImage ( ) const
inlinenodiscard

Returns the depth image used by headset rendering.

Returns
Multiview depth image handle.

Definition at line 403 of file Headset.h.

References depthBuffer.

◆ getDepthBufferView()

VkImageView Engine::Rendering::Headset::getDepthBufferView ( ) const
inlinenodiscard

Returns the depth image view used by headset rendering.

Returns
Multiview depth image view handle.

Definition at line 412 of file Headset.h.

References depthBuffer.

◆ getEyeCount()

uint32_t Engine::Rendering::Headset::getEyeCount ( ) const
nodiscard

Returns the number of configured XR views.

Returns
Eye/view count reported by the OpenXR runtime.

◆ getEyeProjectionMatrix()

glm::mat4 Engine::Rendering::Headset::getEyeProjectionMatrix ( size_t eyeIndex) const
nodiscard

Gets the projection matrix for an eye.

Parameters
eyeIndexZero-based eye index.
Returns
Projection matrix built from the latest OpenXR field of view.

◆ getEyeResolution()

VkExtent2D Engine::Rendering::Headset::getEyeResolution ( size_t eyeIndex) const
nodiscard

Returns the recommended render resolution for an eye.

Parameters
eyeIndexZero-based eye index; 0 is the left eye for stereo views.
Returns
Recommended swapchain extent for the requested eye.

◆ getEyeViewMatrix()

glm::mat4 Engine::Rendering::Headset::getEyeViewMatrix ( size_t eyeIndex) const
nodiscard

Returns the world-adjusted view matrix for an eye.

Parameters
eyeIndexZero-based eye index.
Returns
Eye view matrix with player position and rotation applied.

◆ getHeadsetLocalOrientation()

glm::quat Engine::Rendering::Headset::getHeadsetLocalOrientation ( ) const
nodiscard

Gets the headset's local orientation relative to the play space.

Returns
Left-eye orientation, or identity when no eye poses are available.

◆ getHeadsetLocalPosition()

glm::vec3 Engine::Rendering::Headset::getHeadsetLocalPosition ( ) const
nodiscard

Gets the headset's local position relative to the play space origin.

Returns
Average of left and right eye positions, or zero when stereo eye poses are unavailable.

◆ getHeadsetWorldOrientation()

glm::quat Engine::Rendering::Headset::getHeadsetWorldOrientation ( ) const
nodiscard

Gets the headset orientation after player rotation is applied.

Returns
Headset orientation in world space.

◆ getHeadsetWorldPosition()

glm::vec3 Engine::Rendering::Headset::getHeadsetWorldPosition ( ) const
nodiscard

Gets the headset position after player position/rotation are applied.

Returns
Headset center in world space.

◆ getIsExitRequested()

bool Engine::Rendering::Headset::getIsExitRequested ( ) const
nodiscard

Returns whether OpenXR requested application exit or session shutdown.

Returns
True after instance loss, session exiting/loss, timeout-triggered exit, or requestExitSession().

◆ getPlayerPosition()

glm::vec3 Engine::Rendering::Headset::getPlayerPosition ( ) const
inlinenodiscard

Returns the current player/play-space world position.

Returns
World-space offset applied to eye and headset transforms.

Definition at line 224 of file Headset.h.

References playerPosition_.

◆ getPlayerRotation()

glm::quat Engine::Rendering::Headset::getPlayerRotation ( ) const
inlinenodiscard

Returns the player/play-space rotation.

Returns
Normalized rotation applied to eye and headset transforms.

Definition at line 239 of file Headset.h.

References playerRotation_.

◆ getRawEyeViewMatrix()

glm::mat4 Engine::Rendering::Headset::getRawEyeViewMatrix ( size_t eyeIndex) const
nodiscard

Returns the raw OpenXR view matrix for an eye.

Parameters
eyeIndexZero-based eye index.
Returns
Eye view matrix before player position and rotation are applied.

◆ getReferenceSpace()

XrSpace Engine::Rendering::Headset::getReferenceSpace ( ) const
nodiscard

Returns the OpenXR reference space used for view location and layer submission.

Returns
Active OpenXR reference space handle.

◆ getRenderPass()

VkRenderPass Engine::Rendering::Headset::getRenderPass ( ) const
nodiscard

Returns the legacy multiview render pass.

Returns
Vulkan render pass used by the legacy headset render path.

◆ getRenderTarget()

const RenderTarget * Engine::Rendering::Headset::getRenderTarget ( size_t swapchainImageIndex) const

Returns the render target for a swapchain image.

Parameters
swapchainImageIndexSwapchain image index returned by beginXrFrameAfterWait().
Returns
Pointer to the render target stored by Headset.

◆ getResolveBufferImage()

VkImage Engine::Rendering::Headset::getResolveBufferImage ( ) const
inlinenodiscard

Returns the single-sample resolve image used before XR swapchain tonemapping.

Returns
Multiview resolve image handle.

Definition at line 439 of file Headset.h.

References resolveBuffer.

◆ getResolveBufferView()

VkImageView Engine::Rendering::Headset::getResolveBufferView ( ) const
inlinenodiscard

Returns the single-sample resolve image view used before XR swapchain tonemapping.

Returns
Multiview resolve image view handle.

Definition at line 448 of file Headset.h.

References resolveBuffer.

◆ getSceneColorFormat()

VkFormat Engine::Rendering::Headset::getSceneColorFormat ( ) const
inlinenodiscard

Returns the HDR scene color format used for engine-owned color and resolve buffers.

Returns
Vulkan format of the headset scene color attachments.

Definition at line 466 of file Headset.h.

References sceneColorFormat_.

◆ getSession()

XrSession Engine::Rendering::Headset::getSession ( ) const
nodiscard

Returns the OpenXR session handle.

Returns
Active OpenXR session handle.

◆ getSwapchainImage()

VkImage Engine::Rendering::Headset::getSwapchainImage ( size_t swapchainImageIndex) const
nodiscard

Returns a borrowed OpenXR swapchain image handle.

Parameters
swapchainImageIndexSwapchain image index returned by beginXrFrameAfterWait().
Returns
Vulkan image owned by the OpenXR swapchain.

◆ getSwapchainRenderTargets()

std::vector< RenderTarget > Engine::Rendering::Headset::getSwapchainRenderTargets ( )

Returns a copy of the swapchain render-target list.

Returns
Render targets corresponding to the OpenXR swapchain images.

◆ getViewProjectionMatrix()

glm::mat4 Engine::Rendering::Headset::getViewProjectionMatrix ( size_t eyeIndex) const
nodiscard

Gets the projection-view matrix for an eye.

Parameters
eyeIndexZero-based eye index.
Returns
getEyeProjectionMatrix(eyeIndex) * getEyeViewMatrix(eyeIndex).

◆ getXrFrameState()

XrFrameState Engine::Rendering::Headset::getXrFrameState ( ) const
nodiscard

Returns the latest OpenXR frame state.

Returns
Frame state filled by the most recent successful xrWaitFrame().

◆ requestExitSession()

void Engine::Rendering::Headset::requestExitSession ( )

Requests the XR runtime to exit the session gracefully. This should be called when the application wants to shut down (e.g., window close). The XR runtime will transition through proper states before exiting.

◆ setInteractionProfileChangedCallback()

void Engine::Rendering::Headset::setInteractionProfileChangedCallback ( std::function< void()> callback)

Registers a callback invoked when the runtime reports an interaction profile change.

Parameters
callbackCallback invoked without arguments on XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED.

◆ setPlayerPosition()

void Engine::Rendering::Headset::setPlayerPosition ( const glm::vec3 & position)
inline

Sets the player/play-space world position.

Parameters
positionWorld-space offset applied to eye and headset transforms.

Definition at line 215 of file Headset.h.

References playerPosition_.

◆ setPlayerRotation()

void Engine::Rendering::Headset::setPlayerRotation ( const glm::quat & rotation)

Setter for the player/play-space rotation applied around the world origin.

Parameters
rotationRotation applied to eye and headset transforms; normalized before storage.

◆ setSessionStateCallback()

void Engine::Rendering::Headset::setSessionStateCallback ( std::function< void(XrSessionState)> callback)

Registers a callback invoked whenever the OpenXR session state changes.

Parameters
callbackCallback receiving the new session state.

◆ transformPlaySpaceOrientation()

glm::quat Engine::Rendering::Headset::transformPlaySpaceOrientation ( const glm::quat & orientation) const
nodiscard

Converts an OpenXR play-space orientation into world space.

Parameters
orientationOrientation in OpenXR reference-space coordinates.
Returns
Orientation after player rotation is applied.

◆ transformPlaySpacePosition()

glm::vec3 Engine::Rendering::Headset::transformPlaySpacePosition ( const glm::vec3 & position) const
nodiscard

Converts an OpenXR play-space position into world space.

Parameters
positionPosition in OpenXR reference-space coordinates.
Returns
Position after player rotation and player position are applied.

◆ updateViewMatrix()

void Engine::Rendering::Headset::updateViewMatrix ( )

Updates cached eye view and projection matrices from the latest OpenXR eye poses.

◆ waitForXrFrame()

WaitFrameResult Engine::Rendering::Headset::waitForXrFrame ( Rendering::Renderer * renderer)

First part of frame setup: calls xrWaitFrame. Can be called before previous xrEndFrame completes. Polls events and waits for the next frame to be ready.

Parameters
rendererRenderer associated with the frame loop; reserved for state-transition handling.
Returns
WaitFrameResult indicating what to do next

Member Data Documentation

◆ colorBuffer

ImageBuffer Engine::Rendering::Headset::colorBuffer
private

Multisampled HDR color attachment for multiview rendering.

Definition at line 359 of file Headset.h.

Referenced by getColorBufferImage(), and getColorBufferView().

◆ colorFormat_

VkFormat Engine::Rendering::Headset::colorFormat_ = VK_FORMAT_R8G8B8A8_UNORM
private

VkFormat used for OpenXR swapchain image views.

Definition at line 473 of file Headset.h.

Referenced by getColorFormat().

◆ context

const Core::ApplicationContext* Engine::Rendering::Headset::context = nullptr
private

Application context that owns Vulkan and OpenXR handles.

Definition at line 328 of file Headset.h.

Referenced by Engine::Rendering::Headset::ImageBuffer::cleanup(), and Headset().

◆ depthBuffer

ImageBuffer Engine::Rendering::Headset::depthBuffer
private

Multisampled depth attachment, also sampled by Hi-Z generation.

Definition at line 360 of file Headset.h.

Referenced by getDepthBufferImage(), and getDepthBufferView().

◆ eyeCount

uint32_t Engine::Rendering::Headset::eyeCount = 0u
private

Number of views reported by the OpenXR runtime.

Definition at line 337 of file Headset.h.

◆ eyeImageInfos

std::vector<XrViewConfigurationView> Engine::Rendering::Headset::eyeImageInfos
private

Runtime-recommended image settings per eye.

Definition at line 339 of file Headset.h.

◆ eyePoses

std::vector<XrView> Engine::Rendering::Headset::eyePoses
private

Eye poses and fields of view from the latest xrLocateViews() call.

Definition at line 341 of file Headset.h.

◆ eyeRenderInfos

std::vector<XrCompositionLayerProjectionView> Engine::Rendering::Headset::eyeRenderInfos
private

Projection-layer views submitted to xrEndFrame().

Definition at line 373 of file Headset.h.

◆ eyes

std::vector<Eye> Engine::Rendering::Headset::eyes = {}
private

Cached eye matrices indexed by zero-based eye index.

Definition at line 384 of file Headset.h.

◆ interactionProfileChangedCallback_

std::function<void()> Engine::Rendering::Headset::interactionProfileChangedCallback_
private

Invoked on OpenXR interaction profile changes.

Definition at line 368 of file Headset.h.

◆ isExistRequested

bool Engine::Rendering::Headset::isExistRequested = false
private

True once OpenXR or the application requests session exit.

Definition at line 326 of file Headset.h.

◆ lastUpdateTime

XrTime Engine::Rendering::Headset::lastUpdateTime = 0
private

Reserved timestamp for future pose update tracking.

Definition at line 386 of file Headset.h.

◆ playerPosition_

glm::vec3 Engine::Rendering::Headset::playerPosition_ { 0.0f, 0.0f, 0.0f }
private

World-space player/play-space offset.

Definition at line 388 of file Headset.h.

Referenced by getPlayerPosition(), and setPlayerPosition().

◆ playerRotation_

glm::quat Engine::Rendering::Headset::playerRotation_ { 1.0f, 0.0f, 0.0f, 0.0f }
private

World-space player/play-space rotation.

Definition at line 389 of file Headset.h.

Referenced by getPlayerRotation().

◆ resolveBuffer

ImageBuffer Engine::Rendering::Headset::resolveBuffer
private

Single-sample HDR resolve target before tonemapping to the XR swapchain.

Definition at line 361 of file Headset.h.

Referenced by getResolveBufferImage(), and getResolveBufferView().

◆ sceneColorFormat_

VkFormat Engine::Rendering::Headset::sceneColorFormat_ = VK_FORMAT_R16G16B16A16_SFLOAT
private

HDR format for engine-owned scene buffers.

Definition at line 474 of file Headset.h.

Referenced by getSceneColorFormat().

◆ sessionStateCallback_

std::function<void( XrSessionState )> Engine::Rendering::Headset::sessionStateCallback_
private

Invoked on OpenXR session state changes.

Definition at line 367 of file Headset.h.

◆ swapchainFormat_

VkFormat Engine::Rendering::Headset::swapchainFormat_ = VK_FORMAT_R8G8B8A8_UNORM
private

VkFormat used when creating the OpenXR swapchain.

Definition at line 472 of file Headset.h.

◆ swapchainRenderTargets

std::vector<RenderTarget> Engine::Rendering::Headset::swapchainRenderTargets
private

Render target wrappers for OpenXR swapchain images.

Definition at line 371 of file Headset.h.

◆ useMutableSwapchainFormat_

bool Engine::Rendering::Headset::useMutableSwapchainFormat_ = false
private

True when swapchain views use a different color format.

Definition at line 475 of file Headset.h.

◆ vkRenderPass

VkRenderPass Engine::Rendering::Headset::vkRenderPass = VK_NULL_HANDLE
private

Legacy multiview render pass used by framebuffer rendering.

Definition at line 330 of file Headset.h.

◆ xrFrameState

XrFrameState Engine::Rendering::Headset::xrFrameState = {}
private

State returned by the latest xrWaitFrame() call.

Definition at line 322 of file Headset.h.

◆ xrReferenceSpace

XrSpace Engine::Rendering::Headset::xrReferenceSpace = XR_NULL_HANDLE
private

Reference space used to locate views and submit layers.

Definition at line 334 of file Headset.h.

◆ xrReferenceSpaceType

XrReferenceSpaceType Engine::Rendering::Headset::xrReferenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL
private

Configured reference-space type.

Definition at line 335 of file Headset.h.

◆ xrSession

XrSession Engine::Rendering::Headset::xrSession = XR_NULL_HANDLE
private

OpenXR session created for the application context's system id.

Definition at line 332 of file Headset.h.

◆ xrSessionState

XrSessionState Engine::Rendering::Headset::xrSessionState = XR_SESSION_STATE_UNKNOWN
private

Current OpenXR session lifecycle state.

Definition at line 324 of file Headset.h.

◆ xrSwapchain

XrSwapchain Engine::Rendering::Headset::xrSwapchain = nullptr
private

OpenXR color swapchain submitted to the runtime.

Definition at line 363 of file Headset.h.

◆ xrViewState

XrViewState Engine::Rendering::Headset::xrViewState = {}
private

Validity flags for the latest xrLocateViews() result.

Definition at line 321 of file Headset.h.

◆ xrWaitThreadPool_

std::unique_ptr<NamedThreadPool> Engine::Rendering::Headset::xrWaitThreadPool_
private

Thread pool used to timeout xrWaitFrame() safely.

Definition at line 365 of file Headset.h.


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Renderer/Headset.h