libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Functions
gpu.h File Reference

GPU functions. More...

#include <libtransistor/types.h>
Include dependency graph for gpu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gpu_buffer_t
 Buffer to be used for various GPU functions. More...
 
struct  gpu_fence_t
 

Functions

result_t gpu_initialize ()
 Initialize GPU.
 
result_t gpu_buffer_initialize (gpu_buffer_t *gpu_b, void *addr, size_t size, uint32_t heapmask, uint32_t flags, uint32_t alignment, uint8_t kind)
 Initializes a GPU buffer with the args provided. More...
 
result_t gpu_buffer_destroy (gpu_buffer_t *gpu_b, uint64_t *refcount, uint32_t *flags)
 Destroys a GPU buffer. More...
 
result_t gpu_buffer_get_id (gpu_buffer_t *gpu_b, uint32_t *id)
 Get a GPU buffer's ID. More...
 
result_t gpu_buffer_initialize_from_id (gpu_buffer_t *gpu_b, uint32_t id)
 Create a structure to access an existing GPU buffer from a given ID. More...
 
result_t gpu_wait_fence (gpu_fence_t *fence, uint32_t timeout)
 Waits on a fence to complete. More...
 
void gpu_finalize ()
 Finalize GPU.
 

Detailed Description

GPU functions.

Function Documentation

result_t gpu_buffer_destroy ( gpu_buffer_t gpu_b,
uint64_t *  refcount,
uint32_t *  flags 
)

Destroys a GPU buffer.

Parameters
gpu_bGPU buffer to destroy
result_t gpu_buffer_get_id ( gpu_buffer_t gpu_b,
uint32_t *  id 
)

Get a GPU buffer's ID.

Parameters
gpu_bGPU buffer
idID of GPU buffer
result_t gpu_buffer_initialize ( gpu_buffer_t gpu_b,
void *  addr,
size_t  size,
uint32_t  heapmask,
uint32_t  flags,
uint32_t  alignment,
uint8_t  kind 
)

Initializes a GPU buffer with the args provided.

Parameters
gpu_bGPU buffer
addrAddress of backing memory
sizeSize of buffer to create
heapmaskHeapmask for buffer
flagsFlags for buffer
alignmentAlignment of buffer
kindKind of buffer
result_t gpu_buffer_initialize_from_id ( gpu_buffer_t gpu_b,
uint32_t  id 
)

Create a structure to access an existing GPU buffer from a given ID.

Parameters
gpu_bGPU buffer structure to initialize
idID of gpu buffer
result_t gpu_wait_fence ( gpu_fence_t fence,
uint32_t  timeout 
)

Waits on a fence to complete.

Parameters
fenceFence to wait for completion on