RetroArch
Classes | Macros | Enumerations | Functions
shader_utils.c File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <wiiu/gx2.h>
#include <wiiu/system/memory.h>
#include <wiiu/shader_utils.h>
#include <wiiu/wiiu_dbg.h>
Include dependency graph for shader_utils.c:

Classes

struct  org_programs_t
 
struct  GFDFileHeader
 
struct  GFDBlockHeader
 
struct  GFDRelocationHeader
 
struct  GFDBlock
 

Macros

#define MAKE_MAGIC(c0, c1, c2, c3)   ((c0 << 24) |(c1 << 16) |(c2 << 8) |(c3 << 0))
 
#define GFD_FILE_MAJOR_VERSION   7
 
#define GFD_FILE_GPU_VERSION   2
 
#define GFD_BLOCK_MAJOR_VERSION   1
 
#define GFD_FILE_MAGIC   MAKE_MAGIC('G','f','x','2')
 
#define GFD_BLOCK_MAGIC   MAKE_MAGIC('B','L','K','{')
 
#define GFD_BLOCK_RELOCATIONS_MAGIC   MAKE_MAGIC('}','B','L','K')
 
#define GFD_RELOCATIONS_TYPE_MASK   0xFFF00000
 
#define GFD_RELOCATIONS_VALUE_MASK   (~GFD_RELOCATIONS_TYPE_MASK)
 
#define GFD_RELOCATIONS_DATA   0xD0600000
 
#define GFD_RELOCATIONS_TEXT   0xCA700000
 

Enumerations

enum  GFDBlockType {
  GFD_BLOCK_TYPE_END_OF_FILE = 1, GFD_BLOCK_TYPE_PADDING = 2, GFD_BLOCK_TYPE_VERTEX_SHADER_HEADER = 3, GFD_BLOCK_TYPE_VERTEX_SHADER_PROGRAM = 5,
  GFD_BLOCK_TYPE_PIXEL_SHADER_HEADER = 6, GFD_BLOCK_TYPE_PIXEL_SHADER_PROGRAM = 7
}
 

Functions

void GX2InitShader (GX2Shader *shader)
 
void GX2DestroyShader (GX2Shader *shader)
 
void GX2SetShader (GX2Shader *shader)
 
void dump_vs_data (GX2VertexShader *vs)
 
void dump_ps_data (GX2PixelShader *ps)
 
void check_shader_verbose (u32 *shader, u32 shader_size, u32 *org, u32 org_size, const char *name)
 
void check_shader (const void *shader_, u32 shader_size, const void *org_, u32 org_size, const char *name)
 
void gfd_free (GFDFile *gfd)
 
static bool gfd_relocate_block (GFDBlock *block)
 
GFDFilegfd_open (const char *filename)
 

Macro Definition Documentation

◆ GFD_BLOCK_MAGIC

#define GFD_BLOCK_MAGIC   MAKE_MAGIC('B','L','K','{')

◆ GFD_BLOCK_MAJOR_VERSION

#define GFD_BLOCK_MAJOR_VERSION   1

◆ GFD_BLOCK_RELOCATIONS_MAGIC

#define GFD_BLOCK_RELOCATIONS_MAGIC   MAKE_MAGIC('}','B','L','K')

◆ GFD_FILE_GPU_VERSION

#define GFD_FILE_GPU_VERSION   2

◆ GFD_FILE_MAGIC

#define GFD_FILE_MAGIC   MAKE_MAGIC('G','f','x','2')

◆ GFD_FILE_MAJOR_VERSION

#define GFD_FILE_MAJOR_VERSION   7

◆ GFD_RELOCATIONS_DATA

#define GFD_RELOCATIONS_DATA   0xD0600000

◆ GFD_RELOCATIONS_TEXT

#define GFD_RELOCATIONS_TEXT   0xCA700000

◆ GFD_RELOCATIONS_TYPE_MASK

#define GFD_RELOCATIONS_TYPE_MASK   0xFFF00000

◆ GFD_RELOCATIONS_VALUE_MASK

#define GFD_RELOCATIONS_VALUE_MASK   (~GFD_RELOCATIONS_TYPE_MASK)

◆ MAKE_MAGIC

#define MAKE_MAGIC (   c0,
  c1,
  c2,
  c3 
)    ((c0 << 24) |(c1 << 16) |(c2 << 8) |(c3 << 0))

Enumeration Type Documentation

◆ GFDBlockType

Enumerator
GFD_BLOCK_TYPE_END_OF_FILE 
GFD_BLOCK_TYPE_PADDING 
GFD_BLOCK_TYPE_VERTEX_SHADER_HEADER 
GFD_BLOCK_TYPE_VERTEX_SHADER_PROGRAM 
GFD_BLOCK_TYPE_PIXEL_SHADER_HEADER 
GFD_BLOCK_TYPE_PIXEL_SHADER_PROGRAM 

Function Documentation

◆ check_shader()

void check_shader ( const void shader_,
u32  shader_size,
const void org_,
u32  org_size,
const char *  name 
)

◆ check_shader_verbose()

void check_shader_verbose ( u32 shader,
u32  shader_size,
u32 org,
u32  org_size,
const char *  name 
)

◆ dump_ps_data()

void dump_ps_data ( GX2PixelShader ps)

◆ dump_vs_data()

void dump_vs_data ( GX2VertexShader vs)

◆ gfd_free()

void gfd_free ( GFDFile gfd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gfd_open()

GFDFile* gfd_open ( const char *  filename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gfd_relocate_block()

static bool gfd_relocate_block ( GFDBlock block)
static
Here is the caller graph for this function:

◆ GX2DestroyShader()

void GX2DestroyShader ( GX2Shader shader)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GX2InitShader()

void GX2InitShader ( GX2Shader shader)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GX2SetShader()

void GX2SetShader ( GX2Shader shader)
Here is the call graph for this function:
Here is the caller graph for this function: