libnx  v4.2.0
graphic_buffer.h
1 #pragma once
2 #include "../display/types.h"
3 #include "types.h"
4 
5 typedef struct {
6  u32 width;
7  u32 height;
8  NvColorFormat color_format;
9  NvLayout layout;
10  u32 pitch;
11  u32 unused; // usually this field contains the nvmap handle, but it's completely unused/overwritten during marshalling
12  u32 offset;
13  NvKind kind;
14  u32 block_height_log2;
15  NvDisplayScanFormat scan;
16  u32 second_field_offset;
17  u64 flags;
18  u64 size;
19  u32 unk[6]; // compression related
20 } NvSurface;
21 
22 typedef struct {
23  NativeHandle header;
24  s32 unk0; // -1
25  s32 nvmap_id; // nvmap object id
26  u32 unk2; // 0
27  u32 magic; // 0xDAFFCAFF
28  u32 pid; // 42
29  u32 type; // ?
30  u32 usage; // GRALLOC_USAGE_* bitmask
31  u32 format; // PIXEL_FORMAT_*
32  u32 ext_format; // copy of the above (in most cases)
33  u32 stride; // in pixels!
34  u32 total_size; // in bytes
35  u32 num_planes; // usually 1
36  u32 unk12; // 0
37  NvSurface planes[3];
38  u64 unused; // official sw writes a pointer to bookkeeping data here, but it's otherwise completely unused/overwritten during marshalling
types.h
Definitions for Android-related types and enumerations.
s32
int32_t s32
32-bit signed integer.
Definition: types.h:27
u32
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
u64
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
NativeHandle
Definition: types.h:143
NvSurface
Definition: graphic_buffer.h:5
NvGraphicBuffer
Definition: graphic_buffer.h:22