Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
session
is the session that enumerates the supported formats.
formatCapacityInput
is the capacity of theformats
, or 0 to retrieve the required capacity.formatCountOutput
is a pointer to the count ofuint64_t
formats written, or a pointer to the required capacity in the case thatformatCapacityInput
is0
.formats
is a pointer to an array ofint64_t
format ids, but can beNULL
ifformatCapacityInput
is0
. The format ids are specific to the specified graphics API.- See
Buffer Size Parameters
chapter for a detailed description of retrieving the required
formats
size.
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)
-
session
must be a validSession
handle
-
formatCountOutput
must be a pointer to auint32_t
value - If
formatCapacityInput
is not0
,formats
must be a pointer to an array offormatCapacityInput
int64_t
values
Return Codes
See Also
:: 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)
-
swapchain
must be a validSwapchain
handle
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
swapchain
is theSwapchain
to get images from.
imageCapacityInput
is the capacity of theimages
array, or 0 to indicate a request to retrieve the required capacity.imageCountOutput
is a pointer to the count ofimages
written, or a pointer to the required capacity in the case thatimageCapacityInput
is 0.images
is a pointer to an array of graphics API-specificXrSwapchainImage
structures based off ofSwapchainImageBaseHeader
. It can beNULL
ifimageCapacityInput
is 0.- See
Buffer Size Parameters
chapter for a detailed description of retrieving the required
images
size.
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)
-
swapchain
must be a validSwapchain
handle
-
imageCountOutput
must be a pointer to auint32_t
value - If
imageCapacityInput
is not0
,images
must be a pointer to an array ofimageCapacityInput
SwapchainImageBaseHeader
-based structures. See also:SwapchainImageD3D11KHR
,SwapchainImageD3D12KHR
,SwapchainImageOpenGLESKHR
,SwapchainImageOpenGLKHR
,SwapchainImageVulkanKHR
Return Codes
See Also
acquireSwapchainImage Source #
:: 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)
-
swapchain
must be a validSwapchain
handle
- If
acquireInfo
is notNULL
,acquireInfo
must be a pointer to a validSwapchainImageAcquireInfo
structure -
index
must be a pointer to auint32_t
value
Return Codes
See Also
Swapchain
, SwapchainImageAcquireInfo
,
createSwapchain
, destroySwapchain
, enumerateSwapchainImages
,
releaseSwapchainImage
, waitSwapchainImage
:: 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 #
:: forall io. MonadIO io | |
=> Swapchain |
|
-> SwapchainImageWaitInfo |
|
-> io Result |
A variant of waitSwapchainImage
which makes a *safe* FFI call
releaseSwapchainImage Source #
:: 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)
-
swapchain
must be a validSwapchain
handle
- If
releaseInfo
is notNULL
,releaseInfo
must be a pointer to a validSwapchainImageReleaseInfo
structure
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
SwapchainCreateInfo | |
|
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
SwapchainImageBaseHeader | |
|
Instances
class ToCStruct a => IsSwapchainImage a where Source #
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
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
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.