| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
OpenXR.Core10.Image
Synopsis
- enumerateSwapchainFormats :: forall io. MonadIO io => Session -> io (Result, "formats" ::: Vector Int64)
- createSwapchain :: forall a io. (Extendss SwapchainCreateInfo a, PokeChain a, MonadIO io) => Session -> SwapchainCreateInfo a -> io (Result, Swapchain)
- withSwapchain :: forall a io r. (Extendss SwapchainCreateInfo a, PokeChain a, MonadIO io) => Session -> SwapchainCreateInfo a -> (io (Result, Swapchain) -> ((Result, Swapchain) -> io ()) -> r) -> r
- destroySwapchain :: forall io. MonadIO io => Swapchain -> io ()
- enumerateSwapchainImages :: forall a io. (Inherits SwapchainImageBaseHeader a, ToCStruct a, FromCStruct a, MonadIO io) => Swapchain -> io (Result, "images" ::: Vector a)
- acquireSwapchainImage :: forall io. MonadIO io => Swapchain -> ("acquireInfo" ::: Maybe SwapchainImageAcquireInfo) -> io (Result, "index" ::: Word32)
- waitSwapchainImage :: forall io. MonadIO io => Swapchain -> SwapchainImageWaitInfo -> io Result
- waitSwapchainImageSafe :: forall io. MonadIO io => Swapchain -> SwapchainImageWaitInfo -> io Result
- releaseSwapchainImage :: forall io. MonadIO io => Swapchain -> ("releaseInfo" ::: Maybe SwapchainImageReleaseInfo) -> io Result
- data SwapchainCreateInfo (es :: [Type]) = SwapchainCreateInfo {
- next :: Chain es
- createFlags :: SwapchainCreateFlags
- usageFlags :: SwapchainUsageFlags
- format :: Int64
- sampleCount :: Word32
- width :: Word32
- height :: Word32
- faceCount :: Word32
- arraySize :: Word32
- mipCount :: Word32
- data SwapchainImageBaseHeader = SwapchainImageBaseHeader {}
- class ToCStruct a => IsSwapchainImage a where
- data SwapchainImageAcquireInfo = SwapchainImageAcquireInfo {
- data SwapchainImageWaitInfo = SwapchainImageWaitInfo {}
- data SwapchainImageReleaseInfo = SwapchainImageReleaseInfo {
Documentation
enumerateSwapchainFormats :: forall io. MonadIO io => Session -> io (Result, "formats" ::: Vector Int64) Source #
xrEnumerateSwapchainFormats - Enumerates swapchain formats
Parameter Descriptions
sessionis the session that enumerates the supported formats.
formatCapacityInputis the capacity of theformats, or 0 to retrieve the required capacity.formatCountOutputis a pointer to the count ofuint64_tformats written, or a pointer to the required capacity in the case thatformatCapacityInputis0.formatsis a pointer to an array ofint64_tformat ids, but can beNULLifformatCapacityInputis0. The format ids are specific to the specified graphics API.- See
Buffer Size Parameters
chapter for a detailed description of retrieving the required
formatssize.
Description
enumerateSwapchainFormats enumerates the texture formats supported by
the current session. The type of formats returned are dependent on the
graphics API specified in createSession. For
example, if a DirectX graphics API was specified, then the enumerated
formats correspond to the DXGI formats, such as
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB. Texture formats should be in order
from highest to lowest runtime preference.
With an OpenGL-based graphics API, the texture formats correspond to OpenGL internal formats.
With a Direct3D-based graphics API, enumerateSwapchainFormats never
returns typeless formats (e.g. DXGI_FORMAT_R8G8B8A8_TYPELESS). Only
concrete formats are returned, and only concrete formats may be
specified by applications for swapchain creation.
Runtimes must always return identical buffer contents from this enumeration for the lifetime of the session.
Valid Usage (Implicit)
-
sessionmust be a validSessionhandle
-
formatCountOutputmust be a pointer to auint32_tvalue - If
formatCapacityInputis not0,formatsmust be a pointer to an array offormatCapacityInputint64_tvalues
Return Codes
See Also
Arguments
| :: forall a io. (Extendss SwapchainCreateInfo a, PokeChain a, MonadIO io) | |
| => Session |
|
| -> SwapchainCreateInfo a |
|
| -> io (Result, Swapchain) |
xrCreateSwapchain - Creates an XrSwapchain
Parameter Descriptions
Description
Creates an Swapchain handle. The returned
swapchain handle may be subsequently used in API calls. Multiple
Swapchain handles may exist simultaneously, up
to some limit imposed by the runtime. The
Swapchain handle must be eventually freed via
the destroySwapchain function. The runtime must return
ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED if the
image format specified in the SwapchainCreateInfo is unsupported. The
runtime must return
ERROR_FEATURE_UNSUPPORTED if any bit of the
create flags specified in the SwapchainCreateInfo is unsupported.
Return Codes
See Also
Session, Swapchain,
SwapchainCreateInfo, acquireSwapchainImage, destroySwapchain,
enumerateSwapchainFormats, enumerateSwapchainImages,
releaseSwapchainImage
withSwapchain :: forall a io r. (Extendss SwapchainCreateInfo a, PokeChain a, MonadIO io) => Session -> SwapchainCreateInfo a -> (io (Result, Swapchain) -> ((Result, Swapchain) -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createSwapchain and destroySwapchain
To ensure that destroySwapchain is always called: pass
bracket (or the allocate function from your
favourite resource management library) as the last argument.
To just extract the pair pass (,) as the last argument.
xrDestroySwapchain - Destroys an XrSwapchain
Parameter Descriptions
Description
All submitted graphics API commands that refer to swapchain must
have completed execution. Runtimes may continue to utilize swapchain
images after destroySwapchain is called.
Valid Usage (Implicit)
-
swapchainmust be a validSwapchainhandle
Thread Safety
- Access to
swapchain, and any child handles, must be externally synchronized
Return Codes
See Also
enumerateSwapchainImages :: forall a io. (Inherits SwapchainImageBaseHeader a, ToCStruct a, FromCStruct a, MonadIO io) => Swapchain -> io (Result, "images" ::: Vector a) Source #
xrEnumerateSwapchainImages - Gets images from an XrSwapchain
Parameter Descriptions
swapchainis theSwapchainto get images from.
imageCapacityInputis the capacity of theimagesarray, or 0 to indicate a request to retrieve the required capacity.imageCountOutputis a pointer to the count ofimageswritten, or a pointer to the required capacity in the case thatimageCapacityInputis 0.imagesis a pointer to an array of graphics API-specificXrSwapchainImagestructures based off ofSwapchainImageBaseHeader. It can beNULLifimageCapacityInputis 0.- See
Buffer Size Parameters
chapter for a detailed description of retrieving the required
imagessize.
Description
Fills an array of graphics API-specific XrSwapchainImage structures.
The resources must be constant and valid for the lifetime of the
Swapchain.
Runtimes must always return identical buffer contents from this enumeration for the lifetime of the swapchain.
Note: images is a pointer to an array of structures of graphics
API-specific type, not an array of structure pointers.
Valid Usage (Implicit)
-
swapchainmust be a validSwapchainhandle
-
imageCountOutputmust be a pointer to auint32_tvalue - If
imageCapacityInputis not0,imagesmust be a pointer to an array ofimageCapacityInputSwapchainImageBaseHeader-based structures. See also:SwapchainImageD3D11KHR,SwapchainImageD3D12KHR,SwapchainImageOpenGLESKHR,SwapchainImageOpenGLKHR,SwapchainImageVulkanKHR
Return Codes
See Also
acquireSwapchainImage Source #
Arguments
| :: forall io. MonadIO io | |
| => Swapchain |
|
| -> ("acquireInfo" ::: Maybe SwapchainImageAcquireInfo) |
|
| -> io (Result, "index" ::: Word32) |
xrAcquireSwapchainImage - Acquire a swapchain image
Parameter Descriptions
Description
Acquires the image corresponding to the index position in the array
returned by enumerateSwapchainImages. The runtime must return
ERROR_CALL_ORDER_INVALID if index has
already been acquired and not yet released with releaseSwapchainImage.
If the swapchain was created with the
XR_SWAPCHAIN_CREATE_STATIC_IMAGE_BIT set in
SwapchainCreateInfo::createFlags, this function must not have been
previously called for this swapchain. The runtime must return
ERROR_CALL_ORDER_INVALID if a swapchain
created with the XR_SWAPCHAIN_CREATE_STATIC_IMAGE_BIT set in
SwapchainCreateInfo::createFlags and this function has been
successfully called previously for this swapchain.
Valid Usage (Implicit)
-
swapchainmust be a validSwapchainhandle
- If
acquireInfois notNULL,acquireInfomust be a pointer to a validSwapchainImageAcquireInfostructure -
indexmust be a pointer to auint32_tvalue
Return Codes
See Also
Swapchain, SwapchainImageAcquireInfo,
createSwapchain, destroySwapchain, enumerateSwapchainImages,
releaseSwapchainImage, waitSwapchainImage
Arguments
| :: forall io. MonadIO io | |
| => Swapchain |
|
| -> SwapchainImageWaitInfo |
|
| -> io Result |
xrWaitSwapchainImage - Wait for a swapchain image to be available
Parameter Descriptions
Description
Before an application can begin writing to a swapchain image, it must
first wait on the image to avoid writing to it before the compositor has
finished reading from it. waitSwapchainImage will implicitly wait on
the oldest acquired swapchain image which has not yet been successfully
waited on. Once a swapchain image has been successfully waited on, it
must be released before waiting on the next acquired swapchain image.
This function may block for longer than the timeout specified in
SwapchainImageWaitInfo due to scheduling or contention.
If the timeout expires without the image becoming available for writing,
TIMEOUT_EXPIRED must be returned. If
waitSwapchainImage returns
TIMEOUT_EXPIRED, the next call to
waitSwapchainImage will wait on the same image index again until the
function succeeds with SUCCESS. Note that
this is not an error code; XR_SUCCEEDED(XR_TIMEOUT_EXPIRED) is true.
The runtime must return
ERROR_CALL_ORDER_INVALID if no image has
been acquired by calling acquireSwapchainImage.
Return Codes
See Also
Swapchain, SwapchainImageWaitInfo,
acquireSwapchainImage, createSwapchain, destroySwapchain,
enumerateSwapchainImages, releaseSwapchainImage
waitSwapchainImageSafe Source #
Arguments
| :: forall io. MonadIO io | |
| => Swapchain |
|
| -> SwapchainImageWaitInfo |
|
| -> io Result |
A variant of waitSwapchainImage which makes a *safe* FFI call
releaseSwapchainImage Source #
Arguments
| :: forall io. MonadIO io | |
| => Swapchain |
|
| -> ("releaseInfo" ::: Maybe SwapchainImageReleaseInfo) |
|
| -> io Result |
xrReleaseSwapchainImage - Release a swapchain image
Parameter Descriptions
Description
If the swapchain was created with the
XR_SWAPCHAIN_CREATE_STATIC_IMAGE_BIT set in
SwapchainCreateInfo::createFlags structure, this function must not
have been previously called for this swapchain.
The runtime must return
ERROR_CALL_ORDER_INVALID if no image has
been waited on by calling waitSwapchainImage.
Valid Usage (Implicit)
-
swapchainmust be a validSwapchainhandle
- If
releaseInfois notNULL,releaseInfomust be a pointer to a validSwapchainImageReleaseInfostructure
Return Codes
See Also
Swapchain, SwapchainImageReleaseInfo,
acquireSwapchainImage, createSwapchain, destroySwapchain,
enumerateSwapchainImages, waitSwapchainImage
data SwapchainCreateInfo (es :: [Type]) Source #
XrSwapchainCreateInfo - Creation info for a swapchain
Valid Usage (Implicit)
See Also
SessionCreateFlags,
StructureType,
SwapchainCreateFlags,
SwapchainUsageFlags,
createSession, createSwapchain,
createSwapchainAndroidSurfaceKHR,
enumerateSwapchainFormats
Constructors
| SwapchainCreateInfo | |
Fields
| |
Instances
data SwapchainImageBaseHeader Source #
XrSwapchainImageBaseHeader - Image base header for a swapchain image
Member Descriptions
Description
The SwapchainImageBaseHeader is a base structure that can be
overridden by a graphics API-specific XrSwapchainImage* child
structure.
Valid Usage (Implicit)
See Also
Constructors
| SwapchainImageBaseHeader | |
Fields
| |
Instances
class ToCStruct a => IsSwapchainImage a where Source #
Methods
toSwapchainImageBaseHeader :: a -> SwapchainImageBaseHeader Source #
Instances
data SwapchainImageAcquireInfo Source #
XrSwapchainImageAcquireInfo - Describes a swapchain image acquisition
Member Descriptions
Description
Because this structure only exists to support extension-specific
structures, acquireSwapchainImage will accept a NULL argument for
acquireInfo for applications that are not using any relevant
extensions.
Valid Usage (Implicit)
See Also
Constructors
| SwapchainImageAcquireInfo | |
Instances
data SwapchainImageWaitInfo Source #
XrSwapchainImageWaitInfo - Describes a swapchain image wait operation
Valid Usage (Implicit)
See Also
https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrDuration,
StructureType, waitSwapchainImage
Constructors
| SwapchainImageWaitInfo | |
Instances
data SwapchainImageReleaseInfo Source #
XrSwapchainImageReleaseInfo - Describes a swapchain image release
Member Descriptions
Description
Because this structure only exists to support extension-specific
structures, releaseSwapchainImage will accept a NULL argument for
releaseInfo for applications that are not using any relevant
extensions.
Valid Usage (Implicit)
See Also
Constructors
| SwapchainImageReleaseInfo | |