shbin.h File Reference

Shader binary support. More...

`#include <3ds/gpu/gpu.h>`

Go to the source code of this file.

## Data Structures

struct | DVLP_s
| DVLP data. More...
struct | DVLE_constEntry_s
| DVLE constant entry data. More...
struct | DVLE_outEntry_s
| DVLE output entry data. More...
struct | DVLE_uniformEntry_s
| DVLE uniform entry data. More...
struct | DVLE_s
| DVLE data. More...
struct | DVLB_s
| DVLB data. More...

## Enumerations

enum | DVLE_type { VERTEX_SHDR =GPU_VERTEX_SHADER , GEOMETRY_SHDR =GPU_GEOMETRY_SHADER }
| DVLE type. More...
enum | DVLE_constantType { DVLE_CONST_BOOL =0x0 , DVLE_CONST_u8 =0x1 , DVLE_CONST_FLOAT24 =0x2 }
| Constant type. More...
enum | DVLE_outputAttribute_t { RESULT_POSITION = 0x0 , RESULT_NORMALQUAT = 0x1 , RESULT_COLOR = 0x2 , RESULT_TEXCOORD0 = 0x3 , RESULT_TEXCOORD0W = 0x4 , RESULT_TEXCOORD1 = 0x5 , RESULT_TEXCOORD2 = 0x6 , RESULT_VIEW = 0x8 , RESULT_DUMMY = 0x9 }
| Output attribute. More...
enum | DVLE_geoShaderMode { GSH_POINT = 0 , GSH_VARIABLE_PRIM = 1 , GSH_FIXED_PRIM = 2 }
| Geometry shader operation modes. More...

## Functions

DVLB_s * | DVLB_ParseFile (u32 *shbinData, u32 shbinSize)
| Parses a shader binary. More...
void | DVLB_Free (DVLB_s *dvlb)
| Frees shader binary data. More...
s8 | DVLE_GetUniformRegister (DVLE_s *dvle, const char *name)
| Gets a uniform register index from a shader. More...
void | DVLE_GenerateOutmap (DVLE_s *dvle)
| Generates a shader output map. More...

## Detailed Description

Shader binary support.

## Enumeration Type Documentation

## DVLE_constantType

enum DVLE_constantType

Constant type.

Enumerator
DVLE_CONST_BOOL | Bool.
DVLE_CONST_u8 | Unsigned 8-bit integer.
DVLE_CONST_FLOAT24 | 24-bit float.

## DVLE_geoShaderMode

enum DVLE_geoShaderMode

Geometry shader operation modes.

Enumerator
GSH_POINT | Point processing mode.
GSH_VARIABLE_PRIM | Variable-size primitive processing mode.
GSH_FIXED_PRIM | Fixed-size primitive processing mode.

## DVLE_outputAttribute_t

enum DVLE_outputAttribute_t

Output attribute.

Enumerator
RESULT_POSITION | Position.
RESULT_NORMALQUAT | Normal Quaternion.
RESULT_COLOR | Color.
RESULT_TEXCOORD0 | Texture coordinate 0.
RESULT_TEXCOORD0W | Texture coordinate 0 W.
RESULT_TEXCOORD1 | Texture coordinate 1.
RESULT_TEXCOORD2 | Texture coordinate 2.
RESULT_VIEW | View.
RESULT_DUMMY | Dummy attribute (used as passthrough for geometry shader input).

## DVLE_type

enum DVLE_type

DVLE type.

Enumerator
VERTEX_SHDR | Vertex shader.
GEOMETRY_SHDR | Geometry shader.

## Function Documentation

## DVLB_Free()

void DVLB_Free | ( | DVLB_s * | dvlb | ) |

Frees shader binary data.

Parameters

  dvlb | DVLB to free.

Examples
  graphics/gpu/both_screens/source/main.c, graphics/gpu/fragment_light/source/main.c, graphics/gpu/geoshader/source/main.c, graphics/gpu/immediate/source/main.c, graphics/gpu/lenny/source/main.c, graphics/gpu/loop_subdivision/source/main.c, graphics/gpu/mipmap_fog/source/main.c, graphics/gpu/particles/source/main.c, graphics/gpu/proctex/source/main.c, graphics/gpu/simple_tri/source/main.c, graphics/gpu/textured_cube/source/main.c, and graphics/gpu/toon_shading/source/main.c.

## DVLB_ParseFile()

DVLB_s* DVLB_ParseFile | ( | u32 * | shbinData,
|  | u32 | shbinSize
| ) |  |

Parses a shader binary.

Parameters

  shbinData | Shader binary data.
  shbinSize | Shader binary size.

Returns
  The parsed shader binary.

Examples
  graphics/gpu/both_screens/source/main.c, graphics/gpu/fragment_light/source/main.c, graphics/gpu/geoshader/source/main.c, graphics/gpu/immediate/source/main.c, graphics/gpu/lenny/source/main.c, graphics/gpu/loop_subdivision/source/main.c, graphics/gpu/mipmap_fog/source/main.c, graphics/gpu/particles/source/main.c, graphics/gpu/proctex/source/main.c, graphics/gpu/simple_tri/source/main.c, graphics/gpu/textured_cube/source/main.c, and graphics/gpu/toon_shading/source/main.c.

## DVLE_GenerateOutmap()

void DVLE_GenerateOutmap | ( | DVLE_s * | dvle | ) |

Generates a shader output map.

Parameters

  dvle | Shader to generate an output map for.

## DVLE_GetUniformRegister()

s8 DVLE_GetUniformRegister | ( | DVLE_s * | dvle,
|  | const char * | name
| ) |  |

Gets a uniform register index from a shader.

Parameters

  dvle | Shader to get the register from.
  name | Name of the register.

Returns
  The uniform register index.