nn::gr::CTR::Shader Class

Syntax

class Shader

Description

Class for setting the shader binary.

Member Constants

protected S EXE_IMAGE_MAX const s32 A class constant.
protected S SWIZZLE_PATTERN_MAX const s32 The maximum number of swizzle patterns.
protected S DUMMY_DATA_NUM_251 const s32 The number of dummy commands that can be set to 0x251.
protected S DUMMY_DATA_NUM_200 const s32 The number of dummy commands that can be set to 0x200.
protected S PADDING_DATA const u32 The value used for padding for dummy commands, etc.
protected S OUT_ATTR_COMMAND_MAX const s32 Maximum number of output attribute commands.
protected S CONST_REG_COMMAND_MAX const u32 The maximum number of constant register commands.

Member Variables

protected m_VtxShaderIndex s32 The index of the enabled vertex shader. Type is s32.
protected m_GeoShaderIndex s32 The index of the enabled geometry shader. Type is s32.
protected m_ExeImageInfoNum u8 The number of executable shaders in a shader binary.
protected m_ExeImageInfo const ExeImageInfo * Holds a pointer to information on the executable shaders in a shader binary. Its type is ExeImageInfo[].
protected m_Instruction const bit32 * A pointer to the part of the shader binary with executable shader code. The type is bit32*.
protected m_InstructionCount u32 The size of the executable shader code in the shader binary. Type is u32.
protected m_Swizzle bit32 Swizzle patterns represented in command format. Its type is bit32[].
protected m_SwizzleCount u32 The number of swizzle patterns. Type is u32.
protected m_DrawMode PicaDataDrawMode Indicates the rendering mode. The default is PICA_DATA_DRAW_TRIANGLES. Its type is PicaDataDrawMode.
protected m_VtxShaderBoolMapUniform bit32 A vertex shader Boolean map to be set. The type is bit32.
protected m_GeoShaderBoolMapUniform bit32 A geometry shader Boolean map to be set. The type is bit32.
protected m_CmdCacheOutAttrArray bit32 A two-dimensional array for the output attribute command cache. The type is bit32.
protected m_CmdCacheOutAttrNum u32 An array of the number of commands for output attributes. Type is u32.
protected m_CmdCacheConstArray bit32 A two-dimensional array of command caches for shader constant registers. Its type is bit32[][].
protected m_CmdCacheConstNumArray u32 An array of the number of commands for the shader's constant registers. Type is u32[].

Member Functions

Shader A constructor that initializes shader binary settings.
SetupBinary Sets up information used for generating commands based on the shader binary. Note: The binary is not copied. Do not destroy the binary until the command is generated. An ASSERT results if the specified index is not a valid shader. For more information about the index to be specified, see the MAP file generated at link time by ctr_VertexShaderLinker32.exe. Geometry shaders can be disabled by specifying -1 for geo_shader_index.
SetShaderIndex Configures the index of the used shader. You must use this function after calling the SetupBinary function. For more information about the index to be specified, see the MAP file generated at link time by ctr_VertexShaderLinker32.exe. Geometry shaders can be disabled by specifying -1 for geo_shader_index. When switching between the use and non-use of geometry shaders, you need to reconfigure the rendering mode with the SetDrawMode function before generating a command.
SetUniformBool Sets a boolean register value for the vertex shader.
SetDrawMode Sets the draw mode. The default is PICA_DATA_DRAW_TRIANGLES.
MakeFullCommand Generates all commands required for switching shaders. Call this function after you have configured the shader binary with the SetupBinary function.
MakeShaderCommand Generates the minimum commands necessary for switching the shader image within the shader binary. This function must be called after calling the MakeFullCommand function and sending a command. In addition, when switching the mode for using or not using the geometry shader with the SetShaderIndex function, the isMakePrepareCommand argument must be set to true.
MakeVtxBoolMapCommand Generates a command for setting a value into the vertex shader boolean register. Call this function after you have configured the shader binary with the SetupBinary function.
MakeGeoBoolMapCommand Generates a command for setting a value into the geometry shader boolean register. Call this function after you have configured the shader binary with the SetupBinary function.
MakePrepareCommand Generates a command for setting the use of a geometry shader. Call this function after you have configured the shader binary with the SetupBinary function. This includes dummy commands and commands for setting enable/disable that are required to enable/disable the geometry shader.
MakeVtxProgramCommand Generates a program load command for vertex shaders. This includes the entry point address and executable code within the shader binary. Call this function after you have configured the shader binary with the SetupBinary function.
MakeGeoProgramCommand Generates a program load command for geometry shaders. This includes the entry point address and executable code within the shader binary. Call this function after you have configured the shader binary with the SetupBinary function.
MakeVtxSwizzleCommand Generates commands to load swizzle patterns for vertex shaders. Call this function after you have configured the shader binary with the SetupBinary function.
MakeGeoSwizzleCommand Generates a command for swizzle pattern loading of geometry shaders. Call this function after you have configured the shader binary with the SetupBinary function.
MakeVtxConstRgCommand Generates a command for setting a value into the constant register for the vertex shader. Call this function after you have configured the shader binary with the SetupBinary function.
MakeGeoConstRgCommand Generates a command for setting a value into the constant register for the geometry shader. Call this function after you have configured the shader binary with the SetupBinary function.
MakeOutAttrCommand Generates a command for setting shader output attributes. Call this function after you have configured the shader binary with the SetupBinary function.
SearchBindSymbol Converts from symbol names to symbol information. Symbol type information and bound register numbers can be obtained by specifying the symbol name set by pragma_bind_symbol() in the shader code as an argument. Call this function after you have configured the shader binary with the SetupBinary function.
SearchBindSymbolNum Searches how many symbols there are of the specified type. Searches for how many symbols there are of the specified type among those set by pragma_bind_symbol in the shader code. Call this function after you have configured the shader binary with the SetupBinary function.
GetShaderNum Gets the number of executable shaders included in the shader binary.
IsEnableGeoShader Gets whether geometry shaders are enabled.
GetVtxShaderIndex Gets the index of the enabled vertex shader.
GetGeoShaderIndex Gets the index of the enabled geometry shader.
GetVtxShaderBoolMapUniform Gets the boolean map set for the vertex shader.
GetGeoShaderBoolMap Gets the boolean map set for the geometry shader.
S MakeDisableCommand Generates commands to disable this feature.
protected CheckVtxShaderIndex_ Tests the validity of the index of a vertex shader. An assert failure occurs if the specified index is not a valid shader.     Call this function after you have configured the shader binary with the SetupBinary function.
protected CheckGeoShaderIndex_ Tests the validity of the index of a geometry shader. An assert failure occurs if the specified index is not a valid shader.     Call this function after you have configured the shader binary with the SetupBinary function.
protected MakeShaderConstCommandCache_ Generates the constant register command cache for the vertex and geometry shaders.
protected MakeShaderOutAttrCommandCache_ Generates the output attribute command cache for the vertex and geometry shaders.
protected MakeConstRgCommand_ Generates a command for setting a value into the constant register.
protected MakeOutAttrCommand_ Generates a command for setting shader output attributes.
protected MakeLoadCommand_ Generates commands to send a set of data to a specified register. This does not support SEQ and BE.
protected S MakeShaderModeCommand_ Generates the commands that are required to enable or disable the geometry shader: dummy commands and enable/disable setting commands.
protected S MakeDummyCommand_ Generates commands to send dummy commands to a specified register.

Revision History

2010/09/15
Initial version.

CONFIDENTIAL