nn::gr::CTR::Shader Class

Syntax

class Shader

Description

Class for setting the shader binary.

Member Variables

protected m_VtxShaderIndex The index of the enabled vertex shader. Its type is int.
protected m_GeoShaderIndex The index of the enabled geometry shader. Its type is int.
protected m_ExeImageInfoNum The number of executable shaders in a shader binary.
protected m_ExeImageInfo Holds a pointer to information on the executable shaders in a shader binary. Its type is ExeImageInfo[].
protected m_Instruction A pointer to the part of the shader binary with executable shader code. The type is bit32*.
protected m_InstructionCount The size of the executable shader code in the shader binary. Type is u32.
protected m_Swizzle Swizzle patterns represented in command format. Its type is bit32[].
protected m_SwizzleCount The number of swizzle patterns. Type is u32.
protected m_DrawMode Indicates the rendering mode. The default is PICA_DATA_DRAW_TRIANGLES. Its type is PicaDataDrawMode.
protected m_VtxShaderBoolMapUniform A vertex shader Boolean map to be made uniform. The type is bit32.
protected m_GeoShaderBoolMapUniform A geometry shader Boolean map to be made uniform. The type is bit32.
protected m_CmdCacheOutAttr The command cache for output attributes. Its type is bit32[].
protected m_CmdCacheOutAttrNum The number of commands for output attributes. Type is u32.
protected m_CmdCacheVtxConst The command cache for the vertex shader's constant registers. Its type is bit32[].
protected m_CmdCacheVtxConstNum The number of commands for the vertex shader's constant registers. Type is u32.
protected m_CmdCacheGeoConst The command cache for the geometry shader's constant registers. Its type is bit32[].
protected m_CmdCacheGeoConstNum The number of commands for the geometry 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.
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.
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 commands for making constant registers uniform for vertex shaders. Call this function after you have configured the shader binary with the SetupBinary function.
MakeGeoConstRgCommand Generates constant register commands for geometry shaders. 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 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.
protected MakeConstRgCommand_ Generates commands for making constant registers uniform. Call this function after you have configured the shader binary with the SetupBinary function.
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.

Revision History

2010/09/15
Initial version.

CONFIDENTIAL