libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
PixelShader Class Reference

Owns a GX2PixelShader's compiled program and uniform/sampler metadata, mirroring VertexShader's role on the pixel-shader side. More...

#include <PixelShader.h>

Inheritance diagram for PixelShader:
[legend]

Public Member Functions

void setProgram (const uint32_t *program, uint32_t programSize, const uint32_t *regs, uint32_t regsSize)
 Uploads the compiled shader program.
 
void addUniformVar (const GX2UniformVar &var)
 Registers a uniform variable so it can be set by location.
 
void addSamplerVar (const GX2SamplerVar &var)
 Registers a texture sampler variable.
 
GX2PixelShader * getPixelShader () const
 
void setShader () const
 Binds this pixel shader for subsequent draws.
 

Static Public Member Functions

static void setUniformReg (uint32_t location, uint32_t size, const void *reg)
 Writes uniform registers for the bound pixel shader.
 
- Static Public Member Functions inherited from Shader
static void draw (int32_t primitive=GX2_PRIMITIVE_MODE_QUADS, uint32_t vtxCount=4)
 Issues the draw call for the currently bound shaders and attribute buffers.
 

Protected Attributes

GX2PixelShader * pixelShader
 The GX2 pixel shader object.
 

Additional Inherited Members

- Static Public Attributes inherited from Shader
static const uint16_t cuVertexAttrSize = sizeof(float) * 3
 Size in bytes of one position vertex (3 floats)
 
static const uint16_t cuTexCoordAttrSize = sizeof(float) * 2
 Size in bytes of one texture coordinate (2 floats)
 
static const uint16_t cuColorAttrSize = sizeof(uint8_t) * 4
 Size in bytes of one vertex color (4 bytes, RGBA)
 

Detailed Description

Owns a GX2PixelShader's compiled program and uniform/sampler metadata, mirroring VertexShader's role on the pixel-shader side.

Definition at line 16 of file PixelShader.h.

Constructor & Destructor Documentation

◆ PixelShader()

PixelShader::PixelShader ( )
inline

Definition at line 19 of file PixelShader.h.

◆ ~PixelShader()

virtual PixelShader::~PixelShader ( )
inlinevirtual

Definition at line 29 of file PixelShader.h.

Member Function Documentation

◆ addSamplerVar()

void PixelShader::addSamplerVar ( const GX2SamplerVar & var)
inline

Registers a texture sampler variable.

Definition at line 94 of file PixelShader.h.

◆ addUniformVar()

void PixelShader::addUniformVar ( const GX2UniformVar & var)
inline

Registers a uniform variable so it can be set by location.

Definition at line 72 of file PixelShader.h.

◆ getPixelShader()

GX2PixelShader * PixelShader::getPixelShader ( ) const
inline
Returns
the underlying GX2PixelShader

Definition at line 116 of file PixelShader.h.

◆ setProgram()

void PixelShader::setProgram ( const uint32_t * program,
uint32_t programSize,
const uint32_t * regs,
uint32_t regsSize )
inline

Uploads the compiled shader program.

Parameters
programCompiled GX2 pixel shader bytecode
programSizeSize of program in bytes
regsPrecomputed shader register values
regsSizeSize of regs in bytes

Definition at line 55 of file PixelShader.h.

◆ setShader()

void PixelShader::setShader ( ) const
inline

Binds this pixel shader for subsequent draws.

Definition at line 119 of file PixelShader.h.

◆ setUniformReg()

static void PixelShader::setUniformReg ( uint32_t location,
uint32_t size,
const void * reg )
inlinestatic

Writes uniform registers for the bound pixel shader.

Parameters
locationRegister location of the uniform
sizeNumber of registers to write
regSource values

Definition at line 128 of file PixelShader.h.

Member Data Documentation

◆ pixelShader

GX2PixelShader* PixelShader::pixelShader
protected

The GX2 pixel shader object.

Definition at line 134 of file PixelShader.h.


The documentation for this class was generated from the following file: