libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
gpu.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include<libtransistor/types.h>
13 
18 typedef struct {
19  uint32_t nvmap_handle;
20  size_t size;
21  uint32_t alignment;
22  uint8_t kind;
23 } gpu_buffer_t;
24 
25 typedef struct {
26  uint32_t syncpt_id;
27  uint32_t syncpt_value;
28 } gpu_fence_t;
29 
34 
46 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);
47 
53 result_t gpu_buffer_destroy(gpu_buffer_t *gpu_b, uint64_t *refcount, uint32_t *flags);
54 
61 result_t gpu_buffer_get_id(gpu_buffer_t *gpu_b, uint32_t *id);
62 
70 
71 
77 result_t gpu_wait_fence(gpu_fence_t *fence, uint32_t timeout);
78 
82 void gpu_finalize();
83 
84 #ifdef __cplusplus
85 }
86 #endif
Various system types.
void gpu_finalize()
Finalize GPU.
uint32_t result_t
Function result.
Definition: types.h:51
Definition: gpu.h:25
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.
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.
Buffer to be used for various GPU functions.
Definition: gpu.h:18
result_t gpu_initialize()
Initialize GPU.
result_t gpu_buffer_get_id(gpu_buffer_t *gpu_b, uint32_t *id)
Get a GPU buffer's ID.
result_t gpu_buffer_destroy(gpu_buffer_t *gpu_b, uint64_t *refcount, uint32_t *flags)
Destroys a GPU buffer.
result_t gpu_wait_fence(gpu_fence_t *fence, uint32_t timeout)
Waits on a fence to complete.
uint32_t nvmap_handle
Handle for nvmap gpu memory management driver.
Definition: gpu.h:19