Owns a GX2PixelShader's compiled program and uniform/sampler metadata, mirroring VertexShader's role on the pixel-shader side.
More...
#include <PixelShader.h>
|
| 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 void | setUniformReg (uint32_t location, uint32_t size, const void *reg) |
| | Writes uniform registers for the bound pixel 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.
|
| |
|
| GX2PixelShader * | pixelShader |
| | The GX2 pixel shader object.
|
| |
|
| 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)
|
| |
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.
◆ PixelShader()
| PixelShader::PixelShader |
( |
| ) |
|
|
inline |
◆ ~PixelShader()
| virtual PixelShader::~PixelShader |
( |
| ) |
|
|
inlinevirtual |
◆ 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
-
| program | Compiled GX2 pixel shader bytecode |
| programSize | Size of program in bytes |
| regs | Precomputed shader register values |
| regsSize | Size 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
-
| location | Register location of the uniform |
| size | Number of registers to write |
| reg | Source values |
Definition at line 128 of file PixelShader.h.
◆ pixelShader
| GX2PixelShader* PixelShader::pixelShader |
|
protected |
The documentation for this class was generated from the following file: